openMSX
|
#include <WD2793.hh>
Public Types | |
enum class | FSM { NONE , SEEK , TYPE2_LOADED , TYPE2_NOT_FOUND , TYPE2_ROTATED , CHECK_WRITE , PRE_WRITE_SECTOR , WRITE_SECTOR , POST_WRITE_SECTOR , TYPE3_LOADED , TYPE3_ROTATED , WRITE_TRACK , READ_TRACK , IDX_IRQ } |
Public Member Functions | |
WD2793 (Scheduler &scheduler, DiskDrive &drive, MSXCliComm &cliComm, EmuTime::param time, bool isWD1770) | |
This class has emulation for WD1770, WD1793, WD2793. | |
void | reset (EmuTime::param time) |
uint8_t | getStatusReg (EmuTime::param time) |
uint8_t | getTrackReg (EmuTime::param time) const |
uint8_t | getSectorReg (EmuTime::param time) const |
uint8_t | getDataReg (EmuTime::param time) |
uint8_t | peekStatusReg (EmuTime::param time) const |
uint8_t | peekTrackReg (EmuTime::param time) const |
uint8_t | peekSectorReg (EmuTime::param time) const |
uint8_t | peekDataReg (EmuTime::param time) const |
void | setCommandReg (uint8_t value, EmuTime::param time) |
void | setTrackReg (uint8_t value, EmuTime::param time) |
void | setSectorReg (uint8_t value, EmuTime::param time) |
void | setDataReg (uint8_t value, EmuTime::param time) |
bool | getIRQ (EmuTime::param time) const |
bool | getDTRQ (EmuTime::param time) const |
bool | peekIRQ (EmuTime::param time) const |
bool | peekDTRQ (EmuTime::param time) const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Public Member Functions inherited from openmsx::Schedulable | |
Schedulable (const Schedulable &)=delete | |
Schedulable (Schedulable &&)=delete | |
Schedulable & | operator= (const Schedulable &)=delete |
Schedulable & | operator= (Schedulable &&)=delete |
virtual void | schedulerDeleted () |
Just before the the Scheduler is deleted, it calls this method of all the Schedulables that are still registered. | |
Scheduler & | getScheduler () const |
EmuTime::param | getCurrentTime () const |
Convenience method: This is the same as getScheduler().getCurrentTime(). | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Additional Inherited Members | |
Static Public Member Functions inherited from openmsx::Schedulable | |
template<typename Archive > | |
static std::vector< SyncPointBW > | serializeBW (Archive &ar) |
template<typename Archive > | |
static void | restoreOld (Archive &ar, std::vector< Schedulable * > schedulables) |
Protected Member Functions inherited from openmsx::Schedulable | |
Schedulable (Scheduler &scheduler) | |
~Schedulable () | |
void | setSyncPoint (EmuTime::param timestamp) |
bool | removeSyncPoint () |
void | removeSyncPoints () |
bool | pendingSyncPoint () const |
bool | pendingSyncPoint (EmuTime &result) const |
|
strong |
openmsx::WD2793::WD2793 | ( | Scheduler & | scheduler_, |
DiskDrive & | drive_, | ||
MSXCliComm & | cliComm_, | ||
EmuTime::param | time, | ||
bool | isWD1770_ | ||
) |
This class has emulation for WD1770, WD1793, WD2793.
Though at the moment the only emulated difference between WD1770 and WD{12}793 is that WD1770 has no ready input signal. (E.g. we don't emulate the WD1770 motor out signal yet).
Definition at line 49 of file WD2793.cc.
References reset(), and openmsx::RawTrack::STANDARD_SIZE.
uint8_t openmsx::WD2793::getDataReg | ( | EmuTime::param | time | ) |
Definition at line 249 of file WD2793.cc.
References openmsx::RawTrack::Sector::addrCrcErr, openmsx::RawTrack::Sector::deleted, getDTRQ(), openmsx::CRC16::getValue(), openmsx::DiskDrive::invalidateWd2793ReadTrackQuirk(), openmsx::DiskDrive::readTrackByte(), openmsx::DynamicClock::reset(), and openmsx::CRC16::update().
Referenced by openmsx::AVTFDC::readIO(), openmsx::MicrosolFDC::readIO(), openmsx::SVIFDC::readIO(), openmsx::CanonFDC::readMem(), openmsx::NationalFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::SanyoFDC::readMem(), openmsx::SpectravideoFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::VictorFDC::readMem(), and openmsx::YamahaFDC::readMem().
bool openmsx::WD2793::getDTRQ | ( | EmuTime::param | time | ) | const |
Definition at line 79 of file WD2793.cc.
References peekDTRQ().
Referenced by getDataReg(), getStatusReg(), openmsx::AVTFDC::readIO(), openmsx::MicrosolFDC::readIO(), openmsx::SVIFDC::readIO(), openmsx::CanonFDC::readMem(), openmsx::NationalFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::SanyoFDC::readMem(), openmsx::SpectravideoFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::VictorFDC::readMem(), openmsx::YamahaFDC::readMem(), and setDataReg().
bool openmsx::WD2793::getIRQ | ( | EmuTime::param | time | ) | const |
Definition at line 94 of file WD2793.cc.
References peekIRQ().
Referenced by openmsx::AVTFDC::readIO(), openmsx::MicrosolFDC::readIO(), openmsx::SVIFDC::readIO(), openmsx::CanonFDC::readMem(), openmsx::NationalFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::SanyoFDC::readMem(), openmsx::SpectravideoFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::VictorFDC::readMem(), and openmsx::YamahaFDC::readMem().
uint8_t openmsx::WD2793::getSectorReg | ( | EmuTime::param | time | ) | const |
Definition at line 225 of file WD2793.cc.
References peekSectorReg().
Referenced by openmsx::AVTFDC::readIO(), openmsx::MicrosolFDC::readIO(), openmsx::SVIFDC::readIO(), openmsx::CanonFDC::readMem(), openmsx::NationalFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::SanyoFDC::readMem(), openmsx::SpectravideoFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::VictorFDC::readMem(), and openmsx::YamahaFDC::readMem().
uint8_t openmsx::WD2793::getStatusReg | ( | EmuTime::param | time | ) |
Definition at line 159 of file WD2793.cc.
References getDTRQ(), openmsx::DiskDrive::indexPulse(), openmsx::DiskDrive::isTrack00(), and openmsx::DiskDrive::isWriteProtected().
Referenced by peekStatusReg(), openmsx::AVTFDC::readIO(), openmsx::MicrosolFDC::readIO(), openmsx::SVIFDC::readIO(), openmsx::CanonFDC::readMem(), openmsx::NationalFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::SanyoFDC::readMem(), openmsx::SpectravideoFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::VictorFDC::readMem(), and openmsx::YamahaFDC::readMem().
uint8_t openmsx::WD2793::getTrackReg | ( | EmuTime::param | time | ) | const |
Definition at line 210 of file WD2793.cc.
References peekTrackReg().
Referenced by openmsx::AVTFDC::readIO(), openmsx::MicrosolFDC::readIO(), openmsx::SVIFDC::readIO(), openmsx::CanonFDC::readMem(), openmsx::NationalFDC::readMem(), openmsx::PhilipsFDC::readMem(), openmsx::SanyoFDC::readMem(), openmsx::SpectravideoFDC::readMem(), openmsx::ToshibaFDC::readMem(), openmsx::VictorFDC::readMem(), and openmsx::YamahaFDC::readMem().
uint8_t openmsx::WD2793::peekDataReg | ( | EmuTime::param | time | ) | const |
Definition at line 314 of file WD2793.cc.
References peekDTRQ(), and openmsx::DiskDrive::readTrackByte().
Referenced by openmsx::AVTFDC::peekIO(), openmsx::MicrosolFDC::peekIO(), openmsx::SVIFDC::peekIO(), openmsx::CanonFDC::peekMem(), openmsx::NationalFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::SanyoFDC::peekMem(), openmsx::SpectravideoFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::VictorFDC::peekMem(), and openmsx::YamahaFDC::peekMem().
bool openmsx::WD2793::peekDTRQ | ( | EmuTime::param | time | ) | const |
Definition at line 84 of file WD2793.cc.
References openmsx::DynamicClock::getTime().
Referenced by getDTRQ(), peekDataReg(), openmsx::AVTFDC::peekIO(), openmsx::MicrosolFDC::peekIO(), openmsx::SVIFDC::peekIO(), openmsx::CanonFDC::peekMem(), openmsx::NationalFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::SanyoFDC::peekMem(), openmsx::SpectravideoFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::VictorFDC::peekMem(), and openmsx::YamahaFDC::peekMem().
bool openmsx::WD2793::peekIRQ | ( | EmuTime::param | time | ) | const |
Definition at line 99 of file WD2793.cc.
Referenced by getIRQ(), openmsx::AVTFDC::peekIO(), openmsx::MicrosolFDC::peekIO(), openmsx::SVIFDC::peekIO(), openmsx::CanonFDC::peekMem(), openmsx::NationalFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::SanyoFDC::peekMem(), openmsx::SpectravideoFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::VictorFDC::peekMem(), and openmsx::YamahaFDC::peekMem().
uint8_t openmsx::WD2793::peekSectorReg | ( | EmuTime::param | time | ) | const |
Definition at line 230 of file WD2793.cc.
Referenced by getSectorReg(), openmsx::AVTFDC::peekIO(), openmsx::MicrosolFDC::peekIO(), openmsx::SVIFDC::peekIO(), openmsx::CanonFDC::peekMem(), openmsx::NationalFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::SanyoFDC::peekMem(), openmsx::SpectravideoFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::VictorFDC::peekMem(), and openmsx::YamahaFDC::peekMem().
uint8_t openmsx::WD2793::peekStatusReg | ( | EmuTime::param | time | ) | const |
Definition at line 199 of file WD2793.cc.
References getStatusReg().
Referenced by openmsx::AVTFDC::peekIO(), openmsx::MicrosolFDC::peekIO(), openmsx::SVIFDC::peekIO(), openmsx::CanonFDC::peekMem(), openmsx::NationalFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::SanyoFDC::peekMem(), openmsx::SpectravideoFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::VictorFDC::peekMem(), and openmsx::YamahaFDC::peekMem().
uint8_t openmsx::WD2793::peekTrackReg | ( | EmuTime::param | time | ) | const |
Definition at line 215 of file WD2793.cc.
Referenced by getTrackReg(), openmsx::AVTFDC::peekIO(), openmsx::MicrosolFDC::peekIO(), openmsx::SVIFDC::peekIO(), openmsx::CanonFDC::peekMem(), openmsx::NationalFDC::peekMem(), openmsx::PhilipsFDC::peekMem(), openmsx::SanyoFDC::peekMem(), openmsx::SpectravideoFDC::peekMem(), openmsx::ToshibaFDC::peekMem(), openmsx::VictorFDC::peekMem(), and openmsx::YamahaFDC::peekMem().
void openmsx::WD2793::reset | ( | EmuTime::param | time | ) |
Definition at line 60 of file WD2793.cc.
References NONE, openmsx::Schedulable::removeSyncPoint(), openmsx::DynamicClock::reset(), and setCommandReg().
Referenced by openmsx::WD2793BasedFDC::reset(), and WD2793().
void openmsx::WD2793::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 1120 of file WD2793.cc.
References openmsx::Schedulable::getCurrentTime(), openmsx::Clock< FREQ_NUM, FREQ_DENOM >::getTime(), openmsx::CRC16::getValue(), openmsx::CRC16::init(), openmsx::CliComm::printWarning(), openmsx::Schedulable::removeSyncPoint(), openmsx::DynamicClock::reset(), openmsx::Schedulable::serializeBW(), openmsx::DynamicClock::setFreq(), and openmsx::Schedulable::setSyncPoint().
void openmsx::WD2793::setCommandReg | ( | uint8_t | value, |
EmuTime::param | time | ||
) |
Definition at line 111 of file WD2793.cc.
References openmsx::DiskDrive::flushTrack(), and openmsx::Schedulable::removeSyncPoint().
Referenced by reset(), openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().
void openmsx::WD2793::setDataReg | ( | uint8_t | value, |
EmuTime::param | time | ||
) |
Definition at line 235 of file WD2793.cc.
References getDTRQ(), and openmsx::DynamicClock::reset().
Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().
void openmsx::WD2793::setSectorReg | ( | uint8_t | value, |
EmuTime::param | time | ||
) |
Definition at line 220 of file WD2793.cc.
Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().
void openmsx::WD2793::setTrackReg | ( | uint8_t | value, |
EmuTime::param | time | ||
) |
Definition at line 205 of file WD2793.cc.
Referenced by openmsx::AVTFDC::writeIO(), openmsx::MicrosolFDC::writeIO(), openmsx::SVIFDC::writeIO(), openmsx::CanonFDC::writeMem(), openmsx::NationalFDC::writeMem(), openmsx::PhilipsFDC::writeMem(), openmsx::SanyoFDC::writeMem(), openmsx::SpectravideoFDC::writeMem(), openmsx::ToshibaFDC::writeMem(), openmsx::VictorFDC::writeMem(), and openmsx::YamahaFDC::writeMem().