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);
}