diff options
author | Nebuleon Fumika | 2013-01-07 20:46:10 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-01-07 20:46:10 -0500 |
commit | 7d57e5aa451573bc0055e80ac18ad50c324002fa (patch) | |
tree | c90ca2628dd31bb1e27ea8bc4aae4d94bf676768 | |
parent | 377c6bcadbf56216237ee23841776701e2e9086c (diff) | |
download | snesemu-7d57e5aa451573bc0055e80ac18ad50c324002fa.tar.gz snesemu-7d57e5aa451573bc0055e80ac18ad50c324002fa.tar.bz2 snesemu-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.cpp | 4 |
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 */); |