Initialize last track/sector, update on drive eject
This commit is contained in:
parent
5a89948172
commit
c8b7af6828
|
@ -1050,7 +1050,10 @@ void __stdcall Disk2InterfaceCard::ReadWrite(WORD pc, WORD addr, BYTE bWrite, BY
|
|||
ReadTrack(m_currDrive, uExecutedCycles);
|
||||
|
||||
if (!pFloppy->m_trackimagedata)
|
||||
{
|
||||
pDrive->SetLastReadTrackSector(0);
|
||||
return UpdateLatchForEmptyDrive(pDrive);
|
||||
}
|
||||
|
||||
// Improve precision of "authentic" drive mode - GH#125
|
||||
UINT uSpinNibbleCount = 0;
|
||||
|
|
|
@ -115,14 +115,25 @@ public:
|
|||
m_headWindow = 0;
|
||||
m_spinning = 0;
|
||||
m_writelight = 0;
|
||||
m_LastReadTrackSector[0] = -1;
|
||||
m_LastReadTrackSector[1] = -1;
|
||||
m_disk.clear();
|
||||
}
|
||||
|
||||
// NOTE: Managed by Disk2InterfaceCard::ReadWrite()
|
||||
void SetLastReadTrackSector(BYTE* pVolumeTrackSectorChecksum)
|
||||
{
|
||||
m_LastReadTrackSector[0] = pVolumeTrackSectorChecksum[1];
|
||||
m_LastReadTrackSector[1] = pVolumeTrackSectorChecksum[2];
|
||||
if (pVolumeTrackSectorChecksum)
|
||||
{
|
||||
m_LastReadTrackSector[0] = pVolumeTrackSectorChecksum[1];
|
||||
m_LastReadTrackSector[1] = pVolumeTrackSectorChecksum[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_LastReadTrackSector[0] = -1;
|
||||
m_LastReadTrackSector[1] = -1;
|
||||
}
|
||||
assert(m_LastReadTrackSector[0] <= 80);
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue