OXYGENHUB
◆ main openmsx / src / memory / ESE_SCC.hh
1.2 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef ESE_SCC_HH
2
#define ESE_SCC_HH
3
4
#include "RomBlockDebuggable.hh"
5
#include "SRAM.hh"
6
7
#include "MSXDevice.hh"
8
#include "SCC.hh"
9
10
#include <array>
11
12
namespace openmsx {
13
14
class MB89352;
15
16
class ESE_SCC final : public MSXDevice
17
{
18
public:
19
	ESE_SCC(DeviceConfig& config, bool withSCSI);
20
21
	void powerUp(EmuTime time) override;
22
	void reset(EmuTime time) override;
23
24
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) override;
25
	[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override;
26
	void writeMem(uint16_t address, byte value, EmuTime time) override;
27
	[[nodiscard]] const byte* getReadCacheLine(uint16_t address) const override;
28
	[[nodiscard]] byte* getWriteCacheLine(uint16_t address) override;
29
30
	template<typename Archive>
31
	void serialize(Archive& ar, unsigned version);
32
33
private:
34
	[[nodiscard]] size_t getSramSize(bool withSCSI) const;
35
	void setMapperLow(unsigned page, byte value);
36
	void setMapperHigh(byte value);
37
38
private:
39
	SRAM sram;
40
	SCC scc;
41
	const std::unique_ptr<MB89352> spc; // can be nullptr
42
	RomBlockDebuggable romBlockDebug;
43
44
	const byte mapperMask;
45
	std::array<byte, 4> mapper;
46
	bool spcEnable = false;
47
	bool sccEnable = false;
48
	bool writeEnable = false;
49
};
50
51
} // namespace openmsx
52
53
#endif