From 933c8610639ec818209ebc51ca74d8d5e2db625f Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Fri, 17 Aug 2018 10:23:20 -0500 Subject: [PATCH] Move render to HBLANK start. --- cpuexec.cpp | 10 +++++----- snes9x.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cpuexec.cpp b/cpuexec.cpp index 1f707347..1adc2fe0 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -357,6 +357,11 @@ 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; @@ -372,11 +377,6 @@ 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 61fdbc4a..1f8d0068 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 (48 * ONE_DOT_CYCLE) // 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 1096 // FIXME: Snes9x renders a line at a time. #define SNES_TR_MASK (1 << 4) #define SNES_TL_MASK (1 << 5)