Restore Logical Sector number

This commit is contained in:
michaelangel007 2023-04-25 22:24:49 -07:00
parent 430b1c95cf
commit fdd93d0b43

View File

@ -103,19 +103,21 @@ void Disk2InterfaceCard::SetEnhanceDisk(bool bEnhanceDisk) { m_enhanceDisk = bEn
// Returns true if Track, Sector is valid
void Disk2InterfaceCard::GetLastReadTrackSector(const int drive, int& track, int& sector)
{
// Waiting for PR #1212 which adds DISK_STATUS_EMPTY
/*
Disk_Status_e status = GetDriveLightStatus(drive);
bool bValid = DISK_STATUS_OFF ? false : true;
if (bValid)
{
track = m_floppyDrive[drive].m_LastReadTrackSector[0];
sector = m_floppyDrive[drive].m_LastReadTrackSector[1];
}
else
if (status == DISK_STATUS_EMPTY)
{
track = -1;
sector = -1;
}
return bValid;
*/
track = m_floppyDrive[drive].m_LastReadTrackSector[0];
int physical = m_floppyDrive[drive].m_LastReadTrackSector[1];
const int PhysicalToLogicalSectorNumber[16] = {0x00,0x07,0x0E,0x06,0x0D,0x05,0x0C,0x04, 0x0B,0x03,0x0A,0x02,0x09,0x01,0x08,0x0F};
sector = PhysicalToLogicalSectorNumber[physical];
}
int Disk2InterfaceCard::GetCurrentDrive(void) { return m_currDrive; }