8[[nodiscard]]
static unsigned getAddressHigh(
const DeviceConfig& config)
10 unsigned prim = config.getChildDataAsInt(
"ps", 0);
11 unsigned sec = config.getChildDataAsInt(
"ss", 0);
12 if ((prim >= 4) || (sec >= 4)) {
13 throw MSXException(
"Invalid slot in mirror device.");
15 return (prim << 18) | (sec << 16);
20 , interface(getCPUInterface())
21 , addressHigh(getAddressHigh(config))
56template<
typename Archive>
59 ar.template serializeBase<MSXDevice>(*
this);
#define REGISTER_MSXDEVICE(CLASS, NAME)
void writeSlottedMem(unsigned address, byte value, EmuTime::param time)
byte peekSlottedMem(unsigned address, EmuTime::param time) const
byte readSlottedMem(unsigned address, EmuTime::param time)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXMirrorDevice(const DeviceConfig &config)
byte * getWriteCacheLine(word start) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
bool allowUnaligned() const override
By default we don't allow unaligned <mem> specifications in the config file.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void serialize(Archive &ar, unsigned version)
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)