Is there anyone out there that could run this code on their GP2X's and report back what Frame Rates you get?
SETSCREEN 320,240,0
LIMITFPS 60
GLOBAL mb,ma,mx,my
WHILE TRUE
MOUSESTATE mx,my,ma,mb
IF ma =1 THEN END
printfps(0,0)
FPS(TRUE,0,20)
SHOWSCREEN
WEND
FUNCTION printfps:l_x,l_y
STATIC fps_time,fps_counter,s_FPS,fps_temp
fps_time = GETTIMERALL()
fps_counter = fps_counter + 1
IF (fps_time-fps_temp)>1000
fps_temp = fps_time
s_FPS = fps_counter
fps_counter = 0
ENDIF
PRINT s_FPS+" Frames",l_x,l_y
RETURN s_FPS
ENDFUNCTION
FUNCTION FPS: SHOW,X,Y
GLOBAL Seconds,Minutes,Hours,Days,FR,timeK,time1,frames
timeK=GETTIMER();
time1=time1+timeK;
frames=frames+1;
IF time1>1000;
FR=INTEGER(frames); frames=0;
time1=timeK-1000;
Seconds=Seconds+1;
IF Seconds>59; Minutes=Minutes+1; Seconds=0; ENDIF;
IF Minutes>59; Hours=Hours+1; Minutes=0; ENDIF;
IF Hours>23; Days=Days+1; Hours=0; ENDIF;
ENDIF;
IF SHOW=TRUE
PRINT " FPS: "+FR,X,Y
ENDIF
RETURN FR
ENDFUNCTION
I've placed a LIMITFPS of 60 in the code. There's nothing going on but a SHOWSCREEN (which I am guessing will be copying the whole backbuffer data to the display).
On my two pocketpc's (not particularly high spec) I get:
Mio = 32 FPS
Garmin = 42 FPS
Wondering what I should expect for the two types of GP2X? I can compensate the speed for when the game runs as PocketPC/GP2X and Desktops.
Question for Gernot:- the SHOWSCREEN will not go any faster than my desktop refresh rate (60Hz) even when the LIMITFPS is set higher so it must be tied to the VBL. Is it possible to add a command to not limit the the monitor refresh rate? I know it will make the display more choppy, but useful to have in some scenarios (especially 3D).
60 frames
fps: 120
on my old gp2x mk2
That's a good speed! BTW, ignore the second reading - it always seems to return double the amount (code taken from the FPS thread).
Thanks XaMMaX