Skip to content

Commit 6f3fd23

Browse files
authored
Merge pull request #96 from sourcehold/reimpl/SHC_3BB0A8C1_0x0047A1B0
reimplement: SHC_3BB0A8C1_0x0047A1B0 100%
2 parents 2600845 + 3842a51 commit 6f3fd23

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 "../SoundSystem.func.hpp"
2+
3+
#include "OpenSHC/Audio/SFX/SFXState.func.hpp"
4+
#include "OpenSHC/DE/SHCDE/eMusicIDs.hpp"
5+
6+
#include "OpenSHC/Globals/DAT_GameCore.hpp"
7+
#include "OpenSHC/Globals/DAT_SFXDefinedData.hpp"
8+
#include "OpenSHC/Globals/DAT_SFXState.hpp"
9+
10+
namespace OpenSHC {
11+
namespace Audio {
12+
namespace MSS {
13+
14+
// FUNCTION: STRONGHOLDCRUSADER 0x0047A1B0
15+
void SoundSystem::setupVolumeAndSoundID(eMusicIDsInt soundID)
16+
{
17+
// NOTE: Is this certain that these ids fit to the original game?
18+
if (soundID == DE::SHCDE::MUSIC_TUNE_NARR1) {
19+
// missionNumber1to20 might be unsigned, but found signs inconclusive
20+
if (DAT_GameCore::ptr->missionNumber1to20 - 1U <= 19) {
21+
soundID = DAT_GameCore::ptr->missionNumber1to20 + 46;
22+
} else {
23+
soundID = DE::SHCDE::MUSIC_TUNE_OFF;
24+
}
25+
}
26+
27+
if (soundID == this->currentSoundID_0x3278) {
28+
return;
29+
}
30+
this->currentSoundID_0x3278 = soundID;
31+
int const fileVolume = MACRO_CALL_MEMBER(SFX::SFXState_Func::getSoundVolumeForFilename, DAT_SFXState::ptr)(
32+
DAT_SFXDefinedData::ptr->DAT_SFX_Pointers[soundID].musicFile);
33+
this->currentSoundIDVolumeUnk_0x327c = (fileVolume * 100) / 0x7f;
34+
this->mbr_0x3280 = 0;
35+
}
36+
37+
}
38+
}
39+
}

status/addresses-SHC-3BB0A8C1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10895,7 +10895,7 @@ SHC_3BB0A8C1_0x00479F30 | 100.0% | Reimplemented
1089510895
SHC_3BB0A8C1_0x00479FC0 | 100.0% | Reimplemented
1089610896
SHC_3BB0A8C1_0x0047A080 | 0.0% | Pending
1089710897
SHC_3BB0A8C1_0x0047A130 | 0.0% | Pending
10898-
SHC_3BB0A8C1_0x0047A1B0 | 0.0% | Pending
10898+
SHC_3BB0A8C1_0x0047A1B0 | 100.0% | Reimplemented
1089910899
SHC_3BB0A8C1_0x0047A220 | 0.0% | Pending
1090010900
SHC_3BB0A8C1_0x0047A290 | 0.0% | Pending
1090110901
SHC_3BB0A8C1_0x0047A2A0 | 0.0% | Pending

0 commit comments

Comments
 (0)