openMSX
PrinterPortLogger.hh
Go to the documentation of this file.
1 #ifndef MSXPRINTERPORTLOGGER_HH
2 #define MSXPRINTERPORTLOGGER_HH
3 
4 #include "PrinterPortDevice.hh"
5 #include "FilenameSetting.hh"
6 #include "File.hh"
7 
8 namespace openmsx {
9 
10 class CommandController;
11 
13 {
14 public:
15  explicit PrinterPortLogger(CommandController& commandController);
16 
17  // PrinterPortDevice
18  bool getStatus(EmuTime::param time) override;
19  void setStrobe(bool strobe, EmuTime::param time) override;
20  void writeData(byte data, EmuTime::param time) override;
21 
22  // Pluggable
23  const std::string& getName() const override;
24  string_view getDescription() const override;
25  void plugHelper(Connector& connector, EmuTime::param time) override;
26  void unplugHelper(EmuTime::param time) override;
27 
28  template<typename Archive>
29  void serialize(Archive& ar, unsigned version);
30 
31 private:
32  FilenameSetting logFilenameSetting;
33  File file;
34  byte toPrint;
35  bool prevStrobe;
36 };
37 
38 } // namespace openmsx
39 
40 #endif
void plugHelper(Connector &connector, EmuTime::param time) override
void writeData(byte data, EmuTime::param time) override
Sets the data signals.
Represents something you can plug devices into.
Definition: Connector.hh:20
void unplugHelper(EmuTime::param time) override
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void setStrobe(bool strobe, EmuTime::param time) override
Sets the strobe signal: false = low, true = high.
void serialize(Archive &ar, unsigned version)
constexpr auto data(C &c) -> decltype(c.data())
Definition: span.hh:69
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
const std::string & getName() const override
Name used to identify this pluggable.
bool getStatus(EmuTime::param time) override
Returns the STATUS signal: false = low = ready, true = high = not ready.
string_view getDescription() const override
Description for this pluggable.
PrinterPortLogger(CommandController &commandController)