21 reset(EmuTime::dummy());
31 pointer = (value == 0) ? 0 : 3;
36 byte result =
peekIO(port, time);
37 pointer =
byte(std::min(3, pointer + 1));
47 return narrow_cast<byte>(password >> 8);
49 return narrow_cast<byte>(password & 0xFF);
55template<
typename Archive>
58 ar.template serializeBase<MSXDevice>(*
this);
59 ar.serialize(
"pointer", pointer);
#define REGISTER_MSXDEVICE(CLASS, NAME)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
void reset(EmuTime::param time) override
This method is called on reset.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
PasswordCart(const DeviceConfig &config)
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
void serialize(Archive &ar, unsigned version)
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
This file implemented 3 utility functions:
uint8_t byte
8 bit unsigned integer
uint16_t word
16 bit unsigned integer
constexpr To narrow_cast(From &&from) noexcept
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)