OXYGENHUB
◆ main openmsx / src / memory / RomAscii16X.hh
1.1 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef ROMASCII16X_HH
2
#define ROMASCII16X_HH
3
4
#include "AmdFlash.hh"
5
#include "MSXRom.hh"
6
#include "RomBlockDebuggable.hh"
7
8
#include <array>
9
10
namespace openmsx {
11
12
class RomAscii16X final : public MSXRom
13
{
14
public:
15
	RomAscii16X(DeviceConfig& config, Rom&& rom);
16
17
	void reset(EmuTime time) override;
18
	[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override;
19
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) override;
20
	[[nodiscard]] const byte* getReadCacheLine(uint16_t address) const override;
21
	void writeMem(uint16_t address, byte value, EmuTime time) override;
22
	[[nodiscard]] byte* getWriteCacheLine(uint16_t address) override;
23
24
	template<typename Archive>
25
	void serialize(Archive& ar, unsigned version);
26
27
private:
28
	[[nodiscard]] unsigned getFlashAddr(uint16_t addr) const;
29
30
	struct Debuggable final : RomBlockDebuggableBase {
31
		explicit Debuggable(const RomAscii16X& device)
32
			: RomBlockDebuggableBase(device) {}
33
		[[nodiscard]] unsigned readExt(unsigned address) override;
34
	} debuggable;
35
36
	AmdFlash flash;
37
38
	std::array<uint16_t, 2> bankRegs = {0, 0};
39
};
40
41
} // namespace openmsx
42
43
#endif