From 597cea1d86bc5dfe697a136c2aca75a497d915ae Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 14 Jan 2023 14:30:12 +0000 Subject: [PATCH] NTSC: Change to NTSC_GetVblBar() from NTSC_GetVideoVert(). Debugger: fix video scanner position's visibility (green colour) for SHR - didn't work for lines $C0-C7. --- source/NTSC.cpp | 13 +++++++------ source/NTSC.h | 2 +- source/Video.cpp | 4 ++-- source/Video.h | 2 -- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/NTSC.cpp b/source/NTSC.cpp index c5bc5fde..de24f0b4 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -1940,11 +1940,6 @@ uint16_t NTSC_VideoGetScannerAddress ( const ULONG uExecutedCycles ) return addr; } -uint16_t NTSC_GetVideoVert(void) -{ - return g_nVideoClockVert; -} - void NTSC_GetVideoVertHorzForDebugger(uint16_t& vert, uint16_t& horz) { ResetCyclesExecutedForDebugger(); // if in full-speed, then reset cycles so that CpuCalcCycles() doesn't ASSERT @@ -2741,9 +2736,15 @@ UINT NTSC_GetCyclesUntilVBlank(int cycles) (cyclesPerFrames - cycleCurrentPos + cycleVBl); } +bool NTSC_GetVblBar(void) +{ + const UINT visibleScanLines = ((g_uNewVideoModeFlags & VF_SHR) == 0) ? VIDEO_SCANNER_Y_DISPLAY : VIDEO_SCANNER_Y_DISPLAY_IIGS; + return g_nVideoClockVert < visibleScanLines; +} + bool NTSC_IsVisible(void) { - return (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY) && (g_nVideoClockHorz >= VIDEO_SCANNER_HORZ_START); + return NTSC_GetVblBar() && (g_nVideoClockHorz >= VIDEO_SCANNER_HORZ_START); } // For debugger diff --git a/source/NTSC.h b/source/NTSC.h index f4bcc079..af7ef595 100644 --- a/source/NTSC.h +++ b/source/NTSC.h @@ -12,7 +12,6 @@ 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); -uint16_t NTSC_GetVideoVert(void); void NTSC_GetVideoVertHorzForDebugger(uint16_t& vert, uint16_t& horz); uint16_t NTSC_GetVideoVertForDebugger(void); void NTSC_Destroy(void); @@ -28,5 +27,6 @@ UINT NTSC_GetCyclesPerFrame(void); UINT NTSC_GetCyclesPerLine(void); UINT NTSC_GetVideoLines(void); UINT NTSC_GetCyclesUntilVBlank(int cycles); +bool NTSC_GetVblBar(void); bool NTSC_IsVisible(void); uint16_t NTSC_GetScannerAddressAndData(uint32_t& data, int& dataSize); diff --git a/source/Video.cpp b/source/Video.cpp index 860e599d..574a67f6 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -455,7 +455,7 @@ bool Video::VideoGetVblBarEx(const DWORD dwCyclesThisFrame) NTSC_VideoClockResync(dwCyclesThisFrame); } - return NTSC_GetVideoVert() < kVDisplayableScanLines; + return NTSC_GetVblBar(); } // Called when *inside* CpuExecute() @@ -467,7 +467,7 @@ bool Video::VideoGetVblBar(const DWORD uExecutedCycles) NTSC_VideoClockResync(CpuGetCyclesThisVideoFrame(uExecutedCycles)); } - return NTSC_GetVideoVert() < kVDisplayableScanLines; + return NTSC_GetVblBar(); } //=========================================================================== diff --git a/source/Video.h b/source/Video.h index d580ec35..22a9ae16 100644 --- a/source/Video.h +++ b/source/Video.h @@ -295,8 +295,6 @@ private: COLORREF g_nMonochromeRGB; // saved to Registry bool m_hasVidHD; - static const int kVDisplayableScanLines = 192; // max displayable scanlines - static const UINT kVideoRomSize8K = kVideoRomSize4K*2; static const UINT kVideoRomSize16K = kVideoRomSize8K*2; static const UINT kVideoRomSizeMax = kVideoRomSize16K;