md, improve z80/68k synchronization

This commit is contained in:
kub 2023-06-22 22:12:50 +00:02
parent f3876af7f9
commit e0c4dac19c
2 changed files with 20 additions and 17 deletions

View file

@ -204,8 +204,8 @@ extern struct DrZ80 drZ80;
#define z80_cyclesDone() \
(Pico.t.z80c_aim - z80_cyclesLeft)
// one line has 488 68K cycles and 228 Z80 cycles, 228/488*8192=3827
#define cycles_68k_to_z80(x) ((x) * 3847 >> 13)
// 68k clock = OSC/7, z80 clock = OSC/15, 68k:z80 ratio = 7/15*8192=3822.9
#define cycles_68k_to_z80(x) ((x) * 3823 >> 13)
// ----------------------- SH2 CPU -----------------------
@ -449,6 +449,7 @@ struct PicoTiming
unsigned int z80c_line_start;
int z80_scanline;
int z80_buscycles;
int z80_busdelay;
int timer_a_next_oflow, timer_a_step; // in z80 cycles
int timer_b_next_oflow, timer_b_step;