Mercurial > repos > blastem
diff genesis.c @ 1291:f17fe0d00626
Adjust Z80 interrupt pulse duration to match hardware measurements
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 19 Mar 2017 18:32:49 -0700 |
parents | 94f32d534bed |
children | 208803173ebc |
line wrap: on
line diff
--- 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)