comparison 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
comparison
equal deleted inserted replaced
1290:aa1a8eb5bb2b 1291:f17fe0d00626
19 19
20 uint32_t MCLKS_PER_68K; 20 uint32_t MCLKS_PER_68K;
21 #define MCLKS_PER_YM 7 21 #define MCLKS_PER_YM 7
22 #define MCLKS_PER_Z80 15 22 #define MCLKS_PER_Z80 15
23 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16) 23 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16)
24 #define Z80_INT_PULSE_MCLKS 2573 //measured value is ~171.5 Z80 clocks
24 #define DEFAULT_SYNC_INTERVAL MCLKS_LINE 25 #define DEFAULT_SYNC_INTERVAL MCLKS_LINE
25 #define DEFAULT_LOWPASS_CUTOFF 3390 26 #define DEFAULT_LOWPASS_CUTOFF 3390
26 27
27 //TODO: Figure out the exact value for this 28 //TODO: Figure out the exact value for this
28 #define LINES_NTSC 262 29 #define LINES_NTSC 262
106 107
107 static void z80_next_int_pulse(z80_context * z_context) 108 static void z80_next_int_pulse(z80_context * z_context)
108 { 109 {
109 genesis_context * gen = z_context->system; 110 genesis_context * gen = z_context->system;
110 z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp); 111 z_context->int_pulse_start = vdp_next_vint_z80(gen->vdp);
111 //Notes in the Genesis Plus GX code suggest this is asserted for one line 112 z_context->int_pulse_end = z_context->int_pulse_start + Z80_INT_PULSE_MCLKS;
112 z_context->int_pulse_end = z_context->int_pulse_start + MCLKS_LINE;
113 } 113 }
114 114
115 static void sync_z80(z80_context * z_context, uint32_t mclks) 115 static void sync_z80(z80_context * z_context, uint32_t mclks)
116 { 116 {
117 #ifndef NO_Z80 117 #ifndef NO_Z80