MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / decodeDataRecord

Method decodeDataRecord

arch/c64/decoder.cc:84–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 void decodeDataRecord() override
85 {
86 if (readRaw20() != C64_DATA_RECORD)
87 return;
88
89 const auto& bits = readRawBits(259 * 10);
90 const auto& bytes = decode(bits).slice(0, 259);
91
92 _sector->data = bytes.slice(0, C64_SECTOR_LENGTH);
93 uint8_t gotChecksum = xorBytes(_sector->data);
94 uint8_t wantChecksum = bytes[256];
95 _sector->status =
96 (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM;
97 }
98};
99
100std::unique_ptr<Decoder> createCommodore64Decoder(const DecoderProto& config)

Callers

nothing calls this directly

Calls 3

xorBytesFunction · 0.85
sliceMethod · 0.80
decodeFunction · 0.70

Tested by

no test coverage detected