mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-23 00:37:03 +02:00
[audio] correct biquad filter v2 parameters (#3142)
We had the same struct for v1 and v2 - this was tested only with MP4, should output correct sounds now and boot it. Co-authored-by: MaranBr <maranbr@outlook.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3142 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
parent
1e06c6f752
commit
06b83a58a6
7 changed files with 130 additions and 42 deletions
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -34,14 +37,22 @@ void BiquadFilterInfo::Update(BehaviorInfo::ErrorInfo& error_info,
|
|||
}
|
||||
|
||||
void BiquadFilterInfo::UpdateForCommandGeneration() {
|
||||
if (enabled) {
|
||||
usage_state = UsageState::Enabled;
|
||||
} else {
|
||||
usage_state = UsageState::Disabled;
|
||||
}
|
||||
usage_state = enabled ? UsageState::Enabled : UsageState::Disabled;
|
||||
|
||||
auto params{reinterpret_cast<ParameterVersion1*>(parameter.data())};
|
||||
params->state = ParameterState::Updated;
|
||||
auto* params_v1 = reinterpret_cast<ParameterVersion1*>(parameter.data());
|
||||
auto* params_v2 = reinterpret_cast<ParameterVersion2*>(parameter.data());
|
||||
|
||||
const auto raw_state_v1 = static_cast<u8>(params_v1->state);
|
||||
const auto raw_state_v2 = static_cast<u8>(params_v2->state);
|
||||
|
||||
if (raw_state_v1 <= static_cast<u8>(ParameterState::Updated)) {
|
||||
params_v1->state = ParameterState::Updated;
|
||||
} else if (raw_state_v2 <= static_cast<u8>(ParameterState::Updated)) {
|
||||
params_v2->state = ParameterState::Updated;
|
||||
} else {
|
||||
params_v1->state = ParameterState::Updated;
|
||||
params_v2->state = ParameterState::Updated;
|
||||
}
|
||||
}
|
||||
|
||||
void BiquadFilterInfo::InitializeResultState(EffectResultState& result_state) {}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
|
@ -27,10 +30,12 @@ public:
|
|||
struct ParameterVersion2 {
|
||||
/* 0x00 */ std::array<s8, MaxChannels> inputs;
|
||||
/* 0x06 */ std::array<s8, MaxChannels> outputs;
|
||||
/* 0x0C */ std::array<s16, 3> b;
|
||||
/* 0x12 */ std::array<s16, 2> a;
|
||||
/* 0x16 */ s8 channel_count;
|
||||
/* 0x17 */ ParameterState state;
|
||||
/* 0x0C */ u32 padding;
|
||||
/* 0x10 */ std::array<f32, 3> b;
|
||||
/* 0x1C */ std::array<f32, 2> a;
|
||||
/* 0x24 */ s8 channel_count;
|
||||
/* 0x25 */ ParameterState state;
|
||||
/* 0x26 */ u16 reserved;
|
||||
};
|
||||
static_assert(sizeof(ParameterVersion2) <= sizeof(EffectInfoBase::InParameterVersion2),
|
||||
"BiquadFilterInfo::ParameterVersion2 has the wrong size!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue