9 , reference(getCurrentTime())
16 reference.
reset(time);
28 if ((port & 3) == 0) {
34 return narrow_cast<byte>(latchedValue >> (8 * (port & 3)));
39 unsigned tmp = (port & 3) ? latchedValue : reference.
getTicksTill(time);
40 return narrow_cast<byte>(tmp >> (8 * (port & 3)));
43template<
typename Archive>
46 ar.template serializeBase<MSXDevice>(*
this);
47 ar.serialize(
"reference", reference,
48 "latchedValue", latchedValue);
#define REGISTER_MSXDEVICE(CLASS, NAME)
constexpr void reset(EmuTime::param e)
Reset the clock to start ticking at the given time.
constexpr void advance(EmuTime::param e)
Advance this clock in time until the last tick which is not past the given time.
constexpr unsigned getTicksTill(EmuTime::param e) const
Calculate the number of ticks for this clock until the given time.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
EmuTime::param getCurrentTime() const
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
MSXHiResTimer(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.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time) override
This method is called on reset.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)