openMSX
PrinterPortSimpl.hh
Go to the documentation of this file.
1 #ifndef PRINTERPORTSIMPLE_HH
2 #define PRINTERPORTSIMPLE_HH
3 
4 #include "PrinterPortDevice.hh"
5 #include <memory>
6 
7 namespace openmsx {
8 
9 class HardwareConfig;
10 class DACSound8U;
11 
12 class PrinterPortSimpl final : public PrinterPortDevice
13 {
14 public:
15  explicit PrinterPortSimpl(const HardwareConfig& hwConf);
16  ~PrinterPortSimpl() override;
17 
18  // PrinterPortDevice
19  bool getStatus(EmuTime::param time) override;
20  void setStrobe(bool strobe, EmuTime::param time) override;
21  void writeData(byte data, EmuTime::param time) override;
22 
23  // Pluggable
24  const std::string& getName() const override;
25  std::string_view getDescription() const override;
26  void plugHelper(Connector& connector, EmuTime::param time) override;
27  void unplugHelper(EmuTime::param time) override;
28 
29  template<typename Archive>
30  void serialize(Archive& ar, unsigned version);
31 
32 private:
33  void createDAC();
34 
35  const HardwareConfig& hwConf;
36  std::unique_ptr<DACSound8U> dac; // can be nullptr
37 };
38 
39 } // namespace openmsx
40 
41 #endif
openmsx::HardwareConfig
HardwareConfig
Definition: HardwareConfig.cc:459
openmsx::PrinterPortSimpl::PrinterPortSimpl
PrinterPortSimpl(const HardwareConfig &hwConf)
Definition: PrinterPortSimpl.cc:10
openmsx::PrinterPortSimpl::getStatus
bool getStatus(EmuTime::param time) override
Returns the STATUS signal: false = low = ready, true = high = not ready.
Definition: PrinterPortSimpl.cc:17
openmsx::PrinterPortSimpl::writeData
void writeData(byte data, EmuTime::param time) override
Sets the data signals.
Definition: PrinterPortSimpl.cc:27
PrinterPortDevice.hh
openmsx::PrinterPortSimpl::plugHelper
void plugHelper(Connector &connector, EmuTime::param time) override
Definition: PrinterPortSimpl.cc:46
openmsx::PrinterPortSimpl::getName
const std::string & getName() const override
Name used to identify this pluggable.
Definition: PrinterPortSimpl.cc:56
openmsx::PrinterPortSimpl::~PrinterPortSimpl
~PrinterPortSimpl() override
openmsx::PrinterPortSimpl::serialize
void serialize(Archive &ar, unsigned version)
Definition: PrinterPortSimpl.cc:68
openmsx::PrinterPortSimpl::getDescription
std::string_view getDescription() const override
Description for this pluggable.
Definition: PrinterPortSimpl.cc:62
openmsx::PrinterPortSimpl::setStrobe
void setStrobe(bool strobe, EmuTime::param time) override
Sets the strobe signal: false = low, true = high.
Definition: PrinterPortSimpl.cc:22
openmsx::Connector
Represents something you can plug devices into.
Definition: Connector.hh:20
openmsx::HardwareConfig
Definition: HardwareConfig.hh:21
openmsx::PrinterPortSimpl::unplugHelper
void unplugHelper(EmuTime::param time) override
Definition: PrinterPortSimpl.cc:51
openmsx::PrinterPortDevice
Definition: PrinterPortDevice.hh:9
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::PrinterPortSimpl
Definition: PrinterPortSimpl.hh:12