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
39 changes: 39 additions & 0 deletions src/OpenSHC/Audio/SFX/SFXState/playOnSpeechSfxStream.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// disable deprecation warnings for strcpy
#pragma warning(disable : 4996)

#include "../SFXState.func.hpp"

#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp"
#include "OpenSHC/OS.func.hpp"
#include "OpenSHC/string-literals.hpp"

#include "OpenSHC/Globals/DAT_LastSpeechSFXFilename.hpp"
#include "OpenSHC/Globals/DAT_SoundSystemState.hpp"

namespace OpenSHC {
namespace Audio {
namespace SFX {

// FUNCTION: STRONGHOLDCRUSADER 0x0044A500
void SFXState::playOnSpeechSfxStream(char* filename)
{
if (!MACRO_CALL(OS_Func::__stricmp)(filename, DAT_LastSpeechSFXFilename::instance)) {
if (MACRO_CALL_MEMBER(MSS::SoundSystem_Func::isSampleOrStreamPlaying, DAT_SoundSystemState::ptr)(
MSS::enums::SND_STR_SPEECH_1)
|| MACRO_CALL_MEMBER(MSS::SoundSystem_Func::isSampleOrStreamPlaying, DAT_SoundSystemState::ptr)(
MSS::enums::SND_STR_SPEECH_2)) {
if (MACRO_CALL(OS_Func::__stricmp)(filename, s_buildingwreck_01_wav_005a4d78)) {
return;
}
}
}
strcpy(DAT_LastSpeechSFXFilename::instance, filename);

char fullSoundPath[64];
MACRO_CALL(OS_Func::_sprintf)(fullSoundPath, s_fx_speech_s_005a4d68, filename);
MACRO_CALL_MEMBER(MSS::SoundSystem_Func::playSpeechSfx, DAT_SoundSystemState::ptr)(fullSoundPath);
}

}
}
}
39 changes: 39 additions & 0 deletions src/OpenSHC/Audio/SFX/SFXState/playWAVSFX.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// disable deprecation warnings for strcpy
#pragma warning(disable : 4996)

#include "../SFXState.func.hpp"

#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp"
#include "OpenSHC/OS.func.hpp"
#include "OpenSHC/string-literals.hpp"

#include "OpenSHC/Globals/DAT_LastSpeechSFXFilename.hpp"
#include "OpenSHC/Globals/DAT_SoundSystemState.hpp"

namespace OpenSHC {
namespace Audio {
namespace SFX {

// FUNCTION: STRONGHOLDCRUSADER 0x0044A460
void SFXState::playWAVSFX(char const* wav_filename)
{
if (!MACRO_CALL(OS_Func::__stricmp)(wav_filename, DAT_LastSpeechSFXFilename::instance)) {
if (MACRO_CALL_MEMBER(MSS::SoundSystem_Func::isSampleOrStreamPlaying, DAT_SoundSystemState::ptr)(
MSS::enums::SND_STR_SPEECH_1)
|| MACRO_CALL_MEMBER(MSS::SoundSystem_Func::isSampleOrStreamPlaying, DAT_SoundSystemState::ptr)(
MSS::enums::SND_STR_SPEECH_2)) {
if (MACRO_CALL(OS_Func::__stricmp)(wav_filename, s_buildingwreck_01_wav_005a4d78)) {
return;
}
}
}
strcpy(DAT_LastSpeechSFXFilename::instance, wav_filename);

char fullSoundPath[64];
MACRO_CALL(OS_Func::_sprintf)(fullSoundPath, s_fx_speech_s_005a4d68, wav_filename);
MACRO_CALL_MEMBER(MSS::SoundSystem_Func::playSoundOnSpeechStream, DAT_SoundSystemState::ptr)(fullSoundPath);
}

}
}
}
4 changes: 2 additions & 2 deletions src/OpenSHC/OS/OS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace OS {
void* _memset(void* _Dst, int _Val, size_t _Size) { return memset(_Dst, _Val, _Size); }

// STUB: STRONGHOLDCRUSADER 0x0057F6DA
int _sprintf(char* _Dest, char* _Format, ...)
int _sprintf(char* _Dest, char const* _Format, ...)
{
// needed for proxy
va_list args;
Expand All @@ -39,7 +39,7 @@ namespace OS {
}

// STUB: STRONGHOLDCRUSADER 0x0057F8EE
int __stricmp(char* _Str1, char* _Str2) { return _stricmp(_Str1, _Str2); }
int __stricmp(char const* _Str1, char const* _Str2) { return _stricmp(_Str1, _Str2); }

// STUB: STRONGHOLDCRUSADER 0x0057FA62
int _atexit(_atexit_t* param_1) { return atexit(param_1); }
Expand Down
4 changes: 2 additions & 2 deletions status/addresses-SHC-3BB0A8C1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16281,9 +16281,9 @@ SHC_3BB0A8C1_0x0044A360 | 0.0% | Pending

SHC_3BB0A8C1_0x0044A3A0 | 0.0% | Pending

SHC_3BB0A8C1_0x0044A460 | 0.0% | Pending
SHC_3BB0A8C1_0x0044A460 | 100.0% | Reimplemented, Security Cookie of DLL

SHC_3BB0A8C1_0x0044A500 | 0.0% | Pending
SHC_3BB0A8C1_0x0044A500 | 100.0% | Reimplemented, Security Cookie of DLL

SHC_3BB0A8C1_0x0044A5A0 | 0.0% | Pending

Expand Down