From 5fe760f094e7cd2092527cea0895552ffd5e31e1 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Thu, 31 May 2001 02:45:42 +0000 Subject: [PATCH] Fixed vsync in fullscreen mode --- zsnes/src/win/winlink.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 77e3e397..c8e0970d 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -159,21 +159,32 @@ extern "C" BYTE vsyncon; void DrawScreen() { - if(FullScreen == 1) + if (vsyncon == 1) { - DD_BackBuffer->Blt(NULL, DD_CFB, NULL, DDBLT_WAIT, NULL); - DD_Primary->Flip(NULL, DDFLIP_WAIT); - } - else - { - if (vsyncon == 1) + if(FullScreen == 1) + { + DD_BackBuffer->Blt(NULL, DD_CFB, NULL, DDBLT_WAIT, NULL); + DD_Primary->Flip(NULL, DDFLIP_WAIT); + } + else { if(lpDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL) != DD_OK) { DDrawError(); } } - DD_Primary->Blt(&rcWindow, DD_CFB, NULL, DDBLT_WAIT, NULL); + } + else + { + if(FullScreen == 1) + { + DD_BackBuffer->Blt(NULL, DD_CFB, NULL, DDBLT_WAIT, NULL); + DD_Primary->Flip(NULL, DDFLIP_NOVSYNC); + } + else + { + DD_Primary->Blt(&rcWindow, DD_CFB, NULL, DDBLT_WAIT, NULL); + } } }