diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 88bf45be..41ffe1b9 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -1350,7 +1350,9 @@ int CheckBreakpointsVideo() if (pBP->eSource != BP_SRC_VIDEO_SCANNER) continue; - if (_CheckBreakpointValue(pBP, g_nVideoClockVert)) + uint16_t vert, horz; + NTSC_GetVideoHVForDebugger(vert, horz); // update g_nVideoClockHorz/g_nVideoClockVert - needed for when in fullspeed (GH#1164) + if (_CheckBreakpointValue(pBP, vert)) { bBreakpointHit = BP_HIT_VIDEO_POS; pBP->bEnabled = false; // Disable, otherwise it'll trigger many times on this scan-line diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index 60a73d36..fdefc200 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -3231,10 +3231,8 @@ static void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible) //=========================================================================== static void DrawVideoScannerInfo(int line) { - NTSC_UpdateVideoHVForDebugger(); // update g_nVideoClockHorz/g_nVideoClockVert - - int v = g_nVideoClockVert; - int h = g_nVideoClockHorz; + uint16_t v, h; + NTSC_GetVideoHVForDebugger(v, h); // update g_nVideoClockHorz/g_nVideoClockVert - needed for when in fullspeed (GH#1164) if (g_videoScannerDisplayInfo.isHorzReal) { diff --git a/source/NTSC.cpp b/source/NTSC.cpp index 32a89808..64ed21ec 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -1940,10 +1940,12 @@ uint16_t NTSC_VideoGetScannerAddress ( const ULONG uExecutedCycles ) return addr; } -void NTSC_UpdateVideoHVForDebugger(void) +void NTSC_GetVideoHVForDebugger(uint16_t& vert, uint16_t& horz) { ResetCyclesExecutedForDebugger(); // if in full-speed, then reset cycles so that CpuCalcCycles() doesn't ASSERT NTSC_VideoGetScannerAddress(0); + vert = g_nVideoClockVert; + horz = g_nVideoClockHorz; } //=========================================================================== diff --git a/source/NTSC.h b/source/NTSC.h index 6894cc7d..2825b6f3 100644 --- a/source/NTSC.h +++ b/source/NTSC.h @@ -14,7 +14,7 @@ void NTSC_SetVideoTextMode(int cols); uint32_t* NTSC_VideoGetChromaTable(bool bHueTypeMonochrome, bool bMonitorTypeColorTV); void NTSC_VideoClockResync(const DWORD dwCyclesThisFrame); uint16_t NTSC_VideoGetScannerAddress(const ULONG uExecutedCycles); -void NTSC_UpdateVideoHVForDebugger(void); +void NTSC_GetVideoHVForDebugger(uint16_t& vert, uint16_t& horz); void NTSC_Destroy(void); void NTSC_VideoInit(uint8_t *pFramebuffer); void NTSC_VideoReinitialize(DWORD cyclesThisFrame, bool bInitVideoScannerAddress);