openMSX
|
This class implements a real drive, single or double sided. More...
#include <RealDrive.hh>
Public Types | |
using | DrivesInUse = std::bitset< MAX_DRIVES > |
Public Types inherited from openmsx::DiskDrive | |
enum class | TrackMode { NORMAL , YAMAHA_FD_03 } |
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? | |
bool | isWriteProtected () const override |
Is disk write protected? | |
bool | isDoubleSided () override |
Is disk double sided? | |
bool | isTrack00 () const override |
Head above track 0. | |
void | setSide (bool side) override |
Side select. | |
bool | getSide () const override |
void | step (bool direction, EmuTime::param time) override |
Step head. | |
void | setMotor (bool status, EmuTime::param time) override |
Set motor on/off. | |
bool | getMotor () const override |
Returns the previously set motor status. | |
bool | indexPulse (EmuTime::param time) override |
Gets the state of the index pulse. | |
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. | |
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? | |
bool | peekDiskChanged () const override |
bool | isDummyDrive () const override |
Is there a dummy (unconnected) drive? | |
void | applyWd2793ReadTrackQuirk () override |
See RawTrack::applyWd2793ReadTrackQuirk() | |
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. | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Public Member Functions inherited from openmsx::DiskDrive | |
virtual | ~DiskDrive ()=default |
Public Member Functions inherited from openmsx::MediaInfoProvider | |
MediaInfoProvider (const MediaInfoProvider &)=delete | |
MediaInfoProvider (MediaInfoProvider &&)=delete | |
MediaInfoProvider & | operator= (const MediaInfoProvider &)=delete |
MediaInfoProvider & | operator= (MediaInfoProvider &&)=delete |
Static Public Member Functions | |
static std::shared_ptr< DrivesInUse > | getDrivesInUse (MSXMotherBoard &motherBoard) |
Static Public Attributes | |
static constexpr unsigned | MAX_DRIVES = 26 |
Static Public Attributes inherited from openmsx::DiskDrive | |
static constexpr unsigned | ROTATIONS_PER_SECOND = 5 |
Additional Inherited Members | |
Protected Member Functions inherited from openmsx::MediaInfoProvider | |
MediaInfoProvider ()=default | |
~MediaInfoProvider ()=default | |
This class implements a real drive, single or double sided.
Definition at line 19 of file RealDrive.hh.
using openmsx::RealDrive::DrivesInUse = std::bitset<MAX_DRIVES> |
Definition at line 23 of file RealDrive.hh.
openmsx::RealDrive::RealDrive | ( | MSXMotherBoard & | motherBoard, |
EmuDuration::param | motorTimeout, | ||
bool | signalsNeedMotorOn, | ||
bool | doubleSided, | ||
DiskDrive::TrackMode | trackMode | ||
) |
Definition at line 26 of file RealDrive.cc.
References getDrivesInUse(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::MSXMotherBoard::getMSXCommandController(), openmsx::CliComm::HARDWARE, openmsx::MSXCommandController::hasCommand(), MAX_DRIVES, openmsx::MSXMotherBoard::registerMediaInfo(), and openmsx::MSXCliComm::update().
|
override |
Definition at line 60 of file RealDrive.cc.
References flushTrack(), openmsx::MSXMotherBoard::getMSXCliComm(), openmsx::CliComm::HARDWARE, openmsx::MSXMotherBoard::unregisterMediaInfo(), and openmsx::MSXCliComm::update().
|
overridevirtual |
See RawTrack::applyWd2793ReadTrackQuirk()
Implements openmsx::DiskDrive.
Definition at line 484 of file RealDrive.cc.
References openmsx::RawTrack::applyWd2793ReadTrackQuirk().
|
overridevirtual |
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 457 of file RealDrive.cc.
Referenced by ~RealDrive().
|
static |
Definition at line 21 of file RealDrive.cc.
References openmsx::MSXMotherBoard::getSharedStuff().
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 79 of file RealDrive.cc.
References openmsx::TclObject::addDictKeyValue(), openmsx::TclObject::addDictKeyValues(), openmsx::TclObject::addListElements(), openmsx::SectorAccessibleDisk::SECTOR_SIZE, and view::transform().
|
overridevirtual |
Returns the previously set motor status.
Implements openmsx::DiskDrive.
Definition at line 292 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 427 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 147 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 361 of file RealDrive.cc.
References openmsx::Clock< TICKS_PER_ROTATION *ROTATIONS_PER_SECOND >::duration(), and isDiskInserted().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 402 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 350 of file RealDrive.cc.
References isDiskInserted().
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 489 of file RealDrive.cc.
|
overridevirtual |
Is drive ready?
Implements openmsx::DiskDrive.
Definition at line 108 of file RealDrive.cc.
Referenced by getTimeTillIndexPulse(), and indexPulse().
|
overridevirtual |
|
overridevirtual |
Is there a dummy (unconnected) drive?
Implements openmsx::DiskDrive.
Definition at line 479 of file RealDrive.cc.
|
overridevirtual |
|
overridevirtual |
Is disk write protected?
Implements openmsx::DiskDrive.
Definition at line 127 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 474 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 417 of file RealDrive.cc.
References openmsx::RawTrack::read().
void openmsx::RealDrive::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 502 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 237 of file RealDrive.cc.
References openmsx::LoadingIndicator::update().
|
overridevirtual |
Side select.
side | false = side 0, true = side 1. |
Implements openmsx::DiskDrive.
Definition at line 141 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 206 of file RealDrive.cc.
|
overridevirtual |
Implements openmsx::DiskDrive.
Definition at line 408 of file RealDrive.cc.
References openmsx::RawTrack::write().
|
staticconstexpr |
Definition at line 22 of file RealDrive.hh.
Referenced by RealDrive().