PrinterPortSimpl.hh 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef PRINTERPORTSIMPLE_HH
  2. #define PRINTERPORTSIMPLE_HH
  3. #include "PrinterPortDevice.hh"
  4. #include <memory>
  5. namespace openmsx {
  6. class HardwareConfig;
  7. class DACSound8U;
  8. class PrinterPortSimpl final : public PrinterPortDevice
  9. {
  10. public:
  11. explicit PrinterPortSimpl(const HardwareConfig& hwConf);
  12. ~PrinterPortSimpl() override;
  13. // PrinterPortDevice
  14. bool getStatus(EmuTime::param time) override;
  15. void setStrobe(bool strobe, EmuTime::param time) override;
  16. void writeData(byte data, EmuTime::param time) override;
  17. // Pluggable
  18. const std::string& getName() const override;
  19. std::string_view getDescription() const override;
  20. void plugHelper(Connector& connector, EmuTime::param time) override;
  21. void unplugHelper(EmuTime::param time) override;
  22. template<typename Archive>
  23. void serialize(Archive& ar, unsigned version);
  24. private:
  25. void createDAC();
  26. const HardwareConfig& hwConf;
  27. std::unique_ptr<DACSound8U> dac; // can be nullptr
  28. };
  29. } // namespace openmsx
  30. #endif