Re: [Tuxnes-devel] Smoother scrolling
Brought to you by:
tmmm
From: Jason D. S. <jd...@us...> - 2004-01-19 20:52:57
|
Ryan Jackson wrote: > Changing the usleep() delay doesn't sound right to me either, but it's > the only thing I've found that works. > > Which gettimeofday() call did you remove: the one in set_timeframe() or > set_frameskip()? I tried changing set_timeframe(), but all that > happened was the emu ran way too fast. The scrolling was smooth though. > :-) What exactly was the problem you were chasing? The problem is that resynchronize() is only accurate to within 1 frame; i.e., 1/60 of a second. Under my patch it should be accurate to within 1 microsecond (1/1000000 of a second). The patch removed both set_frameskip and set_timeframe. The timeframe variable is removed entirely. All we track is the current frame, and from this we can determine what time we should be at. So the usleep sleeps until this time when resynchronize() is called. resynchronize also sets frameskip (if we're more than 1 frame behind) and desync (if we're more than 20 frames behind). jason |