OXYGENHUB
◆ main openmsx / src / fdc / TurboRFDC.hh
1.0 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef TURBORFDC_HH
2
#define TURBORFDC_HH
3
4
#include "MSXFDC.hh"
5
#include "RomBlockDebuggable.hh"
6
#include "TC8566AF.hh"
7
8
#include <cstdint>
9
#include <span>
10
11
namespace openmsx {
12
13
class TurboRFDC final : public MSXFDC
14
{
15
public:
16
	enum class Type : uint8_t { BOTH, R7FF2, R7FF8 };
17
18
	explicit TurboRFDC(DeviceConfig& config);
19
20
	void reset(EmuTime time) override;
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 start) 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
	void setBank(byte value);
32
33
private:
34
	TC8566AF controller;
35
	RomBlockDebuggable romBlockDebug;
36
	std::span<const byte, 0x4000> memory;
37
	const byte blockMask;
38
	byte bank;
39
	const Type type;
40
};
41
42
} // namespace openmsx
43
44
#endif