A D64 is every 256-byte sector of a Commodore 1541 disk, track by track, with no header. Tracks are numbered from 1 and sectors from 0. The layout here follows the VICE emulator’s documentation, which builds on Peter Schepers’ notes on Commodore disk formats.
Sectors per track
The outer tracks, which are longer, hold more sectors (VICE manual 17.5).
| Tracks | Sectors per track | Sectors in zone |
|---|---|---|
| 1–17 | 21 (0–20) | 357 |
| 18–24 | 19 (0–18) | 133 |
| 25–30 | 18 (0–17) | 108 |
| 31–35 | 17 (0–16) | 85 |
| 36–40 (40- and 42-track images) | 17 | 85 |
| 41–42 (42-track images) | 17 | 34 |
The byte offset of track t, sector s is the track’s offset below plus s × 256.
| Track | Offset | Track | Offset | Track | Offset |
|---|---|---|---|---|---|
| 1 | 0x00000 | 15 | 0x12600 | 29 | 0x23200 |
| 2 | 0x01500 | 16 | 0x13B00 | 30 | 0x24400 |
| 3 | 0x02A00 | 17 | 0x15000 | 31 | 0x25600 |
| 4 | 0x03F00 | 18 | 0x16500 | 32 | 0x26700 |
| 5 | 0x05400 | 19 | 0x17800 | 33 | 0x27800 |
| 6 | 0x06900 | 20 | 0x18B00 | 34 | 0x28900 |
| 7 | 0x07E00 | 21 | 0x19E00 | 35 | 0x29A00 |
| 8 | 0x09300 | 22 | 0x1B100 | 36 | 0x2AB00 |
| 9 | 0x0A800 | 23 | 0x1C400 | 37 | 0x2BC00 |
| 10 | 0x0BD00 | 24 | 0x1D700 | 38 | 0x2CD00 |
| 11 | 0x0D200 | 25 | 0x1EA00 | 39 | 0x2DE00 |
| 12 | 0x0E700 | 26 | 0x1FC00 | 40 | 0x2EF00 |
| 13 | 0x0FC00 | 27 | 0x20E00 | 41 | 0x30000 |
| 14 | 0x11100 | 28 | 0x22000 | 42 | 0x31100 |
When files are written, the 1541 skips sectors to give the drive time to process each one: an interleave of 10 for files and 3 for the directory. A reader simply follows the track and sector links.
Image sizes
A reader tells the variants apart by the file size.
| Tracks | Sectors | Without error bytes | With error bytes |
|---|---|---|---|
| 35 | 683 | 174,848 | 175,531 |
| 40 | 768 | 196,608 | 197,376 |
| 42 | 802 | 205,312 | 206,114 |
Error bytes
Some images end with one byte per sector, in the same order as the sectors, recording whether the sector on the original disk had an error: the first byte for track 1 sector 0, the last (on a 35-track image) for track 35 sector 16. The codes are those the 1541’s disk controller reports (VICE manual 17.5.4).
| Code | 1541 error | Kind | Meaning |
|---|---|---|---|
00 | – | – | Not used |
01 | 00 | – | No error |
02 | 20 | Seek | Header block not found |
03 | 21 | Seek | No sync sequence found |
04 | 22 | Read | Data descriptor byte not found |
05 | 23 | Read | Checksum error in data block |
06 | 24 | Write | Write verify on format (never occurs on a 1541) |
07 | 25 | Write | Write verify error |
08 | 26 | Write | Write protect on |
09 | 27 | Seek | Checksum error in header block |
0A | 28 | Write | Write error (never occurs) |
0B | 29 | Seek | Disk sector ID mismatch |
0C–0E | – | – | Not used |
0F | 74 | Read | Drive not ready |