# HG changeset patch # User Michael Pavone # Date 1489904317 25200 # Node ID ca0383656a82f0660f9241031180ba0756aa27e0 # Parent 76e47254596bda5bf982890bc0232ee04444dced Basic refresh emulation that doesn't break direct color DMA demos. Fixes sound after entering pause menu in Pacman 2: The New Adventures diff -r 76e47254596b -r ca0383656a82 genesis.c --- a/genesis.c Sat Mar 18 17:09:14 2017 -0700 +++ b/genesis.c Sat Mar 18 23:18:37 2017 -0700 @@ -144,6 +144,7 @@ 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 @@ 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 @@ 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