Fix wrongly marked functions as stdcall

This commit is contained in:
Guus Waals 2025-06-07 01:30:24 +08:00
parent e6c8d527bc
commit b6be9b7c09
24 changed files with 189 additions and 15 deletions

View File

@ -0,0 +1,26 @@
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
extern "C" {
undefined FUN_004993a0(undefined4 param_1); // 004993a0 // FUN_004993a0 // cdecl
undefined FUN_00498e90(undefined4 param_1); // 00498e90 // FUN_00498e90 // cdecl
undefined FUN_00499540(undefined4 param_1); // 00499540 // FUN_00499540 // cdecl
// 004995f0
void FUN_004995f0(undefined4 param_1,undefined4 param_2)
{
int iVar1;
iVar1 = FUN_00499540(param_1);
if (iVar1 != 0) {
FUN_00498e90(param_2);
FUN_004993a0(param_2);
}
return;
}
}

View File

@ -7,7 +7,7 @@ extern "C" {
undefined r3_module1_init(void); // 0043e630 // r3_module1_init // cdecl
byte Erm_fn_ucInitErrMsg(void); // 0043e1d0 // Erm_fn_ucInitErrMsg // stdcall
undefined r3_module_big_init(void); // 00443f10 // r3_module_big_init // cdecl
undefined Mmg_fn_vFirstInitMmgModule(undefined1 ucMaxNbChannel); // 0043f830 // Mmg_fn_vFirstInitMmgModule // stdcall
void Mmg_fn_vFirstInitMmgModule(byte ucMaxNbChannel); // 0043f830 // Mmg_fn_vFirstInitMmgModule // stdcall
// 00401000
void __cdecl r3_initAllModules(void)

View File

@ -0,0 +1,60 @@
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
extern "C" {
void r3_beginLoadLevel(void); // 00447860 // r3_beginLoadLevel // stdcall
FIL_ConcatFile * FIL_fn_vOpenConcatFile(char * fileName); // 0055d890 // FIL_fn_vOpenConcatFile // stdcall
undefined r3_waitForDvd(const char * param_1, const char * param_2, undefined4 param_3); // 0043e540 // r3_waitForDvd // cdecl
void r3_unlockLoadLevelMutex(void); // 00447890 // r3_unlockLoadLevelMutex // stdcall
// 004fa4a0
void r3_loadVignette(char *param_1)
{
char cVar1;
int iVar2;
char *local_11c;
char *local_118;
char *local_10c;
char *local_108;
char local_104 [256];
r3_beginLoadLevel();
g_fileWrapper1 = FIL_fn_vOpenConcatFile(param_1);
if (g_fileWrapper1 == (FIL_ConcatFile *)0x0) {
local_108 = param_1;
local_10c = local_104;
do {
cVar1 = *local_108;
*local_10c = cVar1;
local_108 = local_108 + 1;
local_10c = local_10c + 1;
} while (cVar1 != '\0');
sprintf(param_1,s_percent_s_path_2,0x5d26a8,local_104);
g_fileWrapper1 = FIL_fn_vOpenConcatFile(param_1);
while (g_fileWrapper1 == (FIL_ConcatFile *)0x0) {
iVar2 = r3_waitForDvd(s_Please_insert_the_CD_005be980,s_Please_insert_the_CD_005be980,0x40035)
;
if (iVar2 == 2) {
/* WARNING: Subroutine does not return */
exit(-1);
}
g_fileWrapper1 = FIL_fn_vOpenConcatFile(param_1);
}
local_118 = local_104;
local_11c = param_1;
do {
cVar1 = *local_118;
*local_11c = cVar1;
local_118 = local_118 + 1;
local_11c = local_11c + 1;
} while (cVar1 != '\0');
}
r3_unlockLoadLevelMutex();
return;
}
}

View File

@ -11,7 +11,7 @@ undefined FUN_00441d70(undefined4 param_1, undefined4 param_2, undefined4 param_
void IPT_fn_vReadInput(void); // 00505fe0 // IPT_fn_vReadInput // stdcall
// 0043e540
int __cdecl r3_waitForDvd(char *param_1,char *param_2,uint param_3)
int __cdecl r3_waitForDvd(const char *param_1,const char *param_2,uint param_3)
{
ushort uVar1;

View File

@ -59,6 +59,7 @@ char(&lpAppName_005b68f0)[8] = reinterpret_cast<char(&)[8]>(GH_MEM(0x005b68f0));
const char* s_Directory_005b68f8 = "Directory"; // 005b68f8
const char* s_None = "None"; // 005b6904
const char* s_UbiSoft_Ubi_ini = "/UbiSoft/Ubi.ini"; // 005b690c
const char* s_percent_s_path_2 = "%s\\%s"; // 005ba354
const char* s_percent_d = "%d"; // 005bad58
undefined1& g_errModDInput= (undefined1&) GH_MEM(0x005bd29c);
undefined4& DAT_005bd454= (undefined4&) GH_MEM(0x005bd454);
@ -102,6 +103,7 @@ const char* s_Veuillez_ins_rer_le_DVD_dans_vot_005be500 = "Veuillez ins←rer le
const char* s_fmt_c_colon_s = "%c:%s"; // 005be540
const char* s_r3_program_files = "\\program files\\Ubi Soft\\Rayman3"; // 005be548
const char* s_driveLetterTemplate = "A:\\"; // 005be568
const char* s_Please_insert_the_CD_005be980 = "Please insert the CD"; // 005be980
undefined4& DAT_005bf684= (undefined4&) GH_MEM(0x005bf684);
undefined4& g_config_camera_hor_axis= (undefined4&) GH_MEM(0x005c67c8);
undefined4& g_config_camera_ver_axis= (undefined4&) GH_MEM(0x005c67cc);
@ -127,6 +129,7 @@ IDirect3D8*& gfx_d3d = (IDirect3D8*&)GH_MEM(0x005e6c30); // 005e6c30
r3_astruct_2& g_startOfGfxStruct= (r3_astruct_2&) GH_MEM(0x005f5e24);
undefined4& DAT_0063be24= (undefined4&) GH_MEM(0x0063be24);
undefined1& DAT_0063be50= (undefined1&) GH_MEM(0x0063be50);
FIL_ConcatFile*& g_fileWrapper1 = (FIL_ConcatFile*&)GH_MEM(0x00754eb0); // 00754eb0
int& g_windowInitialized= (int&) GH_MEM(0x0077d0a4);
int& g_runMaximized= (int&) GH_MEM(0x0077d0a8);
undefined4& g_engineShouldRun= (undefined4&) GH_MEM(0x0077d0b0);

View File

@ -64,6 +64,7 @@ extern char(&lpAppName_005b68f0)[8]; // 005b68f0
extern const char* s_Directory_005b68f8; // 005b68f8
extern const char* s_None; // 005b6904
extern const char* s_UbiSoft_Ubi_ini; // 005b690c
extern const char* s_percent_s_path_2; // 005ba354
extern const char* s_percent_d; // 005bad58
extern undefined1& g_errModDInput; // 005bd29c
extern undefined4& DAT_005bd454; // 005bd454
@ -107,6 +108,7 @@ extern const char* s_Veuillez_ins_rer_le_DVD_dans_vot_005be500; // 005be500
extern const char* s_fmt_c_colon_s; // 005be540
extern const char* s_r3_program_files; // 005be548
extern const char* s_driveLetterTemplate; // 005be568
extern const char* s_Please_insert_the_CD_005be980; // 005be980
extern undefined4& DAT_005bf684; // 005bf684
extern undefined4& g_config_camera_hor_axis; // 005c67c8
extern undefined4& g_config_camera_ver_axis; // 005c67cc
@ -132,6 +134,7 @@ extern IDirect3D8*& gfx_d3d; // 005e6c30
extern r3_astruct_2& g_startOfGfxStruct; // 005f5e24
extern undefined4& DAT_0063be24; // 0063be24
extern undefined1& DAT_0063be50; // 0063be50
extern FIL_ConcatFile*& g_fileWrapper1; // 00754eb0
extern int& g_windowInitialized; // 0077d0a4
extern int& g_runMaximized; // 0077d0a8
extern undefined4& g_engineShouldRun; // 0077d0b0

View File

@ -9,5 +9,5 @@
// 0043e1d0
// Erm_fn_ucInitErrMsg
extern "C" byte Erm_fn_ucInitErrMsg(void) {
return gh_stub_impl_stdcall<(stub_t)0x0043e1d0, byte>();
return gh_stub_impl_cdecl<(stub_t)0x0043e1d0, byte>();
}

View File

@ -0,0 +1,13 @@
// AUTO-GENERATED FILE!!!!
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
// with possible manualy fixes
#include <r3/binders/auto.h>
#include <r3/binders/stub.h>
#include <gh_global.h>
// 0055d890
// FIL_fn_vOpenConcatFile
extern "C" FIL_ConcatFile * FIL_fn_vOpenConcatFile(char * fileName) {
return gh_stub_impl_cdecl<(stub_t)0x0055d890, FIL_ConcatFile *>(fileName);
}

View File

@ -0,0 +1,13 @@
// AUTO-GENERATED FILE!!!!
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
// with possible manualy fixes
#include <r3/binders/auto.h>
#include <r3/binders/stub.h>
#include <gh_global.h>
// 00498e90
// FUN_00498e90
extern "C" undefined FUN_00498e90(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x00498e90, undefined>(param_1);
}

View File

@ -0,0 +1,13 @@
// AUTO-GENERATED FILE!!!!
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
// with possible manualy fixes
#include <r3/binders/auto.h>
#include <r3/binders/stub.h>
#include <gh_global.h>
// 004993a0
// FUN_004993a0
extern "C" undefined FUN_004993a0(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x004993a0, undefined>(param_1);
}

View File

@ -0,0 +1,13 @@
// AUTO-GENERATED FILE!!!!
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
// with possible manualy fixes
#include <r3/binders/auto.h>
#include <r3/binders/stub.h>
#include <gh_global.h>
// 00499540
// FUN_00499540
extern "C" undefined FUN_00499540(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x00499540, undefined>(param_1);
}

View File

@ -8,6 +8,6 @@
// 00505fe0
// IPT_fn_vReadInput
extern "C" void IPT_fn_vReadInput(void) {
gh_stub_impl_stdcall<(stub_t)0x00505fe0, void>();
extern "C" void IPT_fn_vReadInput(uint arg) {
gh_stub_impl_cdecl<(stub_t)0x00505fe0, void>(arg);
}

View File

@ -8,6 +8,6 @@
// 0043f830
// Mmg_fn_vFirstInitMmgModule
extern "C" undefined Mmg_fn_vFirstInitMmgModule(undefined1 ucMaxNbChannel) {
return gh_stub_impl_stdcall<(stub_t)0x0043f830, undefined>(ucMaxNbChannel);
extern "C" void Mmg_fn_vFirstInitMmgModule(byte ucMaxNbChannel) {
gh_stub_impl_cdecl<(stub_t)0x0043f830, void>(ucMaxNbChannel);
}

View File

@ -9,5 +9,5 @@
// 00447200
// ?r3_renderViewport
extern "C" bool UNKr3_renderViewport(byte viewportIdx) {
return gh_stub_impl_stdcall<(stub_t)0x00447200, bool>(viewportIdx);
return gh_stub_impl_cdecl<(stub_t)0x00447200, bool>(viewportIdx);
}

View File

@ -9,5 +9,5 @@
// 00447460
// doGraphics
extern "C" void doGraphics(byte param_1) {
gh_stub_impl_stdcall<(stub_t)0x00447460, void>(param_1);
gh_stub_impl_cdecl<(stub_t)0x00447460, void>(param_1);
}

View File

@ -9,5 +9,5 @@
// 00401310
// g_setInitVar0
extern "C" void g_setInitVar0(void) {
gh_stub_impl_stdcall<(stub_t)0x00401310, void>();
gh_stub_impl_cdecl<(stub_t)0x00401310, void>();
}

View File

@ -9,5 +9,5 @@
// 00401300
// getHWND
extern "C" HWND getHWND(void) {
return gh_stub_impl_stdcall<(stub_t)0x00401300, HWND>();
return gh_stub_impl_cdecl<(stub_t)0x00401300, HWND>();
}

View File

@ -9,5 +9,5 @@
// 00402450
// loadSplashBitmap
extern "C" void loadSplashBitmap(HWND unused) {
gh_stub_impl_stdcall<(stub_t)0x00402450, void>(unused);
gh_stub_impl_cdecl<(stub_t)0x00402450, void>(unused);
}

View File

@ -0,0 +1,13 @@
// AUTO-GENERATED FILE!!!!
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
// with possible manualy fixes
#include <r3/binders/auto.h>
#include <r3/binders/stub.h>
#include <gh_global.h>
// 00447860
// r3_beginLoadLevel
extern "C" void r3_beginLoadLevel(void) {
gh_stub_impl_cdecl<(stub_t)0x00447860, void>();
}

View File

@ -9,5 +9,5 @@
// 0047bb00
// r3_get_gli_height1
extern "C" int r3_get_gli_height1(void) {
return gh_stub_impl_stdcall<(stub_t)0x0047bb00, int>();
return gh_stub_impl_cdecl<(stub_t)0x0047bb00, int>();
}

View File

@ -9,5 +9,5 @@
// 0047baf0
// r3_get_gli_width1
extern "C" int r3_get_gli_width1(void) {
return gh_stub_impl_stdcall<(stub_t)0x0047baf0, int>();
return gh_stub_impl_cdecl<(stub_t)0x0047baf0, int>();
}

View File

@ -0,0 +1,13 @@
// AUTO-GENERATED FILE!!!!
// This function has yet to be decompiled using 'Dump Current Function' in ghidra
// with possible manualy fixes
#include <r3/binders/auto.h>
#include <r3/binders/stub.h>
#include <gh_global.h>
// 00447890
// r3_unlockLoadLevelMutex
extern "C" void r3_unlockLoadLevelMutex(void) {
gh_stub_impl_cdecl<(stub_t)0x00447890, void>();
}

View File

@ -9,5 +9,5 @@
// 0043e620
// setGameHWND3
extern "C" void setGameHWND3(HWND wnd) {
gh_stub_impl_stdcall<(stub_t)0x0043e620, void>(wnd);
gh_stub_impl_cdecl<(stub_t)0x0043e620, void>(wnd);
}

View File

@ -147,6 +147,10 @@ struct FIL_FileNameListElement {
struct LST2_tdstAnchorToFIL_tdxHandleToFileNameListElementDyn *hFatherDyn;
char *szFileName;
};
struct AnnotatedFPtr {
undefined *func;
unsigned int value;
};
#define C_wTimerTrue 32766
#define C_Check_OverflowFlag 8
struct SND_astruct_4 {