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