hurtado wrote:You nearly got it
I compared the non-windows version of mine and yours:
Line 23, my version:
dim shared as stPaleta miPaleta(0 to cdToColor)
Line 23, your version:
dim shared as stPaleta miPaleta(0 to cdToColor+1)
Are sure that is right? Freebasic allocates 1 memory location more the C (unfortunately).
So with cdToColor = 255, my version gives 256 elements (0...255), yours 257 (0...256).
Line 59, my version:
SetColorBase(x, y, Color)
Line 59, your version:
SetColorBase(x, y, color_)
That made the biggest difference. I should have done a 'search and replace'
Line 68, my version:
mBase(0) = int(rnd() * 226) + 1
Line 68, your version:
mBase(0) = int(rnd() * 255) + 1
That was a stupid typo. I would have never found that probably.
Now I will look at the algorithm itself. I did the conversion without trying to understand it...