From 89c0bad42f218afd9e4e7719dd3da65f1fe3ff55 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 14 Dec 2016 20:20:34 -0800 Subject: Fix Z80 interrupt pulse duration. Fixes inconsistent music playback speed in Sonic 2 introduced in 0.4.1 --- genesis.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'genesis.c') diff --git a/genesis.c b/genesis.c index e4140ca..b386421 100644 --- a/genesis.c +++ b/genesis.c @@ -97,14 +97,13 @@ void adjust_int_cycle(m68k_context * context, vdp_context * v_context) #define dputs #endif -#define Z80_VINT_DURATION 128 - void z80_next_int_pulse(z80_context * z_context) { - genesis_context * gen = z_context->system; + genesis_context * gen = z_context->system; z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp); - z_context->int_pulse_end = z_context->int_pulse_start + Z80_VINT_DURATION * MCLKS_PER_Z80; - } + //Notes in the Genesis Plus GX code suggest this is asserted for one line + z_context->int_pulse_end = z_context->int_pulse_start + MCLKS_LINE; +} void sync_z80(z80_context * z_context, uint32_t mclks) { -- cgit v1.2.3