Skip to content
Techniques & Technology

Character-Shift Parallax

Parallax by redrawing the font

The C64 has one background layer, so its games faked a second by rolling the pixel definitions of a few characters against the direction of the scroll. Achim traces it to Bounder, Parallax and Marauder; John Rowlands added it to Mayhem in Monsterland in an hour.

commodore-64graphicsscrollingeffects

The VIC-II draws one character layer. It has no second playfield, and its scroll registers move the whole picture at once. A C64 game that wants a background drifting past more slowly than the platforms has to make the background out of something that can move without the screen moving — and the thing that qualifies is the character set itself.

Fast facts

  • Mechanism: the background is drawn with a handful of characters; every frame their 8-byte pixel definitions are rotated one pixel against the scroll direction.
  • Effect: the foreground moves with the scroll register, the background stays put on the character grid, and the eye reads the difference as depth.
  • Cost: a few dozen rol/ror instructions a frame; the screen and colour RAM are untouched.
  • Named uses: Bounder, Parallax and Marauder (Achim’s list); Mayhem in Monsterland (John Rowlands, by his own account).

How it works

Achim’s Codebase64 page lays out the four routines for a 2×2 hires tile. Horizontal shifts are bit rotations across the paired characters — lda charB,x / asl / rol charA,x / rol charB,x carries bit 7 of the right-hand character into bit 0 of the left, so the pattern wraps seamlessly across the tile boundary. Vertical shifts move bytes within the definition and put the saved end byte back at the other end. Multicolour characters have 4-pixel-wide pairs, so the horizontal loop runs twice per frame to move one visible pixel.

Run one of these every frame while the hardware scroll advances, and any screen cell using those characters appears to slide at a different speed. Half speed comes free: shift the characters on alternate frames, or shift them one pixel while the foreground moves two.

Mayhem in Monsterland

Rowlands’ own diary, printed in Commodore Format in March 1993, records how the effect went in. Working late one night in December 1992, he “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)”. The result was a background pattern moving at half the foreground’s speed. The “six levels of parallax” in the same diary entry belong to the game’s Get Ready screen, a separate “mini-parallax version of the levels” built from characters and sprites, not to the levels themselves.

Why not VSP?

VSP and its relatives reposition the whole screen; they do not create a second layer. Cadaver’s rant on multidirectional scrolling sets the VIC-II tricks aside for games because “they’re usually too limiting”.

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.