SPU: Fix DC filter types and clamping

Fix wrong type being used for dc filter state.

The filter seems to introduce some small amount of gain, so we need to
clamp it.
This commit is contained in:
Ziemas 2023-09-24 19:22:43 +02:00 committed by refractionpcsx2
parent 8b84b0403b
commit 0197aeeb4b
3 changed files with 3 additions and 3 deletions

View File

@ -691,8 +691,8 @@ __forceinline
// Edit: I'm sorry Jake, but I know of no good audio system that arbitrary distorts and clips // Edit: I'm sorry Jake, but I know of no good audio system that arbitrary distorts and clips
// output by design. // output by design.
// Good thing though that this code gets the volume exactly right, as per tests :) // Good thing though that this code gets the volume exactly right, as per tests :)
Out = clamp_mix(Out);
Out = DCFilter(Out); Out = DCFilter(Out);
Out = clamp_mix(Out);
SndBuffer::Write(StereoOut16(Out)); SndBuffer::Write(StereoOut16(Out));
// Update AutoDMA output positioning // Update AutoDMA output positioning

View File

@ -514,7 +514,7 @@ extern u16 InputPos;
// SPU Mixing Cycles ("Ticks mixed" counter) // SPU Mixing Cycles ("Ticks mixed" counter)
extern u32 Cycles; extern u32 Cycles;
// DC Filter state // DC Filter state
extern StereoOut16 DCFilterIn, DCFilterOut; extern StereoOut32 DCFilterIn, DCFilterOut;
extern s16 spu2regs[0x010000 / sizeof(s16)]; extern s16 spu2regs[0x010000 / sizeof(s16)];
extern s16 _spu2mem[0x200000 / sizeof(s16)]; extern s16 _spu2mem[0x200000 / sizeof(s16)];

View File

@ -37,7 +37,7 @@ V_CoreDebug DebugCores[2];
V_Core Cores[2]; V_Core Cores[2];
V_SPDIF Spdif; V_SPDIF Spdif;
StereoOut16 DCFilterIn, DCFilterOut; StereoOut32 DCFilterIn, DCFilterOut;
u16 OutPos; u16 OutPos;
u16 InputPos; u16 InputPos;
u32 Cycles; u32 Cycles;