Fixed screen update when running at full-speed

. Specifically IBIZA.DSK demo which streams data from the disk throughout (ie. so runs at full-speed all the time)
. Update the screen every frame, but only if video memory has changed (check AZTEC.DSK loading time)
. NB. When running at full-speed, then 6502 emulation doesn't do cycle-accurate video updates
Fixed crash that could occur when switch video mode (F9) when running at full-speed
. Occured when g_nVideoClockVert was >= 192
This commit is contained in:
tomcw
2016-07-23 22:53:29 +01:00
parent 66e468db65
commit 02b0d7419a
6 changed files with 82 additions and 7 deletions
+16
View File
@@ -79,6 +79,7 @@ TCHAR g_sDebugDir [MAX_PATH] = TEXT(""); // TODO: Not currently used
TCHAR g_sScreenShotDir[MAX_PATH] = TEXT(""); // TODO: Not currently used
TCHAR g_sCurrentDir[MAX_PATH] = TEXT(""); // Also Starting Dir. Debugger uses this when load/save
BOOL restart = 0;
bool g_bRestartFullScreen = false;
DWORD g_dwSpeed = SPEED_NORMAL; // Affected by Config dialog's speed slider bar
double g_fCurrentCLK6502 = CLK_6502; // Affected by Config dialog's speed slider bar
@@ -215,7 +216,10 @@ void ContinueExecution(void)
else
{
if (bWasFullSpeed)
{
VideoRedrawScreenDuringFullSpeed(0, true); // Invalidate the copies of video memory
VideoRedrawScreenAfterFullSpeed(g_dwCyclesThisFrame);
}
// Don't call Spkr_Demute()
MB_Demute();
@@ -247,6 +251,12 @@ void ContinueExecution(void)
{
g_dwCyclesThisFrame -= dwClksPerFrame;
if (g_bFullSpeed)
{
// For IBIZA.DSK
VideoRedrawScreenDuringFullSpeed(g_dwCyclesThisFrame);
}
VideoRefreshScreen(0); // Just copy the output of our Apple framebuffer to the system Back Buffer
MB_EndOfVideoFrame();
}
@@ -1146,6 +1156,12 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
EnterMessageLoop();
LogFileOutput("Main: LeaveMessageLoop()\n");
if (restart)
{
bSetFullScreen = g_bRestartFullScreen;
g_bRestartFullScreen = false;
}
MB_Reset();
LogFileOutput("Main: MB_Reset()\n");