diff --git a/src/OpenSHC/Audio/mss/SoundSystem/pauseAudioSample.cpp b/src/OpenSHC/Audio/mss/SoundSystem/pauseAudioSample.cpp new file mode 100644 index 0000000..6ab51b3 --- /dev/null +++ b/src/OpenSHC/Audio/mss/SoundSystem/pauseAudioSample.cpp @@ -0,0 +1,40 @@ +#include "../SoundSystem.func.hpp" + +namespace OpenSHC { +namespace Audio { + namespace MSS { + + // FUNCTION: STRONGHOLDCRUSADER 0x00479FC0 + void SoundSystem::pauseAudioSample() + { + if (!(this->waveOutOpenUnk_0x8 && this->digSndDriver_0x4)) { + return; + } + + for (int streamIndex = 0; streamIndex < 5; ++streamIndex) { + if (MACRO_CALL_MEMBER(SoundSystem_Func::isSampleOrStreamPlaying, this)(streamIndex)) { + this->streamPaused_0x15c[streamIndex] = 1; + if (streamIndex == enums::SND_STR_MUSIC) { + AIL_stop_sample(this->musicSampleUnk_0x170); + } else { + AIL_pause_stream(this->stream_0xc[streamIndex], 0); + } + } else { + this->streamPaused_0x15c[streamIndex] = 0; + } + } + + for (int soundIndex = 1; soundIndex < this->loadedSoundsCountAndIndex_0x316c; ++soundIndex) { + if (this->soundFileCurrSampleNum_0x28c[soundIndex] < 0) { + continue; + } + if (MACRO_CALL_MEMBER(SoundSystem_Func::getAndUpdateSampleStatus, this)(soundIndex)) { + this->samplePaused_0x31f4[this->soundFileCurrSampleNum_0x28c[soundIndex]] = 1; + AIL_stop_sample(this->sample_0x190[this->soundFileCurrSampleNum_0x28c[soundIndex] + -1]); + } + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b68c070..c7325fd 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -10892,7 +10892,7 @@ SHC_3BB0A8C1_0x00479D90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00479DF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00479E60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00479F30 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00479FC0 | 0.0% | Pending +SHC_3BB0A8C1_0x00479FC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047A080 | 0.0% | Pending SHC_3BB0A8C1_0x0047A130 | 0.0% | Pending SHC_3BB0A8C1_0x0047A1B0 | 0.0% | Pending