openMSX
MSXMirrorDevice.hh
Go to the documentation of this file.
1 #ifndef MSXMIRRORDEVICE_HH
2 #define MSXMIRRORDEVICE_HH
3 
4 #include "MSXDevice.hh"
5 
6 namespace openmsx {
7 
8 class MSXCPUInterface;
9 
10 class MSXMirrorDevice final : public MSXDevice
11 {
12 public:
13  explicit MSXMirrorDevice(const DeviceConfig& config);
14 
15  byte readMem(word address, EmuTime::param time) override;
16  void writeMem(word address, byte value, EmuTime::param time) override;
17  const byte* getReadCacheLine(word start) const override;
18  byte* getWriteCacheLine(word start) const override;
19  byte peekMem(word address, EmuTime::param time) const override;
20  bool allowUnaligned() const override;
21 
22  template<typename Archive>
23  void serialize(Archive& ar, unsigned version);
24 
25 private:
26  MSXCPUInterface& interface;
27  const unsigned addressHigh;
28 };
29 
30 } // namespace openmsx
31 
32 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::MSXMirrorDevice
Definition: MSXMirrorDevice.hh:11
openmsx::MSXMirrorDevice::getWriteCacheLine
byte * getWriteCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: MSXMirrorDevice.cc:45
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::MSXCPUInterface
Definition: MSXCPUInterface.hh:64
MSXDevice.hh
openmsx::MSXMirrorDevice::allowUnaligned
bool allowUnaligned() const override
By default we don't allow unaligned <mem> specifications in the config file.
Definition: MSXMirrorDevice.cc:50
openmsx::MSXCPUInterface
MSXCPUInterface
Definition: MSXCPUInterface.cc:1274
openmsx::MSXMirrorDevice::getReadCacheLine
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: MSXMirrorDevice.cc:40
openmsx::MSXMirrorDevice::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXMirrorDevice.cc:57
openmsx::MSXMirrorDevice::MSXMirrorDevice
MSXMirrorDevice(const DeviceConfig &config)
Definition: MSXMirrorDevice.cc:18
openmsx::MSXMirrorDevice::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MSXMirrorDevice.cc:30
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::MSXMirrorDevice::writeMem
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.
Definition: MSXMirrorDevice.cc:35
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::MSXMirrorDevice::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MSXMirrorDevice.cc:25