From 6668ba3e37fe4b2dce6840c818d0ae78524f2242 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:46:36 +0300 Subject: [PATCH] HLE DSP: Fix embedded buffer starting sample position --- src/core/audio/hle_core.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/audio/hle_core.cpp b/src/core/audio/hle_core.cpp index c01a8ccd..f150482b 100644 --- a/src/core/audio/hle_core.cpp +++ b/src/core/audio/hle_core.cpp @@ -292,6 +292,9 @@ namespace Audio { } if (config.embeddedBufferDirty) { + // Annoyingly, and only for embedded buffer, whether we use config.playPosition depends on the relevant dirty bit + const u32 playPosition = config.playPositionDirty ? config.playPosition : 0; + config.embeddedBufferDirty = 0; if (s32(config.length) >= 0) [[likely]] { // TODO: Add sample format and channel count @@ -303,7 +306,7 @@ namespace Audio { .adpcmDirty = config.adpcmDirty != 0, .looping = config.isLooping != 0, .bufferID = config.bufferID, - .playPosition = config.playPosition, + .playPosition = playPosition, .format = source.sampleFormat, .sourceType = source.sourceType, .fromQueue = false,