Introduction
A Commodore .tap file is a recording of a cassette tape as the length of every pulse, for the
Commodore 64, VIC-20, C16, Plus/4 and PET. It does not hold bytes: it holds what the tape recorder’s
signal was, so it can store programs saved by the machine’s own routines and programs saved by
fast “turbo” loaders alike, and protected tapes too. To get a program out, the pulses have to be decoded.
The file starts with the text C64-TAPE-RAW (C16-TAPE-RAW for the C16 and
Plus/4 family), a version, the machine and video standard, and the number of pulse bytes. Each pulse byte is
the length of a pulse in units of 8 processor cycles. See the header
and pulses pages.
A tape saved with the computer’s Kernal routines is a sequence of blocks of short, medium and long
pulses, each block written twice, which spell out bytes with a parity bit, a checksum and a countdown
sync. The Kernal tape format page describes it. The
explorer decodes these blocks into files, shows the pulse-length histogram, and opens each program with the
same BASIC and disassembly view as a .prg file, following its
SYS entry. Pulses that do not follow the Kernal format, such as a turbo loader’s, are counted
and named as not decoded.
The extension is shared with two unrelated formats, the ZX Spectrum tape and the Oric tape; see all the .tap variations.
Structure
0Signature:C64-TAPE-RAWorC16-TAPE-RAW12 bytes12Version, platform, video standard, reserved4 bytes16Data length: the number of pulse bytes, little-endian4 bytes20Pulses: one byte each, length in units of 8 cyclesdata length
Variants
- ZX Spectrum tape image – blocks of a 2-byte length, a flag, the contents and an XOR checksum
- Oric tape image – the bytes of an Oric-1 or Atmos cassette: leader, sync, a 9-byte header, the name and the data
- Commodore raw-pulse tape image – the lengths of the pulses on a C64, VIC-20 or C16 tape
Links
Software
- VICE – Commodore emulator that loads, plays and writes TAP files (Windows, macOS, Linux)
Not described
Known, not yet covered
- Reference: the timings of the C16, Plus/4 and PET tape formats, which differ from the C64’s. The decoder reads them with the C64’s pulse lengths, so a block of another machine may not decode.
- Reference: turbo loaders and other fast formats: only the first stage of a tape (usually in Kernal format) is decoded. The explorer counts the other pulses and shows their lengths in the histogram.
- Viewer: version 2 files (half-wave pulses) are read by adding two pulses into one, which is not tested on a real file. VIC-20, PET and C16 programs are shown with the C64’s BASIC and named addresses. Data files (type 4) are listed with their size but their bytes are not shown as text.
Unknown
- Reference: the contents of the unused bytes of a header block (the explorer does not interpret them), and the leader lengths a real Kernal writes, which are not stated here.