Search found 6899 matches

by dodicat
Jun 20, 2021 15:20
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

Thanks, I had a look at the new .chm, I see the constants now, under arrays. However I still like my goto's, (anywhere). A false loop seems ugly just to avoid a simple goto. #include "fbc-int/array.bi" function flagsString(flags as uinteger) as string return str(flags and &h0000000f) &...
by dodicat
Jun 20, 2021 12:39
Forum: Beginners
Topic: Distortion when moving across the screen sprite (Raspberry 4B))
Replies: 67
Views: 1080

Re: Distortion when moving across the screen sprite (Raspberry 4B))

I can only suggest you move 1 pixel at a time and speed up the framerate with the regulator. Also keep your colours contrasted a bit to conceal any distortions, yellow on blue is very bold on. Draw your sprite in the centre of a larger image, leave a bit of transparency around the edge. ScreenRes 80...
by dodicat
Jun 20, 2021 12:07
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

How on earth does this work? All arrays redim to start. mat4() remains dynamic while all the rest become fixed.(because I have omitted (0) (I have looped everything to check 16 bit alignment) The memory allocations change from time to time, I suppose depending what the OS is doing in the background....
by dodicat
Jun 19, 2021 20:57
Forum: Beginners
Topic: Distortion when moving across the screen sprite (Raspberry 4B))
Replies: 67
Views: 1080

Re: Distortion when moving across the screen sprite (Raspberry 4B))

The test means that sleep 1 in your Linux distro is one millisecond, so it will be easier to get a smooth run. On windows you will get a max of about 64 fps no matter how far you drag the slider, (thus for windows I have to add settimer and freetimer) to get the 120 fps. I assume that even offline y...
by dodicat
Jun 19, 2021 16:08
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

I ran a parallel method to get addresses of pointers aligned to 16. #include "Windows.bi" ' HeapAlloc + HeapFree #include "crt.bi" ' MasmBasic's Alloc16 ported to FreeBasic (https://www.jj2007.eu/MasmBasicQuickReference.htm#Mb1391) #define maxalloc16 1000 ' #allocations Dim share...
by dodicat
Jun 19, 2021 15:43
Forum: Beginners
Topic: Distortion when moving across the screen sprite (Raspberry 4B))
Replies: 67
Views: 1080

Re: Distortion when moving across the screen sprite (Raspberry 4B))

I tested cairo, not as smooth as opengl. The reason I used settimer and freetimer on windows was to make sure a sleep 1 was 1 millisecond. Normally it is about 15 milliseconds on windows. Google chrome used to set this one millisecond automatically when online in the freebasic forum, but I note that...
by dodicat
Jun 19, 2021 15:08
Forum: General
Topic: A brain teaser
Replies: 27
Views: 729

Re: A brain teaser

deltarho[] The Sattolo is a tiny bit different, first loop is to end-1, I had end-2 https://danluu.com/sattolo/ I note the property of sattolo is that no number ends up in the same place after a shuffle. VIZ: Sub shuffle(a() As Ubyte) #define range(f,l) Int(Rnd*(((l)+1)-(f))+(f)) For n As Integer = ...
by dodicat
Jun 18, 2021 21:35
Forum: General
Topic: A brain teaser
Replies: 27
Views: 729

Re: A brain teaser

Old Sattolo's doesn't look too bad probability wise. Plus it is efficient, no swapping something with itself. Knuth of course shares similar probabilities. score 0 0 footie ??. screen 20 Sub shuffle(a() As Ubyte) #define range(f,l) Int(Rnd*(((l)+1)-(f))+(f)) For n As Integer = Lbound(a) To Ubound(a)...
by dodicat
Jun 18, 2021 21:25
Forum: Beginners
Topic: Distortion when moving across the screen sprite (Raspberry 4B))
Replies: 67
Views: 1080

Re: Distortion when moving across the screen sprite (Raspberry 4B))

You could try this. ScreenRes 800, 600, 32,2 width 800\8,600\16 dim as any ptr im=imagecreate(128,128,rgb(200,0,0)) Screenset 1,0 Function Regulate(Byval MyFps As Long,Byref fps As Long) As Long Static As Double timervalue,lastsleeptime,t3,frames frames+=1 If (Timer-t3)>=1 Then t3=Timer:fps=frames:f...
by dodicat
Jun 18, 2021 19:10
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

Very nice jj2007. I look forward to your code. I think I have got a working method. I am using good old fashioned goto, it saves fluffing around with whiles e.t.c. Tested 32/64 bits and 32 gas. Maybe it won't work everywhere (like the rules of physics), but it works here. #include "fbc-int/arra...
by dodicat
Jun 18, 2021 13:46
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

Thanks jj2007. That was my idea, but redim preserve back to the requested size sometimes gets a different pointer. Maybe you should try out your idea in fb. fxm's supercilious remarks are a put off for me. I was going to try and repair my algorithm (I usually get a job done one way or another), but ...
by dodicat
Jun 18, 2021 11:55
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

What do you mean "nothing justifies the principle of your algorithm."? Are we not allowed to take part in this discussion about 16 bit alignment? I did say it was not really usable at the start. If a moderator puts me down like this, then it is hardly worth me posting any more. I used 32 b...
by dodicat
Jun 18, 2021 11:36
Forum: Beginners
Topic: Distortion when moving across the screen sprite (Raspberry 4B))
Replies: 67
Views: 1080

Re: Distortion when moving across the screen sprite (Raspberry 4B))

So you are not using Wine on Linux to run Windows stuff.
(I have never used Raspberry machines)
I only ask because I can test the Cairo library on windows for this moving box.
by dodicat
Jun 18, 2021 11:12
Forum: General
Topic: [solved] Is the FreeBASIC array alignment safe ?
Replies: 37
Views: 812

Re: [solved] Is the FreeBASIC array alignment safe ?

This seems to work better. Do it in the main module by macro. Or you can make the macro a sub, still works. #include "fbc-int/array.bi" function flagsString(flags as uinteger) as string return str(flags and &h0000000f) & " allocated dims " & _ iif(flags and &h0000...
by dodicat
Jun 18, 2021 8:22
Forum: Beginners
Topic: Distortion when moving across the screen sprite (Raspberry 4B))
Replies: 67
Views: 1080

Re: Distortion when moving across the screen sprite (Raspberry 4B))

I'll try Cairo later, but generally Cairo is a bit slow and you need more dll's than can fit in a folder. However member srvaldez has combined all these dll's into one which makes Cairo very easy to handle. Not sure about Linux though (.so), or are you (PavelUT) using wine (in a computing sense), or...

Go to advanced search