OXYGENHUB
◆ main openmsx / src / MSXS1990.hh
1.1 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef MSXS1990_HH
2
#define MSXS1990_HH
3
4
#include "FirmwareSwitch.hh"
5
#include "MSXDevice.hh"
6
#include "SimpleDebuggable.hh"
7
8
namespace openmsx {
9
10
/**
11
 * This class implements the MSX-engine found in a MSX Turbo-R (S1990)
12
 *
13
 * TODO explanation
14
 */
15
class MSXS1990 final : public MSXDevice
16
{
17
public:
18
	explicit MSXS1990(const DeviceConfig& config);
19
20
	void reset(EmuTime time) override;
21
	[[nodiscard]] byte readIO(uint16_t port, EmuTime time) override;
22
	[[nodiscard]] byte peekIO(uint16_t port, EmuTime time) const override;
23
	void writeIO(uint16_t port, byte value, EmuTime time) override;
24
25
	template<typename Archive>
26
	void serialize(Archive& ar, unsigned version);
27
28
private:
29
	[[nodiscard]] byte readRegister(byte reg) const;
30
	void writeRegister(byte reg, byte value);
31
	void setCPUStatus(byte value);
32
33
private:
34
	struct Debuggable final : SimpleDebuggable {
35
		Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
36
		[[nodiscard]] byte read(unsigned address) override;
37
		void write(unsigned address, byte value) override;
38
	} debuggable;
39
40
	FirmwareSwitch firmwareSwitch;
41
	byte registerSelect;
42
	byte cpuStatus;
43
};
44
45
} // namespace openmsx
46
47
#endif