Hopefully get the imagereader/imagewriter and IBM encoder/decoders using sector

IDs.
This commit is contained in:
David Given
2021-07-29 00:02:46 +02:00
parent 8b115f8156
commit 29e8c99b4f
34 changed files with 304 additions and 61 deletions

View File

@@ -140,7 +140,7 @@ public:
br.read_8(); /* skip ID byte */
_sector->logicalTrack = br.read_8();
_sector->logicalSide = br.read_8();
_sector->logicalSector = br.read_8() - _config.sector_id_base();
_sector->logicalSector = br.read_8();
_currentSectorSize = 1 << (br.read_8() + 7);
uint16_t wantCrc = br.read_be16();
uint16_t gotCrc = crc16(CCITT_POLY, bytes.slice(0, _currentHeaderLength + 5));

View File

@@ -208,7 +208,7 @@ public:
bw.write_8(idamUnencoded);
bw.write_8(sectorData->logicalTrack);
bw.write_8(sectorData->logicalSide);
bw.write_8(sectorData->logicalSector + trackdata.start_sector_id());
bw.write_8(sectorData->logicalSector);
bw.write_8(sectorSize);
uint16_t crc = crc16(CCITT_POLY, header);
bw.write_be16(crc);

View File

@@ -8,7 +8,6 @@ message IbmDecoderProto {
repeated int32 sector = 1 [(help) = "require these sectors to exist for a good read"];
}
optional int32 sector_id_base = 1 [default = 1, (help) = "ID of first sector"];
optional bool ignore_side_byte = 2 [default = false, (help) = "ignore side byte in sector header"];
optional bool swap_sides = 4 [default = false, (help) = "swap side bytes when reading"];
optional SectorsProto sectors = 5 [(help) = "require these sectors to exist for a good read"];
@@ -27,7 +26,6 @@ message IbmEncoderProto {
optional double track_length_ms = 1 [(help) = "length of track"];
optional int32 sector_size = 2 [default=512, (help) = "number of bytes per sector"];
optional bool emit_iam = 3 [default=true, (help) = "whether to emit an IAM record"];
optional int32 start_sector_id = 4 [default=1, (help) = "ID of first sector"];
optional double clock_rate_khz = 5 [(help) = "data clock rate"];
optional bool use_fm = 6 [default=false, (help) = "whether to use FM encoding rather than MFM"];
optional int32 idam_byte = 7 [default=0x5554, (help) = "16-bit raw bit pattern of IDAM byte"];