42 Astoundingly Useful Scripts and Automations for the Macintosh

8 (bit) Days of Christmas: Day 111 (Dual Greeting Card)

Day 111 of the 8 (bit) days of Christmas is Joseph Kohn’s dual greeting card, from December 1984. How do you create text on a graphics screen that doesn’t accept the PRINT statement?

Jerry Stratton, December 17, 2020

The December issue of The Rainbow, a magazine for the TRS-80/Tandy Color Computer, always contained several Christmas programs, and many of those were Christmas art made on the very low color graphics of the era.

Here’s what the code tended to look like in the magazine:

[toggle code]

  • 60 DIM A$(90)
  • 70 A$(33)="U4E2F2D2NL4D2BR3" 'A
  • 80 A$(34)="U6R3F1D1G1NL3F1D1G1L3BR7" 'B
  • 90 A$(35)="BR3E1BU4H1L2G1D4F1R2BR4"'C
  • 100 A$(36)="U6R3F1D4G1L3BR7" 'D
  • 110 A$(37)="R4BU6L4D3NR2D3BR7" 'E
  • 120 A$(38)="U6NR4D3NR2D3BR7" 'F
  • 130 A$(39)="BR4BU5H1L2G1D4F1R3U2NL1D2BR3" 'G
  • 140 A$(40)="U6D3R4U3D6BR3" 'H
  • 150 A$(41)="BU6BR1R2L1D6L1R2BR4" 'I
  • 160 A$(42)="BU1F1R2E1U5BD6BR3"  'J
  • 170 A$(43)="U6D3R1NE3F3BR3" 'K
  • 180 A$(44)="NU6R4BR3" 'L
  • 190 A$(45)="U6F2ND1E2D6BR3" 'M
  • 200 A$(46)="U6F4U4D6BR3" 'N

That’s from Joseph Kohn’s December 1984 code for “Season’s Greetings”. Each of those lines beginning with A$ after the line number is the code for drawing a letter. The Color Computer had a DRAW command that took one-letter directions such as U for up, E for heading up at a 45-degree angle, F for heading down at a 135-degree angle, D for down, and so on.

Line 70, the letter A, draws a line up 4 pixels, then goes right and up—at a 45-degree angle—for 2 pixels, down and right (a 135 degree angle) for 2 pixels, down for 2 pixels, goes left without updating the pen position (NL) for 4 pixels to draw the crossbar for the letter A, then completes the A’s right leg by drawing down for 2. Finally, it moves the pen right without drawing (BR) three pixels to prepare for the next letter.

If you have a Color Computer, or the emulator xroar, you can see it happening using this program:

  • 20 DATA U4,E2,F2,D2,NL4,D2,BR3,END
  • 30 PMODE 3,1
  • 31 PCLS 2
  • 32 SCREEN 1,0
  • 40 READ D$
  • 41 IF D$="END" THEN 100
  • 42 DRAW D$
  • 43 FOR I=1 TO 800:NEXT I
  • 44 GOTO 40
  • 100 GOTO 100

The DRAW command is how most of these images were made. By using an array of instructions, Kohn was able to put messages on the screen—and was able to let the person on the other end of the magazine, typing it in, change that message by changing which letters were drawn. This is the subroutine he used for that:

  • 930 FORX1=1TO LEN(X$):Y1=ASC(MID$(X$,X1,1))-32:DRAW"XA$(Y1);":NEXT:RETURN
  1. Repeat for each position in the string to be displayed (X$).
  2. Get the ASCII code for the letter at the current position, reducing it by 32.
  3. Use that code as the position in the A$ array, and use the draw instructions at that position.

This could create some surprisingly beautiful imagery, even in the low resolution of the era. The Color Computer had only 256 by 192 pixels (that’s right, they weren’t even square pixels, they were rectangular), and that meant only two colors. Kohn created this image using PMODE 3; that was medium resolution, or only 128 by 192 pixels, but it gave him four colors to work with. One of the neat things about the Color Computer was that the instructions didn’t change when the resolution did—you always used high resolution commands, and the computer scaled it down for you if you told it to draw in medium or low resolution mode.

Kohn’s Seasons Greetings

Tonight is the last night of Chanukah, so use your shammash to light all eight candles on the menorah.

I chose Kohn’s image first because it’s from 1984, which makes it among the earliest of the images I’ve chosen for these eight days. It also happens that this year, eight days before Christmas is also the eighth night of Chanukah, and Kohn’s image has the menorah candles lit as for the eighth night.

That’s it for day 111! Stay tuned for day 110.

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 110 Snowman ->