OXYGENHUB
◆ main openmsx / src / memory / MSXRam.hh
941 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef MSXRAM_HH
2
#define MSXRAM_HH
3
4
#include "CheckedRam.hh"
5
6
#include "MSXDevice.hh"
7
8
#include <optional>
9
10
namespace openmsx {
11
12
class MSXRam final : public MSXDevice
13
{
14
public:
15
	explicit MSXRam(const DeviceConfig& config);
16
17
	void powerUp(EmuTime time) override;
18
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) override;
19
	void writeMem(uint16_t address, byte value, EmuTime time) override;
20
	[[nodiscard]] const byte* getReadCacheLine(uint16_t start) const override;
21
	[[nodiscard]] byte* getWriteCacheLine(uint16_t start) override;
22
	[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override;
23
24
	template<typename Archive>
25
	void serialize(Archive& ar, unsigned version);
26
27
private:
28
	void init() override;
29
	[[nodiscard]] inline unsigned translate(unsigned address) const;
30
31
private:
32
	/*const*/ unsigned base;
33
	/*const*/ unsigned size;
34
	/*const*/ std::optional<CheckedRam> checkedRam;
35
};
36
37
} // namespace openmsx
38
39
#endif