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
void serialize(Archive &ar, unsigned version)
Definition: ESE_RAM.cc:117
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:81
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
ESE_RAM(const DeviceConfig &config)
Definition: ESE_RAM.cc:41
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:95
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ESE_RAM.cc:50
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:70
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:57