SPC-700 APU DSP FIR filter

If you're having problems with Snes9x, or think you've found a bug, this is the place to be.
Post Reply
funraiser
Snes9x White Belt
Posts: 3
Joined: Tue Apr 24, 2012 2:06 am

SPC-700 APU DSP FIR filter

Post by funraiser »

Hello,

Anyone have the FIR Filter equation in the SPC700 DSP echo block ?
I am interest to know how setting the FIR coefficients will affect the echo feedback.

Thanks
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Re: SPC-700 APU DSP FIR filter

Post by BearOso »

It's actually in the form of a table in the source:
https://github.com/snes9xgit/snes9x/blo ... SP.cpp#L93
It's much more difficult to edit in this form, so I'm not sure if that's going to help much. :-)
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Re: SPC-700 APU DSP FIR filter

Post by BearOso »

Whoops, I thought you meant the gaussian filter. Echo is at
https://github.com/snes9xgit/snes9x/blo ... P.cpp#L593

Slightly easier.
funraiser
Snes9x White Belt
Posts: 3
Joined: Tue Apr 24, 2012 2:06 am

Re: SPC-700 APU DSP FIR filter

Post by funraiser »

Thanks BearOso :) that is of great help, I am reading them

In this
https://github.com/snes9xgit/snes9x/blo ... P.cpp#L593
at line 385

inline VOICE_CLOCK( V1 )
{
m.t_dir_addr = m.t_dir * 0x100 + m.t_srcn * 4;
m.t_srcn = VREG(v->regs,srcn);
}

should the two statements be reversed in order ?
The m.t_srcn be evaluated to reflect the current VREG,
otherwise m.t_dir_addr will be of an earlier value ?
funraiser
Snes9x White Belt
Posts: 3
Joined: Tue Apr 24, 2012 2:06 am

Re: SPC-700 APU DSP FIR filter

Post by funraiser »

In this subroutine
https://github.com/snes9xgit/snes9x/blo ... P.cpp#L593

// Gaussian interpolation
{
int output = interpolate( v );

// Noise
if ( m.t_non & v->vbit )
output = (int16_t) (m.noise * 2);

// Apply envelope
m.t_output = (output * v->env) >> 11 & ~1;
v->t_envx_out = (uint8_t) (v->env >> 4);
}

*****************************************
Can we "logic shortcut" it so execution can be faster without evaluating interpolate in some cases and drop it during the noise ?
that is, there is no "side-effect" in interpolate that must be run each time ?

// Gaussian interpolation
{
int output;

// Noise or interpolate
if ( m.t_non & v->vbit ) output = (int16_t) (m.noise * 2);
else output = interpolate(v);

// Apply envelope
m.t_output = (output * v->env) >> 11 & ~1;
v->t_envx_out = (uint8_t) (v->env >> 4);
}
Post Reply