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#include <cstdint>
7
8namespace openmsx {
9
10class PrinterPortDevice;
11
12class SVIPrinterPort final : public MSXDevice, public Connector
13{
14public:
15 explicit SVIPrinterPort(const DeviceConfig& config);
16
17 [[nodiscard]] PrinterPortDevice& getPluggedPrintDev() const;
18
19 // MSXDevice
20 void reset(EmuTime::param time) override;
21 [[nodiscard]] uint8_t readIO(uint16_t port, EmuTime::param time) override;
22 [[nodiscard]] uint8_t peekIO(uint16_t port, EmuTime::param time) const override;
23 void writeIO(uint16_t port, uint8_t value, EmuTime::param time) override;
24
25 // Connector
26 [[nodiscard]] std::string_view getDescription() const override;
27 [[nodiscard]] std::string_view getClass() const override;
28 void plug(Pluggable& dev, EmuTime::param time) override;
29
30 template<typename Archive>
31 void serialize(Archive& ar, unsigned version);
32
33private:
34 void setStrobe(bool newStrobe, EmuTime::param time);
35 void writeData(uint8_t newData, EmuTime::param time);
36
37private:
38 bool strobe = false; // != true
39 uint8_t data = 255; // != 0
40};
41
42} // namespace openmsx
43
44#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:36
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.
void writeIO(uint16_t port, uint8_t value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
uint8_t peekIO(uint16_t port, EmuTime::param time) const override
Read a byte from a given IO port.
std::string_view getDescription() const override
Get a description for this connector.
uint8_t readIO(uint16_t port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
void reset(EmuTime::param time) override
This method is called on reset.
PrinterPortDevice & getPluggedPrintDev() const
This file implemented 3 utility functions:
Definition Autofire.cc:11