Fourmilab Home Page

Commodore Curiosities

Commodore 64

Around 1987, I became interested in the emerging market for very inexpensive home computers. Although they were severely limited in processing power and memory, they were being sold in the millions and their customers were willing to pay modest sums for interesting software, and they were enormously patient. Microsoft had ported its Multiplan spreadsheet to machines including the Commodore 64, Radio Shack TRS-80, Apple II, and Texas Instruments 99/4. I decided to learn about these machines to explore whether they could be possible hosts for some software concepts I was exploring, and decided to start with the Commodore 64, as it had one of the largest and most committed user bases.

I bought a Commodore 128, which was 100% compatible with the Commodore 64, and in its own native mode ran twice as fast and had twice the memory. Of course, I immediately began to write little hacks to explore the graphics and sound capabilities of the machine. And, letting nothing go to waste, I submitted some of them to Commodore magazines such as Compute!'s Gazette and Commodore Magazine.

Yes, in that era magazines published the source or binary code of programs which readers would type in to their computers character-by-character. (A premium subscription included a floppy disc with all of the programs in ready-to-run form.) The characters added to the lines in the listings of BASIC programs are checksums used by the magazines' data entry program to verify the text had been entered correctly.

Here are Commodore 64 and 128 programs from this era. Any Commodore 64 program will run on both the 64 and 128, but 128-specific programs will only run on that machine. All of these programs may be run under VICE (the Versatile Commodore Emulator), which runs on Linux, Macintosh, Windows, and a variety of other machines and provides a faithful emulation of both the Commodore 64 and 128, including graphics, sound, and peripherals. To run a program, you can either download the BASIC source code and copy and paste it into the emulator window or download a floppy disc image containing the program and run it from the command line or attach and load it within the emulator. BASIC source code is provided in all lower case ASCII characters, which the emulator maps to upper case PETSCII when pasting the text.

Key Clicker

My first, and without doubt most trivial, Commodore program was Key Clicker, which was published in the April 1988 edition of Compute!'s Gazette. It demonstrates the protean mutability of the Commodore 64 by adding, by a little software patch, something its hardware lacks: key clicks as you type. Using Commodore's sound synthesiser chip, it provides three options for the clicks, and can be extended to anything you imagine. Due to differences in hardware configuration, separate versions are provided for the Commodore 64 and the 128 in its native mode.

Rainy Day Moon

I've always loved doing computational astronomy on computers, and I could hardly resist porting my moon phase program from the Sun workstation to the Commodore. Drawing the Moon required the new graphics commands added to the Commodore 128's BASIC V7.0 In 1989, programs which showed off the 128's new features were rare, and Commodore Magazine published the program in its August 1989 issue.

Neural Network

The most ambitious (or, if you like, absurd) application I attempted on the Commodore 64 was the implementation of an associative memory employing a simple neural network. This allows learning a variety of patterns (letters and numbers), then recognising them and similar patterns, perhaps degraded by noise. This is all done in less than 250 lines of BASIC. It was deemed “too esoteric” by the Commodore magazines and rejected, but you can read it here and, if you have an emulator or an ancient machine in the attic, try it out for yourself.