Skip to content
Open
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
29 changes: 29 additions & 0 deletions src/OpenSHC/Audio/mss/SoundSystem/setStreamAndSampleVolumeUnk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "OpenSHC/Audio/mss/SoundSystem.func.hpp"

namespace OpenSHC {
namespace Audio {
namespace MSS {

// NOTE:
// Quick test showed usage for SND_STR_MUSIC (0) and SND_STR_SFX_2Unk (2), but this might be coincidental
// Test showed usage mostly for fading music out, during gameplay or during menu switches

// FUNCTION: STRONGHOLDCRUSADER 0x00479AF0
void SoundSystem::setStreamAndSampleVolumeUnk(SHC_SoundStreamInt sndStreamIndex, int volumeParam)
{
if (!(this->waveOutOpenUnk_0x8 && this->streamActiveUnk_0x20[sndStreamIndex])) {
return;
}

if (sndStreamIndex == enums::SND_STR_MUSIC) {
AIL_set_sample_volume(this->musicSampleUnk_0x170, (this->streamVolume[0] * volumeParam) / 100);
} else {
AIL_set_stream_volume(
this->stream_0xc[sndStreamIndex], (this->streamVolume[sndStreamIndex] * volumeParam) / 100);
}
this->streamFileVolumeCurrentUnk_0x5c[sndStreamIndex] = volumeParam;
}

}
}
}
2 changes: 1 addition & 1 deletion status/addresses-SHC-3BB0A8C1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10883,7 +10883,7 @@ SHC_3BB0A8C1_0x00479790 | 0.0% | Pending
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_0x00479AF0 | 100.0% | Reimplemented
SHC_3BB0A8C1_0x00479B70 | 0.0% | Pending
SHC_3BB0A8C1_0x00479C20 | 0.0% | Pending
SHC_3BB0A8C1_0x00479C80 | 0.0% | Pending
Expand Down