The DSK format comes from the CPCEMU emulator; the extended format was added later so
that copy-protected disks with irregular tracks could be stored. Both describe the disk
as the Amstrad’s µPD765 floppy controller sees it: tracks, sector IDs and status bytes.
This page follows the Sinclair Wiki’s DSK format page and MAME’s reader
(src/lib/formats/dsk_dsk.cpp). Numbers
are little-endian. The site treats the two versions as two formats: this page is the reference for both tables, and the extended file has its own pages,
.DSK (extended).
Disk information block
The first 256 bytes of the file.
| Offset | Size | Standard DSK | Extended DSK |
|---|---|---|---|
0x00 | 34 | MV - CPCEMU Disk-File, CR LF, Disk-Info, CR LF. Readers check only MV - CPC. | EXTENDED CPC DSK File, CR LF, Disk-Info, CR LF. Readers check EXTENDED. |
0x22 | 14 | Name of the program that made the file | Name of the program that made the file |
0x30 | 1 | Number of tracks | Number of tracks |
0x31 | 1 | Number of sides, 1 or 2 | Number of sides, 1 or 2 |
0x32 | 2 | Size of every track, including its 256-byte track information block | Unused |
0x34 | 204 | Unused | Track size table: one byte per track and side, the size divided by 256. 0 means the track was not formatted and is not stored. |
Track blocks follow from offset 256, in the order track 0 side 0, track 0 side 1, track 1 side 0, and so on (one side only for single-sided disks). The block of a given track starts at 256 plus the sizes of all the tracks before it.
Track information block
The first 256 bytes of each track block; the sector data follows at +256.
| Offset | Size | Name | Description |
|---|---|---|---|
0x00 | 12 | Signature | Track-Info, CR LF. |
0x0C | 4 | – | Unused. |
0x10 | 1 | Track number | – |
0x11 | 1 | Side number | 0 or 1. |
0x12 | 2 | – | Unused in the Sinclair Wiki’s description; any later meaning is not covered here. |
0x14 | 1 | Sector size | The size code N used when the track was formatted; sectors are 128 × 2N bytes (2 means 512). |
0x15 | 1 | Number of sectors | Sectors on the track; 0 for a track with no sectors. |
0x16 | 1 | Gap 3 length | The gap used when formatting. |
0x17 | 1 | Filler byte | The byte the sectors were filled with when formatted, often E5. |
0x18 | 8 each | Sector information list | One entry per sector, in the order they occur on the track; see below. |
Sector information
| Offset | Size | Name | Description |
|---|---|---|---|
0 | 1 | C | Track number in the sector’s ID field. |
1 | 1 | H | Side number in the ID. |
2 | 1 | R | Sector number in the ID (the Sinclair Wiki’s DSK page, as of 13 November 2026: “1-9 for +3 disks, Others use $40-49 and $C0-C9”, which are hexadecimal ranges; the CPCwiki page gives no ranges). |
3 | 1 | N | Size code in the ID. |
4 | 1 | ST1 | The controller’s status register 1 after reading the sector. |
5 | 1 | ST2 | Status register 2. |
6 | 2 | Data length | Extended format: the bytes stored for this sector. Unused in the standard format, where every sector is 128 × 2N bytes of the track’s size code. |
MAME’s reader (src/lib/formats/dsk_dsk.cpp) uses these status bits:
| Bit | ST1 | ST2 |
|---|---|---|
0x04 | Set: no data is stored for the sector | – |
0x20 | CRC error (MAME: in the ID field, or a bad data CRC) | CRC error in the data field |
0x40 | – | Deleted data |
MAME treats a sector with a data CRC error that is not deleted as “weak”. The other bits of the controller’s status registers are defined by the µPD765 / NEC765 datasheet, which this page does not reproduce; the DSK specifications only say the fields hold the controller’s status “after reading”.
Weak sectors. The CPCEMU extension recorded on the CPCwiki page Format:DSK disk image file format: for a copy-protection sector whose data changes on each read, several copies are stored one after another, and the actual data length field (bytes 6–7) is then a multiple of the size N gives. The emulator chooses which copy to return on each read. The same page notes that 8 KiB sectors (N = 6) may hold more than the 0x1800 bytes once thought usable, so up to 8 KiB must be supported, and that N = 7 stores the full 16 KiB; sizes are taken as 3 bits, so N = 8 is the same as N = 0.
Example
00000000 45 58 54 45 4E 44 45 44 20 43 50 43 20 44 53 4B EXTENDED CPC DSK
00000010 20 46 69 6C 65 0D 0A 44 69 73 6B 2D 49 6E 66 6F File..Disk-Info
00000020 0D 0A …
00000030 28 01 00 00 13 13 13 13 13 13 13 13 13 13 13 13 (...............
Reading it: the extended signature; 40 tracks (0x28), one side; every
track 0x13 × 256 = 4,864 bytes, which is a 256-byte track information
block and nine 512-byte sectors.