Question about BG scrolling

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Question about BG scrolling
by on (#133874)
I recently started programming a RPG game with some friends of mine and I successfully animated sprites and created all command+tasking engine.
Next step is programming a smooth scrolling for walking inside towns, so I compared some methods used in popular games (all of them use mode 1):

* Treasure Hunter G: it sets SC size 0 and 16x16 tile size, thus making SC0 512x512 pixel. Because display area is 256x224, it's pretty obvious how the game updates tilemap data off-screen to make a smooth scrolling.

* Secret of Mana, Secret of Evermore, Seiken Densetsu 3: all of them sets SC size 1 and 8x8 tile size, thus making SC0+SC1 512x256 pixel. I have some doubts about how the game updates tilemap data off-screen when moving vertically.

* Tales of Phantasia: it sets SC size 0 and 8x8 tile size, thus making SC0 256x256 pixel. BG0, BG1 and BG2 are consecutive in VRAM ($5000, $5400, $5800) and display area matches screen size, so... how the game updates off-screen tilemap? Where is located "off-screen" tilemap in VRAM?

My design is using 8x8 tiles and would like to use SC size = 0, so tilemap data is $800 byte length in VRAM, from $4000 to $43FF. If I would move the screen 1 pixel to the right, I should keep tilemap data on VRAM for the left column (because I'm showing 7 pixels of all 8x8 tiles in that column), but I also had to write to VRAM tilemap data for the new right column (because I'm showing 1 pixel of all 8x8 tiles on that column). Which VRAM address would have to write to?

Regards!
Re: Question about BG scrolling
by on (#133878)
You can use window registers to show only 248px of the 256px wide background map. I'm pretty sure Kirby Super Star does this, given how its side borders are thicker than those of other games.
Re: Question about BG scrolling
by on (#133884)
Tales of Phantasia clips the left/right edges with window clipping.

As for vertical scrolling, the SNES has two vertical resolutions, the larger one is like the NES while the smaller one automatically blacks out NTSC overscan region, by having a larger VBlank. The vast majority of games uses this mode because :
1) It's possible to scroll vertically with a 32-tile height map without any artefacts
2) There's more time for VRAM transfers.
Re: Question about BG scrolling
by on (#133887)
Note that the larger resolution is 240 pixels high, not 256, so that'd still give some room for vertical scrolling in the second case (but yeah, the 224 height is better anyway due to the extended vblank time).
Re: Question about BG scrolling
by on (#133899)
Thanks for all your replies. I now understand how vertical scrolling is achieve in Secret of Mana, Secret of Evermore and Seiken Densetsu 3.

If you had to decide, which method for scrolling would you choose? It seems Tales of Phantasia is more more optimized (less VRAM for tilemap) and maybe less difficult to program than using SC size 1.
Re: Question about BG scrolling
by on (#133917)
I see two reason to clip the borders and use a 32x32 tilemaps for BGs :

1) You have a lot of patterns and you need to keep as much free VRAM as possible for them
2) You use 8x8 sprites and don't want to bother give minus coordinates to sprites that are not entierely on the screen.

Otherwise I'd say go for 64x32 tilemaps.
Re: Question about BG scrolling
by on (#133924)
Bregalad wrote:
1) You have a lot of patterns and you need to keep as much free VRAM as possible for them


That's a great reason. Thanks for your help!