I created a very rudimentary implementation of the APU in my emulator. I currently sample at 48000Hz and every 41st cycle of the cpu, I go ahead and spew the current tone out for the two pulse waves (basically nearest neighbor algorithm). I don't do anything else fancy like envelopes or handling duty cycles, everything is at a constant volume. As a result, the music/sound never turns off (I'm only testing with Donkey Kong) which is expected.
What I noticed is that the PPU doesn't match up with the APU. I'm testing with Donkey Kong and if Mario gets hit by a barrel, the kill noise is delayed and doesn't output for a few seconds.
My implementation of the PPU is to currently draw out the whole frame at the end (89,342 PPU cycles). I don't think I'm bound by my computer as it's able to keep up fine. Also there's zero input lag between keyboard input (controlling mario) and picture output.
Based on my implementation, does it make sense that the sound doesn't match up with the picture? There is still a lot of work to do but for now I'm more curious as to what could cause the delay. Thanks.
What I noticed is that the PPU doesn't match up with the APU. I'm testing with Donkey Kong and if Mario gets hit by a barrel, the kill noise is delayed and doesn't output for a few seconds.
My implementation of the PPU is to currently draw out the whole frame at the end (89,342 PPU cycles). I don't think I'm bound by my computer as it's able to keep up fine. Also there's zero input lag between keyboard input (controlling mario) and picture output.
Based on my implementation, does it make sense that the sound doesn't match up with the picture? There is still a lot of work to do but for now I'm more curious as to what could cause the delay. Thanks.