OXYGENHUB
◆ main openmsx / src / memory / RomRamFile.hh
803 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef ROMRAMFILE_HH
2
#define ROMRAMFILE_HH
3
4
#include "MSXRom.hh"
5
#include "SRAM.hh"
6
7
namespace openmsx {
8
9
class MSXCPU;
10
11
class RomRamFile final : public MSXRom
12
{
13
public:
14
	RomRamFile(const DeviceConfig& config, Rom&& rom);
15
16
	void reset(EmuTime time) override;
17
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) override;
18
	[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override;
19
	[[nodiscard]] const byte* getReadCacheLine(uint16_t address) const override;
20
	void writeMem(uint16_t address, byte value, EmuTime time) override;
21
	[[nodiscard]] byte* getWriteCacheLine(uint16_t address) override;
22
23
	template<typename Archive>
24
	void serialize(Archive& ar, unsigned version);
25
26
private:
27
	std::unique_ptr<SRAM> sram;
28
	MSXCPU& cpu;
29
	byte shiftValue;
30
};
31
32
} // namespace openmsx
33
34
#endif