Skip to content

Commit

Permalink
SPU2: Clamp before Applying master volume
Browse files Browse the repository at this point in the history
ApplyVolume needs both its arguments to be within 16bit range.

[SAVEVERSION+]
  • Loading branch information
Ziemas authored and refractionpcsx2 committed Oct 18, 2023
1 parent a90695e commit 7cc6f63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pcsx2/SPU2/Mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/SaveState.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cc6f63

Please sign in to comment.