diff --git a/cpuexec.cpp b/cpuexec.cpp index 9f220219..b905f018 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -132,13 +132,6 @@ void S9xMainLoop (void) if (CPU.Flags & SCAN_KEYS_FLAG) { - #ifdef DEBUGGER - if (!(CPU.Flags & FRAME_ADVANCE_FLAG)) - #endif - { - S9xSyncSpeed(); - } - break; } @@ -326,6 +319,12 @@ void S9xDoHEventProcessing (void) if (CPU.V_Counter == PPU.ScreenHeight + FIRST_VISIBLE_LINE) // VBlank starts from V=225(240). { S9xEndScreenRefresh(); + #ifdef DEBUGGER + if (!(CPU.Flags & FRAME_ADVANCE_FLAG)) + #endif + { + S9xSyncSpeed(); + } CPU.Flags |= SCAN_KEYS_FLAG; diff --git a/gtk/src/gtk_s9x.cpp b/gtk/src/gtk_s9x.cpp index 5a7f1d74..4aa01a14 100644 --- a/gtk/src/gtk_s9x.cpp +++ b/gtk/src/gtk_s9x.cpp @@ -304,8 +304,6 @@ static bool S9xIdleFunc() S9xProcessEvents(true); - S9xThrottle(Settings.SkipFrames); - if (!S9xDisplayDriverIsReady()) { usleep(100); @@ -494,6 +492,7 @@ static void S9xThrottle(int method) void S9xSyncSpeed() { + S9xThrottle(Settings.SkipFrames); } static void S9xCheckPointerTimer()