SNES Maps

Each SNES background is drawn from a tilemap, a grid of entries that names which tile goes in each cell and how it is coloured and flipped. A screen holds 32×32 entries, and several screens can be joined into a larger 64×64 map that scrolls under the display.

SNES Maps

Overview

A tilemap is the plan of a background layer. Where the tiles are the pieces of art, the tilemap says where each piece sits, which palette colours it, whether it appears in front of or behind other things, and whether it is mirrored. The PPU reads the tilemap as it scans each line, fetches the named tiles from VRAM, and composites the layer. One tilemap exists per active background layer.

PropertyValue
Screen size32 × 32 tile entries
Entry size2 bytes
Screen bytes2 KB (2048 bytes)
Max map64 × 64 entries (four screens)
Tile cell8 × 8 or 16 × 16 pixels

Screens and sizes

The basic unit is a screen of 32×32 entries, which is 2 KB of VRAM. Because the display is 32 cells wide, one screen exactly covers the visible area with a little to spare. To scroll over a larger world the layer can be set to two or four screens, arranged 64×32, 32×64 or 64×64. A two-bit size field in the layer's screen-base register picks the arrangement.

SizeLayoutScreens
032 × 321
164 × 322, side by side
232 × 642, stacked
364 × 644

The screens are stored in VRAM one after another, so a 64×64 map is four consecutive 2 KB screens, and the PPU wraps around the map edges as the layer scrolls.

The tilemap entry

Each cell of the map is a single 16-bit entry. It packs the tile number in its low ten bits, then a palette group, a priority bit, and two flip bits, so one word carries everything the PPU needs to place and dress a tile:

Bit15141312–109–0
MeaningV flipH flipPriorityPalette (0–7)Tile number (0–1023)

The ten tile bits index up to 1024 characters in the layer's tile area. The three palette bits choose one of eight sub-palettes for a 4bpp or 2bpp layer. The priority bit lifts the tile above or below same-layer tiles, letting a foreground detail sit in front of a sprite. The two flip bits mirror the tile horizontally, vertically, or both, so one tile serves several orientations.

Scrolling layers

Each background layer has its own horizontal and vertical scroll registers, so layers move independently. Setting different scroll speeds for two layers produces parallax, a near layer sliding faster than a far one. The scroll values are 10 bits, enough to move anywhere within a 64-wide map, and are usually updated each frame, or per scanline through a raster interrupt for wavy and split-screen effects.

RegisterRole
BGnHOFSHorizontal scroll of layer n.
BGnVOFSVertical scroll of layer n.

Map memory

Tilemaps live in VRAM alongside the tiles. Each layer has a base address register pointing at its map, and another pointing at its tile data. Because a screen is 2 KB and VRAM is 64 KB, maps and tiles share the same limited space, so a game balances how large its scrolling maps are against how many distinct tiles it keeps.

SettingMeaning
BGnSCMap base address and screen-size arrangement.
BGnNBABase address of the layer's tile character data.

New map data is written during the vertical blank, usually by DMA, so a scrolling game streams fresh columns or rows of entries into VRAM just off the visible edge as the view moves.