1#ifndef MSXMEMORYMAPPERBASE_HH
2#define MSXMEMORYMAPPERBASE_HH
28 void reset(EmuTime::param time)
override;
29 void powerUp(EmuTime::param time)
override;
30 [[nodiscard]]
byte readIO(
word port, EmuTime::param time)
override;
31 [[nodiscard]]
byte peekIO(
word port, EmuTime::param time)
const override;
32 [[nodiscard]]
byte readMem(
word address, EmuTime::param time)
override;
33 void writeMem(
word address,
byte value, EmuTime::param time)
override;
36 [[nodiscard]]
byte peekMem(
word address, EmuTime::param time)
const override;
42 void writeIO(
word port,
byte value, EmuTime::param time)
override = 0;
44 template<
typename Archive>
45 void serialize(Archive& ar,
unsigned version);
63 [[nodiscard]]
byte read(
unsigned address)
override;
64 void write(
unsigned address,
byte value)
override;
This class keeps track of which bytes in the Ram have been written to.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
unsigned calcAddress(word address) const
Converts a Z80 address to a RAM address.
void writeIOImpl(word port, byte value, EmuTime::param time)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
unsigned getBaseSizeAlignment() const override
The 'base' and 'size' attribute values need to be at least aligned to CacheLine::SIZE.
std::array< byte, 4 > registers
void serialize(Archive &ar, unsigned version)
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.
byte getSelectedSegment(byte page) const override
Returns the currently selected segment for the given page.
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
unsigned getSizeInBlocks() const
void writeIO(word port, byte value, EmuTime::param time) override=0
Write a byte to a given IO port at a certain time to this device.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
unsigned segmentOffset(byte page) const
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