34static constexpr int DRIVE_A_SELECT = 0x01;
35static constexpr int DRIVE_B_SELECT = 0x02;
36static constexpr int DRIVE_A_NOT_READY = 0x01;
37static constexpr int DRIVE_B_NOT_READY = 0x02;
38static constexpr int DISK_A_CHANGED = 0x04;
39static constexpr int DISK_B_CHANGED = 0x08;
40static constexpr int MOTOR_ON = 0x04;
41static constexpr int DATA_REQUEST = 0x40;
42static constexpr int INTR_REQUEST = 0x80;
48 if (
rom->size() !=
one_of(0x4000u, 0x8000u)) {
49 throw MSXException(
"YamahaFDC ROM size must be 16kB or 32kB.");
62 switch (address & 0x3FFF) {
92 switch (address & 0x3FFF) {
115 if (
unsigned(address - 0x4000) <
rom->size()) {
116 return (*
rom)[address - 0x4000];
128 }
else if (
unsigned(start - 0x4000) <
rom->size()) {
129 return &(*rom)[start - 0x4000];
137 switch (address & 0x3fff) {
152 switch (value & (DRIVE_A_SELECT | DRIVE_B_SELECT)) {
187template<
typename Archive>
190 ar.template serializeBase<WD2793BasedFDC>(*
this);
#define REGISTER_MSXDEVICE(CLASS, NAME)
This (abstract) class defines the DiskDrive interface.
void setMotor(bool status, EmuTime::param time) override
Set motor on/off.
bool peekDiskChanged() const override
void selectDrive(Drive num, EmuTime::param time)
bool isDiskInserted() const override
Is drive ready?
bool diskChanged() override
Is disk changed?
void setSide(bool side) override
Side select.
static std::array< byte, 0x10000 > unmappedRead
static std::array< byte, 0x10000 > unmappedWrite
EmuTime::param getCurrentTime() const
void reset(EmuTime::param time) override
This method is called on reset.
DriveMultiplexer multiplexer
uint8_t peekDataReg(EmuTime::param time) const
bool peekIRQ(EmuTime::param time) const
uint8_t getStatusReg(EmuTime::param time)
void setTrackReg(uint8_t value, EmuTime::param time)
void setSectorReg(uint8_t value, EmuTime::param time)
uint8_t getTrackReg(EmuTime::param time) const
uint8_t peekSectorReg(EmuTime::param time) const
bool peekDTRQ(EmuTime::param time) const
void setCommandReg(uint8_t value, EmuTime::param time)
uint8_t peekTrackReg(EmuTime::param time) const
bool getDTRQ(EmuTime::param time) const
uint8_t peekStatusReg(EmuTime::param time) const
uint8_t getDataReg(EmuTime::param time)
void setDataReg(uint8_t value, EmuTime::param time)
bool getIRQ(EmuTime::param time) const
uint8_t getSectorReg(EmuTime::param time) const
void serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time) override
This method is called on reset.
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
YamahaFDC(const DeviceConfig &config)
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)