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
This commit is contained in:
gigaherz 2010-03-16 14:39:36 +00:00
parent 5087099871
commit ad4bbbf920
1 changed files with 5 additions and 5 deletions

View File

@ -466,16 +466,16 @@ static s32 __forceinline GetVoiceValues_Cubic( V_Core& thiscore, uint voiceidx )
return ( a0*mu*mu2 + a1*mu2 + a2*mu + a3 );*/ return ( a0*mu*mu2 + a1*mu2 + a2*mu + a3 );*/
const s32 z0 = vc.PV4 - vc.PV3 - vc.PV1 + vc.PV2; const s32 z0 = (vc.PV1 - vc.PV2) - (vc.PV4 - vc.PV3);
const s32 z1 = vc.PV1 - vc.PV2 - z0; const s32 z1 = (vc.PV4 - vc.PV3) - z0;
const s32 z2 = vc.PV3 - vc.PV1; const s32 z2 = (vc.PV2 - vc.PV4);
const s32 mu = vc.SP; const s32 mu = vc.SP + 4096;
s32 val = (z0 * mu) >> 12; s32 val = (z0 * mu) >> 12;
val = ((val + z1) * mu) >> 12; val = ((val + z1) * mu) >> 12;
val = ((val + z2) * 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 // 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 // it is used, various sound effects can end prematurely if we truncate more than