| 53 | } |
| 54 | |
| 55 | void decodeSectorRecord() override |
| 56 | { |
| 57 | auto bits = readRawBits(TIDS990_SECTOR_RECORD_SIZE * 16); |
| 58 | auto bytes = decodeFmMfm(bits).slice(0, TIDS990_SECTOR_RECORD_SIZE); |
| 59 | |
| 60 | ByteReader br(bytes); |
| 61 | if (br.read_be16() != SECTOR_ID) |
| 62 | return; |
| 63 | |
| 64 | uint16_t gotChecksum = |
| 65 | crc16(CCITT_POLY, bytes.slice(1, TIDS990_SECTOR_RECORD_SIZE - 3)); |
| 66 | |
| 67 | _sector->logicalHead = br.read_8() >> 3; |
| 68 | _sector->logicalCylinder = br.read_8(); |
| 69 | br.read_8(); /* number of sectors per track */ |
| 70 | _sector->logicalSector = br.read_8(); |
| 71 | br.read_be16(); /* sector size */ |
| 72 | uint16_t wantChecksum = br.read_be16(); |
| 73 | |
| 74 | if (wantChecksum == gotChecksum) |
| 75 | _sector->status = |
| 76 | Sector::DATA_MISSING; /* correct but unintuitive */ |
| 77 | } |
| 78 | |
| 79 | void decodeDataRecord() override |
| 80 | { |
nothing calls this directly
no test coverage detected