AX: enable low-pass/biquad filtering of Wiimote audio

This commit is contained in:
Tillmann Karras 2022-05-15 05:48:23 +01:00
parent 9d2841be10
commit 6946f17b8c
2 changed files with 14 additions and 0 deletions

View File

@ -229,6 +229,7 @@ struct PBBiquadFilter
union PBInfImpulseResponseWM
{
u16 on; // 0: off, 2: biquad, other: low-pass
PBLowPassFilter lpf;
PBBiquadFilter biquad;
};

View File

@ -562,6 +562,19 @@ void ProcessVoice(HLEAccelerator* accelerator, PB_TYPE& pb, const AXBuffers& buf
// Wiimote mixing.
if (pb.remote)
{
if (new_filter && pb.remote_iir.on != 0)
{
// Only one filter at most for Wiimotes.
if (pb.remote_iir.on == 2)
{
BiquadFilter(samples, count, pb.remote_iir.biquad);
}
else
{
LowPassFilter(samples, count, pb.remote_iir.lpf);
}
}
// Old AXWii versions process ms per ms.
u16 wm_count = count == 96 ? 18 : 6;