The header is 20 bytes. Numbers are little-endian. The pulses follow it directly.
Layout
| Offset | Size | Name | Description |
|---|---|---|---|
0 | 12 | Signature | The text C64-TAPE-RAW, or C16-TAPE-RAW. |
12 | 1 | Version | 0, 1 or 2. |
13 | 1 | Platform | The machine: 0 to 4. |
14 | 1 | Video standard | PAL or NTSC: 0 to 3. |
15 | 1 | Reserved | Zero. |
16 | 4 | Data length | The number of pulse bytes after the header. |
Signature
Twelve characters, no terminator. C64-TAPE-RAW is used for the C64, the VIC-20 and the
PET; C16-TAPE-RAW for the C16 and Plus/4. The explorer recognises a file by either text.
Version
| Value | Meaning |
|---|---|
0 | A pulse byte of 0 stands for a pulse longer than 255 × 8 cycles; its real length is not stored. |
1 | A pulse byte of 0 is followed by three bytes, the pulse length in cycles, little-endian. See pulses. |
2 | Each pulse byte is a half-wave, not a whole pulse; a zero is read as in version 1. The explorer adds two half-waves into one pulse. This is not tested on a real version 2 file. |
The real tapes checked here are all version 1.
Platform
| Value | Machine |
|---|---|
0 | Commodore 64 |
1 | VIC-20 |
2 | C16, Plus/4 |
3 | PET |
4 | C5x, C128 |
The machine sets the clock the pulse lengths are counted in.
Video standard
| Value | Standard |
|---|---|
0 | PAL |
1 | NTSC |
2 | old NTSC |
3 | PAL-N |
With the platform this gives the processor clock. The explorer turns pulse lengths into seconds for these clocks: C64 PAL 985,248 Hz and NTSC 1,022,727 Hz; VIC-20 PAL 1,108,405 Hz and NTSC 1,022,727 Hz; C16 PAL 886,724 Hz and NTSC 894,886 Hz. For another combination it gives no duration.
Reserved
One byte kept for later versions. It is zero in the real tapes checked.
Data length
The number of bytes after the header: the file size minus 20. The explorer reports a file whose size disagrees.
00000000 43 36 34 2D 54 41 50 45 2D 52 41 57 01 00 00 00 C64-TAPE-RAW....
00000010 AE C7 09 00 30 30 30 30 30 30 30 30 30 30 30 30 ....000000000000
0009C7AE, 640,942 bytes.