openMSX
Public Member Functions | List of all members
openmsx::CassettePort Class Referencefinal

#include <CassettePort.hh>

Inheritance diagram for openmsx::CassettePort:
Inheritance graph
[legend]
Collaboration diagram for openmsx::CassettePort:
Collaboration graph
[legend]

Public Member Functions

 CassettePort (const HardwareConfig &hwConf)
 
 ~CassettePort () override
 
void setMotor (bool status, EmuTime::param time) override
 Sets the cassette motor relay false = off true = on. More...
 
void cassetteOut (bool output, EmuTime::param time) override
 Writes one bit to the cassette port. More...
 
bool cassetteIn (EmuTime::param time) override
 Reads one bit from the cassette port. More...
 
void setLaserdiscPlayer (LaserdiscPlayer *laserdisc) override
 Set the Laserdisc Player; when the motor control is off, sound is read from the laserdisc. More...
 
bool lastOut () const override
 last bit written to CasOut. More...
 
std::string_view getDescription () const override
 Get a description for this connector. More...
 
std::string_view getClass () const override
 A Connector belong to a certain class. More...
 
void unplug (EmuTime::param time) override
 This unplugs the currently inserted Pluggable from this Connector. More...
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 
- Public Member Functions inherited from openmsx::CassettePortInterface
virtual ~CassettePortInterface ()=default
 
virtual void setMotor (bool status, EmuTime::param time)=0
 Sets the cassette motor relay false = off true = on. More...
 
virtual void cassetteOut (bool output, EmuTime::param time)=0
 Writes one bit to the cassette port. More...
 
virtual bool lastOut () const =0
 last bit written to CasOut. More...
 
virtual bool cassetteIn (EmuTime::param time)=0
 Reads one bit from the cassette port. More...
 
virtual void setLaserdiscPlayer (LaserdiscPlayer *laserdisc)=0
 Set the Laserdisc Player; when the motor control is off, sound is read from the laserdisc. More...
 
- Public Member Functions inherited from openmsx::Connector
 Connector (const Connector &)=delete
 
Connectoroperator= (const Connector &)=delete
 
const std::string & getName () const
 Name that identifies this connector. More...
 
virtual std::string_view getDescription () const =0
 Get a description for this connector. More...
 
virtual std::string_view getClass () const =0
 A Connector belong to a certain class. More...
 
virtual void plug (Pluggable &device, EmuTime::param time)
 This plugs a Pluggable in this Connector. More...
 
virtual void unplug (EmuTime::param time)
 This unplugs the currently inserted Pluggable from this Connector. More...
 
PluggablegetPlugged () const
 Returns the Pluggable currently plugged in. More...
 
PluggingControllergetPluggingController () const
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::Connector
 Connector (PluggingController &pluggingController, std::string name, std::unique_ptr< Pluggable > dummy)
 Creates a new Connector. More...
 
 ~Connector ()
 

Detailed Description

Definition at line 63 of file CassettePort.hh.

Constructor & Destructor Documentation

◆ CassettePort()

openmsx::CassettePort::CassettePort ( const HardwareConfig hwConf)
explicit

◆ ~CassettePort()

openmsx::CassettePort::~CassettePort ( )
override

Definition at line 56 of file CassettePort.cc.

References openmsx::MSXMotherBoard::getCurrentTime(), and unplug().

Member Function Documentation

◆ cassetteIn()

bool openmsx::CassettePort::cassetteIn ( EmuTime::param  time)
overridevirtual

Reads one bit from the cassette port.

From the RedBook: The cassette input is used to read the signal from the cassette EAR output. This is passed through a comparator to clean the edges and to convert to digital levels, but is otherwise unprocessed.

Implements openmsx::CassettePortInterface.

Definition at line 81 of file CassettePort.cc.

References openmsx::LaserdiscPlayer::readSample(), and openmsx::CassetteDevice::readSample().

◆ cassetteOut()

void openmsx::CassettePort::cassetteOut ( bool  output,
EmuTime::param  time 
)
overridevirtual

Writes one bit to the cassette port.

From the RedBook: The CasOut bit is filtered and attenuated before being taken to the cassette DIN socket as the MIC signal. All cassette tone generation is performed in software.

Implements openmsx::CassettePortInterface.

Definition at line 69 of file CassettePort.cc.

References openmsx::CassetteDevice::setSignal().

◆ getClass()

std::string_view openmsx::CassettePort::getClass ( ) const
overridevirtual

A Connector belong to a certain class.

Only Pluggables of this class can be plugged in this Connector.

Implements openmsx::Connector.

Definition at line 114 of file CassettePort.cc.

◆ getDescription()

std::string_view openmsx::CassettePort::getDescription ( ) const
overridevirtual

Get a description for this connector.

Implements openmsx::Connector.

Definition at line 109 of file CassettePort.cc.

◆ lastOut()

bool openmsx::CassettePort::lastOut ( ) const
overridevirtual

last bit written to CasOut.

for use in Pluggable::plugHelper()

Implements openmsx::CassettePortInterface.

Definition at line 76 of file CassettePort.cc.

◆ serialize()

template<typename Archive >
void openmsx::CassettePort::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 125 of file CassettePort.cc.

◆ setLaserdiscPlayer()

void openmsx::CassettePort::setLaserdiscPlayer ( LaserdiscPlayer laserdisc)
overridevirtual

Set the Laserdisc Player; when the motor control is off, sound is read from the laserdisc.

Implements openmsx::CassettePortInterface.

Definition at line 98 of file CassettePort.cc.

◆ setMotor()

void openmsx::CassettePort::setMotor ( bool  status,
EmuTime::param  time 
)
overridevirtual

Sets the cassette motor relay false = off true = on.

Implements openmsx::CassettePortInterface.

Definition at line 62 of file CassettePort.cc.

References openmsx::CassetteDevice::setMotor().

◆ unplug()

void openmsx::CassettePort::unplug ( EmuTime::param  time)
overridevirtual

This unplugs the currently inserted Pluggable from this Connector.

It is replaced by the dummy Pluggable provided by the concrete Connector subclass.

Reimplemented from openmsx::Connector.

Definition at line 104 of file CassettePort.cc.

References openmsx::Connector::unplug().

Referenced by ~CassettePort().


The documentation for this class was generated from the following files: