diff --git a/controls.cpp b/controls.cpp index 9c26aa7a..b828bd9d 100644 --- a/controls.cpp +++ b/controls.cpp @@ -3321,8 +3321,6 @@ void S9xControlEOF (void) do_polling(POLL_ALL); - S9xMovieUpdate(); - pad_read_last = pad_read; pad_read = false; } diff --git a/cpuexec.cpp b/cpuexec.cpp index 78f9876a..bc27e0b6 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -11,6 +11,7 @@ #include "apu/apu.h" #include "fxemu.h" #include "snapshot.h" +#include "movie.h" #ifdef DEBUGGER #include "debug.h" #include "missing.h" @@ -18,7 +19,6 @@ static inline void S9xReschedule (void); - void S9xMainLoop (void) { #define CHECK_FOR_IRQ_CHANGE() \ @@ -31,6 +31,12 @@ void S9xMainLoop (void) Timings.IRQFlagChanging = IRQ_NONE; \ } + if (CPU.Flags & SCAN_KEYS_FLAG) + { + CPU.Flags &= ~SCAN_KEYS_FLAG; + S9xMovieUpdate(); + } + for (;;) { if (CPU.NMIPending) @@ -120,7 +126,16 @@ void S9xMainLoop (void) #endif if (CPU.Flags & SCAN_KEYS_FLAG) + { + #ifdef DEBUGGER + if (!(CPU.Flags & FRAME_ADVANCE_FLAG)) + #endif + { + S9xSyncSpeed(); + } + break; + } uint8 Op; struct SOpcodes *Opcodes; @@ -155,15 +170,6 @@ void S9xMainLoop (void) } S9xPackStatus(); - - if (CPU.Flags & SCAN_KEYS_FLAG) - { - #ifdef DEBUGGER - if (!(CPU.Flags & FRAME_ADVANCE_FLAG)) - #endif - S9xSyncSpeed(); - CPU.Flags &= ~SCAN_KEYS_FLAG; - } } static inline void S9xReschedule (void)