openMSX
SVIPrinterPort.hh
Go to the documentation of this file.
1 #ifndef SVIPRINTERPORT_HH
2 #define SVIPRINTERPORT_HH
3 
4 #include "MSXDevice.hh"
5 #include "Connector.hh"
6 
7 namespace openmsx {
8 
9 class PrinterPortDevice;
10 
11 class SVIPrinterPort final : public MSXDevice, public Connector
12 {
13 public:
14  SVIPrinterPort(const DeviceConfig& config);
15 
16  [[nodiscard]] PrinterPortDevice& getPluggedPrintDev() const;
17 
18  // MSXDevice
19  void reset(EmuTime::param time) override;
20  [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
21  [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
22  void writeIO(word port, byte value, EmuTime::param time) override;
23 
24  // Connector
25  [[nodiscard]] std::string_view getDescription() const override;
26  [[nodiscard]] std::string_view getClass() const override;
27  void plug(Pluggable& dev, EmuTime::param time) override;
28 
29  template<typename Archive>
30  void serialize(Archive& ar, unsigned version);
31 
32 private:
33  void setStrobe(bool newStrobe, EmuTime::param time);
34  void writeData(byte newData, EmuTime::param time);
35 
36 private:
37  bool strobe;
38  byte data;
39 };
40 
41 } // namespace openmsx
42 
43 #endif
Represents something you can plug devices into.
Definition: Connector.hh:21
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
void serialize(Archive &ar, unsigned version)
void plug(Pluggable &dev, EmuTime::param time) override
This plugs a Pluggable in this Connector.
std::string_view getClass() const override
A Connector belong to a certain class.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
SVIPrinterPort(const DeviceConfig &config)
std::string_view getDescription() const override
Get a description for this connector.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void reset(EmuTime::param time) override
This method is called on reset.
PrinterPortDevice & getPluggedPrintDev() const
This file implemented 3 utility functions:
Definition: Autofire.cc:5
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29