Debugger: Extend 'cycles' command to do (partial) timings relative to a user-specified instruction (#787) (PR #789)

This commit is contained in:
TomCh
2020-05-23 18:40:12 +01:00
committed by GitHub
parent 13a4043118
commit a8671f7a6a
6 changed files with 38 additions and 9 deletions
+8 -1
View File
@@ -3789,8 +3789,15 @@ void DrawVideoScannerInfo (int line)
PrintText("cycles:", rect);
rect.left += nameWidth * nFontWidth;
UINT cycles = 0;
if (g_videoScannerDisplayInfo.cycleMode == VideoScannerDisplayInfo::abs)
cycles = (UINT)g_nCumulativeCycles;
else if (g_videoScannerDisplayInfo.cycleMode == VideoScannerDisplayInfo::rel)
cycles = g_videoScannerDisplayInfo.cycleDelta;
else // "part"
cycles = (UINT)g_videoScannerDisplayInfo.lastCumulativeCycles - (UINT)g_videoScannerDisplayInfo.savedCumulativeCycles;
char sValue[10];
const UINT cycles = g_videoScannerDisplayInfo.isAbsCycle ? (UINT)g_nCumulativeCycles : g_videoScannerDisplayInfo.cycleDelta;
sprintf_s(sValue, sizeof(sValue), "%08X", cycles);
PrintText(sValue, rect);
}