diff genesis.c @ 1766:1dc718581aac

Fix Z80 interrupts in Gen/MD mode when using new core. Disable CPU debug log in new Z80 core
author Michael Pavone <pavone@retrodev.com>
date Wed, 20 Feb 2019 09:42:12 -0800
parents 33ec5df77fac
children 8fe162bdb038 51417bb557b6
line wrap: on
line diff
--- a/genesis.c	Wed Feb 20 00:34:52 2019 -0800
+++ b/genesis.c	Wed Feb 20 09:42:12 2019 -0800
@@ -301,6 +301,7 @@
 	z_context->int_cycle = vdp_next_vint_z80(gen->vdp);
 	z_context->int_end_cycle = z_context->int_cycle + Z80_INT_PULSE_MCLKS;
 	z_context->int_value = 0xFF;
+	z80_sync_cycle(z_context, z_context->sync_cycle);
 #else
 	z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp);
 	z_context->int_pulse_end = z_context->int_pulse_start + Z80_INT_PULSE_MCLKS;
@@ -313,7 +314,9 @@
 #ifndef NO_Z80
 	if (z80_enabled) {
 #ifdef NEW_CORE
-		z80_next_int_pulse(z_context);
+		if (z_context->int_cycle == 0xFFFFFFFFU) {
+			z80_next_int_pulse(z_context);
+		}
 #endif
 		z80_run(z_context, mclks);
 	} else