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)
 
 ~RealDrive ()
 
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...
 
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 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

- Static Public Attributes inherited from openmsx::DiskDrive
static const unsigned ROTATIONS_PER_SECOND = 5
 

Detailed Description

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

Definition at line 20 of file RealDrive.hh.

Constructor & Destructor Documentation

◆ RealDrive()

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

◆ ~RealDrive()

openmsx::RealDrive::~RealDrive ( )

Member Function Documentation

◆ applyWd2793ReadTrackQuirk()

void openmsx::RealDrive::applyWd2793ReadTrackQuirk ( )
overridevirtual

◆ diskChanged()

bool openmsx::RealDrive::diskChanged ( )
overridevirtual

Is disk changed?

Implements openmsx::DiskDrive.

Definition at line 351 of file RealDrive.cc.

◆ flushTrack()

void openmsx::RealDrive::flushTrack ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 343 of file RealDrive.cc.

Referenced by getTimeTillIndexPulse(), and ~RealDrive().

◆ getNextSector()

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

◆ 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 255 of file RealDrive.cc.

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

◆ getTrackLength()

unsigned openmsx::RealDrive::getTrackLength ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 290 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 244 of file RealDrive.cc.

References isDiskInserted().

◆ invalidateWd2793ReadTrackQuirk()

void openmsx::RealDrive::invalidateWd2793ReadTrackQuirk ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 371 of file RealDrive.cc.

◆ isDiskInserted()

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

Is drive ready?

Implements openmsx::DiskDrive.

Definition at line 69 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 96 of file RealDrive.cc.

◆ isDummyDrive()

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

Is there a dummy (unconncted) drive?

Implements openmsx::DiskDrive.

Definition at line 361 of file RealDrive.cc.

◆ isTrack00()

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

Head above track 0.

Implements openmsx::DiskDrive.

Definition at line 129 of file RealDrive.cc.

◆ isWriteProtected()

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

Is disk write protected?

Implements openmsx::DiskDrive.

Definition at line 88 of file RealDrive.cc.

◆ peekDiskChanged()

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

Implements openmsx::DiskDrive.

Definition at line 356 of file RealDrive.cc.

◆ readTrackByte()

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

Implements openmsx::DiskDrive.

Definition at line 305 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

◆ setSide()

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

Side select.

Parameters
sidefalse = side 0, true = side 1.

Implements openmsx::DiskDrive.

Definition at line 102 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 108 of file RealDrive.cc.

◆ writeTrackByte()

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

Implements openmsx::DiskDrive.

Definition at line 296 of file RealDrive.cc.

References openmsx::RawTrack::write().


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