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.
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.
| Property | Value |
|---|---|
| Screen size | 32 × 32 tile entries |
| Entry size | 2 bytes |
| Screen bytes | 2 KB (2048 bytes) |
| Max map | 64 × 64 entries (four screens) |
| Tile cell | 8 × 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.
| Size | Layout | Screens |
|---|---|---|
| 0 | 32 × 32 | 1 |
| 1 | 64 × 32 | 2, side by side |
| 2 | 32 × 64 | 2, stacked |
| 3 | 64 × 64 | 4 |
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:
| Bit | 15 | 14 | 13 | 12–10 | 9–0 |
|---|---|---|---|---|---|
| Meaning | V flip | H flip | Priority | Palette (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.
| Register | Role |
|---|---|
| BGnHOFS | Horizontal scroll of layer n. |
| BGnVOFS | Vertical 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.
| Setting | Meaning |
|---|---|
| BGnSC | Map base address and screen-size arrangement. |
| BGnNBA | Base 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.