Skip to content
Draft
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 "OpenSHC/Audio/mss/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);
}
}

}
}
}
8 changes: 5 additions & 3 deletions src/OpenSHC/Audio/mss/UnkSoundFlagsAndLoopCount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ namespace Audio {
// SIZE: 0x00000004
typedef struct UnkSoundFlagsAndLoopCount {

ushort loopCount; // 0x00000000 length: 2
undefined1 padding_0x2[1]; // 0x00000002 length: 1
byte flagsUnk; // 0x00000003 length: 1
int loopCount : 16;
int reserved : 13;
int unknownFlag1 : 1;
int unknownFlag2 : 1;
int uninterruptable : 1;

} UnkSoundFlagsAndLoopCount;
#pragma pack(pop)
Expand Down
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 | 0.0% | Pending
SHC_3BB0A8C1_0x00479AB0 | 0.0% | Pending
SHC_3BB0A8C1_0x00479AF0 | 0.0% | Pending
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 | 0.0% | Pending
Expand Down