diff --git a/cpuexec.cpp b/cpuexec.cpp index 1adc2fe0..1f707347 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -357,11 +357,6 @@ static inline void S9xReschedule (void) switch (CPU.WhichEvent) { case HC_HBLANK_START_EVENT: - CPU.WhichEvent = HC_RENDER_EVENT; - CPU.NextEvent = Timings.RenderPos; - break; - - case HC_RENDER_EVENT: CPU.WhichEvent = HC_HDMA_START_EVENT; CPU.NextEvent = Timings.HDMAStart; break; @@ -377,6 +372,11 @@ static inline void S9xReschedule (void) break; case HC_HDMA_INIT_EVENT: + CPU.WhichEvent = HC_RENDER_EVENT; + CPU.NextEvent = Timings.RenderPos; + break; + + case HC_RENDER_EVENT: CPU.WhichEvent = HC_WRAM_REFRESH_EVENT; CPU.NextEvent = Timings.WRAMRefreshPos; break; diff --git a/snes9x.h b/snes9x.h index 1f8d0068..61fdbc4a 100644 --- a/snes9x.h +++ b/snes9x.h @@ -272,11 +272,11 @@ #define SNES_WRAM_REFRESH_HC_v2 538 #define SNES_WRAM_REFRESH_CYCLES 40 -#define SNES_HBLANK_START_HC 1096 // H=274 -#define SNES_HDMA_START_HC 1106 // FIXME: not true -#define SNES_HBLANK_END_HC 4 // H=1 -#define SNES_HDMA_INIT_HC 20 // FIXME: not true -#define SNES_RENDER_START_HC 1096 // FIXME: Snes9x renders a line at a time. +#define SNES_HBLANK_START_HC 1096 // H=274 +#define SNES_HDMA_START_HC 1106 // FIXME: not true +#define SNES_HBLANK_END_HC 4 // H=1 +#define SNES_HDMA_INIT_HC 20 // FIXME: not true +#define SNES_RENDER_START_HC (48 * ONE_DOT_CYCLE) // FIXME: Snes9x renders a line at a time. #define SNES_TR_MASK (1 << 4) #define SNES_TL_MASK (1 << 5)