openMSX
|
This class implements a real drive, single or double sided. More...
#include <RealDrive.hh>
Public Member Functions | |
RealDrive (MSXMotherBoard &motherBoard, EmuDuration::param motorTimeout, bool signalsNeedMotorOn, bool doubleSided, DiskDrive::TrackMode trackMode) | |
~RealDrive () override | |
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, byte val, bool addIdam) override |
byte | 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 |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
![]() | |
virtual | ~DiskDrive ()=default |
Additional Inherited Members | |
![]() | |
enum class | TrackMode { NORMAL , YAMAHA_FD_03 } |
![]() | |
static constexpr unsigned | ROTATIONS_PER_SECOND = 5 |
This class implements a real drive, single or double sided.
Definition at line 20 of file RealDrive.hh.
openmsx::RealDrive::RealDrive | ( | MSXMotherBoard & | motherBoard, |
EmuDuration::param | motorTimeout, | ||
bool | signalsNeedMotorOn, | ||
bool | doubleSided, | ||
DiskDrive::TrackMode | trackMode | ||
) |
|
override |
Definition at line 52 of file RealDrive.cc.
References flushTrack(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::HARDWARE, and openmsx::CliComm::update().
|
overridevirtual |
See RawTrack::applyWd2793ReadTrackQuirk()
Implements openmsx::DiskDrive.
Definition at line 444 of file RealDrive.cc.
References openmsx::RawTrack::applyWd2793ReadTrackQuirk().
|
overridevirtual |
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 419 of file RealDrive.cc.
Referenced by ~RealDrive().
|
overridevirtual |
Returns the previously set motor status.
Implements openmsx::DiskDrive.
Definition at line 256 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 389 of file RealDrive.cc.
References openmsx::RawTrack::Sector::addrIdx, openmsx::RawTrack::decodeNextSector(), openmsx::Clock< TICKS_PER_ROTATION *ROTATIONS_PER_SECOND >::duration(), and openmsx::RawTrack::getLength().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 108 of file RealDrive.cc.
|
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 325 of file RealDrive.cc.
References LZ4::count(), openmsx::Clock< TICKS_PER_ROTATION *ROTATIONS_PER_SECOND >::duration(), and isDiskInserted().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 364 of file RealDrive.cc.
References openmsx::RawTrack::getLength().
|
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 314 of file RealDrive.cc.
References isDiskInserted().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 449 of file RealDrive.cc.
|
overridevirtual |
Is drive ready?
Implements openmsx::DiskDrive.
Definition at line 69 of file RealDrive.cc.
Referenced by getTimeTillIndexPulse(), and indexPulse().
|
overridevirtual |
|
overridevirtual |
Is there a dummy (unconnected) drive?
Implements openmsx::DiskDrive.
Definition at line 439 of file RealDrive.cc.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 434 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 379 of file RealDrive.cc.
References openmsx::RawTrack::read().
void openmsx::RealDrive::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 462 of file RealDrive.cc.
References openmsx::LedStatus::FDD, openmsx::MSXMotherBoard::getLedStatus(), openmsx::Schedulable::restoreOld(), and openmsx::LedStatus::setLed().
|
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 201 of file RealDrive.cc.
References openmsx::LoadingIndicator::update().
|
overridevirtual |
Side select.
side | false = side 0, true = side 1. |
Implements openmsx::DiskDrive.
Definition at line 102 of file RealDrive.cc.
|
overridevirtual |
Step head.
direction | false = out, true = in. |
time | The moment in emulated time this action takes place. |
Implements openmsx::DiskDrive.
Definition at line 170 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 370 of file RealDrive.cc.
References openmsx::RawTrack::write().