openMSX
Public Types | Public Member Functions | Static Public Attributes | List of all members
openmsx::DiskDrive Class Referenceabstract

This (abstract) class defines the DiskDrive interface. More...

#include <DiskDrive.hh>

Inheritance diagram for openmsx::DiskDrive:
Inheritance graph
[legend]

Public Types

enum class  TrackMode { NORMAL , YAMAHA_FD_03 }
 

Public Member Functions

virtual ~DiskDrive ()=default
 
virtual bool isDiskInserted () const =0
 Is drive ready?
 
virtual bool isWriteProtected () const =0
 Is disk write protected?
 
virtual bool isDoubleSided ()=0
 Is disk double sided?
 
virtual bool isTrack00 () const =0
 Head above track 0.
 
virtual void setSide (bool side)=0
 Side select.
 
virtual bool getSide () const =0
 
virtual void step (bool direction, EmuTime::param time)=0
 Step head.
 
virtual void setMotor (bool status, EmuTime::param time)=0
 Set motor on/off.
 
virtual bool getMotor () const =0
 Returns the previously set motor status.
 
virtual bool indexPulse (EmuTime::param time)=0
 Gets the state of the index pulse.
 
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.
 
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 &sector)=0
 
virtual void flushTrack ()=0
 
virtual bool diskChanged ()=0
 Is disk changed?
 
virtual bool peekDiskChanged () const =0
 
virtual bool isDummyDrive () const =0
 Is there a dummy (unconnected) drive?
 
virtual void applyWd2793ReadTrackQuirk ()=0
 See RawTrack::applyWd2793ReadTrackQuirk()
 
virtual void invalidateWd2793ReadTrackQuirk ()=0
 

Static Public Attributes

static constexpr unsigned ROTATIONS_PER_SECOND = 5
 

Detailed Description

This (abstract) class defines the DiskDrive interface.

Definition at line 12 of file DiskDrive.hh.

Member Enumeration Documentation

◆ TrackMode

enum class openmsx::DiskDrive::TrackMode
strong
Enumerator
NORMAL 
YAMAHA_FD_03 

Definition at line 15 of file DiskDrive.hh.

Constructor & Destructor Documentation

◆ ~DiskDrive()

virtual openmsx::DiskDrive::~DiskDrive ( )
virtualdefault

Member Function Documentation

◆ applyWd2793ReadTrackQuirk()

virtual void openmsx::DiskDrive::applyWd2793ReadTrackQuirk ( )
pure virtual

◆ diskChanged()

virtual bool openmsx::DiskDrive::diskChanged ( )
pure virtual

Is disk changed?

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ flushTrack()

virtual void openmsx::DiskDrive::flushTrack ( )
pure virtual

◆ getMotor()

virtual bool openmsx::DiskDrive::getMotor ( ) const
pure virtual

Returns the previously set motor status.

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ getNextSector()

virtual EmuTime openmsx::DiskDrive::getNextSector ( EmuTime::param  time,
RawTrack::Sector sector 
)
pure virtual

◆ getSide()

virtual bool openmsx::DiskDrive::getSide ( ) const
pure virtual

◆ getTimeTillIndexPulse()

virtual EmuTime openmsx::DiskDrive::getTimeTillIndexPulse ( EmuTime::param  time,
int  count = 1 
)
pure virtual

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.

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ getTrackLength()

virtual unsigned openmsx::DiskDrive::getTrackLength ( )
pure virtual

◆ indexPulse()

virtual bool openmsx::DiskDrive::indexPulse ( EmuTime::param  time)
pure virtual

Gets the state of the index pulse.

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

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

Referenced by openmsx::WD2793::getStatusReg().

◆ invalidateWd2793ReadTrackQuirk()

virtual void openmsx::DiskDrive::invalidateWd2793ReadTrackQuirk ( )
pure virtual

◆ isDiskInserted()

virtual bool openmsx::DiskDrive::isDiskInserted ( ) const
pure virtual

Is drive ready?

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ isDoubleSided()

virtual bool openmsx::DiskDrive::isDoubleSided ( )
pure virtual

Is disk double sided?

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ isDummyDrive()

virtual bool openmsx::DiskDrive::isDummyDrive ( ) const
pure virtual

Is there a dummy (unconnected) drive?

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ isTrack00()

virtual bool openmsx::DiskDrive::isTrack00 ( ) const
pure virtual

Head above track 0.

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

Referenced by openmsx::WD2793::getStatusReg().

◆ isWriteProtected()

virtual bool openmsx::DiskDrive::isWriteProtected ( ) const
pure virtual

Is disk write protected?

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

Referenced by openmsx::WD2793::getStatusReg().

◆ peekDiskChanged()

virtual bool openmsx::DiskDrive::peekDiskChanged ( ) const
pure virtual

◆ readTrackByte()

virtual uint8_t openmsx::DiskDrive::readTrackByte ( int  idx)
pure virtual

◆ setMotor()

virtual void openmsx::DiskDrive::setMotor ( bool  status,
EmuTime::param  time 
)
pure virtual

Set motor on/off.

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

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ setSide()

virtual void openmsx::DiskDrive::setSide ( bool  side)
pure virtual

Side select.

Parameters
sidefalse = side 0, true = side 1.

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ step()

virtual void openmsx::DiskDrive::step ( bool  direction,
EmuTime::param  time 
)
pure virtual

Step head.

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

Implemented in openmsx::DummyDrive, openmsx::DriveMultiplexer, and openmsx::RealDrive.

◆ writeTrackByte()

virtual void openmsx::DiskDrive::writeTrackByte ( int  idx,
uint8_t  val,
bool  addIdam = false 
)
pure virtual

Member Data Documentation

◆ ROTATIONS_PER_SECOND

constexpr unsigned openmsx::DiskDrive::ROTATIONS_PER_SECOND = 5
staticconstexpr

Definition at line 20 of file DiskDrive.hh.


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