Vault · archived work, not current thinking

Space Chase

1989 · HP-28S calculator

Space Chase screenshot

▶ Play it in your browser

Three ships drift across a 137×32 pixel screen. Two of them move at random. One of them is yours, and the game ends the moment they touch. There is a starfield of thirty pixels behind it, a hyperspace jump you can use three times, and a score that counts tenths of a second survived.

It was written on an HP-28S — a clamshell calculator with an alphabetic keyboard on the left half and a scientific one on the right. Randy Weems and I got them in a first-year calculus course at Tennessee Tech taught by John Selden, who was publishing on the 28S as a programming environment rather than a graphing aid, and who created a third-quarter course in “algorithm design” so a few of us could keep going. Space Chase came out of that course.

The whole thing is one idea. The 28S display is 137×32 pixels, which is 548 bytes, and the calculator’s →LCD command takes a plain character string. So the screen is a string. Each ship is a 548-byte string with the sprite in it, and moving a ship means rotating its string — UP shifts by 137 bytes, exactly one page, and LEFT and RIGHT shift by six. Drawing the frame is OR. Detecting a collision is XOR and a comparison against what should be there. There is no collision-detection routine anywhere in the program, because the same operation that composites the screen also answers the question.

The six programs that read the controls are named UP, DOWN, LEFT, RIGHT, SHIFT and INS, and that is not a naming convention. The 28S KEY command returns the name of whatever key you pressed; the game’s entire input system is IF KEY THEN STR→ END, which compiles that name and runs it. The legends printed on the calculator’s case are the dispatch table. Rename a program and the key stops working.

The three ships over the starfield. SHIP1 at left, its two pursuers, and the thirty-pixel field behind them.

Why it only exists on paper

The HP-28S had no wire port. Infrared out to a printer and nothing else — no way to send a program to a computer, no way to save one anywhere. Whatever survives from that machine survives because somebody printed or wrote it down.

So this game appears in none of the floppy backups. Those are all from the HP-48SX that came later, and by then Space Chase was two years old and had never been anywhere a disk could reach. What did survive was a photocopied set of notebook pages: a hand-written manual with a drawing of the keyboard, a printed listing of all ten programs, and two pages of hand-assembled System RPL for a faster version, five nibbles to a line with the mnemonics inked in beside them.

It turns out there was a second copy. Selden put our programs in his conference paper — The HP-28S, Calculus, and Programming, Ohio State, 1990 — so the full listing has also been sitting in university libraries since before I could legally drink. The published version differs slightly from the notebook: the horizontal step is symmetric at six bytes rather than drifting eight-and-nine, and the key handler has a type check the notebook version lacks.

The version here

You can play it above. It is not an emulation — there is no legally distributable HP-28S ROM, so nothing can run the original binary in a browser. Instead it is a small interpreter for the subset of HP-28S RPL the game uses, executing the 1990 published listing directly. The ships, the starfield, the hyperspace sweep from 512 Hz to 1500 Hz, the score in tenths of a second: all of that comes out of the listing rather than being reimplemented.

One number is not evidence. Nothing anywhere records how fast the game actually ran, and a real 28S was pushing several 548-byte string operations through an interpreter every frame. The default speed is the one that feels right to me, which is memory, not measurement. The other two settings are there because I could be wrong.

Written with Randy Weems and Shawn Yeager. The drawing tool that made the ships is DOODL.

← Back to games