OXYGENHUB
◆ main openmsx / src / fdc / NowindInterface.hh
1.2 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef NOWINDINTERFACE_HH
2
#define NOWINDINTERFACE_HH
3
4
#include "NowindCommand.hh"
5
#include "NowindHost.hh"
6
7
#include "AmdFlash.hh"
8
#include "MSXDevice.hh"
9
#include "Rom.hh"
10
11
#include <bitset>
12
#include <optional>
13
#include <string>
14
15
namespace openmsx {
16
17
class NowindInterface final : public MSXDevice
18
{
19
public:
20
	explicit NowindInterface(DeviceConfig& config);
21
	~NowindInterface() override;
22
23
	void reset(EmuTime time) override;
24
	[[nodiscard]] byte peekMem(uint16_t address, EmuTime time) const override;
25
	[[nodiscard]] byte readMem(uint16_t address, EmuTime time) 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
	Rom rom;
35
	AmdFlash flash;
36
	NowindHost::Drives drives;
37
	NowindHost host;
38
	std::optional<NowindCommand> command; // because of delayed initialization
39
	std::string basename;
40
	byte bank;
41
42
	static constexpr unsigned MAX_NOWINDS = 8; // a-h
43
	using NowindsInUse = std::bitset<MAX_NOWINDS>;
44
	std::shared_ptr<NowindsInUse> nowindsInUse;
45
46
	friend class NowindCommand;
47
};
48
49
} // namespace openmsx
50
51
#endif