mirror of https://github.com/PCSX2/pcsx2.git
SPU2-X: Slightly better algo for the new reverb. :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2084 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
f016eca844
commit
6032a142dd
|
@ -143,8 +143,6 @@ StereoOut32 V_Core::DoReverb( const StereoOut32& Input )
|
|||
const s32 IIR_INPUT_B0 = ((_spu2mem[src_b0] * Revb.IIR_COEF) + (INPUT_SAMPLE.Left * Revb.IN_COEF_L))>>16;
|
||||
const s32 IIR_INPUT_B1 = ((_spu2mem[src_b1] * Revb.IIR_COEF) + (INPUT_SAMPLE.Right * Revb.IN_COEF_R))>>16;
|
||||
|
||||
// Faster single-mul approach to interpolation:
|
||||
// (doesn't work yet -- breaks Digital Devil Saga badly)
|
||||
const s32 IIR_A0 = IIR_INPUT_A0 + (((_spu2mem[dest_a0]-IIR_INPUT_A0) * Revb.IIR_ALPHA)>>16);
|
||||
const s32 IIR_A1 = IIR_INPUT_A1 + (((_spu2mem[dest_a1]-IIR_INPUT_A1) * Revb.IIR_ALPHA)>>16);
|
||||
const s32 IIR_B0 = IIR_INPUT_B0 + (((_spu2mem[dest_b0]-IIR_INPUT_B0) * Revb.IIR_ALPHA)>>16);
|
||||
|
@ -155,28 +153,30 @@ StereoOut32 V_Core::DoReverb( const StereoOut32& Input )
|
|||
_spu2mem[dest2_b0] = clamp_mix( IIR_B0 );
|
||||
_spu2mem[dest2_b1] = clamp_mix( IIR_B1 );
|
||||
|
||||
const s32 ACC0 =
|
||||
const s32 ACC0 = (
|
||||
((_spu2mem[acc_src_a0] * Revb.ACC_COEF_A)) +
|
||||
((_spu2mem[acc_src_b0] * Revb.ACC_COEF_B)) +
|
||||
((_spu2mem[acc_src_c0] * Revb.ACC_COEF_C)) +
|
||||
((_spu2mem[acc_src_d0] * Revb.ACC_COEF_D));
|
||||
((_spu2mem[acc_src_d0] * Revb.ACC_COEF_D))
|
||||
) >> 16;
|
||||
|
||||
const s32 ACC1 =
|
||||
const s32 ACC1 = (
|
||||
((_spu2mem[acc_src_a1] * Revb.ACC_COEF_A)) +
|
||||
((_spu2mem[acc_src_b1] * Revb.ACC_COEF_B)) +
|
||||
((_spu2mem[acc_src_c1] * Revb.ACC_COEF_C)) +
|
||||
((_spu2mem[acc_src_d1] * Revb.ACC_COEF_D));
|
||||
((_spu2mem[acc_src_d1] * Revb.ACC_COEF_D)))
|
||||
>> 16;
|
||||
|
||||
const s32 FB_A0 = (_spu2mem[fb_src_a0] * Revb.FB_ALPHA);
|
||||
const s32 FB_A1 = (_spu2mem[fb_src_a1] * Revb.FB_ALPHA);
|
||||
const s32 acc_fb_mix_a = ACC0 + ((_spu2mem[fb_src_a0] - ACC0) * Revb.FB_ALPHA);
|
||||
const s32 acc_fb_mix_b = ACC1 + ((_spu2mem[fb_src_a1] - ACC1) * Revb.FB_ALPHA);
|
||||
|
||||
const s32 fb_xor_a0 = _spu2mem[fb_src_a0] * ( Revb.FB_ALPHA ^ 0x8000 );
|
||||
const s32 fb_xor_a1 = _spu2mem[fb_src_a1] * ( Revb.FB_ALPHA ^ 0x8000 );
|
||||
const s32 FB_A0 = (_spu2mem[fb_src_a0] * Revb.FB_ALPHA) >> 16;
|
||||
const s32 FB_A1 = (_spu2mem[fb_src_a1] * Revb.FB_ALPHA) >> 16;
|
||||
|
||||
_spu2mem[mix_dest_a0] = clamp_mix( (ACC0 - FB_A0) >> 16 );
|
||||
_spu2mem[mix_dest_a1] = clamp_mix( (ACC1 - FB_A1) >> 16 );
|
||||
_spu2mem[mix_dest_b0] = clamp_mix( (MulShr32(Revb.FB_ALPHA<<16, ACC0) - fb_xor_a0 - (_spu2mem[fb_src_b0] * Revb.FB_X)) >> 16 );
|
||||
_spu2mem[mix_dest_b1] = clamp_mix( (MulShr32(Revb.FB_ALPHA<<16, ACC1) - fb_xor_a1 - (_spu2mem[fb_src_b1] * Revb.FB_X)) >> 16 );
|
||||
_spu2mem[mix_dest_a0] = clamp_mix( ACC0 - FB_A0 );
|
||||
_spu2mem[mix_dest_a1] = clamp_mix( ACC1 - FB_A1 );
|
||||
_spu2mem[mix_dest_b0] = clamp_mix( (acc_fb_mix_a - (_spu2mem[fb_src_b0] * Revb.FB_X)) >> 16 );
|
||||
_spu2mem[mix_dest_b1] = clamp_mix( (acc_fb_mix_b - (_spu2mem[fb_src_b1] * Revb.FB_X)) >> 16 );
|
||||
|
||||
upbuf[ubpos] = clamp_mix( StereoOut32(
|
||||
_spu2mem[mix_dest_a0] + _spu2mem[mix_dest_b0], // left
|
||||
|
|
Loading…
Reference in New Issue