27 setStrobe(
true, time);
43 switch (port & 0x01) {
45 writeData(value, time);
48 setStrobe(value & 1, time);
55void SVIPrinterPort::setStrobe(
bool newStrobe, EmuTime::param time)
57 if (newStrobe != strobe) {
62void SVIPrinterPort::writeData(uint8_t newData, EmuTime::param time)
64 if (newData != data) {
72 return "Spectravideo SVI-328 Printer port";
77 return "Printer Port";
89 return *checked_cast<PrinterPortDevice*>(&
getPlugged());
92template<
typename Archive>
95 ar.template serializeBase<MSXDevice>(*
this);
96 ar.template serializeBase<Connector>(*
this);
97 ar.serialize(
"strobe", strobe,
#define REGISTER_MSXDEVICE(CLASS, NAME)
Represents something you can plug devices into.
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
virtual void plug(Pluggable &device, EmuTime::param time)
This plugs a Pluggable in this Connector.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
EmuTime::param getCurrentTime() const
virtual bool getStatus(EmuTime::param time)=0
Returns the STATUS signal: false = low = ready, true = high = not ready.
virtual void writeData(uint8_t data, EmuTime::param time)=0
Sets the data signals.
virtual void setStrobe(bool strobe, EmuTime::param time)=0
Sets the strobe signal: false = low, true = high.
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.
SVIPrinterPort(const DeviceConfig &config)
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:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)