# HG changeset patch # User Michael Pavone # Date 1489973569 25200 # Node ID f17fe0d00626ae03bf89b252c5c8694f97de4981 # Parent aa1a8eb5bb2b43554ec2adb428f6254e5af47745 Adjust Z80 interrupt pulse duration to match hardware measurements diff -r aa1a8eb5bb2b -r f17fe0d00626 genesis.c --- a/genesis.c Sun Mar 19 12:54:20 2017 -0700 +++ b/genesis.c Sun Mar 19 18:32:49 2017 -0700 @@ -21,6 +21,7 @@ #define MCLKS_PER_YM 7 #define MCLKS_PER_Z80 15 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16) +#define Z80_INT_PULSE_MCLKS 2573 //measured value is ~171.5 Z80 clocks #define DEFAULT_SYNC_INTERVAL MCLKS_LINE #define DEFAULT_LOWPASS_CUTOFF 3390 @@ -108,8 +109,7 @@ { genesis_context * gen = z_context->system; z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp); - //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; + z_context->int_pulse_end = z_context->int_pulse_start + Z80_INT_PULSE_MCLKS; } static void sync_z80(z80_context * z_context, uint32_t mclks)