diff --git a/source/Applewin.cpp b/source/Applewin.cpp index c8e9e37f..e22cfec3 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -230,7 +230,9 @@ void ContinueExecution(void) if (g_dwCyclesThisFrame >= dwClksPerFrame) { g_dwCyclesThisFrame -= dwClksPerFrame; - VideoEndOfVideoFrame(); // NTSC currently requires this ... need to investigate why + + // VideoEndOfVideoFrame(); // NTSC_TODO: is this still required? updates flash: if ((SW_TEXT || SW_MIXED) ) g_bTextFlashFlag = true + VideoRefreshScreen(0); // Just copy the output of our Apple framebuffer to the system Back Buffer MB_EndOfVideoFrame(); } diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 54c445f5..e200553f 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -310,7 +310,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA bool g_bTraceHeader = false; // semaphore, flag header to be printed DWORD extbench = 0; - bool g_bDebuggerViewingAppleOutput = false; + int g_bDebuggerViewingAppleOutput = false; // NOTE: alias for bVideoModeFlags! bool g_bIgnoreNextKey = false; @@ -6096,9 +6096,12 @@ Update_t _ViewOutput( ViewVideoPage_t iPage, int bVideoModeFlags ) default: break; } - +#if _DEBUG + if(!bVideoModeFlags) + MessageBoxA( NULL, "bVideoModeFlags = ZERO !?", "Information", MB_OK ); +#endif + g_bDebuggerViewingAppleOutput = bVideoModeFlags; VideoRefreshScreen( bVideoModeFlags ); - g_bDebuggerViewingAppleOutput = true; return UPDATE_NOTHING; // intentional } diff --git a/source/Debugger/Debug.h b/source/Debugger/Debug.h index 26c3ecec..8c1fdc79 100644 --- a/source/Debugger/Debug.h +++ b/source/Debugger/Debug.h @@ -105,7 +105,7 @@ extern int g_aDisasmTargets[ MAX_DISPLAY_LINES ]; // Display - extern bool g_bDebuggerViewingAppleOutput; + extern int g_bDebuggerViewingAppleOutput; // Font extern int g_nFontHeight; diff --git a/source/Frame.cpp b/source/Frame.cpp index ad696605..aa87f0f6 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -565,6 +565,7 @@ static void DrawFrameWindow () else // Win7: In fullscreen mode with 1 redraw, the the screen doesn't get redraw. //VideoRedrawScreen(g_bIsFullScreen ? 2 : 1); // TC: 22/06/2014: Why 2 redraws in full-screen mode (32-bit only)? (8-bit doesn't need this nor does Win8, just Win7 or older OS's) + //VideoRefreshScreen(0); VideoRedrawScreen(); // DD Full-Screen Palette: BUGFIX: needs to come _after_ all drawing... @@ -1173,8 +1174,8 @@ LRESULT CALLBACK FrameWndProc ( VideoReinitialize(); if ((g_nAppMode != MODE_LOGO) || ((g_nAppMode == MODE_DEBUG) && (g_bDebuggerViewingAppleOutput))) { - VideoRedrawScreen(); - g_bDebuggerViewingAppleOutput = true; + //VideoRedrawScreen(); + VideoRefreshScreen( g_bDebuggerViewingAppleOutput ); } Config_Save_Video(); diff --git a/source/Video.cpp b/source/Video.cpp index 6a7a941f..41f87868 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -1196,7 +1196,8 @@ void VideoRealizePalette(HDC dc) void VideoRedrawScreen () { g_VideoForceFullRedraw = 1; - VideoRefreshScreen( g_uVideoMode ); + + VideoRefreshScreen( g_uVideoMode ); //g_uVideoMode ); } //=========================================================================== @@ -1246,8 +1247,11 @@ void VideoRefreshScreen ( int bVideoModeFlags ) DebugRefresh(0); #endif - NTSC_SetVideoMode( bVideoModeFlags ); - g_pNTSC_FuncVideoUpdate( VIDEO_SCANNER_6502_CYCLES ); + if( bVideoModeFlags ) + { + NTSC_SetVideoMode( bVideoModeFlags ); + g_pNTSC_FuncVideoUpdate( VIDEO_SCANNER_6502_CYCLES ); + } // NTSC_BEGIN: wsVideoRefresh() LPBYTE pDstFrameBufferBits = 0; @@ -1256,8 +1260,14 @@ void VideoRefreshScreen ( int bVideoModeFlags ) if (hFrameDC) { -// StretchBlt(hFrameDC,0,0,VIEWPORTCX,VIEWPORTCY,g_hDeviceDC,0,0,FRAMEBUFFER_W,FRAMEBUFFER_H,SRCCOPY); - StretchBlt(hFrameDC,0,0,FRAMEBUFFER_W,FRAMEBUFFER_H,g_hDeviceDC,0,0,FRAMEBUFFER_W,FRAMEBUFFER_H,SRCCOPY); + StretchBlt( + hFrameDC, + 0,0, + FRAMEBUFFER_W,FRAMEBUFFER_H, + g_hDeviceDC, + 0,0, + FRAMEBUFFER_W,FRAMEBUFFER_H, + SRCCOPY ); GdiFlush(); } @@ -1335,7 +1345,7 @@ BYTE VideoSetMode (WORD, WORD address, BYTE write, BYTE, ULONG uExecutedCycles) // NB. Deferring the update by just setting /g_VideoForceFullRedraw/ is not an option, since this doesn't provide "flip-immediate" // // Ultimately this isn't the correct solution, and proper cycle-accurate video rendering should be done, but this is a much bigger job! - // + // TODO: Is MemReadFloatingBus() still accurate now that we have proper per cycle video rendering?? if (!g_bVideoUpdatedThisFrame) {