From ad4bbbf92097277e56d8203de3e113dcc1e13ddc Mon Sep 17 00:00:00 2001 From: gigaherz Date: Tue, 16 Mar 2010 14:39:36 +0000 Subject: [PATCH] This should properly fix cubic interpolation. If it seems to dull the audio, it's because it's meant to. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2722 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/Mixer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/spu2-x/src/Mixer.cpp b/plugins/spu2-x/src/Mixer.cpp index b8b039dd32..7a776c265f 100644 --- a/plugins/spu2-x/src/Mixer.cpp +++ b/plugins/spu2-x/src/Mixer.cpp @@ -466,16 +466,16 @@ static s32 __forceinline GetVoiceValues_Cubic( V_Core& thiscore, uint voiceidx ) return ( a0*mu*mu2 + a1*mu2 + a2*mu + a3 );*/ - const s32 z0 = vc.PV4 - vc.PV3 - vc.PV1 + vc.PV2; - const s32 z1 = vc.PV1 - vc.PV2 - z0; - const s32 z2 = vc.PV3 - vc.PV1; + const s32 z0 = (vc.PV1 - vc.PV2) - (vc.PV4 - vc.PV3); + const s32 z1 = (vc.PV4 - vc.PV3) - z0; + const s32 z2 = (vc.PV2 - vc.PV4); - const s32 mu = vc.SP; + const s32 mu = vc.SP + 4096; s32 val = (z0 * mu) >> 12; val = ((val + z1) * mu) >> 12; val = ((val + z2) * mu) >> 12; - val += vc.PV2; + val += vc.PV3; // Note! It's very important that ADSR stay as accurate as possible. By the way // it is used, various sound effects can end prematurely if we truncate more than