Go to the documentation of this file.
4 #include "DiskDrive.hh"
6 namespace openmsx {
12 class DriveMultiplexer final : public DiskDrive
13 {
14 public:
15  enum DriveNum {
16  DRIVE_A = 0,
17  DRIVE_B = 1,
18  DRIVE_C = 2,
19  DRIVE_D = 3,
21  };
23  // Multiplexer interface
24  explicit DriveMultiplexer(DiskDrive* drv[4]);
26  void selectDrive(DriveNum num, EmuTime::param time);
27  DriveNum getSelectedDrive() const { return selected; }
29  // DiskDrive interface
30  bool isDiskInserted() const override;
31  bool isWriteProtected() const override;
32  bool isDoubleSided() const override;
33  bool isTrack00() const override;
34  void setSide(bool side) override;
35  bool getSide() const override;
36  void step(bool direction, EmuTime::param time) override;
37  void setMotor(bool status, EmuTime::param time) override;
38  bool getMotor() const override;
39  bool indexPulse(EmuTime::param time) override;
40  EmuTime getTimeTillIndexPulse(EmuTime::param time, int count) override;
41  unsigned getTrackLength() override;
42  void writeTrackByte(int idx, byte val, bool addIdam) override;
43  byte readTrackByte(int idx) override;
44  EmuTime getNextSector(EmuTime::param time, RawTrack::Sector& sector) override;
45  void flushTrack() override;
46  bool diskChanged() override;
47  bool peekDiskChanged() const override;
48  bool isDummyDrive() const override;
49  void applyWd2793ReadTrackQuirk() override;
50  void invalidateWd2793ReadTrackQuirk() override;
52  template<typename Archive>
53  void serialize(Archive& ar, unsigned version);
55 private:
56  DummyDrive dummyDrive;
57  DiskDrive* drive[5];
58  DriveNum selected;
59  bool motor;
60  bool side;
61 };
63 } // namespace openmsx
65 #endif
bool getSide() const override
EmuTime getNextSector(EmuTime::param time, RawTrack::Sector &sector) override
byte readTrackByte(int idx) override
DriveMultiplexer(DiskDrive *drv[4])
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...
bool isDiskInserted() const override
Is drive ready?
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
DriveNum getSelectedDrive() const
This class connects to a FDC as a normal DiskDrive and deligates all requests to one of four other Di...
void serialize(Archive &ar, unsigned version)
bool isDummyDrive() const override
Is there a dummy (unconncted) drive?
bool isWriteProtected() const override
Is disk write protected?
void applyWd2793ReadTrackQuirk() override
See RawTrack::applyWd2793ReadTrackQuirk()
void invalidateWd2793ReadTrackQuirk() override
void step(bool direction, EmuTime::param time) override
Step head.
bool getMotor() const override
Returns the previously set motor status.
ALWAYS_INLINE unsigned count(const uint8_t *pIn, const uint8_t *pMatch, const uint8_t *pInLimit)
bool isTrack00() const override
Head above track 0.
Thanks to enen for testing this on a real cartridge:
This class implements a not connected disk drive.
Definition: DiskDrive.hh:100
void setMotor(bool status, EmuTime::param time) override
Set motor on/off.
bool indexPulse(EmuTime::param time) override
Gets the state of the index pulse.
unsigned getTrackLength() override
void setSide(bool side) override
Side select.
bool diskChanged() override
Is disk changed?
This (abstract) class defines the DiskDrive interface.
Definition: DiskDrive.hh:12
bool isDoubleSided() const override
Is disk double sided?
void selectDrive(DriveNum num, EmuTime::param time)
bool peekDiskChanged() const override
void writeTrackByte(int idx, byte val, bool addIdam) override