From 7cc6f635fc475d4a22be5034e2179229027c9a3e Mon Sep 17 00:00:00 2001 From: Ziemas Date: Wed, 18 Oct 2023 14:47:28 +0200 Subject: [PATCH] SPU2: Clamp before Applying master volume ApplyVolume needs both its arguments to be within 16bit range. [SAVEVERSION+] --- pcsx2/SPU2/Mixer.cpp | 5 ++--- pcsx2/SaveState.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pcsx2/SPU2/Mixer.cpp b/pcsx2/SPU2/Mixer.cpp index b88c7324dea64..72b4b31c7c437 100644 --- a/pcsx2/SPU2/Mixer.cpp +++ b/pcsx2/SPU2/Mixer.cpp @@ -633,7 +633,7 @@ __forceinline Ext = StereoOut32::Empty; else { - Ext = clamp_mix(ApplyVolume(Ext, Cores[0].MasterVol)); + Ext = ApplyVolume(clamp_mix(Ext), Cores[0].MasterVol); } // Commit Core 0 output to ram before mixing Core 1: @@ -657,8 +657,7 @@ __forceinline } else { - Out.Left = ApplyVolume(Out.Left, Cores[1].MasterVol.Left.Value); - Out.Right = ApplyVolume(Out.Right, Cores[1].MasterVol.Right.Value); + Out = ApplyVolume(clamp_mix(Out), Cores[1].MasterVol); } // For a long time PCSX2 has had its output volume halved by diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 2153a0908bf8e..bc79047f38067 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -37,7 +37,7 @@ enum class FreezeAction // [SAVEVERSION+] // This informs the auto updater that the users savestates will be invalidated. -static const u32 g_SaveVersion = (0x9A46 << 16) | 0x0000; +static const u32 g_SaveVersion = (0x9A47 << 16) | 0x0000; // the freezing data between submodules and core