diff --git a/pcsx2/SPU2/Mixer.cpp b/pcsx2/SPU2/Mixer.cpp index 72b4b31c7c437..b0dbd70b0d95b 100644 --- a/pcsx2/SPU2/Mixer.cpp +++ b/pcsx2/SPU2/Mixer.cpp @@ -28,16 +28,6 @@ static const s32 tbl_XA_Factor[16][2] = {98, -55}, {122, -60}}; -__forceinline s32 clamp_mix(s32 x) -{ - return std::clamp(x, -0x8000, 0x7fff); -} - -__forceinline StereoOut32 clamp_mix(StereoOut32 sample) -{ - return StereoOut32(clamp_mix(sample.Left), clamp_mix(sample.Right)); -} - static void __forceinline XA_decode_block(s16* buffer, const s16* block, s32& prev1, s32& prev2) { const s32 header = *block; diff --git a/pcsx2/SPU2/Mixer.h b/pcsx2/SPU2/Mixer.h index 6e40f640bf2b9..11a4544e92def 100644 --- a/pcsx2/SPU2/Mixer.h +++ b/pcsx2/SPU2/Mixer.h @@ -16,5 +16,3 @@ #pragma once extern void Mix(); -extern s32 clamp_mix(s32 x); -extern StereoOut32 clamp_mix(StereoOut32 sample); diff --git a/pcsx2/SPU2/defs.h b/pcsx2/SPU2/defs.h index b2c29e0d3f5f0..2d08792db2b97 100644 --- a/pcsx2/SPU2/defs.h +++ b/pcsx2/SPU2/defs.h @@ -40,11 +40,21 @@ extern s16 spu2M_Read(u32 addr); extern void spu2M_Write(u32 addr, s16 value); extern void spu2M_Write(u32 addr, u16 value); -static inline s16 SignExtend16(u16 v) +static __forceinline s16 SignExtend16(u16 v) { return (s16)v; } +static __forceinline s32 clamp_mix(s32 x) +{ + return std::clamp(x, -0x8000, 0x7fff); +} + +static __forceinline StereoOut32 clamp_mix(StereoOut32 sample) +{ + return StereoOut32(clamp_mix(sample.Left), clamp_mix(sample.Right)); +} + struct V_VolumeLR { static V_VolumeLR Max;