OXYGENHUB
◆ main openmsx / src / ide / MegaSCSI.hh
1.1 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef MEGASCSI_HH
2
#define MEGASCSI_HH
3
4
#include "MB89352.hh"
5
6
#include "MSXDevice.hh"
7
#include "RomBlockDebuggable.hh"
8
#include "SRAM.hh"
9
10
#include <array>
11
12
namespace openmsx {
13
14
class MegaSCSI final : public MSXDevice
15
{
16
public:
17
	explicit MegaSCSI(DeviceConfig& config);
18
19
	void reset(EmuTime time) override;
20
21
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) override;
22
	[[nodiscard]]byte peekMem(uint16_t address, EmuTime time) const override;
23
	void writeMem(uint16_t address, byte value, EmuTime time) override;
24
	[[nodiscard]]const byte* getReadCacheLine(uint16_t address) const override;
25
	[[nodiscard]]byte* getWriteCacheLine(uint16_t address) override;
26
27
	template<typename Archive>
28
	void serialize(Archive& ar, unsigned version);
29
30
private:
31
	[[nodiscard]] size_t getSramSize() const;
32
	void setSRAM(unsigned region, byte block);
33
34
private:
35
	MB89352 mb89352;
36
	SRAM sram;
37
	RomBlockDebuggable romBlockDebug;
38
39
	std::array<bool, 4> isWriteable; // which region is readonly?
40
	std::array<byte, 4> mapped; // SPC block mapped in this region?
41
	const byte blockMask;
42
};
43
44
} // namespace openmsx
45
46
#endif