Format of Decoded Sector Data Files =================================== // Current file ID and file format version number and file extension. #define DEC_FILE_ID "UFDC6-D1" #define DEC_FORMATVERSION (0x16) #define DEC_FILE_EXT "UFD" // Structure for file header of extracted sector data files. // This header is at the very beginning of the file. #pragma pack(push, 1) typedef struct { char fileID[8]; // file ID (not null-terminated) uint8_t formatVersion; // file format version (e.g., 16h = v1.6) uint8_t filler[3]; // (set to 00h,00h,00h) uint32_t trailerOfst; // start of notes trailer (offset from beginning of file) } FileHeader; // 16 bytes // Structure for the configuration settings block for "UFDC6-D1" decoded // sector data files, where it is located immediately after the file header. // Some of these fields are only used for the capture, and are not needed // when interpreting this file. typedef struct { uint16_t MotorStart; // floppy disk drive motor startup time, in msec. (100..2000) uint16_t RotationSpeed; // drive rotation speed during capture, in rpm (300/360) uint8_t HeadLoadSettle; // settling time after issuing head load, in msec. (1..200, 0 = none) uint8_t DblStep; // double-step, i.e., 96tpi drive but 48tpi media (1 = single step, 2 = double step) uint8_t StepTime; // time between step pulses (in same direction), in msec. (2..70) uint8_t StepSettle; // settling time after stepping or changing direction, in msec. (2..70) uint8_t HeadSettle; // settling time after changing heads (sides), in msec. (1..10, 0 = none) uint8_t NumCylinders; // number of media cylinders (2..85, usually 35/40/77/80) uint8_t NumSides; // number of sides recorded on media (1/2) uint8_t FirstCyl; // first media cylinder to capture (0..84) uint8_t FirstSide; // first side (of first cylinder) to capture (0/1) uint8_t LastCyl; // last media cylinder to capture (0..84) uint8_t LastSide; // last side (of last cylinder) to capture (0/1) uint8_t SampleRateMSps; // capture sample rate, in MS/s (15/16/20) uint8_t CaptureDevice; // capture device (0 = LOGIC_ANALYZER, 1 = UFDC6_ANALOG) uint8_t TracksUsingFM; // number of media tracks using FM encoding (0 = none, 1..2, FFh = all) uint16_t DataRateFMkbps; // FM data rate at capture, in kbps (125/150/250) uint16_t DataRateMFMkbps; // MFM data rate at capture, in kbps (250/300/500) uint8_t FmSectorsTrack; // number of FM/SD sectors per track (5..26) (used to calculate FmTrackTime) uint8_t MfmSectorsTrack; // number of MFM/DD sectors per track (5..26) (used to calculate MfmTrackTime) uint16_t FmTrackTime; // capture time per FM/SD track (if not sync'd to index), in msec. (167..500) uint16_t MfmTrackTime; // capture time per MFM/DD track (if not sync'd to index), in msec. (167..500) uint16_t SectorLength; // sector length, in bytes (128/256/512/1024) uint8_t SyncdToIndex; // capture sync'd to index pulse (0 = don't sync, 1 = sync) uint8_t FmSecOfstSid0; // sector number offset for FM/SD side 0 (0..99, e.g., 1 for 1..10) uint8_t FmSecOfstSid1; // sector number offset for FM/SD side 1 (0..99, e.g., 1 for 1..10, 11 for 11..20) uint8_t MfmSecOfstSid0; // sector number offset for MFM/DD side 0 (0..99, e.g., 1 for 1..9 or 1..18) uint8_t MfmSecOfstSid1; // sector number offset for MFM/DD side 1 (0..99, e.g., 1 for 1..9 or 19 for 19..36) uint8_t Cyl0Sid0Sec0; // first sector number for cyl 0 side 0 (0 = override offset to set to 0, FFh = no override) uint16_t AnalogScaling; // analog scaling value, as number of millivolts in 256 ADC counts (100..3300) int8_t AnalogShift; // number of analog samples to insert/delete at beginning (negative = delete, positive = insert) uint8_t SideSelect; // side select in DecodedSectorHeader (00h = use ID_Side, FFh = use TT_Side) uint8_t filler[8]; // (filler, all 00h) } Configuration; // 48 bytes (multiple of 16) // Header for each decoded sector. The 128/256/512/1024-byte sector data // follows immediately after its header. typedef struct { uint16_t MagicNumber; // magic number = 7777h uint8_t TT_Cyl; // cylinder number (0..84) (from track table) uint8_t TT_Side; // side number (0/1) (from track table) uint16_t Cfg_SecLen; // sector data length, in bytes (128/256/512/1024) (from configuration record) uint8_t ID_Cyl; // cylinder number (0..84) (from ID Record) uint8_t ID_Side; // side number (0/1) (from ID Record) uint8_t ID_Sect; // sector number (0..39+) uint8_t ID_SecLen; // sector data length code (0 = 128, 1 = 256, 2 = 512, 3 = 1024) uint16_t ID_CRC; // 16-bit CRC of ID Record (on preceding 4 bytes) uint8_t DAM; // Data Address Mark (F8h/F9h/FAh/FBh) uint8_t Data_CRC_OK; // Data Record CRC status (1 = valid, 0 = invalid) uint16_t Data_CRC; // 16-bit CRC of sector data } DecodedSectorHeader; // 16 bytes #pragma pack(pop) Example: ------- 00000000 55 46 44 43 36 2D 44 31-16 00 00 00 50 01 00 00 UFDC6-D1....@... FileHeader 00000010 F4 01 2C 01 00 01 14 1E-01 28 02 00 00 27 01 10 ..,......(...'.. Configuration 00000020 00 00 7D 00 FA 00 0A 12-E6 00 D9 00 00 01 00 01 ..}............. 00000030 01 01 01 FF E8 03 00 00-00 00 00 00 00 00 00 00 ................ 00000040 77 77 00 00 00 01 00 00-01 01 0C FA FB 01 F1 9A ww.............. DecodedSectorHeader 00000050 00 05 A0 12 00 B4 00 01-00 00 02 00 00 FF 10 59 ...............Y sector data 00000060 03 00 12 00 00 00 01 BC-45 0F 5A 04 15 13 37 78 ........E.Z...7x 00000070 78 78 F8 00 00 00 00 00-00 00 00 00 00 00 00 00 xx.............. 00000080 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000090 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 000000A0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 000000B0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 000000C0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 000000D0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 000000E0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 000000F0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 00000150 20 20 0D 0A .. notes (trailer) ....FILE: DecodedSectorDataFileFormat.txt