Skip to content

Commit 4076b83

Browse files
committed
reimplement: SHC_3BB0A8C1_0x0047A2A0 100%
1 parent 0db75dc commit 4076b83

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "../SoundSystem.func.hpp"
2+
3+
namespace OpenSHC {
4+
namespace Audio {
5+
namespace MSS {
6+
7+
// FUNCTION: STRONGHOLDCRUSADER 0x0047A2A0
8+
void SoundSystem::setSomeSoundTime()
9+
{
10+
if (!(0 < this->sec_Section1055_0x3274 && this->mbr_0x154 != 2)) {
11+
return;
12+
}
13+
14+
if (this->mbr_0x154 == 1) {
15+
DWORD _currentTime = timeGetTime();
16+
// This logic seems to smooth out a time difference by not having the timestamp jump directly on
17+
// bigger delays. Instead, it settles slightly behind the real time, basically pushing the current
18+
// timestamp back a small bit, but in such a way that is gets closer and closer to the real time.
19+
this->someSoundTime_0x158
20+
= (_currentTime + ((_currentTime - this->someSoundTime_0x158) / 200) * -10) - 1;
21+
this->mbr_0x154 = 2;
22+
} else {
23+
this->mbr_0x154 = 2;
24+
this->someSoundTime_0x158 = timeGetTime();
25+
}
26+
}
27+
}
28+
29+
}
30+
}

status/addresses-SHC-3BB0A8C1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10898,7 +10898,7 @@ SHC_3BB0A8C1_0x0047A130 | 0.0% | Pending
1089810898
SHC_3BB0A8C1_0x0047A1B0 | 100.0% | Reimplemented
1089910899
SHC_3BB0A8C1_0x0047A220 | 0.0% | Pending
1090010900
SHC_3BB0A8C1_0x0047A290 | 100.0% | Reimplemented
10901-
SHC_3BB0A8C1_0x0047A2A0 | 0.0% | Pending
10901+
SHC_3BB0A8C1_0x0047A2A0 | 100.0% | Reimplemented
1090210902
SHC_3BB0A8C1_0x0047A310 | 0.0% | Pending
1090310903
SHC_3BB0A8C1_0x0047A340 | 0.0% | Pending
1090410904
SHC_3BB0A8C1_0x0047A554 | 0.0% | Pending

0 commit comments

Comments
 (0)