Go to the documentation of this file.
8 , reference(getCurrentTime())
15 reference.
reset(time);
27 if ((port & 3) == 0) {
33 return latchedValue >> (8 * (port & 3));
38 unsigned tmp = (port & 3) ? latchedValue : reference.
getTicksTill(time);
39 return tmp >> (8 * (port & 3));
42 template<
typename Archive>
45 ar.template serializeBase<MSXDevice>(*
this);
46 ar.serialize(
"reference", reference,
47 "latchedValue", latchedValue);
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
constexpr unsigned getTicksTill(EmuTime::param e) const
Calculate the number of ticks for this clock until the given time.
MSXHiResTimer(const DeviceConfig &config)
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
EmuTime::param getCurrentTime() const
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
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.
uint16_t word
16 bit unsigned integer
void serialize(Archive &ar, unsigned version)
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.
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.
This file implemented 3 utility functions: