openMSX
Public Types | Public Member Functions | List of all members
openmsx::DriveMultiplexer Class Referencefinal

This class connects to a FDC as a normal DiskDrive and deligates all requests to one of four other DiskDrives. More...

#include <DriveMultiplexer.hh>

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

Public Types

enum  DriveNum {
  DRIVE_A = 0, DRIVE_B = 1, DRIVE_C = 2, DRIVE_D = 3,
  NO_DRIVE = 4
}
 

Public Member Functions

 DriveMultiplexer (DiskDrive *drive[4])
 
void selectDrive (DriveNum num, EmuTime::param time)
 
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 connects to a FDC as a normal DiskDrive and deligates all requests to one of four other DiskDrives.

Definition at line 12 of file DriveMultiplexer.hh.

Member Enumeration Documentation

◆ DriveNum

Enumerator
DRIVE_A 
DRIVE_B 
DRIVE_C 
DRIVE_D 
NO_DRIVE 

Definition at line 15 of file DriveMultiplexer.hh.

Constructor & Destructor Documentation

◆ DriveMultiplexer()

openmsx::DriveMultiplexer::DriveMultiplexer ( DiskDrive drive[4])
explicit

Definition at line 6 of file DriveMultiplexer.cc.

References DRIVE_A, DRIVE_B, DRIVE_C, DRIVE_D, and NO_DRIVE.

Member Function Documentation

◆ applyWd2793ReadTrackQuirk()

void openmsx::DriveMultiplexer::applyWd2793ReadTrackQuirk ( )
overridevirtual

◆ diskChanged()

bool openmsx::DriveMultiplexer::diskChanged ( )
overridevirtual

Is disk changed?

Implements openmsx::DiskDrive.

Definition at line 100 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::diskChanged().

◆ flushTrack()

void openmsx::DriveMultiplexer::flushTrack ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 95 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::flushTrack().

◆ getNextSector()

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

Implements openmsx::DiskDrive.

Definition at line 90 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::getNextSector().

◆ getTimeTillIndexPulse()

EmuTime openmsx::DriveMultiplexer::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 70 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::getTimeTillIndexPulse().

◆ getTrackLength()

unsigned openmsx::DriveMultiplexer::getTrackLength ( )
overridevirtual

Implements openmsx::DiskDrive.

Definition at line 75 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::getTrackLength().

◆ indexPulse()

bool openmsx::DriveMultiplexer::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 65 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::indexPulse().

◆ invalidateWd2793ReadTrackQuirk()

void openmsx::DriveMultiplexer::invalidateWd2793ReadTrackQuirk ( )
overridevirtual

◆ isDiskInserted()

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

Is drive ready?

Implements openmsx::DiskDrive.

Definition at line 28 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::isDiskInserted().

◆ isDoubleSided()

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

Is disk double sided?

Implements openmsx::DiskDrive.

Definition at line 38 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::isDoubleSided().

◆ isDummyDrive()

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

Is there a dummy (unconncted) drive?

Implements openmsx::DiskDrive.

Definition at line 110 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::isDummyDrive().

◆ isTrack00()

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

Head above track 0.

Implements openmsx::DiskDrive.

Definition at line 54 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::isTrack00().

◆ isWriteProtected()

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

Is disk write protected?

Implements openmsx::DiskDrive.

Definition at line 33 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::isWriteProtected().

◆ peekDiskChanged()

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

Implements openmsx::DiskDrive.

Definition at line 105 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::peekDiskChanged().

◆ readTrackByte()

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

Implements openmsx::DiskDrive.

Definition at line 85 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::readTrackByte().

◆ selectDrive()

void openmsx::DriveMultiplexer::selectDrive ( DriveNum  num,
EmuTime::param  time 
)

◆ serialize()

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

Definition at line 136 of file DriveMultiplexer.cc.

◆ setMotor()

void openmsx::DriveMultiplexer::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 59 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::setMotor().

Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::SanyoFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::SpectravideoFDC::writeMem().

◆ setSide()

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

◆ step()

void openmsx::DriveMultiplexer::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 49 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::step().

◆ writeTrackByte()

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

Implements openmsx::DiskDrive.

Definition at line 80 of file DriveMultiplexer.cc.

References openmsx::DiskDrive::writeTrackByte().


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