Caanoo / WIZ Definitive Frame Rate On Wiz?


thetooth

Still Fresh
Joined
Feb 1, 2010
Messages
11
Hi i am still very new to compiler based programing and am in the process of making a small demo but i am having issues getting a solid 60fps.

I read a post about using DPC set but am unable to get it to do what i want... basically what i need is a quick guide on how to get a set frame rate WITH code, not theories based around experience with C# or something else ridiculous. There seems to be to many of those threads covering the first 40 or so pages of google.

The code i am using at the moment is as follows:
Code:
int t_prev = SDL_GetTicks();
int t = SDL_GetTicks();
while (!done){
	t = SDL_GetTicks();
	//Imput and realtime logic here
	if(t - t_prev >= 1000/FPS){ //FPS is defined as 60
		//Draw surfaces to screen and increment animation int's
		t_prev = t;
	}
}
The problem with this is never actuate on the Wiz as the time difference ranges from 18-20 depending on whats going on. And no its not being lagged as all i'm doing is scrolling a background and without the limiter go's very fast.
 
Your problem is that you're setting t_prev after you're doing a whole bunch of stuff. So there's this gap between the ~16-17ms you're waiting for and the next period. The ~1-2ms gap is the time it takes to do that stuff. The solution is to set t_prev = t BEFORE doing that stuff.
 
Exophase said:
Your problem is that you're setting t_prev after you're doing a whole bunch of stuff. So there's this gap between the ~16-17ms you're waiting for and the next period. The ~1-2ms gap is the time it takes to do that stuff. The solution is to set t_prev = t BEFORE doing that stuff.

hmmm I've tried that but the stuttering still exists on the Wiz.

This is an app I've been working on to try and see whats going on: http://dev.ameoto.com/uploads/wiz/hellos.zip (Windows and Wiz binarys)
You'll notice when running the Wiz binary it has completely different timing and seems to skip frames and "insert some blank here" :/

Source: http://dev.ameoto.com/uploads/wiz/hellos-src.zip

Blarg!: got it working... was my retarded use of the double buffer while using my own buffer >.>
now flipping and writing to both sides and going to try out some crazy transparency stuff like they used on neogeo :p
 
Last edited by a moderator:
Back
Top