VBlank tweaks:

. Removed NTSC_VideoVbl(), since it's not accurate during full-speed. (Nothing was using it)
. Renamed VideoGetVbl() to VideoGetVblBar()
. Correctly pass Vbl (not VblBar) to Mouse's SetVBlank()
This commit is contained in:
tomcw 2016-11-16 11:18:41 +00:00
parent 002af587d4
commit 8447a22942
5 changed files with 12 additions and 11 deletions

View File

@ -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;
}
}

View File

@ -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);
//}
//===========================================================================

View File

@ -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 );

View File

@ -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
//

View File

@ -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);