From 4622cfbc124a02fd5fca8a5207be3aeaaddf8e9e Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Wed, 23 Jul 2003 22:22:14 +0000 Subject: [PATCH] More bug fixes --- zsnes/src/win/winlink.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index feda9ef7..e8782799 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -271,17 +271,26 @@ void DDrawError(){ extern "C" BYTE vsyncon; extern "C" BYTE KitchenSync; - extern "C" BYTE TripleBufferWin; void DrawScreen() { if (FullScreen == 1) { - if (TripleBufferWin == 1) + if (TripleBufferWin == 1 || KitchenSync == 1) { DD_BackBuffer->Blt(NULL, DD_CFB, &BlitArea, DDBLT_WAIT, NULL); DD_Primary->Flip(NULL, DDFLIP_WAIT); + + if (KitchenSync == 1) + { + if (DD_BackBuffer->Blt(&rcWindow, DD_CFB, &BlitArea, DDBLT_WAIT, NULL) == DDERR_SURFACELOST) + DD_Primary->Restore(); + + if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST) + DD_Primary->Restore(); + } + } else { @@ -294,14 +303,7 @@ void DrawScreen() } DD_Primary->Blt(&rcWindow, DD_CFB, &BlitArea, DDBLT_WAIT, NULL); } - if (KitchenSync == 1) - { - if (DD_BackBuffer->Blt(&rcWindow, DD_CFB, &BlitArea, DDBLT_WAIT, NULL) == DDERR_SURFACELOST) - DD_Primary->Restore(); - if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST) - DD_Primary->Restore(); - } } else { @@ -312,7 +314,7 @@ void DrawScreen() DDrawError(); } } - DD_Primary->Blt(&rcWindow, DD_CFB, &BlitArea, DDBLT_WAIT, NULL); + DD_Primary->Blt(&rcWindow, AltSurface == 0 ? DD_CFB : DD_CFB16, &BlitArea, DDBLT_WAIT, NULL); } }