Skip to content

Commit

Permalink
Move S9xMovieUpdate to start of next frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
bearoso committed Dec 12, 2018
1 parent a718990 commit bb66278
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 0 additions & 2 deletions controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3321,8 +3321,6 @@ void S9xControlEOF (void)

do_polling(POLL_ALL);

S9xMovieUpdate();

pad_read_last = pad_read;
pad_read = false;
}
Expand Down
26 changes: 16 additions & 10 deletions cpuexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include "apu/apu.h"
#include "fxemu.h"
#include "snapshot.h"
#include "movie.h"
#ifdef DEBUGGER
#include "debug.h"
#include "missing.h"
#endif

static inline void S9xReschedule (void);


void S9xMainLoop (void)
{
#define CHECK_FOR_IRQ_CHANGE() \
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bb66278

Please sign in to comment.