42 Astoundingly Useful Scripts and Automations for the Macintosh

8 (bit) Days of Christmas: Day 110 (Snowman)

Day 110 of the 8 (bit) days of Christmas is Arron Branigan’s snowman, from December 1986. One of the strangest features of home computers of the era, including the TRS-80 Color Computer, was the use of “artifact colors” to produce more colors than were supposedly possible on the machine.

Jerry Stratton, December 18, 2020

Arron Branigan’s snowman from the December 1986 Rainbow article, “Go Tell It On The CoCo”, uses the Color Computer’s high-resolution graphics mode, giving it a full 256 by 192 pixels, but only two colors. So how is it that you can see more than two colors in this image?

Due to the limitations of the NTSC signal and the phase relationship between the VDG clock and colorburst frequency, it is not actually possible to display 256 dots across the screen reliably… when one switches to the white and black colorset, instead of a muddy gray as you would expect, you will get either red or blue. Reversing the order of the alternating dots will give the opposite color…. Unfortunately the VDG internally can power up on either the rising or falling edge of the clock, so the bit patterns that represent red and blue are not predictable. Most CoCo games would start up with a title screen and invited the user to press the reset button until the colors were correct!

I hope to have an example of that—a program that asks you to reset until you get the correct artifact colors—by Christmas Eve.

And read that carefully: “the NTSC signal”. If you lived in a locale that didn’t use NTSC, but rather used PAL, none of these tricks worked. Because that’s what they were: tricks. You didn’t find this stuff in the official manuals. They were passed by way of poorly-copied newsletters, third-party magazines, and computer clubs, like the arcane formulae of magic spells.

While Branigan uses a handful of DRAW commands, most of his image is drawn with more basic shapes: lines, circles, and boxes. Here’s an example from the part of his code that draws the snowman:

  • 4500 CIRCLE (63,117),35,1,.5,.80,.65
  • 4510 PAINT (15,160),1,1
  • 4520 CIRCLE (128,135),67.5,0,.5,.83,.15
  • 4530 CIRCLE (128,135),67.5,0,.5,.35,.6
  • 4540 CIRCLE (128,90),45,0,.5,.83,.50
  • 4550 LINE (52,102)-(80,76),PRESET
  • 4560 LINE (0,0)-(256,192),PRESET,B

The circles are somewhat obvious; the command takes a point for the center, a radius, and then the less obvious color value, height/width ratio, and start and end—that is, the CIRCLE command can also create ellipses (by altering the ratio) and arcs (by providing a start/end point).

The PAINT command takes a point, and a color, and a border color, and fills that color in on the screen until it reaches the color specified as the border. This is how circles can become disks, for example.

The LINE command is trickier. It does the obvious, draws a line from one point to another using either the foreground color (PSET) or background color (PRESET). But if you add a B to the end of the command, it draws, instead, a rectangle (that is, a ‘B’ox) with the two points representing two opposing corners of the box. Not represented here, adding BF instead of B would make a ‘F’illed ‘B’ox, filled with the foreground color—no need for painting the box in that case.

This is, in two dimensions, very similar to the technique used to create simple shapes in three dimensions using POV-Ray and other raytracers.

Branigan’s Snowman

This is a two-color, black and white image.

In response to 8 (bit) Days of Christmas: Eight holiday images created on the TRS-80 Color Computer, from the early to mid eighties.

  1. <- Day 111 Greeting Card
  2. Day 101 Rudolph ->