I have sort of reverse engineered the .FDD format for supporting it in MESS
The file structure seems relatively easy
Code:
0xC3FC header, followed by raw sector data
Sector map starts at offset 0xDC, with 12bytes for each sector
Each entry of the sector map has the following structure
- 0x0 = track number (if 0xff the sector/track is unformatted/unused)
- 0x1 = head number
- 0x2 = sector number
- 0x3 = sector size (128 << this byte)
- 0x4 = fill byte. if it's not 0xff, then this sector in the original
disk consisted of this single value repeated for the whole
sector size, and the sector is skipped in the .fdd file.
if it's 0xff, then this sector is wholly contained in the .fdd
file
- 0x5 = ??
- 0x6 = ??
- 0x7 = ??
- 0x8-0x0b = absolute offset of the data for this sector, or 0xfffffff
if the sector was skipped in the .fdd (and it has to be
filled with the value at 0x4)
the main thing to account when converting / handling these is the fact that any sector with constant value is skipped in the disk (to save space, I guess) and it has to be manually padded
If the fill byte is H"FF" and the absolute offset is H"FFFFFFFF", then the sector needs to be padded with H"FF". That one caught me for a while. I hope I have it right now.