# HG changeset patch # User Michael Pavone # Date 1481775634 28800 # Node ID 87114df913ec021c2b3f28d1ff012d611f3f3c21 # Parent fc125af5e4f18583b8fd8bc78e45a4485d3854c5 Fix Z80 interrupt pulse duration. Fixes inconsistent music playback speed in Sonic 2 introduced in 0.4.1 diff -r fc125af5e4f1 -r 87114df913ec genesis.c --- a/genesis.c Mon Dec 12 19:21:22 2016 -0800 +++ b/genesis.c Wed Dec 14 20:20:34 2016 -0800 @@ -97,14 +97,13 @@ #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) {