Introduction
This DSK format is a copy of a 3-inch floppy disk for the Amstrad CPC. It was created for the CPCEMU emulator and is used by every CPC emulator since. The ZX Spectrum +3, which used the same disk drive, uses it too.
Unlike a plain sector dump, a DSK file records each track’s layout: how many sectors
it has, their IDs and sizes, and any errors the disk controller reported. That lets it
hold the unusual tracks of copy-protected disks. The extension .dsk is also
used for unrelated disk images of other computers, such as the Apple II.
Structure
There are two versions, told apart by the first bytes of the file, and this site treats them as two formats with a viewer each. This page is the original, which
starts with MV - CPCEMU Disk-File and gives one track size for the whole disk. The
extended version starts with EXTENDED CPC DSK File and gives a size for each
track, so that tracks can differ and unformatted tracks take no space. A .dsk file that starts with neither
is not a CPC disk image: it may be an Apple II sector image.
The file begins with a 256-byte disk information
block: the signature, the name of the
program that made it, the number of tracks and sides, and the track sizes. Track blocks
follow, one per track and side. Each starts with a 256-byte track information block
beginning Track-Info, which gives the track and side numbers, the sector size
and count, the gap length and filler byte, and an 8-byte entry per sector with its ID
(track, side, sector, size) and the controller’s status bytes. The sector data follows
in that order.
0Disk information block signature, creator, tracks, sides, track sizes256 bytes256Track block one per track and siderepeated+0Track information blockTrack-Info, sector size and count, sector IDs256 bytes+256Sector data in the order listedvaries
In the explorer
Drop a .dsk file that starts with MV - CPC on the explorer to see:
- the tree: the disk information block with its fields, every track block with its track information block (every sector entry with its ID, status bytes and length) and each sector’s data, and any bytes left over;
- the disk (creator, tracks, sides, track size, how many sectors and bytes), a table of the tracks and a table of the sectors with the status bits MAME uses named;
- the problems found: a signature text that is not exact, a track block that is not
Track-Infoor is cut short, track and side numbers that disagree with the place, more than 29 sectors, a size code above 7, sector data past the track block, a file shorter than the disk information says, extra bytes.
The extended variant has its own page, .DSK (extended).
Not described
Known, not yet covered
- Reference: the individual bits of the controller status
registers ST1 and ST2 beyond the three MAME uses, which the µPD765 datasheet defines
(blocks); the data rate and recording mode bytes some later writers store at track offsets
0x12and0x13(the pages we read call them unused). - Viewer: the file system inside the disk (AMSDOS/CP/M directory on a CPC data disk, +3DOS on a +3 disk) is not read: the directory, the files and BASIC programs are not listed, and nothing is disassembled; the standard format’s sectors are taken as 128 × 2N bytes with N from the track information block.
Unknown
- Reference: the sector ID ranges of non-+3 disks come from one wiki
line (
$40-49and$C0-C9); the CPCwiki format page gives none, so they are not confirmed by a second source; the viewer’s “first sector ID” line is a hint built on that one line. - Viewer: nine real standard files (games and demos, read in place, not copied) walk to the last byte of the file with the rules of the pages and agree with an independent count of tracks, sectors and sector bytes. Three of them carry an older CPCEMU signature text (
MV - CPCEMU / 17 Jul 95 14:44with a date, instead ofMV - CPCEMU Disk-File), which the viewer notes but reads; no disk with unusual sector sizes, errors in the status bytes or copy protection was among them.
Also used for
- Amstrad CPC disk image (extended) – A CPC or Spectrum +3 floppy (EXTENDED CPC DSK): a size for every track and a stored length for every sector.