OXYGENHUB
◆ main openmsx / src / PrinterPortSimpl.hh
929 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef PRINTERPORTSIMPLE_HH
2
#define PRINTERPORTSIMPLE_HH
3
4
#include "PrinterPortDevice.hh"
5
6
#include "DACSound8U.hh"
7
8
#include <optional>
9
10
namespace openmsx {
11
12
class HardwareConfig;
13
14
class PrinterPortSimpl final : public PrinterPortDevice
15
{
16
public:
17
	explicit PrinterPortSimpl(HardwareConfig& hwConf);
18
19
	// PrinterPortDevice
20
	[[nodiscard]] bool getStatus(EmuTime time) override;
21
	void setStrobe(bool strobe, EmuTime time) override;
22
	void writeData(uint8_t data, EmuTime time) override;
23
24
	// Pluggable
25
	[[nodiscard]] zstring_view getName() const override;
26
	[[nodiscard]] zstring_view getDescription() const override;
27
	void plugHelper(Connector& connector, EmuTime time) override;
28
	void unplugHelper(EmuTime time) override;
29
30
	template<typename Archive>
31
	void serialize(Archive& ar, unsigned version);
32
33
private:
34
	void createDAC();
35
36
private:
37
	HardwareConfig& hwConf;
38
	std::optional<DACSound8U> dac;
39
};
40
41
} // namespace openmsx
42
43
#endif