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