From 449b21fd6575d05e5d36c454d4ae85ea869634fb Mon Sep 17 00:00:00 2001 From: "sl1nk3.s" Date: Sun, 7 Feb 2010 19:36:29 +0000 Subject: [PATCH] Fix an issue with OpenAL not properly using the correct Volume on boot Proper fix for issue 1886 as well as a fix to OGL fullscreen code that might fix issue 2095 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5028 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/AudioCommon/Src/AudioCommonConfig.cpp | 2 +- Source/Core/AudioCommon/Src/OpenALStream.cpp | 3 +++ Source/Core/Core/Src/HW/CPU.cpp | 2 -- Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp | 2 +- Source/Core/DolphinWX/Src/Frame.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp index b175bfa982..a186c5cbaf 100644 --- a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp +++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp @@ -39,7 +39,7 @@ void AudioCommonConfig::Set(IniFile &file) { file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic); file.Set("Config", "EnableThrottle", m_EnableThrottle); file.Set("Config", "Backend", sBackend); -// file.Set("Config", "Volume", m_Volume); + file.Set("Config", "Volume", m_Volume); } // Update according to the values (stream/mixer) diff --git a/Source/Core/AudioCommon/Src/OpenALStream.cpp b/Source/Core/AudioCommon/Src/OpenALStream.cpp index 7945f44d86..15fe2d5fa8 100644 --- a/Source/Core/AudioCommon/Src/OpenALStream.cpp +++ b/Source/Core/AudioCommon/Src/OpenALStream.cpp @@ -144,6 +144,9 @@ void OpenALStream::SoundLoop() alBufferData(uiBuffers[i], AL_FORMAT_STEREO16, realtimeBuffer, OAL_MAX_SAMPLES, ulFrequency); alSourceQueueBuffers(uiSource, OAL_NUM_BUFFERS, uiBuffers); alSourcePlay(uiSource); + + // Set the default sound volume as saved in the config file. + alSourcef(uiSource, AL_GAIN, fVolume); err = alGetError(); // TODO: Error handling diff --git a/Source/Core/Core/Src/HW/CPU.cpp b/Source/Core/Core/Src/HW/CPU.cpp index 6ac1b12f8e..c5425a4055 100644 --- a/Source/Core/Core/Src/HW/CPU.cpp +++ b/Source/Core/Core/Src/HW/CPU.cpp @@ -56,8 +56,6 @@ reswitch: case PowerPC::CPU_RUNNING: //1: enter a fast runloop PowerPC::RunLoop(); - if (PowerPC::GetState() == PowerPC::CPU_POWERDOWN) - return; break; case PowerPC::CPU_STEPPING: diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index 83d2888ed8..e27fbdeefd 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -211,7 +211,7 @@ void Jit64::lXz(UGeckoInstruction inst) return; } - // Fast and daring/failing + // Fast and daring gpr.Lock(a, d); gpr.LoadToX64(a, true, false); gpr.LoadToX64(d, a == d, true); diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index b0ccd48019..84cba281e3 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -323,7 +323,7 @@ CFrame::CFrame(wxFrame* parent, , UseDebugger(_UseDebugger), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false) , bRenderToMain(false), bFloatLogWindow(false), bFloatConsoleWindow(false) , HaveLeds(false), HaveSpeakers(false) - , m_bControlsCreated(false), bNoWiimoteMsg(false), m_StopDlg(NULL) + , m_bControlsCreated(false), m_bModalDialogOpen(false), bNoWiimoteMsg(false), m_StopDlg(NULL) #if wxUSE_TIMER #ifdef _WIN32 , m_fLastClickTime(0), m_iLastMotionTime(0), LastMouseX(0), LastMouseY(0) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp index 2236949286..e1ba4d9d81 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp @@ -495,7 +495,7 @@ void ToggleFullscreen(HWND hParent, bool bForceFull) sscanf(g_Config.cInternalRes, "%dx%d", &w_fs, &h_fs); // FullScreen -> Desktop - ChangeDisplaySettings(NULL, 0); + ChangeDisplaySettings(NULL, CDS_FULLSCREEN); DWORD style = WS_OVERLAPPEDWINDOW; RECT rc = {0, 0, w_fs, h_fs};