diff --git a/game_re/gh_fix/FUN_004995f0.cxx b/game_re/gh_fix/FUN_004995f0.cxx new file mode 100644 index 00000000..8a4ea81c --- /dev/null +++ b/game_re/gh_fix/FUN_004995f0.cxx @@ -0,0 +1,26 @@ +// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!! + +#include +#include + +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; +} + +} + diff --git a/game_re/gh_fix/r3_initAllModules.cxx b/game_re/gh_fix/r3_initAllModules.cxx index 97c52d92..5890164c 100644 --- a/game_re/gh_fix/r3_initAllModules.cxx +++ b/game_re/gh_fix/r3_initAllModules.cxx @@ -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) diff --git a/game_re/gh_fix/r3_loadVignette.cxx b/game_re/gh_fix/r3_loadVignette.cxx new file mode 100644 index 00000000..5a918618 --- /dev/null +++ b/game_re/gh_fix/r3_loadVignette.cxx @@ -0,0 +1,60 @@ +// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!! + +#include +#include + +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; +} + +} + diff --git a/game_re/gh_fix/r3_waitForDvd.cxx b/game_re/gh_fix/r3_waitForDvd.cxx index 571cec56..15689134 100644 --- a/game_re/gh_fix/r3_waitForDvd.cxx +++ b/game_re/gh_fix/r3_waitForDvd.cxx @@ -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; diff --git a/game_re/gh_global.cxx b/game_re/gh_global.cxx index 76005a68..27d7b4a8 100644 --- a/game_re/gh_global.cxx +++ b/game_re/gh_global.cxx @@ -59,6 +59,7 @@ char(&lpAppName_005b68f0)[8] = reinterpret_cast(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); diff --git a/game_re/gh_global.h b/game_re/gh_global.h index b60a21fb..09317bff 100644 --- a/game_re/gh_global.h +++ b/game_re/gh_global.h @@ -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 diff --git a/game_re/gh_stub/Erm_fn_ucInitErrMsg.cxx b/game_re/gh_stub/Erm_fn_ucInitErrMsg.cxx index 5c355598..67a3a9ce 100644 --- a/game_re/gh_stub/Erm_fn_ucInitErrMsg.cxx +++ b/game_re/gh_stub/Erm_fn_ucInitErrMsg.cxx @@ -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>(); } diff --git a/game_re/gh_stub/FIL_fn_vOpenConcatFile.cxx b/game_re/gh_stub/FIL_fn_vOpenConcatFile.cxx new file mode 100644 index 00000000..a9a18356 --- /dev/null +++ b/game_re/gh_stub/FIL_fn_vOpenConcatFile.cxx @@ -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 +#include +#include + +// 0055d890 +// FIL_fn_vOpenConcatFile +extern "C" FIL_ConcatFile * FIL_fn_vOpenConcatFile(char * fileName) { + return gh_stub_impl_cdecl<(stub_t)0x0055d890, FIL_ConcatFile *>(fileName); +} diff --git a/game_re/gh_stub/FUN_00498e90.cxx b/game_re/gh_stub/FUN_00498e90.cxx new file mode 100644 index 00000000..a952f9ce --- /dev/null +++ b/game_re/gh_stub/FUN_00498e90.cxx @@ -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 +#include +#include + +// 00498e90 +// FUN_00498e90 +extern "C" undefined FUN_00498e90(undefined4 param_1) { + return gh_stub_impl_cdecl<(stub_t)0x00498e90, undefined>(param_1); +} diff --git a/game_re/gh_stub/FUN_004993a0.cxx b/game_re/gh_stub/FUN_004993a0.cxx new file mode 100644 index 00000000..a001c533 --- /dev/null +++ b/game_re/gh_stub/FUN_004993a0.cxx @@ -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 +#include +#include + +// 004993a0 +// FUN_004993a0 +extern "C" undefined FUN_004993a0(undefined4 param_1) { + return gh_stub_impl_cdecl<(stub_t)0x004993a0, undefined>(param_1); +} diff --git a/game_re/gh_stub/FUN_00499540.cxx b/game_re/gh_stub/FUN_00499540.cxx new file mode 100644 index 00000000..ae6403b3 --- /dev/null +++ b/game_re/gh_stub/FUN_00499540.cxx @@ -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 +#include +#include + +// 00499540 +// FUN_00499540 +extern "C" undefined FUN_00499540(undefined4 param_1) { + return gh_stub_impl_cdecl<(stub_t)0x00499540, undefined>(param_1); +} diff --git a/game_re/gh_stub/IPT_fn_vReadInput.cxx b/game_re/gh_stub/IPT_fn_vReadInput.cxx index 5827d089..a779c940 100644 --- a/game_re/gh_stub/IPT_fn_vReadInput.cxx +++ b/game_re/gh_stub/IPT_fn_vReadInput.cxx @@ -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); } diff --git a/game_re/gh_stub/Mmg_fn_vFirstInitMmgModule.cxx b/game_re/gh_stub/Mmg_fn_vFirstInitMmgModule.cxx index cb4e509a..5b7135a2 100644 --- a/game_re/gh_stub/Mmg_fn_vFirstInitMmgModule.cxx +++ b/game_re/gh_stub/Mmg_fn_vFirstInitMmgModule.cxx @@ -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); } diff --git a/game_re/gh_stub/UNKr3_renderViewport.cxx b/game_re/gh_stub/UNKr3_renderViewport.cxx index d5872a9b..63f7bb6f 100644 --- a/game_re/gh_stub/UNKr3_renderViewport.cxx +++ b/game_re/gh_stub/UNKr3_renderViewport.cxx @@ -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); } diff --git a/game_re/gh_stub/doGraphics.cxx b/game_re/gh_stub/doGraphics.cxx index 1cf7ed0f..aa701c66 100644 --- a/game_re/gh_stub/doGraphics.cxx +++ b/game_re/gh_stub/doGraphics.cxx @@ -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); } diff --git a/game_re/gh_stub/g_setInitVar0.cxx b/game_re/gh_stub/g_setInitVar0.cxx index 17271e21..a882d611 100644 --- a/game_re/gh_stub/g_setInitVar0.cxx +++ b/game_re/gh_stub/g_setInitVar0.cxx @@ -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>(); } diff --git a/game_re/gh_stub/getHWND.cxx b/game_re/gh_stub/getHWND.cxx index 9fc95d52..ba4f6980 100644 --- a/game_re/gh_stub/getHWND.cxx +++ b/game_re/gh_stub/getHWND.cxx @@ -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>(); } diff --git a/game_re/gh_stub/loadSplashBitmap.cxx b/game_re/gh_stub/loadSplashBitmap.cxx index ff94dc2a..27d320d7 100644 --- a/game_re/gh_stub/loadSplashBitmap.cxx +++ b/game_re/gh_stub/loadSplashBitmap.cxx @@ -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); } diff --git a/game_re/gh_stub/r3_beginLoadLevel.cxx b/game_re/gh_stub/r3_beginLoadLevel.cxx new file mode 100644 index 00000000..4173a182 --- /dev/null +++ b/game_re/gh_stub/r3_beginLoadLevel.cxx @@ -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 +#include +#include + +// 00447860 +// r3_beginLoadLevel +extern "C" void r3_beginLoadLevel(void) { + gh_stub_impl_cdecl<(stub_t)0x00447860, void>(); +} diff --git a/game_re/gh_stub/r3_get_gli_height1.cxx b/game_re/gh_stub/r3_get_gli_height1.cxx index 7ef751a0..1b37e864 100644 --- a/game_re/gh_stub/r3_get_gli_height1.cxx +++ b/game_re/gh_stub/r3_get_gli_height1.cxx @@ -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>(); } diff --git a/game_re/gh_stub/r3_get_gli_width1.cxx b/game_re/gh_stub/r3_get_gli_width1.cxx index 07976af4..f2c4e085 100644 --- a/game_re/gh_stub/r3_get_gli_width1.cxx +++ b/game_re/gh_stub/r3_get_gli_width1.cxx @@ -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>(); } diff --git a/game_re/gh_stub/r3_unlockLoadLevelMutex.cxx b/game_re/gh_stub/r3_unlockLoadLevelMutex.cxx new file mode 100644 index 00000000..304b8196 --- /dev/null +++ b/game_re/gh_stub/r3_unlockLoadLevelMutex.cxx @@ -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 +#include +#include + +// 00447890 +// r3_unlockLoadLevelMutex +extern "C" void r3_unlockLoadLevelMutex(void) { + gh_stub_impl_cdecl<(stub_t)0x00447890, void>(); +} diff --git a/game_re/gh_stub/setGameHWND3.cxx b/game_re/gh_stub/setGameHWND3.cxx index 236ff4d1..3e21c6e5 100644 --- a/game_re/gh_stub/setGameHWND3.cxx +++ b/game_re/gh_stub/setGameHWND3.cxx @@ -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); } diff --git a/game_re/gh_types.h b/game_re/gh_types.h index d949ad57..0d721b8f 100644 --- a/game_re/gh_types.h +++ b/game_re/gh_types.h @@ -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 {