From 64f0b10ed617f4fbfcfc93625b8ca09a44f58615 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 18 Mar 2017 23:18:37 -0700 Subject: Basic refresh emulation that doesn't break direct color DMA demos. Fixes sound after entering pause menu in Pacman 2: The New Adventures --- genesis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'genesis.c') 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 -- cgit v1.2.3