sa2: do not call VideoPresentScreen every Apple ][ frame when in full speed.
But only call it after 16ms wall clock. Fixes https://github.com/audetto/AppleWin/issues/61 Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
c70377fcaf
commit
d88ab1199d
2 changed files with 6 additions and 3 deletions
|
@ -155,8 +155,9 @@ void run_sdl(int argc, const char * argv [])
|
||||||
frame->ExecuteOneFrame(oneFrame);
|
frame->ExecuteOneFrame(oneFrame);
|
||||||
cpuTimer.toc();
|
cpuTimer.toc();
|
||||||
|
|
||||||
if (!options.headless)
|
if (!options.headless && !g_bFullSpeed)
|
||||||
{
|
{
|
||||||
|
// in full speed VideoRedrawScreenDuringFullSpeed is called inside SDLFrame::Execute
|
||||||
refreshScreenTimer.tic();
|
refreshScreenTimer.tic();
|
||||||
frame->VideoPresentScreen();
|
frame->VideoPresentScreen();
|
||||||
refreshScreenTimer.toc();
|
refreshScreenTimer.toc();
|
||||||
|
|
|
@ -591,8 +591,9 @@ namespace sa2
|
||||||
g_dwCyclesThisFrame -= dwClksPerFrame;
|
g_dwCyclesThisFrame -= dwClksPerFrame;
|
||||||
if (g_bFullSpeed)
|
if (g_bFullSpeed)
|
||||||
{
|
{
|
||||||
NTSC_VideoClockResync(g_dwCyclesThisFrame);
|
// only call VideoPresentScreen every 16ms
|
||||||
GetVideo().VideoRefreshBuffer(GetVideo().GetVideoMode(), true);
|
// hardcoded in FrameBase::VideoRedrawScreenDuringFullSpeed()
|
||||||
|
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (totalCyclesExecuted < cyclesToExecute);
|
} while (totalCyclesExecuted < cyclesToExecute);
|
||||||
|
@ -687,6 +688,7 @@ namespace sa2
|
||||||
// entering full speed
|
// entering full speed
|
||||||
MB_Mute();
|
MB_Mute();
|
||||||
setGLSwapInterval(0);
|
setGLSwapInterval(0);
|
||||||
|
VideoRedrawScreenDuringFullSpeed(0, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue