openMSX
|
This class connects to a FDC as a normal DiskDrive and delegates all requests to one of four other DiskDrives. More...
#include <DriveMultiplexer.hh>
Public Types | |
enum | DriveNum { DRIVE_A = 0 , DRIVE_B = 1 , DRIVE_C = 2 , DRIVE_D = 3 , NO_DRIVE = 4 } |
![]() | |
enum class | TrackMode { NORMAL , YAMAHA_FD_03 } |
Public Member Functions | |
DriveMultiplexer (std::span< std::unique_ptr< DiskDrive >, 4 > drv) | |
void | selectDrive (DriveNum num, EmuTime::param time) |
DriveNum | getSelectedDrive () const |
bool | isDiskInserted () const override |
Is drive ready? More... | |
bool | isWriteProtected () const override |
Is disk write protected? More... | |
bool | isDoubleSided () override |
Is disk double sided? More... | |
bool | isTrack00 () const override |
Head above track 0. More... | |
void | setSide (bool side) override |
Side select. More... | |
bool | getSide () const override |
void | step (bool direction, EmuTime::param time) override |
Step head. More... | |
void | setMotor (bool status, EmuTime::param time) override |
Set motor on/off. More... | |
bool | getMotor () const override |
Returns the previously set motor status. More... | |
bool | indexPulse (EmuTime::param time) override |
Gets the state of the index pulse. More... | |
EmuTime | getTimeTillIndexPulse (EmuTime::param time, int count) override |
Return the time till the start of the next index pulse When there is no disk in the drive or when the disk is not spinning, this function returns the current time. More... | |
unsigned | getTrackLength () override |
void | writeTrackByte (int idx, uint8_t val, bool addIdam) override |
uint8_t | readTrackByte (int idx) override |
EmuTime | getNextSector (EmuTime::param time, RawTrack::Sector §or) override |
void | flushTrack () override |
bool | diskChanged () override |
Is disk changed? More... | |
bool | peekDiskChanged () const override |
bool | isDummyDrive () const override |
Is there a dummy (unconnected) drive? More... | |
void | applyWd2793ReadTrackQuirk () override |
See RawTrack::applyWd2793ReadTrackQuirk() More... | |
void | invalidateWd2793ReadTrackQuirk () override |
bool | isDiskInserted (DriveNum num) const |
bool | diskChanged (DriveNum num) |
bool | peekDiskChanged (DriveNum num) const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
![]() | |
virtual | ~DiskDrive ()=default |
virtual bool | isDiskInserted () const =0 |
Is drive ready? More... | |
virtual bool | isWriteProtected () const =0 |
Is disk write protected? More... | |
virtual bool | isDoubleSided ()=0 |
Is disk double sided? More... | |
virtual bool | isTrack00 () const =0 |
Head above track 0. More... | |
virtual void | setSide (bool side)=0 |
Side select. More... | |
virtual bool | getSide () const =0 |
virtual void | step (bool direction, EmuTime::param time)=0 |
Step head. More... | |
virtual void | setMotor (bool status, EmuTime::param time)=0 |
Set motor on/off. More... | |
virtual bool | getMotor () const =0 |
Returns the previously set motor status. More... | |
virtual bool | indexPulse (EmuTime::param time)=0 |
Gets the state of the index pulse. More... | |
virtual EmuTime | getTimeTillIndexPulse (EmuTime::param time, int count=1)=0 |
Return the time till the start of the next index pulse When there is no disk in the drive or when the disk is not spinning, this function returns the current time. More... | |
virtual unsigned | getTrackLength ()=0 |
virtual void | writeTrackByte (int idx, uint8_t val, bool addIdam=false)=0 |
virtual uint8_t | readTrackByte (int idx)=0 |
virtual EmuTime | getNextSector (EmuTime::param time, RawTrack::Sector §or)=0 |
virtual void | flushTrack ()=0 |
virtual bool | diskChanged ()=0 |
Is disk changed? More... | |
virtual bool | peekDiskChanged () const =0 |
virtual bool | isDummyDrive () const =0 |
Is there a dummy (unconnected) drive? More... | |
virtual void | applyWd2793ReadTrackQuirk ()=0 |
See RawTrack::applyWd2793ReadTrackQuirk() More... | |
virtual void | invalidateWd2793ReadTrackQuirk ()=0 |
Additional Inherited Members | |
![]() | |
static constexpr unsigned | ROTATIONS_PER_SECOND = 5 |
This class connects to a FDC as a normal DiskDrive and delegates all requests to one of four other DiskDrives.
Definition at line 15 of file DriveMultiplexer.hh.
Enumerator | |
---|---|
DRIVE_A | |
DRIVE_B | |
DRIVE_C | |
DRIVE_D | |
NO_DRIVE |
Definition at line 18 of file DriveMultiplexer.hh.
|
explicit |
|
overridevirtual |
See RawTrack::applyWd2793ReadTrackQuirk()
Implements openmsx::DiskDrive.
Definition at line 137 of file DriveMultiplexer.cc.
|
overridevirtual |
Is disk changed?
Implements openmsx::DiskDrive.
Definition at line 112 of file DriveMultiplexer.cc.
Referenced by openmsx::CanonFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::YamahaFDC::readMem(), and openmsx::YamahaFDC::writeMem().
bool openmsx::DriveMultiplexer::diskChanged | ( | DriveNum | num | ) |
Definition at line 117 of file DriveMultiplexer.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 107 of file DriveMultiplexer.cc.
|
overridevirtual |
Returns the previously set motor status.
Implements openmsx::DiskDrive.
Definition at line 72 of file DriveMultiplexer.cc.
Referenced by openmsx::ToshibaFDC::peekMem().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 102 of file DriveMultiplexer.cc.
|
inline |
Definition at line 30 of file DriveMultiplexer.hh.
Referenced by openmsx::ToshibaFDC::peekMem().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 51 of file DriveMultiplexer.cc.
Referenced by openmsx::ToshibaFDC::peekMem().
|
overridevirtual |
Return the time till the start of the next index pulse When there is no disk in the drive or when the disk is not spinning, this function returns the current time.
time | The current time |
count | Number of required index pulses. |
Implements openmsx::DiskDrive.
Definition at line 82 of file DriveMultiplexer.cc.
References LZ4::count().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 87 of file DriveMultiplexer.cc.
|
overridevirtual |
Gets the state of the index pulse.
time | The moment in emulated time to get the pulse state for. |
Implements openmsx::DiskDrive.
Definition at line 77 of file DriveMultiplexer.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 142 of file DriveMultiplexer.cc.
|
overridevirtual |
Is drive ready?
Implements openmsx::DiskDrive.
Definition at line 25 of file DriveMultiplexer.cc.
Referenced by openmsx::YamahaFDC::peekMem(), and openmsx::YamahaFDC::readMem().
bool openmsx::DriveMultiplexer::isDiskInserted | ( | DriveNum | num | ) | const |
Definition at line 30 of file DriveMultiplexer.cc.
|
overridevirtual |
Is disk double sided?
Implements openmsx::DiskDrive.
Definition at line 40 of file DriveMultiplexer.cc.
|
overridevirtual |
Is there a dummy (unconnected) drive?
Implements openmsx::DiskDrive.
Definition at line 132 of file DriveMultiplexer.cc.
|
overridevirtual |
Head above track 0.
Implements openmsx::DiskDrive.
Definition at line 61 of file DriveMultiplexer.cc.
|
overridevirtual |
Is disk write protected?
Implements openmsx::DiskDrive.
Definition at line 35 of file DriveMultiplexer.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 122 of file DriveMultiplexer.cc.
Referenced by openmsx::CanonFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::YamahaFDC::peekMem(), and openmsx::YamahaFDC::readMem().
bool openmsx::DriveMultiplexer::peekDiskChanged | ( | DriveNum | num | ) | const |
Definition at line 127 of file DriveMultiplexer.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 97 of file DriveMultiplexer.cc.
void openmsx::DriveMultiplexer::selectDrive | ( | DriveNum | num, |
EmuTime::param | time | ||
) |
Definition at line 15 of file DriveMultiplexer.cc.
Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().
void openmsx::DriveMultiplexer::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 158 of file DriveMultiplexer.cc.
|
overridevirtual |
Set motor on/off.
status | false = off, true = on. |
time | The moment in emulated time this action takes place. |
Implements openmsx::DiskDrive.
Definition at line 66 of file DriveMultiplexer.cc.
Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().
|
overridevirtual |
Side select.
side | false = side 0, true = side 1. |
Implements openmsx::DiskDrive.
Definition at line 45 of file DriveMultiplexer.cc.
Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().
|
overridevirtual |
Step head.
direction | false = out, true = in. |
time | The moment in emulated time this action takes place. |
Implements openmsx::DiskDrive.
Definition at line 56 of file DriveMultiplexer.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 92 of file DriveMultiplexer.cc.