From 7d57e5aa451573bc0055e80ac18ad50c324002fa Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Mon, 7 Jan 2013 20:46:10 -0500 Subject: 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. --- source/nds/entry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') 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 */); -- cgit v1.2.3