| 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 | { |
nothing calls this directly
no outgoing calls
no test coverage detected