Calling all nesdev folks! :-)
A user over on the SNESdev board is having trouble understanding how one goes about implementing the part of a game/video engine that handles, essentially, updating the edges of the screen before doing scrolling/panning.
While the SNES is certainly a bigger and different beast than the NES -- for example, it has enough PPU RAM to hold 2x2 screens worth of data, has actual dedicated BG scroll/position X and Y MMIO registers, handles 4-way scrolling easier, has native DMA for transferring data to/from PPU RAM, has more RAM (~128KB), does not have CHR-ROM, etc. -- the overall model/methodology is exactly the same: you have to keep track of "where" in your map data you are (e.g. upper left corner) pointer-wise, correlate or convert that into SC data ("nametable" in NES terms), only update things in columns (e.g. 32) when panning left/right or things in rows (e.g. 1) when panning up/down, and all the related nuances.
It's a complicated subject simply because of, well, how complicated it can get. I myself have struggled for years trying to mentally grasp implementing this exact type of thing. (I still have hand-written 65816 assembly I wrote during high school trying to do this exact thing, heh. It's several pages, maybe 50% done, and I never bothered trying it.)
I was hoping folks might be able to chime in there, describing the overall implementation/methodology used in your engine/game, including all the stuff you keep track of at the variable level -- or if there are websites, docs, etc. describing all of this, linking them. Visuals I think would also help, if/where applicable.
Thanks!
A user over on the SNESdev board is having trouble understanding how one goes about implementing the part of a game/video engine that handles, essentially, updating the edges of the screen before doing scrolling/panning.
While the SNES is certainly a bigger and different beast than the NES -- for example, it has enough PPU RAM to hold 2x2 screens worth of data, has actual dedicated BG scroll/position X and Y MMIO registers, handles 4-way scrolling easier, has native DMA for transferring data to/from PPU RAM, has more RAM (~128KB), does not have CHR-ROM, etc. -- the overall model/methodology is exactly the same: you have to keep track of "where" in your map data you are (e.g. upper left corner) pointer-wise, correlate or convert that into SC data ("nametable" in NES terms), only update things in columns (e.g. 32) when panning left/right or things in rows (e.g. 1) when panning up/down, and all the related nuances.
It's a complicated subject simply because of, well, how complicated it can get. I myself have struggled for years trying to mentally grasp implementing this exact type of thing. (I still have hand-written 65816 assembly I wrote during high school trying to do this exact thing, heh. It's several pages, maybe 50% done, and I never bothered trying it.)
I was hoping folks might be able to chime in there, describing the overall implementation/methodology used in your engine/game, including all the stuff you keep track of at the variable level -- or if there are websites, docs, etc. describing all of this, linking them. Visuals I think would also help, if/where applicable.
Thanks!