changeset 1286:ca0383656a82

Basic refresh emulation that doesn't break direct color DMA demos. Fixes sound after entering pause menu in Pacman 2: The New Adventures
author Michael Pavone <pavone@retrodev.com>
date Sat, 18 Mar 2017 23:18:37 -0700
parents 76e47254596b
children 65f03a0a426a
files genesis.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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