Mercurial > repos > blastem
changeset 1108:87114df913ec
Fix Z80 interrupt pulse duration. Fixes inconsistent music playback speed in Sonic 2 introduced in 0.4.1
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 14 Dec 2016 20:20:34 -0800 |
parents | fc125af5e4f1 |
children | 4bc27caa6e20 |
files | genesis.c |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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) {