summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-12-14 20:20:34 -0800
committerMichael Pavone <pavone@retrodev.com>2016-12-14 20:20:34 -0800
commit89c0bad42f218afd9e4e7719dd3da65f1fe3ff55 (patch)
tree0d1a56e7eab049983b306bc70b0b97b5e6251f9a
parent54e71ce54fe55606ab62d7db53ab8f63f2514ca3 (diff)
Fix Z80 interrupt pulse duration. Fixes inconsistent music playback speed in Sonic 2 introduced in 0.4.1
-rw-r--r--genesis.c9
1 files changed, 4 insertions, 5 deletions
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)
{