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  std::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
openmsx::PrinterPortLogger::unplugHelper
void unplugHelper(EmuTime::param time) override
Definition: PrinterPortLogger.cc:56
openmsx::CommandController
Definition: CommandController.hh:18
openmsx::PrinterPortLogger::getDescription
std::string_view getDescription() const override
Description for this pluggable.
Definition: PrinterPortLogger.cc:67
openmsx::FilenameSetting
Definition: FilenameSetting.hh:9
openmsx::PrinterPortLogger
Definition: PrinterPortLogger.hh:13
PrinterPortDevice.hh
openmsx::PrinterPortLogger::getStatus
bool getStatus(EmuTime::param time) override
Returns the STATUS signal: false = low = ready, true = high = not ready.
Definition: PrinterPortLogger.cc:23
openmsx::PrinterPortLogger::getName
const std::string & getName() const override
Name used to identify this pluggable.
Definition: PrinterPortLogger.cc:61
File.hh
FilenameSetting.hh
openmsx::PrinterPortLogger::setStrobe
void setStrobe(bool strobe, EmuTime::param time) override
Sets the strobe signal: false = low, true = high.
Definition: PrinterPortLogger.cc:28
openmsx::PrinterPortLogger::serialize
void serialize(Archive &ar, unsigned version)
Definition: PrinterPortLogger.cc:75
openmsx::PrinterPortLogger::PrinterPortLogger
PrinterPortLogger(CommandController &commandController)
Definition: PrinterPortLogger.cc:8
openmsx::File
Definition: File.hh:16
openmsx::PrinterPortLogger::writeData
void writeData(byte data, EmuTime::param time) override
Sets the data signals.
Definition: PrinterPortLogger.cc:39
openmsx::Connector
Represents something you can plug devices into.
Definition: Connector.hh:21
openmsx::PrinterPortLogger::plugHelper
void plugHelper(Connector &connector, EmuTime::param time) override
Definition: PrinterPortLogger.cc:44
openmsx::PrinterPortDevice
Definition: PrinterPortDevice.hh:10
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5