Full-speed: new VideoGetVblBarEx() required when called from main loop

This commit is contained in:
tomcw 2019-11-11 19:55:46 +00:00
parent 8aff6addff
commit 97e73c632d
3 changed files with 16 additions and 3 deletions

View File

@ -357,7 +357,7 @@ static void ContinueExecution(void)
//
const UINT dwClksPerFrame = NTSC_GetCyclesPerFrame();
if (g_dwCyclesThisFrame >= dwClksPerFrame && !VideoGetVblBar(g_dwCyclesThisFrame))
if (g_dwCyclesThisFrame >= dwClksPerFrame && !VideoGetVblBarEx(g_dwCyclesThisFrame))
{
g_dwCyclesThisFrame -= dwClksPerFrame;

View File

@ -873,12 +873,24 @@ WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr /*= V
//===========================================================================
// Called when *outside* of CpuExecute()
bool VideoGetVblBarEx(const DWORD dwCyclesThisFrame)
{
if (g_bFullSpeed)
{
// Ensure that NTSC video-scanner gets updated during full-speed, so video screen can be redrawn during Apple II VBL
NTSC_VideoClockResync(dwCyclesThisFrame);
}
return g_nVideoClockVert < kVDisplayableScanLines;
}
// Called when *inside* CpuExecute()
bool VideoGetVblBar(const DWORD uExecutedCycles)
{
if (g_bFullSpeed)
{
// Ensure that NTSC video-scanner gets updated during full-speed:
// so that video-dependent Apple II code doesn't hang & video screen can be redraw during VBL
// Ensure that NTSC video-scanner gets updated during full-speed, so video-dependent Apple II code doesn't hang
NTSC_VideoClockResync(CpuGetCyclesThisVideoFrame(uExecutedCycles));
}

View File

@ -188,6 +188,7 @@ void VideoReinitialize (bool bInitVideoScannerAddress = true);
void VideoResetState ();
enum VideoScanner_e {VS_FullAddr, VS_PartialAddrV, VS_PartialAddrH};
WORD VideoGetScannerAddress(DWORD nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr);
bool VideoGetVblBarEx(const DWORD dwCyclesThisFrame);
bool VideoGetVblBar(const DWORD uExecutedCycles);
bool VideoGetSW80COL(void);