mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-05-31 22:41:34 +00:00
Wait for A2 VBL before VideoRefreshScreen()
- stops tearing Moved WaitForVerticalBlank() before StretchBlt() - window is updated after StretchBlt(), not after GdiFlush() Still get juddery animation.
This commit is contained in:
parent
521a09e75a
commit
27284dad2b
|
@ -352,12 +352,24 @@ static void ContinueExecution(void)
|
|||
const UINT dwClksPerFrame = NTSC_GetCyclesPerFrame();
|
||||
if (g_dwCyclesThisFrame >= dwClksPerFrame)
|
||||
{
|
||||
#if 0
|
||||
g_dwCyclesThisFrame -= dwClksPerFrame;
|
||||
|
||||
if (g_bFullSpeed)
|
||||
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
||||
else
|
||||
VideoRefreshScreen(); // Just copy the output of our Apple framebuffer to the system Back Buffer
|
||||
#else
|
||||
if (g_nVideoClockVert >= 192)
|
||||
{
|
||||
g_dwCyclesThisFrame %= dwClksPerFrame;
|
||||
|
||||
if (g_bFullSpeed)
|
||||
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
||||
else
|
||||
VideoRefreshScreen(); // Just copy the output of our Apple framebuffer to the system Back Buffer
|
||||
}
|
||||
#endif
|
||||
|
||||
MB_EndOfVideoFrame();
|
||||
}
|
||||
|
@ -1533,7 +1545,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||
LogFileOutput("Init: SysClk_InitTimer(), res=%d\n", bSpeechOK ? 1:0);
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
#if 1
|
||||
DDInit(); // For WaitForVerticalBlank()
|
||||
#endif
|
||||
|
||||
|
|
|
@ -603,6 +603,8 @@ void VideoRefreshScreen ( uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRe
|
|||
int wdest = g_nViewportCX;
|
||||
int hdest = g_nViewportCY;
|
||||
|
||||
if (!bRedrawWholeScreen && g_lpDD) g_lpDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL);
|
||||
|
||||
SetStretchBltMode(hFrameDC, COLORONCOLOR);
|
||||
StretchBlt(
|
||||
hFrameDC,
|
||||
|
@ -614,7 +616,6 @@ void VideoRefreshScreen ( uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRe
|
|||
SRCCOPY);
|
||||
}
|
||||
|
||||
//if (g_lpDD) g_lpDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL);
|
||||
GdiFlush();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user