From 4076b83fe1e5f7956f47530e8309e3cd22d79c2b Mon Sep 17 00:00:00 2001 From: TheRedDaemon <66257843+TheRedDaemon@users.noreply.github.com> Date: Sun, 31 May 2026 23:04:56 +0200 Subject: [PATCH] reimplement: SHC_3BB0A8C1_0x0047A2A0 100% --- .../mss/SoundSystem/setSomeSoundTime.cpp | 30 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Audio/mss/SoundSystem/setSomeSoundTime.cpp diff --git a/src/OpenSHC/Audio/mss/SoundSystem/setSomeSoundTime.cpp b/src/OpenSHC/Audio/mss/SoundSystem/setSomeSoundTime.cpp new file mode 100644 index 0000000..94935b5 --- /dev/null +++ b/src/OpenSHC/Audio/mss/SoundSystem/setSomeSoundTime.cpp @@ -0,0 +1,30 @@ +#include "../SoundSystem.func.hpp" + +namespace OpenSHC { +namespace Audio { + namespace MSS { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047A2A0 + void SoundSystem::setSomeSoundTime() + { + if (!(0 < this->sec_Section1055_0x3274 && this->mbr_0x154 != 2)) { + return; + } + + if (this->mbr_0x154 == 1) { + DWORD _currentTime = timeGetTime(); + // This logic seems to smooth out a time difference by not having the timestamp jump directly on + // bigger delays. Instead, it settles slightly behind the real time, basically pushing the current + // timestamp back a small bit, but in such a way that is gets closer and closer to the real time. + this->someSoundTime_0x158 + = (_currentTime + ((_currentTime - this->someSoundTime_0x158) / 200) * -10) - 1; + this->mbr_0x154 = 2; + } else { + this->mbr_0x154 = 2; + this->someSoundTime_0x158 = timeGetTime(); + } + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 1a684d6..385054d 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -10898,7 +10898,7 @@ SHC_3BB0A8C1_0x0047A130 | 0.0% | Pending SHC_3BB0A8C1_0x0047A1B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047A220 | 0.0% | Pending SHC_3BB0A8C1_0x0047A290 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0047A2A0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047A2A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047A310 | 0.0% | Pending SHC_3BB0A8C1_0x0047A340 | 0.0% | Pending SHC_3BB0A8C1_0x0047A554 | 0.0% | Pending