OXYGENHUB
◆ main openmsx / src / memory / RomPanasonic.hh
933 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef ROMPANASONIC_HH
2
#define ROMPANASONIC_HH
3
4
#include "RomBlocks.hh"
5
#include <array>
6
7
namespace openmsx {
8
9
class PanasonicMemory;
10
11
class RomPanasonic final : public Rom8kBBlocks
12
{
13
public:
14
	RomPanasonic(const DeviceConfig& config, Rom&& rom);
15
16
	void reset(EmuTime time) override;
17
	[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override;
18
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) 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
	void changeBank(unsigned region, unsigned bank);
28
29
private:
30
	PanasonicMemory& panasonicMem;
31
	unsigned maxSRAMBank;
32
	std::array<unsigned, 8> bankSelect;
33
	byte control;
34
};
35
36
} // namespace openmsx
37
38
#endif