All numbers are little-endian. The layout is from the VICE manual (chapter 17, section G64), read through a summarising fetch tool, so it is “our words”.
Header
| Offset | Size | Meaning |
|---|---|---|
$00 | 8 | Signature: GCR-1541, or GCR-1571 for a double-sided disk |
$08 | 1 | Version; only $00 is defined |
$09 | 1 | Number of half-track entries in each table: usually 84 (tracks 1 to 42 and the half tracks between them); usually 168 for GCR-1571 |
$0A | 2 | The largest track size, usually 7,928 ($1EF8) |
The two tables
Two tables of n little-endian 32-bit entries follow the header, n being the half-track count. The entry i (from 0) is track 1 + ⌊i/2⌋, and an odd i is the half track after it.
| Table | Starts at | Entry |
|---|---|---|
| Track offsets | $0C | The file offset of the track block; 0 means the half track has no data |
| Speed zones | $0C + 4n | 0 to 3: the speed zone of the whole track. A larger value is the offset of a block with a speed for every byte (not decoded by the viewer) |
With the usual 84 entries the tables end at $158 and $2A8 (the manual prints these).
Track blocks
A track block is a 16-bit length followed by that many bytes: the track’s bit stream (see GCR tracks and sectors). Blocks may lie anywhere in the file; the offset table says where.
The manual gives 7,692 ($1E0C) as an example of an actual length and says blocks are padded with filler to the declared maximum. The viewer reports a block that does not fit in the file, one longer than the declared maximum and two blocks that overlap.
The manual describes a 1571 file as GCR-1571 with byte $09 usually 168 and half tracks 85 to 168 holding the second side.
It also mentions an SPS extension: an extra-information block tagged EXT (version 1) usually after the tables, with 16 bytes of mastering information per track. Neither the second side nor that block is decoded beyond what is said here.
The bit stream
The contents of a track block are described on GCR tracks and sectors.
Not described
Known, not yet covered
- The per-byte speed blocks and the EXT block.
Unknown
- How the second side of a GCR-1571 file is ordered beyond “half tracks 85 to 168”.