36#if COMPONENT_LASERDISC
47 :
Connector(hwConf.getMotherBoard().getPluggingController(),
"cassetteport",
49 , motherBoard(hwConf.getMotherBoard())
51 auto player = std::make_unique<CassettePlayer>(hwConf);
52 cassettePlayer = player.get();
65 motorControl = status;
66 getPluggedCasDev().
setMotor(status, time);
73 getPluggedCasDev().
setSignal(output, time);
87 #if COMPONENT_LASERDISC
88 if (!motorControl && laserdiscPlayer) {
89 return laserdiscPlayer->readSample(time);
97#if COMPONENT_LASERDISC
100 laserdiscPlayer = laserdiscPlayer_;
106 return "MSX Cassette port";
111 return "Cassette Port";
116 return *checked_cast<CassetteDevice*>(&
getPlugged());
119template<
typename Archive>
122 ar.template serializeBase<Connector>(*
this);
127 if (ar.versionAtLeast(version, 2)) {
129 ar.serializeOnlyOnce(
"cassettePlayer", *cassettePlayer);
virtual int16_t readSample(EmuTime::param time)=0
Read wave data from cassette device.
virtual void setSignal(bool output, EmuTime::param time)=0
Sets the cassette output signal false = low true = high.
virtual void setMotor(bool status, EmuTime::param time)=0
Sets the cassette motor relay false = off true = on.
bool cassetteIn(EmuTime::param time) override
Reads one bit from the cassette port.
void cassetteOut(bool output, EmuTime::param time) override
Writes one bit to the cassette port.
bool lastOut() const override
last bit written to CasOut.
void serialize(Archive &ar, unsigned version)
std::string_view getClass() const override
A Connector belong to a certain class.
CassettePort(const HardwareConfig &hwConf)
void setMotor(bool status, EmuTime::param time) override
Sets the cassette motor relay false = off true = on.
std::string_view getDescription() const override
Get a description for this connector.
Represents something you can plug devices into.
Pluggable & getPlugged() const
Returns the Pluggable currently plugged in.
virtual void unplug(EmuTime::param time)
This unplugs the currently inserted Pluggable from this Connector.
PluggingController & getPluggingController() const
bool lastOut() const override
last bit written to CasOut.
bool cassetteIn(EmuTime::param time) override
Reads one bit from the cassette port.
void cassetteOut(bool output, EmuTime::param time) override
Writes one bit to the cassette port.
void setMotor(bool status, EmuTime::param time) override
Sets the cassette motor relay false = off true = on.
EmuTime::param getCurrentTime() const
Convenience method: This is the same as getScheduler().getCurrentTime().
void registerPluggable(std::unique_ptr< Pluggable > pluggable)
Add a Pluggable to the registry.
This file implemented 3 utility functions:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)