Solve the sound clicking issue in Kirby!
The symptom of the problem was in the form of a rythmic click sound popping in the left channel. Diving deep into Kirby's binary, I found out that channel B and channel A are playing too different pcm buffers simultationsly: A is enabled for the right channel and B is enabled for the left. I found out that the game's sound driver was using VCOUNT in order to syncornize the audio, but in some occassions the fifo DMA was not disabled in time, causing the DMA to fill the fifo in additional 16 bytes of garbage residing next to channel B's pcmBuffer. After a thorough check-up of the GPU state machine, I find out that I stay in VBLANK for 1 line too long, and that's what caused the audio buffer to de-sync with the gpu emulation. This commit fixes this issue. Former-commit-id: e0f20bd01b8abf62da486e2501cff197a9a22763
This commit is contained in:
parent
a01e3ed9cd
commit
5acd7ddd71
|
@ -513,7 +513,7 @@ impl Gpu {
|
|||
if self.cycles > CYCLES_SCANLINE {
|
||||
self.cycles -= CYCLES_SCANLINE;
|
||||
|
||||
if self.current_scanline < DISPLAY_HEIGHT + VBLANK_LINES {
|
||||
if self.current_scanline < DISPLAY_HEIGHT + VBLANK_LINES - 1 {
|
||||
self.update_vcount(self.current_scanline + 1, irqs);
|
||||
return None;
|
||||
} else {
|
||||
|
|
Reference in a new issue