OXYGENHUB
◆ main openmsx / src / PrinterCore.hh
728 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef PRINTER_CORE_HH
2
#define PRINTER_CORE_HH
3
4
#include "PrinterPortDevice.hh"
5
6
namespace openmsx {
7
8
// Abstract printer class
9
class PrinterCore : public PrinterPortDevice
10
{
11
public:
12
	// PrinterPortDevice
13
	[[nodiscard]] bool getStatus(EmuTime time) override;
14
	void setStrobe(bool strobe, EmuTime time) override;
15
	void writeData(uint8_t data, EmuTime time) override;
16
17
	// Pluggable
18
	void plugHelper(Connector& connector, EmuTime time) override;
19
	void unplugHelper(EmuTime time) override;
20
21
protected:
22
	PrinterCore() = default;
23
	~PrinterCore() override = default;
24
	virtual void write(uint8_t data) = 0;
25
	virtual void forceFormFeed() = 0;
26
27
private:
28
	uint8_t toPrint = 0;
29
	bool prevStrobe = true;
30
};
31
32
} // namespace openmsx
33
34
#endif