GP32 Framerates!!


TheMrCul

Still Fresh
Joined
Apr 18, 2003
Messages
52
Hi everyone. Now that the graphics routines are working (largely because of the help I've recieved from generous people on this board, thanks!) I've stepped on another problem. My framerates are all over the place (on real GP32s) usually at 45-50, but shooting up to 95-100 at some spots on the map. I tried this code at the start of my game engine loop:
gp_clearRTC();
and then before swapping double buffers
while(gp_getRTC() < 2);
but it hasn't changed a thing. I searched on the forum and generally on the internet, but came up with nothing helpful. Has anyone written or know of how to get a stable constant framerate of either 30 or 40fps? Thanks.
-TheMrCul
 
I use this function with 2 or 3, keep in mind that this only caps the upper fps but does not prevent slowdowns.

Code:
void wait(int w)
{
  static int ttime = 0;
  int tick = gp_getRTC();
  while(tick < (ttime+w))
  {
      tick = gp_getRTC();
  }
  ttime = tick;
}
 
Unit3 wrote DemonicaGameLib which is a tile system with speed control (moves faster when framerate is lower to compensate). It should be asy to modify it to use non-crappy blitting techniques ;). I'm working on stuff like that too for my graphics functions.
 
Back
Top