audio_core: Fix reverb effect causing extreme noise on Windows

Fixed multiple bugs in reverb processing:
- Early gains for stereo channels not being assigned (missing *=)
- Incorrect TapOut pointer arithmetic (extra +1 offset)
- Uninitialized input pointer causing crashes
- Missing state initialization check
- SetDelay not called during parameter updates

Co-authored-by: MaranBr <maranbr@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-12-17 16:41:59 +10:00
parent b1192de0c4
commit 5fbfc6693b
2 changed files with 18 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -69,6 +70,7 @@ public:
buffer.resize(delay_time + 1, 0);
buffer_end = &buffer[delay_time];
output = &buffer[0];
input = &buffer[0];
decay = decay_rate;
sample_count_max = delay_time;
SetDelay(delay_time);
@@ -79,7 +81,6 @@ public:
return;
}
sample_count = delay_time;
input = &buffer[0];
}
Common::FixedPoint<50, 14> Tick(const Common::FixedPoint<50, 14> sample) {
@@ -107,10 +108,13 @@ public:
}
Common::FixedPoint<50, 14> TapOut(const s32 index) const {
auto out{input - (index + 1)};
const Common::FixedPoint<50, 14>* out{input - index};
if (out < buffer.data()) {
out += sample_count;
}
if (out >= buffer_end) {
out = buffer.data() + ((out - buffer.data()) % (sample_count_max + 1));
}
return *out;
}