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, 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 |
void | getMediaInfo (TclObject &result) override |
This method gets called when information is required on the media inserted in the media slot of the provider. More... | |
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 |
![]() | |
MediaInfoProvider (const MediaInfoProvider &)=delete | |
MediaInfoProvider & | operator= (const MediaInfoProvider &)=delete |
virtual void | getMediaInfo (TclObject &result)=0 |
This method gets called when information is required on the media inserted in the media slot of the provider. More... | |
Additional Inherited Members | |
![]() | |
enum class | TrackMode { NORMAL , YAMAHA_FD_03 } |
![]() | |
static constexpr unsigned | ROTATIONS_PER_SECOND = 5 |
![]() | |
MediaInfoProvider ()=default | |
~MediaInfoProvider ()=default | |
This class implements a real drive, single or double sided.
Definition at line 19 of file RealDrive.hh.
openmsx::RealDrive::RealDrive | ( | MSXMotherBoard & | motherBoard, |
EmuDuration::param | motorTimeout, | ||
bool | signalsNeedMotorOn, | ||
bool | doubleSided, | ||
DiskDrive::TrackMode | trackMode | ||
) |
Definition at line 20 of file RealDrive.cc.
References openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::MSXMotherBoard::getMSXCommandController(), openmsx::MSXMotherBoard::getSharedStuff(), openmsx::CliComm::HARDWARE, openmsx::MSXCommandController::hasCommand(), openmsx::MSXMotherBoard::registerMediaInfo(), and openmsx::CliComm::update().
|
override |
Definition at line 54 of file RealDrive.cc.
References flushTrack(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::HARDWARE, openmsx::MSXMotherBoard::unregisterMediaInfo(), and openmsx::CliComm::update().
|
overridevirtual |
See RawTrack::applyWd2793ReadTrackQuirk()
Implements openmsx::DiskDrive.
Definition at line 477 of file RealDrive.cc.
References openmsx::RawTrack::applyWd2793ReadTrackQuirk().
|
overridevirtual |
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 450 of file RealDrive.cc.
Referenced by ~RealDrive().
|
overridevirtual |
This method gets called when information is required on the media inserted in the media slot of the provider.
The provider must attach the info as a dictionary to the given TclObject.
Implements openmsx::MediaInfoProvider.
Definition at line 73 of file RealDrive.cc.
References openmsx::TclObject::addDictKeyValue(), openmsx::TclObject::addDictKeyValues(), openmsx::TclObject::addListElements(), and view::transform().
|
overridevirtual |
Returns the previously set motor status.
Implements openmsx::DiskDrive.
Definition at line 285 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 420 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 137 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 354 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 395 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 343 of file RealDrive.cc.
References isDiskInserted().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 482 of file RealDrive.cc.
|
overridevirtual |
Is drive ready?
Implements openmsx::DiskDrive.
Definition at line 98 of file RealDrive.cc.
Referenced by getTimeTillIndexPulse(), and indexPulse().
|
overridevirtual |
|
overridevirtual |
Is there a dummy (unconnected) drive?
Implements openmsx::DiskDrive.
Definition at line 472 of file RealDrive.cc.
|
overridevirtual |
|
overridevirtual |
Is disk write protected?
Implements openmsx::DiskDrive.
Definition at line 117 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 467 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 410 of file RealDrive.cc.
References openmsx::RawTrack::read().
void openmsx::RealDrive::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 495 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 230 of file RealDrive.cc.
References openmsx::LoadingIndicator::update().
|
overridevirtual |
Side select.
side | false = side 0, true = side 1. |
Implements openmsx::DiskDrive.
Definition at line 131 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 199 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 401 of file RealDrive.cc.
References openmsx::RawTrack::write().