From 1e4c887933a30da6665e37d64dd2b17f15ad972b Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Fri, 1 Jun 2001 01:52:21 +0000 Subject: [PATCH] Added triple buffering to GUI --- zsnes/src/win/winintrf.asm | 2 +- zsnes/src/win/winlink.cpp | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index 973287ad..7b748ac6 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -1298,7 +1298,7 @@ NEWSYM GUIWFVID, db 0,0,0,1,0,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0 ; If Windo NEWSYM GUIDSIZE, db 0,0,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1 NEWSYM GUIRATIO, db 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 NEWSYM GUIBIFIL, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -NEWSYM GUITBWVID, db 0,0,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1,0,1,0,1 ; Triple Buffering (Win) +NEWSYM GUITBWVID, db 0,0,0,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,1 ; Triple Buffering (Win) SECTION .text ; **************************** diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 63cc52c7..237a37ea 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -155,6 +155,7 @@ void DDrawError(){ } extern "C" BYTE vsyncon; +extern "C" BYTE TripleBufferWin; void DrawScreen() { @@ -162,8 +163,15 @@ void DrawScreen() { if(FullScreen == 1) { - DD_BackBuffer->Blt(NULL, DD_CFB, NULL, DDBLT_WAIT, NULL); - DD_Primary->Flip(NULL, DDFLIP_WAIT); + if(TripleBufferWin == 1) + { + DD_BackBuffer->Blt(NULL, DD_CFB, NULL, DDBLT_WAIT, NULL); + DD_Primary->Flip(NULL, DDFLIP_WAIT); + } + else + { + DD_Primary->Blt(&rcWindow, DD_CFB, NULL, DDBLT_WAIT, NULL); + } } else { @@ -178,8 +186,15 @@ void DrawScreen() { if(FullScreen == 1) { - DD_BackBuffer->Blt(NULL, DD_CFB, NULL, DDBLT_WAIT, NULL); - DD_Primary->Flip(NULL, DDFLIP_NOVSYNC); + if(TripleBufferWin == 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); + } } else {