| 1 |
#ifndef MSXPRINTERPORTLOGGER_HH |
| 2 |
#define MSXPRINTERPORTLOGGER_HH |
| 3 |
|
| 4 |
#include "File.hh" |
| 5 |
#include "FilenameSetting.hh" |
| 6 |
#include "PrinterPortDevice.hh" |
| 7 |
|
| 8 |
namespace openmsx { |
| 9 |
|
| 10 |
class CommandController; |
| 11 |
|
| 12 |
class PrinterPortLogger final : public PrinterPortDevice |
| 13 |
{ |
| 14 |
public: |
| 15 |
explicit PrinterPortLogger(CommandController& commandController); |
| 16 |
|
| 17 |
|
| 18 |
[[nodiscard]] bool getStatus(EmuTime time) override; |
| 19 |
void setStrobe(bool strobe, EmuTime time) override; |
| 20 |
void writeData(uint8_t data, EmuTime time) override; |
| 21 |
|
| 22 |
|
| 23 |
[[nodiscard]] zstring_view getName() const override; |
| 24 |
[[nodiscard]] zstring_view getDescription() const override; |
| 25 |
void plugHelper(Connector& connector, EmuTime time) override; |
| 26 |
void unplugHelper(EmuTime time) override; |
| 27 |
|
| 28 |
template<typename Archive> |
| 29 |
void serialize(Archive& ar, unsigned version); |
| 30 |
|
| 31 |
private: |
| 32 |
FilenameSetting logFilenameSetting; |
| 33 |
File file; |
| 34 |
uint8_t toPrint = 0; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
bool prevStrobe = true; |
| 41 |
}; |
| 42 |
|
| 43 |
} |
| 44 |
|
| 45 |
#endif |