From a92878a626226f63b8a2cfccf2f67694de1fbec2 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Wed, 9 Feb 2005 03:10:26 +0000 Subject: [PATCH] Primary buffer toggle no longer a dummy. --- zsnes/src/win/winlink.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 97d3650b..62d7c98d 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -731,6 +731,7 @@ int RegisterWinClass(void) BYTE PrevStereoSound; DWORD PrevSoundQuality; +extern unsigned char PrimaryBuffer; BOOL InitSound() { @@ -748,13 +749,25 @@ BOOL InitSound() { lpDirectSound->Initialize(NULL); - if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_NORMAL)) //DSSCL_WRITEPRIMARY, fix this StatMat - make a toggle - { - if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE)) - return FALSE; - } - else UsePrimaryBuffer=0; //1, fix this StatMat - make a toggle - } + if (PrimaryBuffer) + { + if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_WRITEPRIMARY)) + { + if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE)) + return FALSE; + } + else UsePrimaryBuffer=1; + } + else + { + if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_NORMAL)) + { + if (DS_OK != lpDirectSound->SetCooperativeLevel(hMainWindow, DSSCL_EXCLUSIVE)) + return FALSE; + } + else UsePrimaryBuffer=0; + } + } else { return FALSE;