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"
7
8namespace openmsx {
9
10class ESE_RAM final : public MSXDevice
11{
12public:
13 explicit ESE_RAM(const DeviceConfig& config);
14
15 void reset(EmuTime::param time) override;
16
17 [[nodiscard]] byte readMem(word address, EmuTime::param time) override;
18 void writeMem(word address, byte value, EmuTime::param time) override;
19 [[nodiscard]] const byte* getReadCacheLine(word address) const override;
20 [[nodiscard]] byte* getWriteCacheLine(word address) const override;
21
22 template<typename Archive>
23 void serialize(Archive& ar, unsigned version);
24
25private:
26 [[nodiscard]] unsigned getSramSize() const;
27 void setSRAM(unsigned region, byte block);
28
29private:
30 SRAM sram;
31 RomBlockDebuggable romBlockDebug;
32
33 bool isWriteable[4]; // which region is readonly?
34 byte mapped[4]; // which block is mapped in this region?
35 const byte blockMask;
36};
37
38} // namespace openmsx
39
40#endif
void serialize(Archive &ar, unsigned version)
Definition: ESE_RAM.cc:117
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:59
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
void reset(EmuTime::param time) override
This method is called on reset.
Definition: ESE_RAM.cc:52
ESE_RAM(const DeviceConfig &config)
Definition: ESE_RAM.cc:43
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
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
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:33
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29