From b8625a6f207cb032afced11cb9032a74a19b010b Mon Sep 17 00:00:00 2001 From: nitsuja Date: Wed, 4 Nov 2009 11:31:45 +0000 Subject: [PATCH] possibly fixing a bug where frame advance can run out of control sometimes, and disabling a throttle setting that didn't seem to add much --- desmume/src/windows/main.cpp | 8 ++++++++ desmume/src/windows/throttle.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 56ff98660..a5112039c 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1630,6 +1630,12 @@ static void StepRunLoop_Throttle(bool allowSleep = true, int forceFrameSkip = -1 SPU_Pause(1); } ServiceDisplayThreadInvocations(); + + if(execute && emu_paused && !frameAdvance) + { + // safety net against running out of control in case this ever happens. + Unpause(); Pause(); + } } DWORD WINAPI run() @@ -3240,6 +3246,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam, int modifiers) void Unpause() { lastPauseFromLostFocus = FALSE; + if (!execute && !emu_paused) NDS_Pause(false), emu_paused=true; if (emu_paused) NDS_UnPause(); emu_paused = 0; } @@ -3247,6 +3254,7 @@ void Unpause() void Pause() { lastPauseFromLostFocus = FALSE; + if (execute && emu_paused) NDS_UnPause(false), emu_paused=false; if (!emu_paused) NDS_Pause(); emu_paused = 1; } diff --git a/desmume/src/windows/throttle.cpp b/desmume/src/windows/throttle.cpp index 137e359b0..0a296829c 100644 --- a/desmume/src/windows/throttle.cpp +++ b/desmume/src/windows/throttle.cpp @@ -16,7 +16,7 @@ static u64 desiredFpsScalers [] = { 1024, 512, 256, // 100% - 224, + //224, 192, 128, // 50% 96,