openMSX
ESE_RAM.hh
Go to the documentation of this file.
1 #ifndef ESE_RAM_HH
2 #define ESE_RAM_HH
3 
4 #include "MSXDevice.hh"
5 #include "SRAM.hh"
6 #include "RomBlockDebuggable.hh"
7 
8 namespace openmsx {
9 
10 class ESE_RAM final : public MSXDevice
11 {
12 public:
13  explicit ESE_RAM(const DeviceConfig& config);
14 
15  void reset(EmuTime::param time) override;
16 
17  byte readMem(word address, EmuTime::param time) override;
18  void writeMem(word address, byte value, EmuTime::param time) override;
19  const byte* getReadCacheLine(word address) const override;
20  byte* getWriteCacheLine(word address) const override;
21 
22  template<typename Archive>
23  void serialize(Archive& ar, unsigned version);
24 
25 private:
26  unsigned getSramSize() const;
27  void setSRAM(unsigned region, byte block);
28 
29  SRAM sram;
30  RomBlockDebuggable romBlockDebug;
31 
32  bool isWriteable[4]; // which region is readonly?
33  byte mapped[4]; // which block is mapped in this region?
34  const byte blockMask;
35 };
36 
37 } // namespace openmsx
38 
39 #endif
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx::ESE_RAM::serialize
void serialize(Archive &ar, unsigned version)
Definition: ESE_RAM.cc:118
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::ESE_RAM::reset
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ESE_RAM.cc:51
openmsx::SRAM
Definition: SRAM.hh:12
openmsx::ESE_RAM::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: ESE_RAM.cc:82
openmsx::ESE_RAM
Definition: ESE_RAM.hh:11
openmsx::ESE_RAM::getWriteCacheLine
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: ESE_RAM.cc:96
MSXDevice.hh
openmsx::ESE_RAM::ESE_RAM
ESE_RAM(const DeviceConfig &config)
Definition: ESE_RAM.cc:42
SRAM.hh
openmsx::RomBlockDebuggable
Definition: RomBlockDebuggable.hh:26
RomBlockDebuggable.hh
openmsx::ESE_RAM::readMem
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
Definition: ESE_RAM.cc:58
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::ESE_RAM::getReadCacheLine
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: ESE_RAM.cc:71
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5