25 assert( base < 0x10000);
26 assert((base + size) <= 0x10000);
36unsigned MSXRam::translate(
unsigned address)
const
39 if (address >= size) address &= (size - 1);
45 return checkedRam->peek(translate(address));
50 return checkedRam->read(translate(address));
55 checkedRam->write(translate(address), value);
60 return checkedRam->getReadCacheLine(translate(start));
65 return checkedRam->getWriteCacheLine(translate(start));
68template<
typename Archive>
71 ar.template serializeBase<MSXDevice>(*
this);
73 ar.serialize(
"ram", checkedRam->getUncheckedRam());
#define REGISTER_MSXDEVICE(CLASS, NAME)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
const DeviceConfig & getDeviceConfig2() const
void getVisibleMemRegion(unsigned &base, unsigned &size) const
Returns the range where this device is visible in memory.
virtual const std::string & getName() const
Returns a human-readable name for this device.
const XMLElement & getDeviceConfig() const
Get the configuration section for this device.
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.
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
void serialize(Archive &ar, unsigned version)
MSXRam(const DeviceConfig &config)
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
byte * getWriteCacheLine(word start) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
int getChildDataAsInt(std::string_view childName, int defaultValue) const
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)