From 85ff52e50214d2983e194d7804ce96e0023e8afe Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Sat, 22 Jul 2017 21:16:17 -0500 Subject: [PATCH] Disable Legacy Audio Hack Option Currently legacy audio hack option is not implemented, so it's disabled before merge into master repo. Plus force all unimplemented functions to output once, not repeatly. --- resource/Cxbx.rc | 2 +- src/CxbxKrnl/EmuDSoundInline.hpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/resource/Cxbx.rc b/resource/Cxbx.rc index 824c81e26..37dabe770 100644 --- a/resource/Cxbx.rc +++ b/resource/Cxbx.rc @@ -273,7 +273,7 @@ COMBOBOX IDC_AC_AUDIO_ADAPTER, 76, 12, 173, 100, CBS_DROPDOWNLIST | WS_VS CONTROL "Enable PCM", IDC_AC_PCM, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 76, 46, 65, 10 CONTROL "Enable XADPCM", IDC_AC_XADPCM, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 76, 59, 123, 11 CONTROL "Enable Unknown Codec", IDC_AC_UNKNOWN_CODEC, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 76, 72, 98, 10 -CONTROL "Use Legacy Audio Hack", IDC_AC_LEGACY_AUDIO_HACK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 76, 33, 98, 10 +CONTROL "Use Legacy Audio Hack", IDC_AC_LEGACY_AUDIO_HACK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 76, 33, 98, 10 PUSHBUTTON "Cancel", IDC_AC_CANCEL, 146, 102, 50, 14, BS_FLAT PUSHBUTTON "Accept", IDC_AC_ACCEPT, 206, 102, 50, 14, BS_FLAT GROUPBOX "DirectSound Configuration", IDC_STATIC, 4, 1, 250, 98, BS_CENTER diff --git a/src/CxbxKrnl/EmuDSoundInline.hpp b/src/CxbxKrnl/EmuDSoundInline.hpp index e8026c72e..707f3f1fa 100644 --- a/src/CxbxKrnl/EmuDSoundInline.hpp +++ b/src/CxbxKrnl/EmuDSoundInline.hpp @@ -40,9 +40,11 @@ // LOG_UNIMPLEMENTED indicates that Cxbx is missing an implementation from DSound api #define LOG_UNIMPLEMENTED_DSOUND() \ - do { if(g_bPrintfOn) { \ - std::cout << __func__ << " unimplemented!\n"; \ - } } while (0) + static bool b_echoOnce = true; \ + if (g_bPrintfOn && b_echoOnce) { \ + std::cout << __func__ << " unimplemented!\n"; \ + b_echoOnce = false; \ + } CRITICAL_SECTION g_DSoundCriticalSection; #define enterCriticalSection EnterCriticalSection(&g_DSoundCriticalSection) @@ -1210,6 +1212,9 @@ inline HRESULT HybridDirectSoundBuffer_SetVolume( } if (lVolume > -10000 && lVolume <= -6400) { lVolume = -10000; + } else if (lVolume > 0) { + EmuWarning("HybridDirectSoundBuffer_SetVolume has received greater than 0: %d", lVolume); + lVolume = 0; } HRESULT hRet = pDSBuffer->SetVolume(lVolume);