SNES Images

The SNES builds its picture from tiled background layers under the control of the PPU. Eight background modes trade the number of layers against the colours each layer can show, and one of them, Mode 7, is a single layer the hardware can rotate and scale. Everything is drawn from tiles held in VRAM, coloured through a 256-entry palette in CGRAM.

SNES Images

Overview

The display is 256×224 pixels in the normal NTSC setup. The picture is not a single bitmap; it is assembled every scanline from up to four scrolling background layers plus the object layer. Each background is a grid of 8×8 tiles, arranged by a tilemap, coloured from a shared 256-colour palette. The chosen background mode decides how many layers exist and how deep their colour is.

PropertyValue
Resolution256 × 224 (up to 512 × 448 interlaced)
Tile size8 × 8 pixels (16 × 16 selectable)
Colour depths2bpp, 4bpp, 8bpp
VRAM64 KB
Palette (CGRAM)256 colours, 15-bit BGR
Background layers1 to 4, by mode

Background modes

The PPU offers eight background modes, numbered 0 to 7. A mode fixes how many background layers are active and how many colours each can use. More layers means fewer colours per layer, because deeper tiles cost more VRAM and more per-pixel fetches. The table gives every mode with its layers and their colour depth.

ModeLayersColours per layerNotes
044 (2bpp) on all fourEach layer uses its own set of palettes.
1316, 16, 4Two 4bpp layers and one 2bpp; the common game mode.
2216, 16Two 4bpp layers with per-column offset (offset-per-tile).
32256, 16One 8bpp layer and one 4bpp.
42256, 4One 8bpp and one 2bpp, with offset-per-tile.
5216, 4High-resolution 512-wide mode.
6116High-resolution 4bpp with offset-per-tile.
71256Single affine layer with rotation and scaling.

Modes 0 to 6 differ only in the layer and depth mix; the tile and tilemap machinery is the same. Mode 1 is the workhorse for most games, giving two richly coloured layers and a third for text or a status bar.

Mode 7

Mode 7 replaces the tiled layers with one large background the PPU can transform. It is a single 8bpp layer, 128×128 tiles at most, wrapped or clamped, that the hardware multiplies through a 2×2 matrix each scanline. That matrix can rotate, scale and shear the layer, producing the tilting floors, spinning maps and racing roads the machine is known for.

RegisterRole
M7A, M7B, M7C, M7DThe four 16-bit matrix coefficients
M7X, M7YCentre of rotation and scaling
M7HOFS, M7VOFSScroll offset of the transformed layer

Changing the matrix values between scanlines, usually with a raster interrupt, bends the transform down the screen and gives the perspective effect of a ground plane receding to the horizon.

Tile character format

A tile, also called a character, is an 8×8 block of pixels. Its colour depth is set by the mode and layer: 2bpp for 4 colours, 4bpp for 16, or 8bpp for 256. The pixels are stored as bitplanes. A 2bpp tile is two planes, 16 bytes; each pair of bytes holds one row, the two planes giving the two bits of each of the eight pixels. Deeper tiles simply add more planes.

DepthColoursPlanesBytes per tile
2bpp4216
4bpp16432
8bpp256864

In a 4bpp tile the first two planes are stored interleaved by row, then the next two planes follow as a second block. Colour index 0 is transparent, so it shows the backdrop or a lower layer. The final on-screen colour is that index plus the palette offset chosen by the tilemap entry.

Palette and CGRAM

All colour on the SNES comes from CGRAM, a 512-byte palette RAM holding 256 colours, two bytes each. A colour is a 15-bit value with five bits per channel in blue-green-red order, so the top bit of the 16-bit word is unused.

Bit1514–109–54–0
MeaningunusedBlue (0–31)Green (0–31)Red (0–31)

The 256 colours are shared out among the layers. A 4bpp layer draws from one of sixteen 16-colour sub-palettes, chosen per tile by the tilemap; an 8bpp layer or Mode 7 uses the whole 256 at once. Objects take the upper 128 colours as eight object palettes.

Video memory

The PPU owns three separate memories. VRAM holds the tiles and tilemaps, CGRAM holds the palette, and OAM holds the sprites. The CPU cannot see VRAM directly; it writes through the PPU data ports, usually driven by DMA during the vertical blank.

MemorySizeContents
VRAM64 KB (32K words)Tile character data and tilemaps.
CGRAM512 bytes256 colours, 15-bit BGR.
OAM544 bytesThe 128 sprite entries.

Because VRAM is only 64 KB, deep tiles and large tilemaps compete for space, so a game balances how many 8bpp characters it keeps against the size of its scrolling maps.