Skip to content

Commit 3901581

Browse files
committed
reimplement: SHC_3BB0A8C1_0x00479E60 100%
1 parent aa02ce0 commit 3901581

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp"
2+
3+
namespace OpenSHC {
4+
namespace Audio {
5+
namespace MSS {
6+
7+
// FUNCTION: STRONGHOLDCRUSADER 0x00479E60
8+
void SoundSystem::setVolumeUnk(int streamIndex, int volume)
9+
{
10+
if (!this->waveOutOpenUnk_0x8) {
11+
return;
12+
}
13+
14+
if (streamIndex == -1) {
15+
this->sampleVolume = volume;
16+
for (int i = 0; i < 31; ++i) {
17+
// TODO: Most structures are either 32 or 1 and 31. We need to unify these.
18+
// Either everything else is of or sample should take in the int value before.
19+
AIL_set_sample_volume(
20+
this->sample_0x190[i], (this->sampleSndStructVolumePercentage_0x3174[i + 1] * volume) / 100);
21+
}
22+
return;
23+
}
24+
this->streamVolume[streamIndex] = volume;
25+
if (!this->streamActiveUnk_0x20[streamIndex]) {
26+
return;
27+
}
28+
if (streamIndex == 0) {
29+
AIL_set_sample_volume(
30+
this->musicSampleUnk_0x170, (this->streamFileVolumeCurrentUnk_0x5c[0] * volume) / 100);
31+
return;
32+
}
33+
AIL_set_stream_volume(
34+
this->stream_0xc[streamIndex], (this->streamFileVolumeCurrentUnk_0x5c[streamIndex] * volume) / 100);
35+
}
36+
37+
}
38+
}
39+
}

status/addresses-SHC-3BB0A8C1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10890,7 +10890,7 @@ SHC_3BB0A8C1_0x00479C80 | 0.0% | Pending
1089010890
SHC_3BB0A8C1_0x00479CF0 | 100.0% | Reimplemented
1089110891
SHC_3BB0A8C1_0x00479D90 | 0.0% | Pending
1089210892
SHC_3BB0A8C1_0x00479DF0 | 0.0% | Pending
10893-
SHC_3BB0A8C1_0x00479E60 | 0.0% | Pending
10893+
SHC_3BB0A8C1_0x00479E60 | 100.0% | Reimplemented
1089410894
SHC_3BB0A8C1_0x00479F30 | 0.0% | Pending
1089510895
SHC_3BB0A8C1_0x00479FC0 | 0.0% | Pending
1089610896
SHC_3BB0A8C1_0x0047A080 | 0.0% | Pending

0 commit comments

Comments
 (0)