diff --git a/source/CPU.cpp b/source/CPU.cpp index b2d525be..c9c32e88 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -444,7 +444,7 @@ static __forceinline void CheckInterruptSources(ULONG uExecutedCycles) if (g_nIrqCheckTimeout < 0) { MB_UpdateCycles(uExecutedCycles); - sg_Mouse.SetVBlank(VideoGetVbl(uExecutedCycles)); + sg_Mouse.SetVBlank( !VideoGetVblBar(uExecutedCycles) ); g_nIrqCheckTimeout = IRQ_CHECK_TIMEOUT; } } diff --git a/source/NTSC.cpp b/source/NTSC.cpp index 4793766f..ed4e33f5 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -1751,10 +1751,12 @@ void NTSC_VideoInitChroma() } //=========================================================================== -bool NTSC_VideoIsVbl () -{ - return (g_nVideoClockVert >= VIDEO_SCANNER_Y_DISPLAY) && (g_nVideoClockVert < VIDEO_SCANNER_MAX_VERT); -} + +// NB. NTSC video-scanner doesn't get updated during full-speed, so video-dependent code can hang +//bool NTSC_VideoIsVbl () +//{ +// return (g_nVideoClockVert >= VIDEO_SCANNER_Y_DISPLAY) && (g_nVideoClockVert < VIDEO_SCANNER_MAX_VERT); +//} //=========================================================================== diff --git a/source/NTSC.h b/source/NTSC.h index 886197d7..d652b67b 100644 --- a/source/NTSC.h +++ b/source/NTSC.h @@ -16,7 +16,6 @@ extern void NTSC_VideoReinitialize( DWORD cyclesThisFrame ); extern void NTSC_VideoInitAppleType(); extern void NTSC_VideoInitChroma(); - extern bool NTSC_VideoIsVbl(); extern void NTSC_VideoUpdateCycles( long cycles6502 ); extern void NTSC_VideoRedrawWholeScreen( void ); extern bool NTSC_GetColorBurst( void ); diff --git a/source/Video.cpp b/source/Video.cpp index af01d673..2d66095f 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -883,10 +883,10 @@ BYTE VideoCheckMode (WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles) BYTE VideoCheckVbl ( ULONG uExecutedCycles ) { - bool bVblBar = VideoGetVbl(uExecutedCycles); + bool bVblBar = VideoGetVblBar(uExecutedCycles); // NTSC: It is tempting to replace with - // bool bVblBar = NTSC_VideoIsVbl(); - // But this breaks "ANSI STORY" intro center fade + // bool bVblBar = !NTSC_VideoIsVbl(); + // But during full-speed, the NTSC video-scanner is not updated, so video-dependent code can hang BYTE r = KeybGetKeycode(); return (r & ~0x80) | (bVblBar ? 0x80 : 0); @@ -1550,7 +1550,7 @@ WORD VideoGetScannerAddress(bool* pbVblBar_OUT, const DWORD uExecutedCycles) //=========================================================================== // Derived from VideoGetScannerAddress() -bool VideoGetVbl(const DWORD uExecutedCycles) +bool VideoGetVblBar(const DWORD uExecutedCycles) { // get video scanner position // diff --git a/source/Video.h b/source/Video.h index b7d00a34..275e4145 100644 --- a/source/Video.h +++ b/source/Video.h @@ -176,7 +176,7 @@ void VideoRefreshScreen (uint32_t uRedrawWholeScreenVideoMode = 0, bool bRedr void VideoReinitialize (); void VideoResetState (); WORD VideoGetScannerAddress(bool* pbVblBar_OUT, const DWORD uExecutedCycles); -bool VideoGetVbl(DWORD uExecutedCycles); +bool VideoGetVblBar(DWORD uExecutedCycles); bool VideoGetSW80COL(void); bool VideoGetSWDHIRES(void);