ROLAND
0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
|
The floppy drive controller. More...
#include <fdc.h>
Public Member Functions | |
Fdc () | |
tUBYTE | read_status () |
tUBYTE | read_data () |
void | specify () |
void | drvstat () |
void | recalib () |
void | intstat () |
void | seek () |
void | readtrk () |
void | write () |
void | read () |
void | readID () |
void | writeID () |
void | scan () |
void | check_unit () |
int | init_status_regs () |
Sector * | find_sector (tUBYTE *requested_CHRN) |
void | cmd_write () |
void | cmd_read () |
void | cmd_readtrk () |
void | cmd_scan () |
int | dsk_load (const char *pchFileName, int drv=0, char chID='A') |
void | dsk_eject (int drv=0) |
int | motor () |
void | setMotor (int s) |
int | flags () |
void | addFlags (int flags) |
int | phase () |
int | timeout () |
void | setTimeout (int val) |
int | cmdDirection () |
bool | led () |
Private Attributes | |
int | mTimeout |
int | mMotor |
bool | mLed |
int | mFlags |
int | mPhase |
int | mByteCount |
int | mBufferCount |
int | mCmdLength |
int | mResLength |
int | mCmdDirection |
CmdHandler | mCmdHandler |
tUBYTE * | pbGPBuffer |
tUBYTE * | mBufferPtr |
tUBYTE * | mBufferEndPtr |
tUBYTE | mCommand [12] |
tUBYTE | mResult [8] |
Drive | mDriveA |
Drive | mDriveB |
Drive * | mActiveDrive |
Track * | mActiveTrack |
tUWORD | mReadStatusDelay |
tUWORD | mBytesTransferred |
CmdTable | mCmdTable |
FILE * | pfileObject |
The floppy drive controller.
Fdc | ( | ) |
References Sector::CHRN(), CMD_C, CMD_CODE, CMD_EOT, CMD_H, CMD_N, CMD_PHASE, CMD_R, Fdc::cmd_scan(), CMD_STP, Fdc::cmd_write(), CPU_TO_FDC, Fdc::drvstat(), EXEC_PHASE, FDC_TO_CPU, Sector::flags(), Fdc::intstat(), LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, MAX_CMD_COUNT, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mByteCount, Fdc::mBytesTransferred, Fdc::mCmdDirection, Fdc::mCmdHandler, Fdc::mCmdLength, Fdc::mCmdTable, Fdc::mCommand, Fdc::mFlags, Fdc::mLed, Fdc::mMotor, Fdc::mPhase, Fdc::mReadStatusDelay, Fdc::mResLength, Fdc::mResult, Fdc::mTimeout, OVERRUN_TIMEOUT, Fdc::pbGPBuffer, Fdc::read(), Fdc::readID(), Fdc::readtrk(), Fdc::recalib(), RES_C, RES_N, RES_ST0, RES_ST1, RES_ST2, RESULT_PHASE, Fdc::scan(), SCAN_flag, SCANFAILED_flag, Track::sector(), Track::sectors(), Fdc::seek(), Drive::setAltered(), Sector::setData(), Track::setData(), Track::setSectors(), SKIP_flag, Fdc::specify(), STATUSDRVA_flag, STATUSDRVB_flag, Fdc::write(), and Fdc::writeID().
|
inline |
References Fdc::flags(), and Fdc::mFlags.
Referenced by Cpc::waitstates(), and Cpc::z80_out_handler().
void check_unit | ( | ) |
References CMD_UNIT, Fdc::mActiveDrive, Fdc::mCommand, Fdc::mDriveA, and Fdc::mDriveB.
Referenced by Fdc::drvstat(), Fdc::read(), Fdc::readID(), Fdc::readtrk(), Fdc::scan(), Fdc::seek(), Fdc::write(), and Fdc::writeID().
|
inline |
References CMD_C, CMD_CODE, CMD_DTL, CMD_EOT, CMD_N, CMD_R, Sector::data(), Fdc::find_sector(), Sector::flag(), INITIAL_TIMEOUT, LOAD_RESULT_WITH_CHRN, LOAD_RESULT_WITH_STATUS, Fdc::mActiveTrack, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mCommand, Fdc::mFlags, Fdc::mPhase, Fdc::mReadStatusDelay, Fdc::mResult, Fdc::mTimeout, RES_ST0, RES_ST1, RES_ST2, RESULT_PHASE, Track::size(), and SKIP_flag.
Referenced by Fdc::read(), and Fdc::read_data().
|
inline |
References Sector::CHRN(), CMD_C, CMD_DTL, CMD_N, Drive::currentSector(), Sector::data(), Sector::flag(), INITIAL_TIMEOUT, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mCommand, Fdc::mReadStatusDelay, Fdc::mResult, Fdc::mTimeout, RES_ST1, RES_ST2, Track::sector(), and Track::size().
Referenced by Fdc::read_data(), and Fdc::readtrk().
|
inline |
References CMD_C, CMD_EOT, CMD_N, CMD_R, CMD_STP, Sector::data(), Fdc::find_sector(), Sector::flag(), INITIAL_TIMEOUT, LOAD_RESULT_WITH_CHRN, LOAD_RESULT_WITH_STATUS, Fdc::mActiveTrack, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mCommand, Fdc::mFlags, Fdc::mPhase, Fdc::mReadStatusDelay, Fdc::mResult, Fdc::mTimeout, RES_ST0, RES_ST1, RES_ST2, RESULT_PHASE, SCANFAILED_flag, Track::size(), and SKIP_flag.
Referenced by Fdc::Fdc(), and Fdc::scan().
|
inline |
References CMD_C, CMD_CODE, CMD_DTL, CMD_N, Sector::data(), Fdc::find_sector(), INITIAL_TIMEOUT, LOAD_RESULT_WITH_CHRN, Fdc::mActiveTrack, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mCommand, Fdc::mPhase, Fdc::mReadStatusDelay, Fdc::mResult, Fdc::mTimeout, RES_ST0, RES_ST1, RESULT_PHASE, Sector::setFlag(), and Track::size().
Referenced by Fdc::Fdc(), and Fdc::write().
|
inline |
References Fdc::mCmdDirection.
Referenced by Cpc::waitstates().
void drvstat | ( | ) |
References Fdc::check_unit(), CMD_UNIT, Drive::currentTrack(), Fdc::mActiveDrive, Fdc::mCommand, Fdc::mMotor, Fdc::mPhase, Fdc::mResult, RES_ST0, RESULT_PHASE, Drive::tracks(), and Drive::writeProtected().
Referenced by Fdc::Fdc().
void dsk_eject | ( | int | drv = 0 | ) |
References Track::clear(), Drive::currentTrack(), DSK_SIDEMAX, DSK_TRACKMAX, Fdc::mDriveA, Fdc::mDriveB, Drive::setCurrentTrack(), and Drive::track().
Referenced by Fdc::dsk_load().
int dsk_load | ( | const char * | pchFileName, |
int | drv = 0 , |
||
char | chID = 'A' |
||
) |
References Sector::CHRN(), Fdc::dsk_eject(), DSK_SECTORMAX, DSK_SIDEMAX, DSK_TRACKMAX, ERR_DSK_INVALID, ERR_DSK_SECTORS, ERR_DSK_SIDES, ERR_FILE_NOT_FOUND, ERR_OUT_OF_MEMORY, Sector::flags(), Fdc::mDriveA, Fdc::mDriveB, Fdc::pbGPBuffer, Fdc::pfileObject, Track::sector(), Track::set(), Drive::setAltered(), Sector::setData(), Track::setData(), Drive::setRandomDEs(), Track::setSectors(), Drive::setSides(), Track::setSize(), Sector::setSize(), Drive::setTracks(), Drive::sides(), Drive::track(), and Drive::tracks().
References Sector::CHRN(), CMD_C, Drive::currentSector(), Sector::flag(), Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mCommand, Fdc::mFlags, Fdc::mResult, Drive::randomDEs(), RES_ST2, RNDDE_flag, Track::sector(), Track::sectors(), and Drive::setCurrentSector().
Referenced by Fdc::cmd_read(), Fdc::cmd_scan(), and Fdc::cmd_write().
|
inline |
References Fdc::mFlags.
Referenced by Fdc::addFlags().
int init_status_regs | ( | ) |
References CMD_UNIT, Fdc::mActiveDrive, Fdc::mCommand, Fdc::mMotor, Fdc::mResult, RES_ST0, and Drive::tracks().
Referenced by Fdc::read(), Fdc::readID(), Fdc::readtrk(), Fdc::scan(), Fdc::seek(), Fdc::write(), and Fdc::writeID().
void intstat | ( | ) |
References Drive::currentTrack(), Fdc::mDriveA, Fdc::mDriveB, Fdc::mFlags, Fdc::mMotor, Fdc::mPhase, Fdc::mResLength, Fdc::mResult, RES_ST0, RES_ST1, RESULT_PHASE, SEEKDRVA_flag, SEEKDRVB_flag, STATUSDRVA_flag, STATUSDRVB_flag, and Drive::tracks().
Referenced by Fdc::Fdc().
|
inline |
References Fdc::mLed.
|
inline |
References Fdc::mMotor.
|
inline |
References Fdc::mPhase.
Referenced by Cpc::waitstates().
void read | ( | ) |
References Fdc::check_unit(), Fdc::cmd_read(), CMD_UNIT, Drive::currentSide(), Drive::currentTrack(), Drive::flipped(), Fdc::init_status_regs(), LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mCommand, Fdc::mLed, Fdc::mPhase, Fdc::mResult, RES_ST0, RES_ST1, RESULT_PHASE, Track::sectors(), Drive::setCurrentSide(), Drive::sides(), and Drive::track().
Referenced by Fdc::Fdc().
tUBYTE read_data | ( | ) |
References CMD_CODE, CMD_EOT, CMD_PHASE, CMD_R, Fdc::cmd_read(), Fdc::cmd_readtrk(), Drive::currentSector(), EXEC_PHASE, FDC_TO_CPU, LOAD_RESULT_WITH_CHRN, LOAD_RESULT_WITH_STATUS, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mByteCount, Fdc::mCmdDirection, Fdc::mCommand, Fdc::mFlags, Fdc::mLed, Fdc::mPhase, Fdc::mResLength, Fdc::mResult, Fdc::mTimeout, OVERRUN_flag, OVERRUN_TIMEOUT, RES_ST0, RES_ST1, RES_ST2, RESULT_PHASE, RNDDE_flag, SCAN_flag, Track::sectors(), and Drive::setCurrentSector().
Referenced by Cpc::waitstates(), and Cpc::z80_in_handler().
tUBYTE read_status | ( | ) |
References EXEC_PHASE, FDC_TO_CPU, Fdc::mByteCount, Fdc::mCmdDirection, Fdc::mPhase, Fdc::mReadStatusDelay, and RESULT_PHASE.
Referenced by Cpc::z80_in_handler().
void readID | ( | ) |
References Fdc::check_unit(), Sector::CHRN(), CMD_UNIT, Drive::currentSector(), Drive::currentSide(), Drive::currentTrack(), Drive::flipped(), Fdc::init_status_regs(), LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mCommand, Fdc::mLed, Fdc::mPhase, Fdc::mResult, RES_C, RES_ST0, RES_ST1, RESULT_PHASE, Track::sector(), Track::sectors(), Drive::setCurrentSector(), Drive::setCurrentSide(), Drive::sides(), and Drive::track().
Referenced by Fdc::Fdc().
void readtrk | ( | ) |
References Fdc::check_unit(), CMD_R, Fdc::cmd_readtrk(), CMD_UNIT, Drive::currentSide(), Drive::currentTrack(), Drive::flipped(), Fdc::init_status_regs(), LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mCommand, Fdc::mLed, Fdc::mPhase, Fdc::mResult, RES_ST0, RES_ST1, RESULT_PHASE, Track::sectors(), Drive::setCurrentSector(), Drive::setCurrentSide(), Drive::sides(), and Drive::track().
Referenced by Fdc::Fdc().
void recalib | ( | ) |
References CMD_C, Fdc::mCommand, and Fdc::seek().
Referenced by Fdc::Fdc().
void scan | ( | ) |
References Fdc::check_unit(), Fdc::cmd_scan(), CMD_STP, CMD_UNIT, Drive::currentSide(), Drive::currentTrack(), Drive::flipped(), Fdc::init_status_regs(), LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mCommand, Fdc::mFlags, Fdc::mLed, Fdc::mPhase, Fdc::mResult, RES_ST0, RES_ST1, RESULT_PHASE, SCAN_flag, Track::sectors(), Drive::setCurrentSide(), Drive::sides(), and Drive::track().
Referenced by Fdc::Fdc().
void seek | ( | ) |
References Fdc::check_unit(), CMD_C, CMD_PHASE, CMD_UNIT, Drive::currentTrack(), DSK_TRACKMAX, Fdc::init_status_regs(), Fdc::mActiveDrive, Fdc::mCommand, Fdc::mFlags, Fdc::mPhase, SEEKDRVA_flag, SEEKDRVB_flag, and Drive::setCurrentTrack().
Referenced by Fdc::Fdc(), and Fdc::recalib().
|
inline |
References Fdc::mMotor.
Referenced by Cpc::z80_out_handler().
|
inline |
References Fdc::mTimeout.
Referenced by Cpc::waitstates().
void specify | ( | ) |
References CMD_PHASE, and Fdc::mPhase.
Referenced by Fdc::Fdc().
|
inline |
References Fdc::mTimeout.
Referenced by Cpc::waitstates().
void write | ( | ) |
References Fdc::check_unit(), CMD_UNIT, Fdc::cmd_write(), Drive::currentSide(), Drive::currentTrack(), Drive::flipped(), Fdc::init_status_regs(), LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mCommand, Fdc::mLed, Fdc::mPhase, Fdc::mResult, RES_ST0, RES_ST1, RESULT_PHASE, Track::sectors(), Drive::setCurrentSide(), Drive::sides(), Drive::track(), and Drive::writeProtected().
Referenced by Fdc::Fdc().
void writeID | ( | ) |
References Fdc::check_unit(), CMD_H, CMD_UNIT, Drive::currentSide(), Drive::currentTrack(), Drive::flipped(), Fdc::init_status_regs(), INITIAL_TIMEOUT, LOAD_RESULT_WITH_CHRN, Fdc::mActiveDrive, Fdc::mActiveTrack, Fdc::mBufferCount, Fdc::mBufferEndPtr, Fdc::mBufferPtr, Fdc::mCommand, Fdc::mLed, Fdc::mPhase, Fdc::mReadStatusDelay, Fdc::mResult, Fdc::mTimeout, Fdc::pbGPBuffer, RES_ST0, RES_ST1, RESULT_PHASE, Drive::setCurrentSide(), Drive::sides(), Drive::track(), and Drive::writeProtected().
Referenced by Fdc::Fdc().
|
private |
|
private |
|
private |
Referenced by Fdc::cmd_read(), Fdc::cmd_readtrk(), Fdc::cmd_scan(), Fdc::cmd_write(), Fdc::Fdc(), Fdc::read_data(), and Fdc::writeID().
|
private |
Referenced by Fdc::cmd_read(), Fdc::cmd_readtrk(), Fdc::cmd_scan(), Fdc::cmd_write(), Fdc::Fdc(), Fdc::read_data(), and Fdc::writeID().
|
private |
Referenced by Fdc::cmd_read(), Fdc::cmd_readtrk(), Fdc::cmd_scan(), Fdc::cmd_write(), Fdc::Fdc(), Fdc::read_data(), and Fdc::writeID().
|
private |
Referenced by Fdc::Fdc(), Fdc::read_data(), and Fdc::read_status().
|
private |
Referenced by Fdc::Fdc().
|
private |
Referenced by Fdc::cmdDirection(), Fdc::Fdc(), Fdc::read_data(), and Fdc::read_status().
|
private |
Referenced by Fdc::Fdc().
|
private |
Referenced by Fdc::Fdc().
|
private |
Referenced by Fdc::Fdc().
|
private |
Referenced by Fdc::check_unit(), Fdc::cmd_read(), Fdc::cmd_readtrk(), Fdc::cmd_scan(), Fdc::cmd_write(), Fdc::drvstat(), Fdc::Fdc(), Fdc::find_sector(), Fdc::init_status_regs(), Fdc::read(), Fdc::read_data(), Fdc::readID(), Fdc::readtrk(), Fdc::recalib(), Fdc::scan(), Fdc::seek(), Fdc::write(), and Fdc::writeID().
|
private |
Referenced by Fdc::check_unit(), Fdc::dsk_eject(), Fdc::dsk_load(), and Fdc::intstat().
|
private |
Referenced by Fdc::check_unit(), Fdc::dsk_eject(), Fdc::dsk_load(), and Fdc::intstat().
|
private |
Referenced by Fdc::addFlags(), Fdc::cmd_read(), Fdc::cmd_scan(), Fdc::Fdc(), Fdc::find_sector(), Fdc::flags(), Fdc::intstat(), Fdc::read_data(), Fdc::scan(), and Fdc::seek().
|
private |
Referenced by Fdc::Fdc(), Fdc::led(), Fdc::read(), Fdc::read_data(), Fdc::readID(), Fdc::readtrk(), Fdc::scan(), Fdc::write(), and Fdc::writeID().
|
private |
Referenced by Fdc::drvstat(), Fdc::Fdc(), Fdc::init_status_regs(), Fdc::intstat(), Fdc::motor(), and Fdc::setMotor().
|
private |
|
private |
Referenced by Fdc::cmd_read(), Fdc::cmd_readtrk(), Fdc::cmd_scan(), Fdc::cmd_write(), Fdc::Fdc(), Fdc::read_status(), and Fdc::writeID().
|
private |
Referenced by Fdc::Fdc(), Fdc::intstat(), and Fdc::read_data().
|
private |
|
private |
Referenced by Fdc::cmd_read(), Fdc::cmd_readtrk(), Fdc::cmd_scan(), Fdc::cmd_write(), Fdc::Fdc(), Fdc::read_data(), Fdc::setTimeout(), Fdc::timeout(), and Fdc::writeID().
|
private |
Referenced by Fdc::dsk_load(), Fdc::Fdc(), and Fdc::writeID().
|
private |
Referenced by Fdc::dsk_load().