A Motorola 6809 at 1.79 MHz, the GIME video chip, a floppy drive and a green screen that says OK. Sold by Radio Shack in 1986. This is what it can do when it is asked nicely.

The programs

DOOM running on the CoCo 3: a tech-base corridor with a monster, DOOM's status bar below

doom DOOM, Freedoom's E1M1

The real first level on a grid, DOOM's lighting and status bar, four kinds of monster, sound, and a floor that reflects everything in real time.

  • reflections cost 0.6% of the frame: the engine compiles them into its wall routines at boot
  • the disk holds palette numbers; the CoCo forges 30 pages of lit, dithered art itself, checked byte for byte
  • 16 of 64 colours, chosen for what their blends can show; the dither is just a choice of page
  • found on the way: 85 wall classes × 3 bytes is one byte too many for a page, and the GIME shows its I/O registers at $FE00 whatever page is mapped
Wolfenstein 3D running on the CoCo 3: a corridor of stone walls, the status bar with BJ's face below

wolf3d Wolfenstein 3D

The real first level, art, status bar and sounds, full screen, with an autopilot that plays it for you.

  • writes ~150 wall-drawing routines at boot
  • no division while playing; 6 bytes per 22 cycles via the stack
  • ~26 frames per second in play, sound at 3.9 kHz
The Mandelbrot set in red, orange and yellow bands, drawn by the CoCo 3

fractals FRACTAL

Nine fractals and an effects reel: zooms, dissolves, a spinning picture, munching squares.

  • no multiply in the inner loop: a table of squares
  • one Mandelbrot step = three table reads
  • matched byte for byte against a reference
A solid cube with red, yellow and cyan sides, an oscilloscope trace below it

cubes CUBE

Dots become a wobbling cube, then a solid shaded one, to a soundtrack the CPU mixes itself.

  • 9 table reads per point, no multiply
  • 3-voice tracker mixed 3,934 times a second
  • the third voice's waveform is the cube's own outline
A 7 drawn on a grey grid; the panel says it is a 7, 86 percent sure

nsx6809 a CoCo that learns

One disk teaches the CoCo to read handwritten digits. The other lets you draw one and asks it what it is.

  • learns from 6,200 examples in 35 minutes, 512 KB, integers only
  • 88.5% on digits it has never seen
  • the CoCo's model matches a reference byte for byte

House rules

On the bench

Working on the inv sqrt hack, AI using real inference, and so on. Every 3D engine wants 1/√x, and the textbook way costs a square root and a division. Quake III Arena (1999) did it like this:

float Q_rsqrt( float number )
{
    long i;
    float x2, y;
    const float threehalfs = 1.5F;

    x2 = number * 0.5F;
    y  = number;
    i  = * ( long * ) &y;            // look at the float's bits as an integer
    i  = 0x5f3759df - ( i >> 1 );    // halve the exponent; the magic number does the rest
    y  = * ( float * ) &i;
    y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//  y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

    return y;
}

Not John Carmack's, as he said himself. The trail runs back through Gary Tarolli at 3dfx to Greg Walsh at Ardent Computer in the late 1980s, working with Cleve Moler, and before that to a 1986 note by William Kahan and K.C. Ng at Berkeley. In 2003 Chris Lomont worked out where the constant comes from. It's a decade-old idea passed from hand to hand by people deciding what to optimize and what to drop.

The 6809 has no floating point at all, but Color BASIC's five-byte floats keep their exponent above the mantissa, which is all the trick needs. DOOM now runs on a grid; next come that trick, monsters that decide with a trained network, and real sectors with floors and ceilings at different heights.

Quoted from the Quake III Arena source (id Software, GPL); the first two comments are reworded.