For a while at the end of the 1980s, a Commodore 64 demo was hardly complete without one. A logo or a block of text would ripple from side to side, each thin line of pixels sliding to its own position along a sine wave, as if the picture were a flag in the wind. Pasi ‘Albert’ Ojala, who explained the trick in 1991, remembered that “half of the demos had pictures waving horizontally on the width of the whole screen”, and that “the audience was puzzled”. The puzzle was that the C64’s hardware can only move the screen eight pixels.
Tech-tech is the name the scene gave the effect. ZZAP!64 glossed it for its readers in 1992 as “a graphic influenced by a vertical sinusoid”, noting that by the scene’s own naming rules it “should really have been called DXPP, but someone came up with the name Tech-Tech first (on the other hand, just try to pronounce DXPP!)”. Who that someone was, and which demo showed the effect first, is not settled in published sources.
Eight pixels are not enough
The VIC-II has a horizontal fine-scroll value in the bottom three bits of register $D016. Change it between raster lines and each line of the screen moves by up to seven pixels. That is enough for a smooth-scrolling message, but a wave that only moves seven pixels is barely a wobble.
To go further, the picture itself has to move a whole character (eight pixels) at a time, and there is no time to copy graphics during a raster line. As Ojala put it, “you can only move a pointer”. Each tech-tech method is a choice of which pointer to move:
- The fine shift, 0 to 7 pixels, goes into
$D016on every line. - The coarse shift, in whole characters, comes from pointing the VIC-II at a different copy of the picture, prepared in advance, in which everything has already been moved one, two, three or more characters to the right.
So a shift of 21 pixels is two whole characters plus five pixels: the copy that is two characters along, and a fine scroll of 5.
Ojala’s way: a character set per position
Ojala’s article, written in May 1991 and published in the “Demo Corner” of the electronic magazine C= Hacking in February 1994, moves the character-set pointer. The VIC-II reads the screen’s character codes only on a badline, once every eight lines, so swapping screens between badlines has no effect. But it reads each line’s pixel patterns from the character set on every line, so a new character set takes effect straight away.
The picture is drawn as characters whose codes run in order across the screen. Character set 0 holds the picture at its starting position; character set 1 holds the same picture moved one character to the right; and so on. On each raster line the program writes the low three bits of the shift to $D016 and selects the character set with bits 1–3 of $D018.
The price is memory. A 16K video bank holds eight 2K character sets, and one of those slots also has to hold the screen, so the picture can move at most 56 pixels. Ojala’s demonstration program wins back the eighth set by using only the inverted half of each character set (codes 128 to 255), which gives a full 64 pixels. It works out each line’s two register values in advance into two tables, because “there is no time for extra calculations on a bad line”, when the VIC-II has already taken most of the processor’s cycles.
The demonstration program shows the mechanism plainly. With a shift speed of zero its eight rows of text sit still; given a speed, every raster line of the text lands at a different position, and the letters shear into the zigzag of a moving wave.
The article ends with a trick for the borders, where there are no characters. There is not time on a raster line to rewrite eight sprites’ X positions, so Ojala changed their pictures instead. The eight sprite image pointers live at the end of the current screen, so one write to $D018, selecting a different screen, changes all eight pointers at once, and “takes only eight cycles”.
The FLI way: a screen per position
Compyx of the group Focus later published a different version on the Codebase64 wiki, its source dated April 2016, saying “it’s been about 25 years since I did a tech-tech”. Instead of switching character sets, it switches whole screens. The VIC-II only picks up a new screen on a badline, so the routine uses FLI to force a badline on every raster line, writing $D011, $D016 and $D018 for each line in a long block of unrolled code. Its 14 screens give a wave 112 pixels wide from a single character set, at FLI’s usual costs: the processor loses most of every line to the forced badlines, and the left edge shows FLI’s three columns of junk, plus a fourth that the scrolling pulls into view, which Compyx hides behind two stretched sprites.
The swinging logo
A simpler relative moved the whole logo as one piece. In Richard Bayliss’s swinging-logo routine, also on Codebase64, the logo sways from side to side once per frame: a single $D016 value from a sine table supplies the fine movement, and the logo’s character codes are copied into the screen from a different starting column for the coarse movement. Every line moves together, so it needs no raster tricks beyond one register write per frame. Tech-tech gives each line its own position, which is what makes the picture bend.
Sources
- Pasi ‘Albert’ Ojala, “Tech-tech - more resolution to vertical shift” (written 16 May 1991, translated 2 June 1992), “The Demo Corner”, C= Hacking issue 7, February 1994: the method, the 56- and 64-pixel limits, the two tables, the demonstration program and the sprite-pointer trick for the borders.
- ZZAP!64 issue 90, November 1992, public domain column, “Scene slang” box: the name and the DXPP joke.
- Compyx/Focus, “TechTech using FLI routine”, Codebase64 wiki, source dated 20 April 2016 (web, secondary). https://codebase64.net/doku.php?id=base:techtech_fli
- Richard Bayliss, “Logo Swing”, Codebase64 wiki (web, secondary). https://codebase64.net/doku.php?id=base:logo_swing
See also
- DYCP: the same sine, applied up and down to each letter
- FLI
- Raster effects
- VIC-II
- C= Hacking