aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-07 20:46:10 -0500
committerNebuleon Fumika2013-01-07 20:46:10 -0500
commit7d57e5aa451573bc0055e80ac18ad50c324002fa (patch)
treec90ca2628dd31bb1e27ea8bc4aae4d94bf676768
parent377c6bcadbf56216237ee23841776701e2e9086c (diff)
downloadsnes9x2005-7d57e5aa451573bc0055e80ac18ad50c324002fa.tar.gz
snes9x2005-7d57e5aa451573bc0055e80ac18ad50c324002fa.tar.bz2
snes9x2005-7d57e5aa451573bc0055e80ac18ad50c324002fa.zip
Require auto_equivalent_skip to be greater than 0 before decrementing it if the code is drawing a frame early in automatic frame skip mode. Otherwise, overflow occurs, and we skip 4 billion images.
-rw-r--r--source/nds/entry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp
index 63d736f..e272415 100644
--- a/source/nds/entry.cpp
+++ b/source/nds/entry.cpp
@@ -674,10 +674,10 @@ void S9xSyncSpeed ()
if (syncdif > 0)
{
// Are we VERY early? Say, 3 entire frames...
- if (syncdif >= frame_time * 3)
+ if (syncdif >= frame_time * 3 && auto_equivalent_skip > 1)
auto_equivalent_skip -= 2;
// or one
- else if (syncdif >= frame_time)
+ else if (syncdif >= frame_time && auto_equivalent_skip > 0)
auto_equivalent_skip--;
ds2_setCPUclocklevel(0);
udelay(syncdif * 128 / 3 /* times 42 + 2/3 microseconds */);