From 10e0ef005d1d86301d8b87215ef23821bdd4d441 Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Wed, 22 Nov 2017 12:12:41 -0600 Subject: [PATCH] Change where we break S9xMainLoop/Scan for input ("Brunnis lag fix") --- cpuexec.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpuexec.cpp b/cpuexec.cpp index fd12bcdcb..c2c562dae 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -444,7 +444,6 @@ void S9xDoHEventProcessing (void) ICPU.Frame++; PPU.HVBeamCounterLatched = 0; - CPU.Flags |= SCAN_KEYS_FLAG; } // From byuu: @@ -474,6 +473,9 @@ void S9xDoHEventProcessing (void) if (CPU.V_Counter == PPU.ScreenHeight + FIRST_VISIBLE_LINE) // VBlank starts from V=225(240). { S9xEndScreenRefresh(); + + CPU.Flags |= SCAN_KEYS_FLAG; + PPU.HDMA = 0; // Bits 7 and 6 of $4212 are computed when read in S9xGetPPU. #ifdef DEBUGGER