Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/OpenSHC/Audio/mss/SoundSystem/meth_0x479b70.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "../SoundSystem.func.hpp"

namespace OpenSHC {
namespace Audio {
namespace MSS {

// NOTE:
// This functions seems to reset the 0 indexed stream, most likely the music stream
// Index 3 seems to be general NPC voices (at least)
// Assumption:
// The tested flag here ("unkownFlag1" currently) might indicate that playing this sample should lower the music
// volume, or that the music volume is currently lowered

// FUNCTION: STRONGHOLDCRUSADER 0x00479B70
void SoundSystem::meth_0x479b70()
{
if (!this->waveOutOpenUnk_0x8) {
return;
}

if (this->streamFlagsUnkAndLoopCount_0x34[3].unknownFlag1 && this->streamActiveUnk_0x20[3]
&& AIL_stream_status(this->stream_0xc[3]) != SMP_PLAYING) {
this->streamFlagsUnkAndLoopCount_0x34[3].unknownFlag1 = false;
AIL_set_sample_volume(
this->musicSampleUnk_0x170, (this->streamVolume[0] * this->streamFileVolumeNextUnk_0x48[0]) / 100);
}
if (this->streamFlagsUnkAndLoopCount_0x34[4].unknownFlag1 && this->streamActiveUnk_0x20[4]
&& AIL_stream_status(this->stream_0xc[4]) != SMP_PLAYING) {
this->streamFlagsUnkAndLoopCount_0x34[4].unknownFlag1 = false;
AIL_set_sample_volume(
this->musicSampleUnk_0x170, (this->streamVolume[0] * this->streamFileVolumeNextUnk_0x48[0]) / 100);
}
}

}
}
}
2 changes: 1 addition & 1 deletion status/addresses-SHC-3BB0A8C1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10884,7 +10884,7 @@ SHC_3BB0A8C1_0x004799A0 | 0.0% | Pending
SHC_3BB0A8C1_0x00479A60 | 100.0% | Reimplemented
SHC_3BB0A8C1_0x00479AB0 | 0.0% | Pending
SHC_3BB0A8C1_0x00479AF0 | 100.0% | Reimplemented
SHC_3BB0A8C1_0x00479B70 | 0.0% | Pending
SHC_3BB0A8C1_0x00479B70 | 100.0% | Reimplemented
SHC_3BB0A8C1_0x00479C20 | 0.0% | Pending
SHC_3BB0A8C1_0x00479C80 | 0.0% | Pending
SHC_3BB0A8C1_0x00479CF0 | 100.0% | Reimplemented
Expand Down