Skip to content
Techniques & Technology

Mode 7

SNES rotation and scaling

Background mode 7 of the Super NES PPU rotates, enlarges and reduces a single 1024×1024-dot layer through a 2×2 matrix in registers $211B–$211E; changed every scanline by HDMA it becomes the perspective floor of F-Zero and Pilotwings.

super-nintendographicshardwarenintendo

Mode 7 is one of the eight background modes of the Super NES picture processor, and the only one in which the layer is not drawn straight from its tilemap but through a 2×2 matrix. The SNESdev wiki’s description is the clearest: the layer is “effectively a 1024x1024 pixel square” that “can be given an arbitrary 2D affine transformation” — it can slide, “rotate at any angle”, “zoom in and out or be squashed”, and “shear or skew”. “It is conceptually similar to texture mapping a single quad on a modern GPU. Conversely, it is also like selecting a parallelogram region from the tilemap, and stretching its four corners to the rectangle of the screen.”

Fast facts

  • Where: Super NES PPU, background mode 7. One layer, 8 bits per pixel, fixed 8×8 characters, a fixed 128×128-character (1024×1024-dot) map.
  • EXTBG: a second 7-bit layer whose top colour bit “acts as priority”, enabled by bit 6 of SETINI ($2133).
  • Matrix: M7A–M7D at $211B$211E, each “8.8 fixed point”, written as two bytes.
  • Centre: M7X and M7Y at $211F$2120, the “pivot-point” of the rotation; scroll through M7HOFS/M7VOFS at $210D$210E.
  • Edges: M7SEL ($211A) chooses between a repeating map and a fill beyond its boundary, and flips the layer horizontally or vertically.
  • Bonus: M7A and M7B double as a signed 16×8-bit multiplier, result read from $2134$2136.
  • Per-line change: HDMA rewrites the matrix each scanline, which is how a flat rotating map becomes a perspective floor.
  • Name in the press: “Mode Seven”, from Nintendo Power’s 1991 explanations of F-Zero and Pilotwings.

The matrix

The four parameters say how far to step through the map for each step across the screen. In the SNESdev wiki’s words: “When you move one pixel to the right on the screen: M7A is how many texels to move to the right on the background. M7C is how many texels to move down. When you move one pixel down on the screen: M7B is how many texels to move right. M7D is how many texels to move down.” So (M7A, M7C) and (M7B, M7D) “are 2D vectors defining Δu and Δv for texture mapping”, and the default of (1, 0) (0, 1) “makes mode 7 behave like a normal background”. Lengthen the vectors and the map shrinks — “(2,0) (0,1) will move 2 texels right for every 1 pixel, shrinking by 1/2 in the horizontal”; rotate them and the map rotates — “(cos ϴ, sin ϴ) (-sin ϴ, cos ϴ) form a standard rotation matrix”. M7X and M7Y “define a texel coordinate that becomes the center (a.k.a. pivot-point) of the scaling/rotation”.

Nintendo’s own licensee manual, the Super NES Development Manual Book I, gives the same four numbers as the sine and cosine of a rotation angle divided by horizontal and vertical reduction rates, written low byte then high byte with the fraction in the low byte and the sign in the top bit, and the centre as 13-bit two’s complement. Its chapter on the mode lists what the layer can do: rotate, enlarge and reduce about a centre that may lie inside or outside the display, flip in either axis, and show 256 colours from 32,768 per dot, or 128 colours plus a priority bit in EXTBG. Past the edge of the map there are three choices — the backdrop colour, the map repeated, or a single character repeated — which is what M7SEL’s repeat and fill bits select.

Mode 7 rotates the background only. Sprites are untouched by the matrix, which is why Nintendo Power’s 1993 pitch for the Super FX was that “not only can large backgrounds be rotated, as with the Super NES’s Mode 7, but even sprites can be manipulated individually”.

The free multiplier

“The 65c816 does not have a multiplication instruction,” the SNESdev wiki notes, “but the SNES includes multiplication hardware that can be accessed with registers.” One of the two multipliers lives in the PPU: the last 16-bit value written to M7A times the 8-bit value in M7B, signed, gives a 24-bit result at $2134$2136 that “can be read immediately after writing the parameters” but “can not be used while rendering Mode 7”. Book I explains why it is there — to take the work of computing the rotation parameters off the CPU — and games use it whether or not they are in mode 7.

Per scanline: the perspective trick

A single matrix rotates and zooms a flat plane; it cannot tilt it. Perspective comes from HDMA, which “can be changed every scanline”, “allowing versatile perspective and distortion effects”: feed it a table of matrix values that shrink the map more for each line up the screen and the plane recedes into the distance. Book I describes H-DMA as a transfer synchronised to horizontal blanking that lets the PPU’s settings change on every scanline, and assigns the rotation and scaling to the first of the two PPU chips, with windows, mosaic and fades on the second.

“Mode Seven” in 1991

The name reached players through Nintendo Power. In June 1991 a preview said Asmik’s Dimension Force “utilizes the Super NES ‘Mode Seven,’ which allows for realistic three dimensional scrolling”. The next issue’s feature on the new console’s capabilities explained the two halves. Rotation: “one of the programs that most effectively uses Mode Seven Rotation is F-Zero, a futuristic driving game. The effect is nothing short of dramatic when the player-controlled car crashes and the ‘camera’ view moves forward briefly, then rotates 180 degrees to show the burning wreckage.” Scaling, contrasted with the old way of drawing an object “at several different sizes and then present the pictures of the object one at a time like the frames in a movie”: “With Mode Seven Scaling, though, an object is drawn only once and then manipulated by the Super NES to grow or shrink as it moves in relation to the ‘camera’ view. Pilotwings, a flight simulator, uses scaling to show approaching targets.”

By October the magazine was pointing it out level by level — Super Ghouls ‘N Ghosts’ cave, where “the entire background rotates when you jump on the platforms … You may very well forget which way is up!” Developers’ opinions of the rest of the machine were more mixed. Neil Jackson of Argonaut wrote to Super Play in 1993 that the Super NES had “Mode 7, which is brilliant”, but that on “the down side, it’s actually slower than a Spectrum, and stupider than a C64” — the gap the Super FX was built to close.

See also

Not yet fact-checked. This entry was drafted by an AI and nobody has verified it. The dates, figures and technical details may be wrong. Use it to find your bearings, then confirm anything that matters against a primary source.