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  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
Represents something you can plug devices into.
Definition: Connector.hh:20
void serialize(Archive &ar, unsigned version)
void plugHelper(Connector &connector, EmuTime::param time) override
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
void unplugHelper(EmuTime::param time) override
constexpr auto data(C &c) -> decltype(c.data())
Definition: span.hh:69
void setStrobe(bool strobe, EmuTime::param time) override
Sets the strobe signal: false = low, true = high.
PrinterPortSimpl(const HardwareConfig &hwConf)
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
const std::string & getName() const override
Name used to identify this pluggable.
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
bool getStatus(EmuTime::param time) override
Returns the STATUS signal: false = low = ready, true = high = not ready.
void writeData(byte data, EmuTime::param time) override
Sets the data signals.
string_view getDescription() const override
Description for this pluggable.