HDMA problem

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
HDMA problem
by on (#62157)
I'm having trouble with the 3d ocean effect in the background of my game. It scrolls at different speeds depending on how many sprite patterns are being DMAed per frame. I'm guessing the 3d scrolling speed depends on what scanline the HDMA starts with, since the farther down scanlines scroll faster than the scanlines above (hence the 3d effect).

by on (#62174)
Hard to say without access to the ROM or sourcecode, but typical problems include:
-HDMA and DMA share the same channels. Make sure you don't accidently use one channel for both at the same time (I usually reserve channel 0 for DMA and use 1-7 for HDMA).
-Make sure your HDMA tables are zero-terminated properly.

by on (#62192)
I fixed the problem. I was supposed to set it up once and keep it that way instead of setting it up every frame.