Question about BG scrolling

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
magno
Posts: 193
Joined: Tue Aug 15, 2006 5:23 am
Location: Spain
Contact:

Question about BG scrolling

Post by magno »

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!
tepples
Posts: 22853
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Question about BG scrolling

Post by tepples »

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.
User avatar
Bregalad
Posts: 8100
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Question about BG scrolling

Post by Bregalad »

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.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Question about BG scrolling

Post by Sik »

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).
magno
Posts: 193
Joined: Tue Aug 15, 2006 5:23 am
Location: Spain
Contact:

Re: Question about BG scrolling

Post by magno »

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.
User avatar
Bregalad
Posts: 8100
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Question about BG scrolling

Post by Bregalad »

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.
magno
Posts: 193
Joined: Tue Aug 15, 2006 5:23 am
Location: Spain
Contact:

Re: Question about BG scrolling

Post by magno »

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!
Post Reply