OXYGENHUB
◆ main openmsx / src / SVIPrinterPort.hh
1.1 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef SVIPRINTERPORT_HH
2
#define SVIPRINTERPORT_HH
3
4
#include "Connector.hh"
5
#include "MSXDevice.hh"
6
7
#include <cstdint>
8
9
namespace openmsx {
10
11
class PrinterPortDevice;
12
13
class SVIPrinterPort final : public MSXDevice, public Connector
14
{
15
public:
16
	explicit SVIPrinterPort(const DeviceConfig& config);
17
18
	[[nodiscard]] PrinterPortDevice& getPluggedPrintDev() const;
19
20
	// MSXDevice
21
	void reset(EmuTime time) override;
22
	[[nodiscard]] uint8_t readIO(uint16_t port, EmuTime time) override;
23
	[[nodiscard]] uint8_t peekIO(uint16_t port, EmuTime time) const override;
24
	void writeIO(uint16_t port, uint8_t value, EmuTime time) override;
25
26
	// Connector
27
	[[nodiscard]] zstring_view getDescription() const override;
28
	[[nodiscard]] zstring_view getClass() const override;
29
	void plug(Pluggable& dev, EmuTime time) override;
30
31
	template<typename Archive>
32
	void serialize(Archive& ar, unsigned version);
33
34
private:
35
	void setStrobe(bool newStrobe, EmuTime time);
36
	void writeData(uint8_t newData, EmuTime time);
37
38
private:
39
	bool strobe = false; // != true
40
	uint8_t data = 255;  // != 0
41
};
42
43
} // namespace openmsx
44
45
#endif