Browse Source

[audio] add splitter_size (#3477)

Thanks to: https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/257
Credits to Coxxs and his friend.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3477
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: Maufeat <sahyno1996@gmail.com>
Co-committed-by: Maufeat <sahyno1996@gmail.com>
dravee/less-toggle
Maufeat 1 day ago
committed by crueter
parent
commit
28a78d76fe
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 7
      src/audio_core/renderer/behavior/info_updater.cpp
  2. 5
      src/audio_core/renderer/behavior/info_updater.h
  3. 8
      src/audio_core/renderer/splitter/splitter_context.cpp
  4. 5
      src/audio_core/renderer/splitter/splitter_context.h

7
src/audio_core/renderer/behavior/info_updater.cpp

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
@ -616,12 +616,11 @@ Result InfoUpdater::UpdateErrorInfo(const BehaviorInfo& behaviour_) {
}
Result InfoUpdater::UpdateSplitterInfo(SplitterContext& splitter_context) {
u32 consumed_size{0};
if (!splitter_context.Update(input, consumed_size)) {
if (!splitter_context.Update(input)) {
return Service::Audio::ResultInvalidUpdateInfo;
}
input += consumed_size;
input += in_header->splitter_size;
return ResultSuccess;
}

5
src/audio_core/renderer/behavior/info_updater.h

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 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
@ -35,7 +38,7 @@ class InfoUpdater {
/* 0x18 */ u32 mix_size{};
/* 0x1C */ u32 sinks_size{};
/* 0x20 */ u32 performance_buffer_size{};
/* 0x24 */ char unk24[4];
/* 0x24 */ u32 splitter_size{};
/* 0x28 */ u32 render_info_size{};
/* 0x2C */ char unk2C[0x10];
/* 0x3C */ u32 size{sizeof(UpdateDataHeader)};

8
src/audio_core/renderer/splitter/splitter_context.cpp

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
@ -93,16 +93,14 @@ bool SplitterContext::Initialize(const BehaviorInfo& behavior,
return true;
}
bool SplitterContext::Update(const u8* input, u32& consumed_size) {
bool SplitterContext::Update(const u8* input) {
auto in_params{reinterpret_cast<const InParameterHeader*>(input)};
if (destinations_count == 0 || info_count == 0) {
consumed_size = 0;
return true;
}
if (in_params->magic != GetSplitterInParamHeaderMagic()) {
consumed_size = 0;
return false;
}
@ -113,8 +111,6 @@ bool SplitterContext::Update(const u8* input, u32& consumed_size) {
u32 offset{sizeof(InParameterHeader)};
offset = UpdateInfo(input, offset, in_params->info_count);
offset = UpdateData(input, offset, in_params->destination_count);
consumed_size = Common::AlignUp(offset, 0x10);
return true;
}

5
src/audio_core/renderer/splitter/splitter_context.h

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
@ -104,9 +104,8 @@ public:
*
* @param input - Input buffer with the new info,
* expected to point to a InParameterHeader.
* @param consumed_size - Output with the number of bytes consumed from input.
*/
bool Update(const u8* input, u32& consumed_size);
bool Update(const u8* input);
/**
* Update the splitters.

Loading…
Cancel
Save