MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / read16

Method read16

tests/ntrcard-probe-test.cpp:441–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439 explicit ScriptedWriteBus(Behavior behavior) : behavior(behavior) {}
440
441 std::uint16_t read16(NtrCard::RegisterOffset offset) const override
442 {
443 assert(offset == NtrCard::RegisterOffset::MCardControl);
444 // Whatever this module set, the thief's value differs from it. A
445 // fixed constant could collide with a value the module itself
446 // writes, and the theft would then be invisible.
447 if (behavior == Behavior::StolenDuringBuffer && currentCommand == 0x81 && bufferTransfers == 2) {
448 return static_cast<std::uint16_t>(mCardControl ^ 0x4000u);
449 }
450 if (behavior == Behavior::StolenAtCommit && currentCommand == 0x82) {
451 return static_cast<std::uint16_t>(mCardControl ^ 0x4000u);
452 }
453 return mCardControl;
454 }
455
456 std::uint32_t read32(NtrCard::RegisterOffset offset) const override
457 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected