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
4 changes: 2 additions & 2 deletions src/OpenSHC/Audio/SFX/SFXState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace Audio {
// SIZE: 0x00008E90
class SFXState {
public:
undefined4 DAT_SFXCounter1; // 0x00000000 length: 4
undefined4 highestSFXCounter; // 0x00000004 length: 4
int DAT_SFXCounter1; // 0x00000000 length: 4
int highestSFXCounter; // 0x00000004 length: 4
pointer* DAT_SoundFileNameArrayMemoryPointer; // 0x00000008 length: 4
char* DAT_SoundFileNamePointersArray[1000]; // 0x0000000C length: 4000
int DAT_SoundVolumeArray[1000]; // 0x00000FAC length: 4000
Expand Down
31 changes: 31 additions & 0 deletions src/OpenSHC/Audio/SFX/SFXState/setUpSFXToPlayUnk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "../SFXState.func.hpp"

namespace OpenSHC {
namespace Audio {
namespace SFX {

// FUNCTION: STRONGHOLDCRUSADER 0x00449C40
void SFXState::setUpSFXToPlayUnk(SoundEffectID sfxOffsetInArray)
{
if (this->DAT_SoundStructures2[sfxOffsetInArray].variationCount <= 0) {
return;
}
int const variantSoundId = this->DAT_SoundStructures2[sfxOffsetInArray].soundID
+ this->DAT_SoundStructures2[sfxOffsetInArray].variationCounter++;
if (this->DAT_SoundStructures2[sfxOffsetInArray].variationCounter
>= this->DAT_SoundStructures2[sfxOffsetInArray].variationCount) {
this->DAT_SoundStructures2[sfxOffsetInArray].variationCounter = 0;
}
++this->DAT_SoundStructures[variantSoundId].scheduledPlayCounter;
this->DAT_SoundStructures[variantSoundId].volumePercentage
= this->DAT_SoundStructures[variantSoundId].baseVolumePercentageUnk;
this->DAT_SoundStructures[variantSoundId].samplePan = 64;
++this->DAT_SFXCounter1;
if (this->DAT_SFXCounter1 > this->highestSFXCounter) {
this->highestSFXCounter = this->DAT_SFXCounter1;
}
}

}
}
}
2 changes: 1 addition & 1 deletion status/addresses-SHC-3BB0A8C1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8124,7 +8124,7 @@ SHC_3BB0A8C1_0x00449B0C | 0.0% | Pending
SHC_3BB0A8C1_0x00449B10 | 0.0% | Pending
SHC_3BB0A8C1_0x00449B20 | 0.0% | Pending
SHC_3BB0A8C1_0x00449B30 | 0.0% | Pending
SHC_3BB0A8C1_0x00449C40 | 0.0% | Pending
SHC_3BB0A8C1_0x00449C40 | 100.0% | Reimplemented
SHC_3BB0A8C1_0x00449CC0 | 0.0% | Pending
SHC_3BB0A8C1_0x00449D50 | 0.0% | Pending
SHC_3BB0A8C1_0x00449DC0 | 0.0% | Pending
Expand Down