After the file header come the track records, one after another to the end of the file. Each is a 20-byte header and then the packed data. All numbers are big-endian.
Track header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0x00 | 2 | text | Signature | TR. |
0x02 | 2 | uint16 | Track number | 0 to 79 for the disk; 65535 for a banner; 80 (with a short size) for FILE_ID.DIZ. See track numbers. |
0x04 | 2 | – | Reserved | Zero in every file seen. |
0x06 | 2 | uint16 | Packed size | How many bytes of packed data follow this header. |
0x08 | 2 | uint16 | Middle size | The size after the dictionary coder and before the run-length stage; for stored and RLE-only tracks it equals the packed size. |
0x0A | 2 | uint16 | Unpacked size | The track as it ends up: 11,264 on a double density disk. A banner track states its text size; one banner seen states 0 and stores its text in the packed size. |
0x0C | 1 | bits | Flags | Bit 0: dictionary coder in use (set on all Quick-to-Deep tracks and most Heavy ones). Heavy tracks: bit 1, new Huffman tables follow in the data; bit 2, a run-length stage follows. |
0x0D | 1 | uint8 | Mode | 0 to 6; see Compression modes. |
0x0E | 2 | uint16 | Checksum | The unpacked bytes added up modulo 65,536. |
0x10 | 2 | uint16 | Data CRC | CRC-16 of the packed data (before any decryption). |
0x12 | 2 | uint16 | Header CRC | CRC-16 of the first 18 bytes of this header. |
Track numbers
- 0 to 79: a cylinder of the disk (both heads). A double density track is 11,264 bytes; track n is at byte n × 11,264 of the image.
- 65535: a banner, text (often with ANSI colour codes) stored, not compressed in the files seen. There can be several, at the start or the end of the file.
- 80 with a size under a full track: the FILE_ID.DIZ description. 65534 also occurs in a few files, as text.
Tracks are not always complete: a file whose range is 0 to 39 or 40 to 79 holds half a disk, and a file with the no-zero-tracks flag may leave out tracks.
Making the disk image
Unpack each disk track and put it at its track number times the track size. The result of a full disk is the 901,120-byte ADF: block 0 is the first 512 bytes. The explorer does exactly this, and then reads the image with the ADF family. Of 975 different files, 962 give a 901,120-byte image, and 865 of the images have a valid AmigaDOS root block (type 2, secondary type 1, checksum correct). The others are disks with their own loader and no AmigaDOS volume, and partial disks.
Checks
- The header CRC over its first 18 bytes.
- The data CRC over the packed bytes, as stored.
- After unpacking, the sum of the bytes modulo 65,536 against the checksum field.
Of 975 different files, 972 pass every check on every track. Two fail the last check on a few tracks although the packed data’s CRC is right, and one is cut short. The cause of the two checksum failures is not established: a damaged source disk or a wrong sum written by DMS are possible, and so is a fault in the unpacker.
Not described
The track records are checked against real files, apart from these points.
- Reference: track 65534 and the rule that tells a DIZ track 80 from a real 81st cylinder are inferred from a few files. The reserved bytes at 0x04 are always zero in the files seen. Gaps from the no-zero-tracks flag and high density tracks (22,528 bytes) were not seen. The cause of two files’ checksum failures is unknown.
- Viewer: text tracks are shown as text with colour codes removed, not as ANSI art. A disk with missing tracks is filled with zeros. Tracks that fail to unpack are marked and left as zeros in the image.