For DSK/NIB images, in authentic disk mode:

. when the disk spins then feed nibbles into nibble-reader (to keep VTSC in sync)
For WOZ images:
. fix so that DumpTrackWOZ() continues to work.
This commit is contained in:
tomcw 2023-05-01 13:13:58 +01:00
parent a0670098c4
commit 10901fc483
3 changed files with 20 additions and 6 deletions

View File

@ -1108,7 +1108,15 @@ void __stdcall Disk2InterfaceCard::ReadWrite(WORD pc, WORD addr, BYTE bWrite, BY
pFloppy->m_byte -= pFloppy->m_nibbles;
m_formatTrack.Reset(); // GH #1215
// Feed all the skipped nibbles to our nibble-reader so that VTSC remains in-sync with the nibble stream
for (UINT i = 0; i < uWrapOffset; i++)
{
m_floppyLatch = *(pFloppy->m_trackimage + pFloppy->m_byte);
m_formatTrack.DecodeLatchNibbleRead(m_floppyLatch);
if (++pFloppy->m_byte >= pFloppy->m_nibbles)
pFloppy->m_byte = 0;
}
#if LOG_DISK_NIBBLES_SPIN
UINT uCompleteRevolutions = uSpinNibbleCount / pFloppy->m_nibbles;
@ -1696,7 +1704,7 @@ void Disk2InterfaceCard::FindTrackSeamWOZ(FloppyDisk& floppy, float track)
// NB. Need to define LOG_DISK_NIBBLES_READ so that GetReadD5AAxxDetectedString() works.
void Disk2InterfaceCard::DumpTrackWOZ(FloppyDisk floppy) // pass a copy of m_floppy
{
FormatTrack formatTrack(true);
FormatTrack formatTrack(true, true);
BYTE shiftReg = 0;
UINT zeroCount = 0;

View File

@ -264,9 +264,12 @@ void FormatTrack::DecodeLatchNibble(BYTE floppylatch, bool bIsWrite, bool bIsSyn
for (UINT i=0; i<4; i++)
m_VolTrkSecChk[i] = ((m_VolTrkSecChk4and4[i*2] & 0x55) << 1) | (m_VolTrkSecChk4and4[i*2+1] & 0x55);
// GH #1215
m_pCard->SetLastReadTrackSector( m_VolTrkSecChk[1], m_VolTrkSecChk[2] );
GetFrame().FrameDrawDiskStatus();
if (!m_bSuppressDiskStatus)
{
// GH #1215
m_pCard->SetLastReadTrackSector(m_VolTrkSecChk[1], m_VolTrkSecChk[2]);
GetFrame().FrameDrawDiskStatus();
}
#if LOG_DISK_NIBBLES_ADDR
const bool chk = (m_VolTrkSecChk[0] ^ m_VolTrkSecChk[1] ^ m_VolTrkSecChk[2] ^ m_VolTrkSecChk[3]) == 0;

View File

@ -30,9 +30,10 @@ class Disk2InterfaceCard;
class FormatTrack // Monitor for formatting of track
{
public:
FormatTrack(bool bSuppressOutput=false)
FormatTrack(bool bSuppressOutput=false, bool bSuppressDiskStatus=false)
{
m_bSuppressReadD5AAxxDetected = bSuppressOutput;
m_bSuppressDiskStatus = bSuppressDiskStatus;
Reset();
};
@ -77,4 +78,6 @@ private:
UINT m_DbgGap2Size;
int m_DbgGap3Size;
#endif
bool m_bSuppressDiskStatus;
};