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/mss.func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace Audio {
Address::SHC_3BB0A8C1_0x0047B510, &OpenSHC::Audio::MSS::SndSystemTimeCallback)
SndSystemTimeCallback;

MACRO_FUNCTION_RESOLVER(undefined4(__stdcall*)(), false, Address::SHC_3BB0A8C1_0x0057E160,
&OpenSHC::Audio::MSS::RegisterMilesAILShutdown)
MACRO_FUNCTION_RESOLVER(
int(__cdecl*)(), false, Address::SHC_3BB0A8C1_0x0057E160, &OpenSHC::Audio::MSS::RegisterMilesAILShutdown)
RegisterMilesAILShutdown;

} // namespace MSS_Func
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/Audio/mss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Audio {

void __stdcall SndSystemTimeCallback(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2);

undefined4 __stdcall RegisterMilesAILShutdown();
int __cdecl RegisterMilesAILShutdown();

} // namespace MSS
} // namespace Audio
Expand Down
22 changes: 22 additions & 0 deletions src/OpenSHC/Audio/mss/RegisterMilesAILShutdown.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "../mss.func.hpp"

#include "OpenSHC/OS.func.hpp"

#include "Mss32.h"

namespace OpenSHC {
namespace Audio {
namespace MSS {

void __cdecl AIL_shutdown_proxy() { AIL_shutdown(); }

// FUNCTION: STRONGHOLDCRUSADER 0x0057E160
int __cdecl RegisterMilesAILShutdown()
{
MACRO_CALL(OS_Func::_atexit)(AIL_shutdown_proxy);
return 0;
}

}
}
}
4 changes: 2 additions & 2 deletions src/OpenSHC/OS.func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace OS_Func {
Address::SHC_3BB0A8C1_0x0057F8EE, &OpenSHC::OS::__stricmp)
__stricmp;

MACRO_FUNCTION_RESOLVER(
int(__cdecl*)(void* param_1), REIMPLEMENTED_CRT, Address::SHC_3BB0A8C1_0x0057FA62, &OpenSHC::OS::_atexit)
MACRO_FUNCTION_RESOLVER(int(__cdecl*)(void(__cdecl* func)()), REIMPLEMENTED_CRT, Address::SHC_3BB0A8C1_0x0057FA62,
&OpenSHC::OS::_atexit)
_atexit;

MACRO_FUNCTION_RESOLVER(
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/OS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace OS {

int __cdecl __stricmp(char* _Str1, char* _Str2);

int __cdecl _atexit(void* param_1);
int __cdecl _atexit(void(__cdecl* func)());

void __cdecl _free_base(void* _Memory);

Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/OS/OS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace OS {
int __stricmp(char* _Str1, char* _Str2) { return _stricmp(_Str1, _Str2); }

// STUB: STRONGHOLDCRUSADER 0x0057FA62
int _atexit(void* param_1) { return atexit(reinterpret_cast<void(__cdecl*)()>(param_1)); }
int _atexit(void(__cdecl* func)()) { return atexit(func); }

// This seems to be the games main free function
// STUB: STRONGHOLDCRUSADER 0x0057FA74
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 @@ -32703,7 +32703,7 @@ SHC_3BB0A8C1_0x0057DFE0 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E020 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E120 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E158 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E160 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E160 | 100.0% | Reimplemented
SHC_3BB0A8C1_0x0057E170 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E180 | 0.0% | Pending
SHC_3BB0A8C1_0x0057E28F | 0.0% | Pending
Expand Down