How does Sonic2 sync music update on z80?
Posted: Fri Mar 20, 2009 2:04 pm
I'm having a hard time tracking down a problem in my genesis emulator which is making music playback in Sonic2 be a bit slow and it also sporadically slows down and speeds up.
At first I thought it was bad implementation of ym2612 timers, but setting breakpoints, Sonic2 never enables them or tests the timer overflow bits. Can anyone confrim this for Sonic2?
Adding diagnostics it looks like z80 vbl interrupt is disabled during ym2612 DAC playback (z80 sits in a tight loop feeding the DAC data register). Listening carefully, it almost sounds like when DAC drum sounds are played, the music time syncing is paused during that time.
So I'm curious does anyone know what the z80 music driver is using to keep music tempo constant? Is there some timer register in z80 that's being read that I haven't implemented perhaps?
One thing I haven't implemented yet which could be part of the problem is that I'm not emulating freezing the 68k during VDP dmas. Does anyone know the side effects of this?
cheers,
Steve.
At first I thought it was bad implementation of ym2612 timers, but setting breakpoints, Sonic2 never enables them or tests the timer overflow bits. Can anyone confrim this for Sonic2?
Adding diagnostics it looks like z80 vbl interrupt is disabled during ym2612 DAC playback (z80 sits in a tight loop feeding the DAC data register). Listening carefully, it almost sounds like when DAC drum sounds are played, the music time syncing is paused during that time.
So I'm curious does anyone know what the z80 music driver is using to keep music tempo constant? Is there some timer register in z80 that's being read that I haven't implemented perhaps?
One thing I haven't implemented yet which could be part of the problem is that I'm not emulating freezing the 68k during VDP dmas. Does anyone know the side effects of this?
cheers,
Steve.