Skip to content

Parallax Scrolling

Depth through motion

Parallax scrolling moves layers of scenery at different speeds so that a flat picture seems to have depth. Irem's Moon Patrol (1982) is widely credited as the first mainstream game to use it. Machines with two or more scrolling layers, such as the Amiga, Mega Drive and Super Nintendo, did much of the work in hardware; on the C64, NES and Spectrum programmers faked the extra layers with raster splits, redefined characters and software.

Look out of the side window of a moving car and the fence posts flash past while the hills behind them barely move. Parallax scrolling copies that. A game splits its scenery into layers and moves the nearer ones faster than the distant ones, and a flat screen suddenly seems to have depth. The idea is older than video games: Wireframe traces it to the multiplane camera that Disney and other studios used in the 1930s, which filmed layers of artwork moving past the lens at different speeds and distances. In games, Irem’s arcade Moon Patrol of 1982 is widely credited as the first mainstream example.

What makes parallax interesting is that most home machines of the early 1980s could scroll only one picture, and a computer that can scroll one picture cannot, by itself, scroll two at different speeds. Programmers got round that in different ways on each machine, and the way they did it tells you a lot about the hardware.

The principle

Each layer moves a set fraction of the foreground’s distance. If the ground under the player scrolls 4 pixels in a frame, a row of trees at half speed moves 2 pixels, hills at quarter speed move 1, and the sky does not move at all. The eye reads the slower layers as further away.

The work is all in the drawing. Nearer layers must be drawn in front of further ones, with gaps where the layers behind show through, and every layer must be moved and redrawn every frame. How much of that the hardware does for you decides whether parallax is cheap, expensive or impossible.

Machines with more than one layer

Amiga: dual playfields and the Copper

The Amiga’s custom chips have a dual-playfield mode, switched on by bit 10 (DBLPF) of the BPLCON0 register. The Amiga Hardware Reference Manual explains that the odd-numbered bitplanes (1, 3 and 5) then form playfield 1 and the even-numbered ones (2, 4 and 6) form playfield 2. In low resolution each playfield can have up to three bitplanes, which gives seven colours plus transparent: colour 0 is transparent in playfield 1 and colour 8 in playfield 2, so the back playfield shows through the gaps in the front one.

The two playfields “can be scrolled separately”. Each has its own bitplane pointers, which set the coarse position, and its own fine scroll: BPLCON1 holds a delay of 0 to 15 pixels for playfield 1 in bits 0–3 and for playfield 2 in bits 4–7. The manual warns that the data-fetch start and stop registers are shared, so a program that scrolls one playfield and holds the other still has to adjust the still one’s pointers and modulo to keep it in place.

That gives two layers. The Copper, the display co-processor, gives more. It can wait for the beam to reach a chosen line and then write to almost any custom-chip register, so a program can change BPLCON1 and the bitplane pointers partway down the screen. Each horizontal band then scrolls at its own speed.

Shadow of the Beast (Psygnosis, 1989) used both. Martin Edmondson, co-founder of the developer Reflections, later recalled drawing “a technical sketch laying out the speeds at which different parallax layers should scroll and where to swap between the two playfields to produce a deep parallax effect”, with the Copper controlling “colour changes and hardware scrolling rates” line by line. CU Amiga’s reviewer counted “no less than 13 layers of parallax, in both the ground and the sky”, and The One reported the same figure in its news pages. The trick had costs. Edmondson said that monsters “could only be moved over one of the two playfields”, and for Shadow of the Beast II Reflections chose a different scrolling system with “fewer colours, less parallax” so that the game could scroll in more directions.

Mega Drive: two planes and a scroll table

The Mega Drive’s VDP has two tile-based scroll planes, A and B, and Sega’s Genesis Software Manual says they “separately can scroll vertically and horizontally on a basis of a one-dot unit”. A window plane, tied to plane A, can hold a fixed status panel. Two layers of parallax need no tricks at all.

The horizontal scroll values live in a table in video memory, and register 11 chooses how the VDP reads it: one value for the whole screen, one for every 8-line cell row, or one for every line. In line mode each line of each plane can sit at its own horizontal position, so a program can give a floor, a sky or a band of distant hills a gradient of speeds by writing numbers into the table, with no interrupts at all. Vertical scroll can be set for the whole screen or for each two-cell column.

Super Nintendo: up to four backgrounds

Nintendo’s Super NES Development Manual describes up to four background screens, each with its own horizontal and vertical offset registers (BG1HOFS, BG1VOFS and so on). How many backgrounds a game can use, and with how many colours, depends on the background mode it picks. Mode 7, the rotating and scaling mode, is a single background.

Machines with one layer

Commodore 64: raster splits and rolling characters

The VIC-II scrolls the whole screen as one. Commodore’s Programmer’s Reference Guide explains that the chip can place the screen in any of 8 horizontal and 8 vertical positions, set by bits 0–2 of $D016 and $D011. To scroll further, “the actual scrolling must be done by a machine language program”, which moves the whole screen one character and resets the fine scroll. There is only one set of scroll bits.

The raster register gives programmers a way round that. Write a line number to $D012, enable the raster interrupt, and the VIC-II interrupts the processor when the beam reaches that line. The interrupt routine can change $D016 and the next interrupt can change it again, so each band of the screen gets its own fine scroll, and the program shifts each band’s characters separately whenever its fine scroll wraps round. Stacked bands moving at different speeds, such as ground, trees and distant hills, give parallax as long as the bands don’t overlap. Zzap!64 described the landscape of Paul Norman’s Beyond Forbidden Forest (1986) scrolling “at three different speeds, creating a 3D parallax effect”.

Layers that overlap need another trick: redrawing the characters themselves. John Rowlands described it in his development diary for Mayhem in Monsterland in Commodore Format: “I spent an hour adding a piece of code that rolls the definition of a few characters in the opposite direction of the scroll (which gives the illusion of parallax). Now we can put a pattern in the background that moves at half the speed of the foreground, giving a greater feel of depth.” The screen scrolls as normal, but the pixels inside the background characters shift back against it, so the pattern appears to move more slowly. See Character-Shift Parallax.

NES: one background, changed mid-frame

The NES’s PPU has one background. Ricoh’s specification for the chip describes it scrolling a dot at a time, horizontally and vertically, with the position written to register $2005. As on the C64, the way to get more than one speed is to change the scroll partway down the screen. The PPU gives one way to find the right moment, the collision flag for sprite 0, and cartridge mappers gave others. Nintendo’s MMC3, for example, contains a programmable interval timer that raises an interrupt, so the program can be woken at a chosen point in the frame to write a new scroll value. Switching character banks, which the MMC3 and other mappers also allow, changes the tile graphics without touching the map, so a background pattern can be animated to seem to move at its own speed.

ZX Spectrum: all in software

The Spectrum has no hardware scrolling at all, so every layer is moved by the Z80. That makes parallax a straight trade against speed. In June 1988 Raffaele Cecco wrote in his CRASH diary for Stormlord that he had spent the day “fiddling with a parallax effect in Stormlord’s scrolling, i.e., a pattern of dots that give the illusion that there is a slower scrolling distant background”. He did not know yet whether it would stay in. Two years later Tiertex explained to Your Sinclair why its Spectrum UN Squadron had lost the coin-op’s parallax: “when this was introduced it made the scrolling too slow.”

Sources

  • Rik Cross, “Moon Patrol’s illusion of depth”, Wireframe issue 3, November 2018, p. 32: the multiplane camera, and parallax in Moon Patrol and Jungle Hunt.
  • “Remembering Irem”, Wireframe issue 18, July 2019, p. 50: Moon Patrol “widely credited” as the first mainstream game with parallax scrolling.
  • Electronic Fun with Computers & Games vol. 1 no. 2, December 1982, p. 29: Moon Patrol among current arcade games.
  • Commodore-Amiga, Amiga Hardware Reference Manual (1985): the Copper and its WAIT and MOVE instructions (Coprocessor Hardware, pp. 13–15); dual playfields (Playfield Hardware, pp. 62–67); horizontal scrolling and the delay of up to 15 pixels (pp. 75–78); BPLCON0, BPLCON1 and BPLCON2 (pp. 84–85).
  • Stuart Hunt, “Beauty of the Beasts”, interview with Martin Edmondson, in The Amiga Book (Imagine Publishing, from Retro Gamer), pp. 66–69: the parallax sketch, the Copper, the playfields and Shadow of the Beast II.
  • CU Amiga, October 1989, p. 59: review of Shadow of the Beast, “no less than 13 layers of parallax”.
  • The One issue 14, November 1989, p. 18: Shadow of the Beast’s “13 levels of parallax”.
  • Sega, Genesis Software Manual (rev. 1992), “Scrolling Screen”, pp. 35–42: scroll planes A and B, the window, and the horizontal and vertical scroll modes.
  • Nintendo, Super NES Development Manual, Book I, section 2, “Background (BG)” and the register descriptions for BG1HOFS to BG4VOFS.
  • Commodore, Commodore 64 Programmer’s Reference Guide (1983), pp. 128–129 (smooth scrolling) and p. 150 (the raster register and raster interrupt).
  • Zzap!64 issue 14, June 1986, p. 80: preview of Beyond Forbidden Forest.
  • John Rowlands and Steve Rowlands, “Let’s make a monster”, Mayhem in Monsterland development diary, Commodore Format issue 30, March 1993, p. 37.
  • Ricoh, RP2C02 development specification: background scrolling, the scroll register and the object 0 collision flag.
  • Nintendo, MMC3 (Multi-Memory Controller 3) specification (Japanese): the programmable interval timer IRQ and the character bank registers.
  • Raffaele Cecco, Stormlord diary, CRASH issue 55, August 1988, p. 50.
  • Your Sinclair issue 59, November 1990, p. 97: Tiertex on the Spectrum UN Squadron.

See also

Checked. Verified against primary sources and signed off by a person.