Search found 130 matches

by ShawnLG
Jun 22, 2020 17:18
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6049

Re: PHP-like associative arrays

Dear ShawnLG; Thanks for your correction. I checked with the following program. There still seems to be collisions. You are right. There is still a problem with collisions. i had a feeling something was quite not right. Thanks for testing it. I was reliying on the hash key for reference for collisi...
by ShawnLG
Jun 20, 2020 16:27
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6049

Re: PHP-like associative arrays

I have added collision currection to the hash mapping. The hash function would be useless without it. I was unable to test it because I do not know of any collision conditions. Why is the hash table defined in two dimentions? assocarray.bi ' collision divergent by ShawnLG #Define ASSOC_ARRAY_LOG_COL...
by ShawnLG
Jun 08, 2020 2:36
Forum: Projects
Topic: "Another" 3d engine Xors3D (abandoned)
Replies: 5
Views: 439

Re: "Another" 3d engine Xors3D (abandoned)

Dr_D wrote:Hi. I'm always interested in 3D engines.


You might like Genesis3D SDK. It is also abandonware. I remember playing the demo in the late 90s. It has that nastalgec Quake feel to it. The source is in C for version 1.2, so it can be translated to FB.

https://www.genesis3d.com/
by ShawnLG
May 28, 2020 1:26
Forum: Community Discussion
Topic: which keyboard to choose?
Replies: 5
Views: 249

Re: which keyboard to choose?

A lot of the keyboards on that list is junk. The IBM model M was the best keyboard ever made but that was over 30 years ago. My first computer was a IBM PS/2 Model 30 computer wich came with a model M keyboard. It is the machine I learned Qbasic. Those where the days.
by ShawnLG
May 24, 2020 2:16
Forum: Community Discussion
Topic: BASIC is not BASIC anymore
Replies: 10
Views: 711

Re: BASIC is not BASIC anymore

There is a workaround using marcros.

Code: Select all

#Undef Int'  Already used in FB' polluted namespace :(

#Macro Int
   Dim As Integer
#EndMacro

Int a = 10' C style define.
Print a
Sleep


Var is implicit and why was it added to FB? It is bad for code readability.
by ShawnLG
May 09, 2020 17:22
Forum: Beginners
Topic: Print bug?
Replies: 4
Views: 234

Print bug?

Code: Select all

Print &hFFFFFFFF 'Prints a -1 in the terminal. The Print function cast it as an integer it should be cast as an Uinteger.
by ShawnLG
May 05, 2020 15:27
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

The modulo can be replaced by a bitmask. This is only true for powers of two. It now runs at 360 fps! [UPDATE} Attn. 64 bit users. I have found a bug that effects the way the texture looks when compiled on 64 bit version of FreeBASIC. This is not desirable. Delete the texture "Wormhole_cloud.bm...
by ShawnLG
May 05, 2020 3:20
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

I lied. Wormhole is now running 269 fps! Using array tables is fast and all but, there is nothing faster than direct affine addressing using pointers. Wormhole_22xFast.bas 'Wormhole effect by ShawnLG #include "file.bi" #IFDEF __FB_PCOS__ 'for windows or DOS #define SLASH Chr(92)'"\&qu...
by ShawnLG
May 03, 2020 17:24
Forum: Tips and Tricks
Topic: The Simplest debug and trace method Win+Lin 32/64 bit
Replies: 7
Views: 556

Re: The Simplest debug and trace method

This is the simplest debug and trace method. beep 'Insert this statement once in various parts of your code to trace down the program crash. If program beeps before crash. move it further in the program. A better way is to display variables in question. print var1, var2, var3 sleep end
by ShawnLG
May 02, 2020 6:41
Forum: General
Topic: Tetris piece creation
Replies: 7
Views: 429

Re: Tetris piece creation

Looks like you are on the right track using recursion. You should try using hashing in replace of your list search function. It would help a lot. (possibly the most useless code I have ever written) I don't think so. It is a good dynamic programming problem. I like it. I initialized n = 4 just to se...
by ShawnLG
May 01, 2020 17:04
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

by ShawnLG
Apr 30, 2020 19:53
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

I added another table for the perspective calculations and that also improved efficency. After cleaning up code in the inner loop. It is more simpler. It now flies at 160 fps. I think it is safe to say I have reached the limit on optimizations. The shading could be done in MMX but the improvement is...
by ShawnLG
Apr 29, 2020 17:15
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

I have moved the Cos and Sin functions out of the inner loops. also, I found a solution to the aTan2 function. Use a table. I now have shader like performance. I get 75 fps. Wormhole_7xFast.bas 'Wormhole effect by ShawnLG #include "file.bi" #IFDEF __FB_PCOS__ 'for windows or DOS #define SL...
by ShawnLG
Apr 29, 2020 8:13
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

UEZ wrote:Your 1st version runs at ~23 fps, the new ~51 fps. If I replace the ATan2() function with Atan2f1 then I get 137 fps


I do not see any differents with Atan2 VS Atan2f1. What is your compiler version and settings?
by ShawnLG
Apr 29, 2020 3:33
Forum: Tips and Tricks
Topic: Wormhole effect
Replies: 34
Views: 1150

Re: Wormhole effect

UEZ, the trig replacement functions do not help with speed. The replacement sin and cos where slower. Is there a single precision version? The pointer for PSET replacement gave extra frame rates. I though POINT(x,y) was bad. That why I replaced that. I manage to sqeeze a few more fps in by replacing...

Go to advanced search