diff --git a/source/Applewin.cpp b/source/Applewin.cpp index a69336f8..6e40438f 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -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"); diff --git a/source/Applewin.h b/source/Applewin.h index b57efcde..43baf895 100644 --- a/source/Applewin.h +++ b/source/Applewin.h @@ -31,6 +31,7 @@ extern TCHAR g_sProgramDir[MAX_PATH]; extern TCHAR g_sCurrentDir[MAX_PATH]; extern BOOL restart; +extern bool g_bRestartFullScreen; extern DWORD g_dwSpeed; extern double g_fCurrentCLK6502; diff --git a/source/Frame.cpp b/source/Frame.cpp index a67eee8b..3c5d83b0 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -978,6 +978,8 @@ LRESULT CALLBACK FrameWndProc ( case WM_CLOSE: LogFileOutput("WM_CLOSE\n"); + if (g_bIsFullScreen && restart) + g_bRestartFullScreen = true; if (g_bIsFullScreen) SetNormalMode(); if (!IsIconic(window)) @@ -1224,10 +1226,9 @@ LRESULT CALLBACK FrameWndProc ( DrawStatusArea( (HDC)0, DRAW_TITLE ); VideoReinitialize(); - if ((g_nAppMode != MODE_LOGO) || ((g_nAppMode == MODE_DEBUG) && (g_bDebuggerViewingAppleOutput))) + if (g_nAppMode != MODE_LOGO) { - //VideoRedrawScreen(); - VideoRefreshScreen( g_bDebuggerViewingAppleOutput ); + VideoRefreshScreen( g_nAppMode == MODE_DEBUG ? g_bDebuggerViewingAppleOutput : 0); } Config_Save_Video(); diff --git a/source/NTSC.cpp b/source/NTSC.cpp index 1bc852b4..6bcaeb97 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -121,10 +121,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define VIDEO_SCANNER_Y_MIXED 160 // num scanlins for mixed graphics + text #define VIDEO_SCANNER_Y_DISPLAY 192 // max displayable scanlines - uint16_t g_aHorzClockMemAddress[VIDEO_SCANNER_MAX_HORZ]; + static uint16_t g_aHorzClockMemAddress[VIDEO_SCANNER_MAX_HORZ]; - bgra_t *g_pVideoAddress = 0; - bgra_t *g_pScanLines[VIDEO_SCANNER_Y_DISPLAY*2]; // To maintain the 280x192 aspect ratio for 560px width, we double every scan line -> 560x384 + static bgra_t *g_pVideoAddress = 0; + static bgra_t *g_pScanLines[VIDEO_SCANNER_Y_DISPLAY*2]; // To maintain the 280x192 aspect ratio for 560px width, we double every scan line -> 560x384 static unsigned (*g_pHorzClockOffset)[VIDEO_SCANNER_MAX_HORZ] = 0; @@ -770,7 +770,7 @@ inline void updateVideoScannerHorzEOL() //=========================================================================== inline void updateVideoScannerAddress() { - g_pVideoAddress = g_pScanLines[2*g_nVideoClockVert]; + g_pVideoAddress = g_nVideoClockVert