I am having difficulty emulating the sprites that appear on and along side of the road (cars, trees, etc.) in Wacky Races. The scaling road effect works and it is updated using a combination of HBlank and General DMA. However, the sprites are updated using plain old OAM DMA. The sprite tiles appear in the correct places, but not only are they the wrong tiles, they are constantly changing. The issue might be related to intentional OAM reshuffling designed to reduce flicker caused by sprite count scanline limitations.
I also noticed that OAM DMA runs twice per frame: once during VBlank and a second time during a mid-frame HBlank. This technique potentially doubles the number of visible sprites. The sprites above the mid-frame OAM DMA look correct; it's the road-related sprites below that appear to be scrambling almost randomly.
The mid-frame HBlank-triggered OAM DMA does not finish transferring data before the end of HBlank. It actually continues into the OAM Search of the successive scanline. According to the wiki, OAM DMA can run at any scanline phase; however, during OAM DMA, the PPU does not have OAM RAM access, blocking it from any sprite rendering on such scanlines.
Since the road sprite coordinates are correct, it suggests that the OAM DMA transfer is actually working. But, the referenced sprite tiles themselves are actually changing as seen on screen.
Anyway, I'm stuck at the moment trying to understand what is special about Wacky Races. If anyone has any suggestions or hints, please respond. Thanks.
I also noticed that OAM DMA runs twice per frame: once during VBlank and a second time during a mid-frame HBlank. This technique potentially doubles the number of visible sprites. The sprites above the mid-frame OAM DMA look correct; it's the road-related sprites below that appear to be scrambling almost randomly.
The mid-frame HBlank-triggered OAM DMA does not finish transferring data before the end of HBlank. It actually continues into the OAM Search of the successive scanline. According to the wiki, OAM DMA can run at any scanline phase; however, during OAM DMA, the PPU does not have OAM RAM access, blocking it from any sprite rendering on such scanlines.
Since the road sprite coordinates are correct, it suggests that the OAM DMA transfer is actually working. But, the referenced sprite tiles themselves are actually changing as seen on screen.
Anyway, I'm stuck at the moment trying to understand what is special about Wacky Races. If anyone has any suggestions or hints, please respond. Thanks.