2014-01-06 · in Media Archiving · 819 words

Commodore 16

This is the computer that I learned to program on — Commodore 16, serial number EA5-233663.

Like nearly all the 8-bit users I knew, I never had a disk drive for this machine, using cassette tape instead for storage. I wrote quite a lot of BASIC — and some 6502 assembler — on this machine between 1989 and 1993, so I had about 25 cassettes to read.

About this machine

The Commodore 16 was part of Commodore's 264 series, built around the TED chip. Commodore designer Bil Herd says that the TED machines were originally intended to compete with Timex/Sinclair's machines at the sub-$100 end of the US marketplace.

Compared to the C64, you got better colour depth and an improved Microsoft BASIC interpreter with graphics support, but no sprites and fairly primitive audio — so it wasn't compatible with any of Commodore's previous software, and failed miserably in the US market as a result. However, it sold for several years as a bargain-basement offering in the UK and Europe, once reduced to surplus prices, and apparently did particularly well in Hungary, with a thriving local software scene.

Plus/4 World has a comprehensive database of 264-series software, including many unofficial conversions of C64 games.

Imaging Commodore 16 tapes

C16 tape with label

This tape is pretty typical — a medium-quality ferric C12 or C15, with several BASIC programs on it. The latest here were from December 1991; the numbers on the label are from the tape position counter on the C16's tape deck.

The first step was to digitise the audio from the tape using a hi-fi tape deck, in exactly the same way that I'd handle a regular audio tape. The C16's tape deck recorded at a fairly high audio level; I set the input gain to give a reasonable amount of headroom, and used ecasound to do the recording in CD-quality mono:

ecasound -r -f:s16,1,44100 \
    -i jack_multi,system:capture_3,system:capture_4 \
    -x -o programs3-popcorn-1.wav

Since the Commodore tape formats rely on the timing between waveform edges to encode data, it's important that the tape speed is reasonably constant. Before playback I fast-wind the tape from start to end and back at least once; this ensures that the tape's tightly wound on the reels, and that the reels can turn freely within the cassette. There were no particularly bad cassettes in this lot, but I've had problems with audio tapes in the past; I've occasionally needed to splice a broken tape, or transplant the tape reels from a jammed cassette into a good one.

I topped-and-tailed the recording in mhwaveedit. The waveform for the first side of the tape above looks like this:

C16 tape waveform

Each program's data is preceded by a header containing the filename, and each header and data block is preceded by a leader tone. You can see five complete programs, and a sixth that got cut off by the end of the tape (which is why I wrote "Full" on the label).

I then needed to turn the audio file into something emulators can read. To do this, I used WAV-PRG's wav2prg program, from the source repos. Note that if you're building this on a Unix-like system, you need to make sure you also compile its loader plugins — else it won't find any data at all — and you may need to update the name it uses for libaudiofile.so.

WAV-PRG can either generate a TAP file which just contains the transition timings:

wav2prg \
    -P /home/ats/src/wav-prg/loaders \
    -s 'Default C16' \
    --machine c16 \
    --sensi 50 \
    --tap programs3-popcorn-1.tap programs3-popcorn-1.wav

... or can decode the data blocks on the tape into a T64 file:

wav2prg \
    -P /home/ats/src/wav-prg/loaders \
    -s 'Default C16' \
    --machine c16 \
    --sensi 50 \
    --t64 programs3-popcorn-1.t64 programs3-popcorn-1.wav

In both cases you have to tell it that it's a C16 tape — the C16 encoding is different from the C64, which it defaults to.

I found that wav2prg's T64 extraction worked for most files but not all of them — e.g. it missed the POLICE program on the tape above, even with the --sensi sensitivity argument turned up. TAP files load more slowly in emulators, but they worked for all the files I tried.

I also found that a few of the tapes contained data that clearly wasn't for the C16; some for the Spectrum and some for the ZX81. (After you've spent a day listening to C16 programs going past, ones in other formats sound obviously different!) As such, I'm going to hang on to the raw .wav files for all the tapes.

Emulating the Commodore 16

VICE includes emulators for most of Commodore's 8-bit machines; xplus4 emulates the 264 family, including the C16. VICE can load both T64 and TAP files.

One of the tapes held the very first programs I wrote — in 1989, judging by the "calculate your age in 2000" program:

My first C16 tape BEN SAM Age in 2000

My programs got a bit more interesting later on.

Productivity:

SCRIBBLE A-DATA

Programming tools:

MACHENTRY monitor RPN SPL title screen SPL help

Games, mostly based on games I'd played elsewhere:

FACTORY FACTORY2 Roons title screen Roons

Lots of music, despite the C16's limited abilities:

POPCORN JESU HELLO MUSISHEET title MUSISHEET menu MUSISHEET tracker

Graphics:

CBARS CLOCK

And some were just silly:

SILLY BBC