From 7eee2467c522203b5b46b5e7241a8f99baf77274 Mon Sep 17 00:00:00 2001 From: tomcw Date: Fri, 20 Dec 2019 12:49:02 +0000 Subject: [PATCH] Disk2: DumpTrackWOZ() - extended to start each line with bitOffset --- source/Disk.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/Disk.cpp b/source/Disk.cpp index 39f2b9d0..e3129668 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -1325,8 +1325,18 @@ void Disk2InterfaceCard::DumpTrackWOZ(FloppyDisk floppy) // pass a copy of m_flo const UINT startBitOffset = floppy.m_bitOffset; + bool newLine = true; + while (1) { + TCHAR str[10]; + if (newLine) + { + newLine = false; + StringCbPrintf(str, sizeof(str), "%04X:", floppy.m_bitOffset & 0xffff); + OutputDebugString(str); + } + BYTE n = floppy.m_trackimage[floppy.m_byte]; BYTE outputBit = (n & floppy.m_bitMask) ? 1 : 0; @@ -1362,13 +1372,15 @@ void Disk2InterfaceCard::DumpTrackWOZ(FloppyDisk floppy) // pass a copy of m_flo nibbleCount++; - TCHAR str[10]; char syncBits = zeroCount <= 9 ? '0'+zeroCount : '+'; - if (zeroCount == 0) StringCbPrintf(str, 10, " %02X", shiftReg); - else StringCbPrintf(str, 10, "(%c)%02X", syncBits, shiftReg); + if (zeroCount == 0) StringCbPrintf(str, sizeof(str), " %02X", shiftReg); + else StringCbPrintf(str, sizeof(str), "(%c)%02X", syncBits, shiftReg); OutputDebugString(str); if ((nibbleCount % 32) == 0) + { OutputDebugString("\n"); + newLine = true; + } #ifdef LOG_DISK_NIBBLES_READ formatTrack.DecodeLatchNibbleRead(shiftReg);