Skip to content

Commit edd8952

Browse files
authored
Merge pull request #81 from sourcehold/reimpl/SHC_3BB0A8C1_0x00479E60
reimplement: SHC_3BB0A8C1_0x00479E60 100%
2 parents 78e15c0 + 3bbcdca commit edd8952

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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: A lot of structures of SoundSystem use an 32 element array. sample_0x190 for example
18+
// uses 31 and might be "missing" its first element. The 0 seems to be used for "something" else
19+
// in general. So either we should one day treat all these as "a value and a 31 element array" or
20+
// like a single 32 array.
21+
AIL_set_sample_volume(
22+
this->sample_0x190[i], (this->sampleSndStructVolumePercentage_0x3174[i + 1] * volume) / 100);
23+
}
24+
return;
25+
}
26+
this->streamVolume[streamIndex] = volume;
27+
if (!this->streamActiveUnk_0x20[streamIndex]) {
28+
return;
29+
}
30+
if (streamIndex == 0) {
31+
AIL_set_sample_volume(
32+
this->musicSampleUnk_0x170, (this->streamFileVolumeCurrentUnk_0x5c[0] * volume) / 100);
33+
return;
34+
}
35+
AIL_set_stream_volume(
36+
this->stream_0xc[streamIndex], (this->streamFileVolumeCurrentUnk_0x5c[streamIndex] * volume) / 100);
37+
}
38+
39+
}
40+
}
41+
}

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 | 100.0% | Reimplemented
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)