Track Dump Format

From Ninerpedia
(Redirected from TD format)
Jump to navigation Jump to search

The Track Dump Format is used in the PC99 emulator. It contains all data bytes from all disk tracks. Unlike the Sector Dump Format, this format stores the tracks "twice ascending", that is,

  • the first half of the image contains tracks 0 to 39 of side one
  • the next track is track 0 on side two, increasing to track 39 of side two.

So it counts up for each side. Thus, the track sequence of side two is reversed to the access direction of the real medium.

The format, as defined by PC99, is not a precise track image: We do not get clock patterns, so we cannot precisely know where the address marks are. Second, the Track Dump Format does not support CRC checking; the CRC bytes are always 0xF7.

The track data depend on the recording technology, which is either FM or MFM.

Standard formats

FM track image

Gap 1: 0x00 (16)
repeat for each sector (9x) Sync: 0x00 (6)
ID Address Mark (IDAM): 0xFE (1)
Track
Head
Sector
Size: 0x01
CRC: always 0xF7F7
Gap 2: 0xFF (11)
Sync: 0x00 (6)
Data Address Mark (DAM): 0xFB
Sector content (256)
CRC: always 0xF7F7
Gap 3: FF (45)
Gap 4: 0xFF (231)

The total length of a track and the length of a DSSD disk (180 KiB) thus calculates as

tracklen = 16 + 9*334 + 231 = 3253 bytes (9 sectors per track, single density)
imagelen = 2*40*tracklen = 260240

MFM track image (18 sectors)

Gap 1: 0x4E (40)
repeat for each sector (18x) Sync: 0x00 (10)
0xA1A1A1
ID Address Mark (IDAM): 0xFE (1)
Track
Head
Sector
Size: 0x01
CRC: always 0xF7F7
Gap 2: 0x4E (22)
Sync: 0x00 (12)
0xA1A1A1
Data Address Mark (DAM): 0xFB
Sector content (256)
CRC: always 0xF7F7
Gap 3: 0x4E (24)
Gap 4: 0x4E (712)

For a typical DSDD disk (360 KiB), we get

tracklen = 40 + 18*340 + 712 = 6872 bytes (18 sectors per track, double density)
imagelen = 2*40*tracklen = 549760

Interleave

If sectors were stored in rising sequence, a single revolution of the disk would be enough to read in all sectors of the track. This requires a data rate which cannot be maintained by most systems. Therefore, sectors are put on the track with a constant interleave between. By this technique, reading all sectors of a track requires 2, 3, 4 or more revolutions.

The interleave used for 9-sectors tracks may look like this:

0 7 5 3 1 8 6 4 2


and like this on a track with 18 sectors:

0 11 4 15 8 1 12 5 16 9 2 13 6 17 10 3 14 7

When the head moves to the next track, the disk keeps rotating, so it would be better to use an offset to catch the next sector. In the track dump format, we indeed have a shift in sector numbers which looks as follows:

Track 0 0 7 5 3 1 8 6 4 2
Track 1 6 4 2 0 7 5 3 1 8
Track 2 3 1 8 6 4 2 0 7 5
Track 3 0 7 5 3 1 8 6 4 2
Track 4 6 4 2 0 7 5 3 1 8
Track 2 3 1 8 6 4 2 0 7 5
...
Track 39 0 7 5 3 1 8 6 4 2

This offset is not mandatory, so it should not be assumed as fixed. Neither is it mandatory that the interleave is 4:1 in all cases. DSDD images, for instance, do not show this offset.

Special format

MFM track image (16 sectors)

This format is used with the TI double density controller and the HX5102, the Hexbus floppy drive.

Gap 1: 0x4E (50)
repeat for each sector (16x) Sync: 0x00 (12)
0xA1A1A1
ID Address Mark (IDAM): 0xFE (1)
Track
Head
Sector
Size: 0x01
CRC: always 0xF7F7
Gap 2: 0x4E (22)
Sync: 0x00 (12)
0xA1A1A1
Data Address Mark (DAM): 0xFB
Sector content (256)
CRC: always 0xF7F7
Gap 3: 0x4E (50)
Gap 4: 0x4E (206)

The total length of a track and the length of a DSSD disk (180 KiB) thus calculates as

tracklen = 50 + 16*368 + 206 = 6144 bytes (16 sectors per track, double density)
imagelen = 2*40*tracklen = 491520

Interleave

There is no skew with this format.

0 9 2 11 4 13 6 15 8 1 10 3 12 5 14 7