Skip to content

Commit

Permalink
Merge pull request audetto#62 from audetto/fullspeed
Browse files Browse the repository at this point in the history
sa2: do not call VideoPresentScreen every Apple ][ frame when in full…
  • Loading branch information
audetto committed Jan 14, 2022
2 parents c70377f + d88ab11 commit 26a7293
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/frontends/sdl/main.cpp
Expand Up @@ -155,8 +155,9 @@ void run_sdl(int argc, const char * argv [])
frame->ExecuteOneFrame(oneFrame);
cpuTimer.toc();

if (!options.headless)
if (!options.headless && !g_bFullSpeed)
{
// in full speed VideoRedrawScreenDuringFullSpeed is called inside SDLFrame::Execute
refreshScreenTimer.tic();
frame->VideoPresentScreen();
refreshScreenTimer.toc();
Expand Down
6 changes: 4 additions & 2 deletions source/frontends/sdl/sdlframe.cpp
Expand Up @@ -591,8 +591,9 @@ namespace sa2
g_dwCyclesThisFrame -= dwClksPerFrame;
if (g_bFullSpeed)
{
NTSC_VideoClockResync(g_dwCyclesThisFrame);
GetVideo().VideoRefreshBuffer(GetVideo().GetVideoMode(), true);
// only call VideoPresentScreen every 16ms
// hardcoded in FrameBase::VideoRedrawScreenDuringFullSpeed()
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
}
}
} while (totalCyclesExecuted < cyclesToExecute);
Expand Down Expand Up @@ -687,6 +688,7 @@ namespace sa2
// entering full speed
MB_Mute();
setGLSwapInterval(0);
VideoRedrawScreenDuringFullSpeed(0, true);
}
else
{
Expand Down

0 comments on commit 26a7293

Please sign in to comment.