summaryrefslogtreecommitdiff
path: root/genesis.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-03-18 23:18:37 -0700
committerMichael Pavone <pavone@retrodev.com>2017-03-18 23:18:37 -0700
commit64f0b10ed617f4fbfcfc93625b8ca09a44f58615 (patch)
tree36acf7578425548cb15f2d352c096bcb9c79d3af /genesis.c
parent401596ec874495e53dc65290f08393fc9aed804d (diff)
Basic refresh emulation that doesn't break direct color DMA demos. Fixes sound after entering pause menu in Pacman 2: The New Adventures
Diffstat (limited to 'genesis.c')
-rw-r--r--genesis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/genesis.c b/genesis.c
index 8f7031c..7855296 100644
--- a/genesis.c
+++ b/genesis.c
@@ -144,6 +144,7 @@ static void sync_sound(genesis_context * gen, uint32_t target)
static uint32_t last_frame_num;
//My refresh emulation isn't currently good enough and causes more problems than it solves
+#define REFRESH_EMULATION
#ifdef REFRESH_EMULATION
#define REFRESH_INTERVAL 128
#define REFRESH_DELAY 2
@@ -322,6 +323,7 @@ static m68k_context * vdp_port_write(uint32_t vdp_port, m68k_context * context,
context->current_cycle += m68k_cycle_diff;
#ifdef REFRESH_EMULATION
last_sync_cycle = context->current_cycle;
+ refresh_counter = 0;
#endif
//Lock the Z80 out of the bus until the VDP access is complete
gen->bus_busy = 1;
@@ -396,7 +398,7 @@ static uint16_t vdp_port_read(uint32_t vdp_port, m68k_context * context)
if (v_context->cycles != before_cycle) {
//printf("68K paused for %d (%d) cycles at cycle %d (%d) for read\n", v_context->cycles - context->current_cycle, v_context->cycles - before_cycle, context->current_cycle, before_cycle);
context->current_cycle = v_context->cycles;
-#ifdef REFRES_EMULATION
+#ifdef REFRESH_EMULATION
last_sync_cycle = context->current_cycle;
#endif
//Lock the Z80 out of the bus until the VDP access is complete