.D64
Commodore 64 disk image
Introduction
A D64 file is a copy of a floppy disk for the Commodore 1541 disk drive, the drive used with the Commodore 64. C64 emulators load D64 files as if they were disks, and most surviving C64 software is kept in this format.
The file holds every 256-byte sector of the disk in order. A standard 35-track disk gives a file of 174,848 bytes. Some images add one error byte per sector at the end, giving 175,531 bytes, and some cover 40 tracks.
Software
Structure
The 1541 records more sectors on the longer outer tracks. Tracks 1 to 17 have 21 sectors, tracks 18 to 24 have 19, tracks 25 to 30 have 18 and tracks 31 to 35 have 17, 683 sectors in all. The image stores them track by track, starting at track 1.
Track 18, in the middle, holds the disk’s catalogue. Sector 0 of track 18 is the block availability map (BAM), which marks the free sectors on every track and holds the disk name and ID. The directory starts at track 18 sector 1, with eight 32-byte entries per sector giving each file’s type, name, size and first sector. Files and directory sectors form chains: the first two bytes of each sector give the track and sector of the next, and the remaining 254 bytes hold data.
0Tracks 1 to 17 21 sectors each91,392 bytes91392Track 18 the BAM in sector 0, then the directory4,864 bytes96256Tracks 19 to 24 19 sectors each29,184 bytes125440Tracks 25 to 30 18 sectors each27,648 bytes153088Tracks 31 to 35 17 sectors each21,760 bytes