| 1 |
#ifndef PRINTER_CORE_HH |
| 2 |
#define PRINTER_CORE_HH |
| 3 |
|
| 4 |
#include "PrinterPortDevice.hh" |
| 5 |
|
| 6 |
namespace openmsx { |
| 7 |
|
| 8 |
|
| 9 |
class PrinterCore : public PrinterPortDevice |
| 10 |
{ |
| 11 |
public: |
| 12 |
|
| 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 |
|
| 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 |
} |
| 33 |
|
| 34 |
#endif |