21 : cassettePlayerCommand(
23 motherBoard.getCommandController(),
24 motherBoard.getStateChangeDistributor(),
25 motherBoard.getScheduler())
45#if COMPONENT_LASERDISC
56 :
Connector(hwConf.getMotherBoard().getPluggingController(),
"cassetteport",
58 , motherBoard(hwConf.getMotherBoard())
60 auto player = std::make_unique<CassettePlayer>(hwConf);
61 cassettePlayer = player.get();
74 motorControl = status;
75 getPluggedCasDev().
setMotor(status, time);
82 getPluggedCasDev().
setSignal(output, time);
96 #if COMPONENT_LASERDISC
97 if (!motorControl && laserdiscPlayer) {
98 return laserdiscPlayer->readSample(time);
106#if COMPONENT_LASERDISC
107void CassettePort::setLaserdiscPlayer(
LaserdiscPlayer *laserdiscPlayer_)
109 laserdiscPlayer = laserdiscPlayer_;
115 return "MSX Cassette port";
120 return "Cassette Port";
125 return *checked_cast<CassetteDevice*>(&
getPlugged());
128template<
typename Archive>
131 ar.template serializeBase<Connector>(*
this);
136 if (ar.versionAtLeast(version, 2)) {
138 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.
DummyCassettePort(MSXMotherBoard &motherBoard)
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)