Re: [Tuxnes-devel] Smoother scrolling
Brought to you by:
tmmm
From: Jason D. S. <jd...@us...> - 2004-01-20 08:46:04
|
Ryan Jackson wrote: > On Mon, Jan 19, 2004 at 02:27:47PM -0500, Jason Dorje Short wrote: > >>This is hard to change because timeframe is a very different concept. >>But this patch may be a little better (now that I got tuxnes to >>compile). It's indistinguishable from the current behavior on my computer. > > > It works great on mine... for about a minute, then the emu goes nuts. > usec overflows and wraps around, becoming negative. Because of that, it > thinks we've missed a whole crapload of frames, so it just resyncs over > and over again. It wraps around on frame 2148. Imagine that. In part this comes because of my overzealous desire to be accurate: I use (1,000,000 * frame) / 60 instead of (1,000,000 / 60) * frame but I guess the problem would kick in after about 60 minutes anyway, so it's just as well. This calculation needs to be done with an 8-byte "long long". (Side note: I didn't know a "long" was only 4 bytes???) Instead of using "long long" it would be nice to use sint64, if such a thing exists. SDL defines an Sint64, but not all of the code uses SDL, right? So, here's a new patch. Does this work better than the current behavior on your system? jason |