openMSX
MSXRam.hh
Go to the documentation of this file.
1 #ifndef MSXRAM_HH
2 #define MSXRAM_HH
3 
4 #include "MSXDevice.hh"
5 #include <memory>
6 
7 namespace openmsx {
8 
9 class CheckedRam;
10 
11 class MSXRam final : public MSXDevice
12 {
13 public:
14  explicit MSXRam(const DeviceConfig& config);
15  ~MSXRam() override;
16 
17  void powerUp(EmuTime::param time) override;
18  byte readMem(word address, EmuTime::param time) override;
19  void writeMem(word address, byte value, EmuTime::param time) override;
20  const byte* getReadCacheLine(word start) const override;
21  byte* getWriteCacheLine(word start) const override;
22  byte peekMem(word address, EmuTime::param time) const override;
23 
24  template<typename Archive>
25  void serialize(Archive& ar, unsigned version);
26 
27 private:
28  void init() override;
29  inline unsigned translate(unsigned address) const;
30 
31  /*const*/ unsigned base;
32  /*const*/ unsigned size;
33  /*const*/ std::unique_ptr<CheckedRam> checkedRam;
34 };
35 
36 } // namespace openmsx
37 
38 #endif
openmsx::MSXRam::getWriteCacheLine
byte * getWriteCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: MSXRam.cc:67
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::MSXRam::~MSXRam
~MSXRam() override
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::MSXRam::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXRam.cc:73
openmsx::MSXRam
Definition: MSXRam.hh:12
openmsx::MSXRam::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: MSXRam.cc:52
openmsx::MSXRam::powerUp
void powerUp(EmuTime::param time) override
This method is called when MSX is powered up.
Definition: MSXRam.cc:35
MSXDevice.hh
openmsx::MSXRam::peekMem
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
Definition: MSXRam.cc:47
openmsx::MSXRam::getReadCacheLine
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: MSXRam.cc:62
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::MSXRam::MSXRam
MSXRam(const DeviceConfig &config)
Definition: MSXRam.cc:10
openmsx::MSXRam::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: MSXRam.cc:57
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5