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

This class implements a real drive, single or double sided. More...

#include <RealDrive.hh>

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

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 () const 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 &sector) override
 
void flushTrack () override
 
bool diskChanged () override
 Is disk changed? More...
 
bool peekDiskChanged () const override
 
bool isDummyDrive () const override
 Is there a dummy (unconncted) drive? More...
 
void applyWd2793ReadTrackQuirk () override
 See RawTrack::applyWd2793ReadTrackQuirk() More...
 
void invalidateWd2793ReadTrackQuirk () override
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 
- Public Member Functions inherited from openmsx::DiskDrive
virtual ~DiskDrive ()=default
 

Additional Inherited Members

- Public Types inherited from openmsx::DiskDrive
enum  TrackMode { TrackMode::NORMAL, TrackMode::YAMAHA_FD_03 }
 
- Static Public Attributes inherited from openmsx::DiskDrive
static constexpr unsigned ROTATIONS_PER_SECOND = 5
 

Detailed Description

This class implements a real drive, single or double sided.

Definition at line 21 of file RealDrive.hh.

Constructor & Destructor Documentation

◆ RealDrive()

openmsx::RealDrive::RealDrive ( MSXMotherBoard motherBoard,
EmuDuration::param  motorTimeout,
bool  signalsNeedMotorOn,
bool  doubleSided,
DiskDrive::TrackMode  trackMode 
)

◆ ~RealDrive()

openmsx::RealDrive::~RealDrive ( )
override

Member Function Documentation

◆ applyWd2793ReadTrackQuirk()

void openmsx::RealDrive::applyWd2793ReadTrackQuirk ( )
overridevirtual

◆ diskChanged()

bool openmsx::RealDrive::diskChanged ( )
overridevirtual

Is disk changed?

Implements openmsx::DiskDrive.

Definition at line 430 of file RealDrive.cc.

◆ flushTrack()

void openmsx::RealDrive::flushTrack ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 420 of file RealDrive.cc.

Referenced by ~RealDrive().

◆ getMotor()

bool openmsx::RealDrive::getMotor ( ) const
overridevirtual

Returns the previously set motor status.

Implements openmsx::DiskDrive.

Definition at line 259 of file RealDrive.cc.

◆ getNextSector()

EmuTime openmsx::RealDrive::getNextSector ( EmuTime::param  time,
RawTrack::Sector sector 
)
overridevirtual

◆ getSide()

bool openmsx::RealDrive::getSide ( ) const
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 111 of file RealDrive.cc.

◆ getTimeTillIndexPulse()

EmuTime openmsx::RealDrive::getTimeTillIndexPulse ( EmuTime::param  time,
int  count 
)
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.

Parameters
timeThe current time
countNumber of required index pulses.

Implements openmsx::DiskDrive.

Definition at line 328 of file RealDrive.cc.

References LZ4::count(), openmsx::Clock< TICKS_PER_ROTATION *ROTATIONS_PER_SECOND >::duration(), and isDiskInserted().

◆ getTrackLength()

unsigned openmsx::RealDrive::getTrackLength ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 367 of file RealDrive.cc.

References openmsx::RawTrack::getLength().

◆ indexPulse()

bool openmsx::RealDrive::indexPulse ( EmuTime::param  time)
overridevirtual

Gets the state of the index pulse.

Parameters
timeThe moment in emulated time to get the pulse state for.

Implements openmsx::DiskDrive.

Definition at line 317 of file RealDrive.cc.

References isDiskInserted().

◆ invalidateWd2793ReadTrackQuirk()

void openmsx::RealDrive::invalidateWd2793ReadTrackQuirk ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 450 of file RealDrive.cc.

◆ isDiskInserted()

bool openmsx::RealDrive::isDiskInserted ( ) const
overridevirtual

Is drive ready?

Implements openmsx::DiskDrive.

Definition at line 72 of file RealDrive.cc.

Referenced by getTimeTillIndexPulse(), and indexPulse().

◆ isDoubleSided()

bool openmsx::RealDrive::isDoubleSided ( ) const
overridevirtual

Is disk double sided?

Implements openmsx::DiskDrive.

Definition at line 99 of file RealDrive.cc.

◆ isDummyDrive()

bool openmsx::RealDrive::isDummyDrive ( ) const
overridevirtual

Is there a dummy (unconncted) drive?

Implements openmsx::DiskDrive.

Definition at line 440 of file RealDrive.cc.

◆ isTrack00()

bool openmsx::RealDrive::isTrack00 ( ) const
overridevirtual

Head above track 0.

Implements openmsx::DiskDrive.

Definition at line 194 of file RealDrive.cc.

◆ isWriteProtected()

bool openmsx::RealDrive::isWriteProtected ( ) const
overridevirtual

Is disk write protected?

Implements openmsx::DiskDrive.

Definition at line 91 of file RealDrive.cc.

◆ peekDiskChanged()

bool openmsx::RealDrive::peekDiskChanged ( ) const
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 435 of file RealDrive.cc.

◆ readTrackByte()

byte openmsx::RealDrive::readTrackByte ( int  idx)
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 382 of file RealDrive.cc.

References openmsx::RawTrack::read().

◆ serialize()

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

◆ setMotor()

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

Set motor on/off.

Parameters
statusfalse = off, true = on.
timeThe moment in emulated time this action takes place.

Implements openmsx::DiskDrive.

Definition at line 204 of file RealDrive.cc.

References openmsx::LoadingIndicator::update().

◆ setSide()

void openmsx::RealDrive::setSide ( bool  side)
overridevirtual

Side select.

Parameters
sidefalse = side 0, true = side 1.

Implements openmsx::DiskDrive.

Definition at line 105 of file RealDrive.cc.

◆ step()

void openmsx::RealDrive::step ( bool  direction,
EmuTime::param  time 
)
overridevirtual

Step head.

Parameters
directionfalse = out, true = in.
timeThe moment in emulated time this action takes place.

Implements openmsx::DiskDrive.

Definition at line 173 of file RealDrive.cc.

◆ writeTrackByte()

void openmsx::RealDrive::writeTrackByte ( int  idx,
byte  val,
bool  addIdam 
)
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 373 of file RealDrive.cc.

References openmsx::RawTrack::write().


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