Restrict to only high FF/10 run-lengths

This commit is contained in:
tomcw 2022-09-18 17:53:03 +01:00
parent fb1b3014aa
commit 1eb00e6f4b
2 changed files with 9 additions and 3 deletions

View File

@ -1256,10 +1256,13 @@ void Disk2InterfaceCard::AddJitter(int phase, FloppyDisk& floppy)
m_foundT00S00Pattern = false; m_foundT00S00Pattern = false;
} }
// GH#1125: For T$21 (track 33.0) or above, randomly skip 1 bit-cell at the start of the FF/2 track seam. // GH#1125: For T$21 (track 33.0) or above (and sufficiently long FF/10 run-length), then randomly skip 1 bit-cell at the start of the FF/2 track seam.
// Example of high run-lengths for tracks 33.0+:
// . Accolade Comics:114, Silent Service:117, Wings of Fury:140, Wizardry I:127, Wizardry III:283
// NB. Restrict to higher FF/10 run-lengths to limit the titles affected by this jitter.
void Disk2InterfaceCard::AddTrackSeamJitter(float phasePrecise, FloppyDisk& floppy) void Disk2InterfaceCard::AddTrackSeamJitter(float phasePrecise, FloppyDisk& floppy)
{ {
if (phasePrecise >= (33.0 * 2)) if (phasePrecise >= (33.0 * 2) && floppy.m_longestSyncFFRunLength > 110)
{ {
if (floppy.m_bitOffset == floppy.m_longestSyncFFBitOffsetStart) if (floppy.m_bitOffset == floppy.m_longestSyncFFBitOffsetStart)
{ {
@ -1598,11 +1601,12 @@ void Disk2InterfaceCard::FindTrackSeamWOZ(FloppyDisk& floppy, float track)
if (longestSyncFFRunLength) if (longestSyncFFRunLength)
{ {
floppy.m_longestSyncFFBitOffsetStart = longestSyncFFStartBitOffset;
const int longestSyncFFBitOffsetEnd = (longestSyncFFStartBitOffset + longestSyncFFRunLength * 10 - 1) % floppy.m_bitCount; const int longestSyncFFBitOffsetEnd = (longestSyncFFStartBitOffset + longestSyncFFRunLength * 10 - 1) % floppy.m_bitCount;
#if LOG_DISK_WOZ_TRACK_SEAM #if LOG_DISK_WOZ_TRACK_SEAM
LOG_DISK("Track seam: T%05.2f: FF/10 (run=%d), start=%04X, end=%04X\n", track, longestSyncFFRunLength, longestSyncFFStartBitOffset, longestSyncFFBitOffsetEnd); LOG_DISK("Track seam: T%05.2f: FF/10 (run=%d), start=%04X, end=%04X\n", track, longestSyncFFRunLength, longestSyncFFStartBitOffset, longestSyncFFBitOffsetEnd);
#endif #endif
floppy.m_longestSyncFFBitOffsetStart = longestSyncFFStartBitOffset;
floppy.m_longestSyncFFRunLength = longestSyncFFRunLength;
} }
else else
{ {

View File

@ -68,6 +68,7 @@ public:
m_trackimage = NULL; m_trackimage = NULL;
m_trackimagedata = false; m_trackimagedata = false;
m_trackimagedirty = false; m_trackimagedirty = false;
m_longestSyncFFRunLength = 0;
m_longestSyncFFBitOffsetStart = -1; m_longestSyncFFBitOffsetStart = -1;
m_initialBitOffset = 0; m_initialBitOffset = 0;
m_revs = 0; m_revs = 0;
@ -88,6 +89,7 @@ public:
LPBYTE m_trackimage; LPBYTE m_trackimage;
bool m_trackimagedata; bool m_trackimagedata;
bool m_trackimagedirty; bool m_trackimagedirty;
UINT m_longestSyncFFRunLength;
int m_longestSyncFFBitOffsetStart; int m_longestSyncFFBitOffsetStart;
UINT m_initialBitOffset; // debug UINT m_initialBitOffset; // debug
UINT m_revs; // debug UINT m_revs; // debug