Skip to content

Commit f748544

Browse files
committed
reimplement: SHC_3BB0A8C1_0x00479FC0 100%
1 parent 07477ad commit f748544

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#include "../SoundSystem.func.hpp"
2+
3+
namespace OpenSHC {
4+
namespace Audio {
5+
namespace MSS {
6+
7+
// FUNCTION: STRONGHOLDCRUSADER 0x00479FC0
8+
void SoundSystem::pauseAudioSample()
9+
{
10+
if (!(this->waveOutOpenUnk_0x8 && this->digSndDriver_0x4)) {
11+
return;
12+
}
13+
14+
for (int streamIndex = 0; streamIndex < 5; ++streamIndex) {
15+
if (MACRO_CALL_MEMBER(SoundSystem_Func::isSampleOrStreamPlaying, this)(streamIndex)) {
16+
this->streamPaused_0x15c[streamIndex] = 1;
17+
if (streamIndex == enums::SND_STR_MUSIC) {
18+
AIL_stop_sample(this->musicSampleUnk_0x170);
19+
} else {
20+
AIL_pause_stream(this->stream_0xc[streamIndex], 0);
21+
}
22+
} else {
23+
this->streamPaused_0x15c[streamIndex] = 0;
24+
}
25+
}
26+
27+
for (int soundIndex = 1; soundIndex < this->loadedSoundsCountAndIndex_0x316c; ++soundIndex) {
28+
if (this->soundFileCurrSampleNum_0x28c[soundIndex] < 0) {
29+
continue;
30+
}
31+
if (MACRO_CALL_MEMBER(SoundSystem_Func::getAndUpdateSampleStatus, this)(soundIndex)) {
32+
this->samplePaused_0x31f4[this->soundFileCurrSampleNum_0x28c[soundIndex]] = 1;
33+
AIL_stop_sample(this->sample_0x190[this->soundFileCurrSampleNum_0x28c[soundIndex] + -1]);
34+
}
35+
}
36+
}
37+
38+
}
39+
}
40+
}

status/addresses-SHC-3BB0A8C1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10892,7 +10892,7 @@ SHC_3BB0A8C1_0x00479D90 | 100.0% | Reimplemented
1089210892
SHC_3BB0A8C1_0x00479DF0 | 100.0% | Reimplemented
1089310893
SHC_3BB0A8C1_0x00479E60 | 100.0% | Reimplemented
1089410894
SHC_3BB0A8C1_0x00479F30 | 100.0% | Reimplemented
10895-
SHC_3BB0A8C1_0x00479FC0 | 0.0% | Pending
10895+
SHC_3BB0A8C1_0x00479FC0 | 100.0% | Reimplemented
1089610896
SHC_3BB0A8C1_0x0047A080 | 0.0% | Pending
1089710897
SHC_3BB0A8C1_0x0047A130 | 0.0% | Pending
1089810898
SHC_3BB0A8C1_0x0047A1B0 | 0.0% | Pending

0 commit comments

Comments
 (0)