WIP Stuff

This commit is contained in:
Guus Waals 2025-06-07 02:18:05 +08:00
parent b6be9b7c09
commit 0d35e5af6d
40 changed files with 698 additions and 45 deletions

View File

@ -0,0 +1,16 @@
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
extern "C" {
// 004013f0
HANDLE __cdecl r3_getDrawSemaphore(void)
{
return g_drawSemaphore;
}
}

View File

@ -0,0 +1,37 @@
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
extern "C" {
// 00506510
int __cdecl IPT_fn_hGetEntryActionHandle(char *param_1)
{
char *pcVar1;
int iVar2;
uint uVar3;
int iVar4;
int iVar5;
/* 0x106510 47 IPT_fn_hGetEntryActionHandle */
iVar5 = 0;
uVar3 = 0;
iVar4 = 0;
do {
if (DAT_00840e9c <= uVar3) {
return iVar5;
}
pcVar1 = *(char **)(iVar4 + 8 + DAT_00840ea0);
if ((pcVar1 != (char *)0x0) && (iVar2 = strcmpi(pcVar1,param_1), iVar2 == 0)) {
iVar5 = iVar4 + DAT_00840ea0;
}
uVar3 = uVar3 + 1;
iVar4 = iVar4 + 0x1c;
} while (iVar5 == 0);
return iVar5;
}
}

View File

@ -7,22 +7,8 @@ extern "C" {
undefined FUN_00496ac0(void); // 00496ac0 // FUN_00496ac0 // cdecl
undefined FUN_00470b00(void); // 00470b00 // FUN_00470b00 // cdecl
undefined FUN_00484ea0(undefined4 param_1); // 00484ea0 // FUN_00484ea0 // cdecl
using FnD3Create8 = IDirect3D8 *(__stdcall *)(UINT);
static FnD3Create8 init_d3d_function() {
HMODULE hModule = LoadLibrary("d3d8.dll");
if (hModule != NULL) {
return (FnD3Create8)GetProcAddress(hModule, "Direct3DCreate8");
}
return nullptr;
}
//
// 0046f870
/* WARNING: Globals starting with '_' overlap smaller symbols at the same
* address */
/* WARNING: Enum "_D3DFORMAT": Some values do not have unique names */
undefined4 gfx_init(HWND hwnd, int param_2, UINT param_3, UINT param_4,
int param_5)
@ -71,7 +57,7 @@ undefined4 gfx_init(HWND hwnd, int param_2, UINT param_3, UINT param_4,
DAT_005e6c28 = param_5;
}
static FnD3Create8 fn_Direct3DCreate8 = init_d3d_function();
static FnD3Create8 fn_Direct3DCreate8 = getDirect3DCreate8();
gfx_d3d = fn_Direct3DCreate8(0xdc);
if (gfx_d3d == (IDirect3D8 *)0x0) {
return 1;

View File

@ -0,0 +1,209 @@
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
#include <bink.h>
extern "C" {
undefined FUN_00401270(void); // 00401270 // FUN_00401270 // cdecl
undefined FUN_0047bb20(undefined4 param_1); // 0047bb20 // FUN_0047bb20 // cdecl
HANDLE r3_getDrawSemaphore(void); // 004013f0 // r3_getDrawSemaphore // cdecl
undefined FUN_0047bb10(void); // 0047bb10 // FUN_0047bb10 // cdecl
void r3_validateBinkVideoQuality(
byte videoBpp,
byte wantedVideoQuality); // 00442090 // r3_validateBinkVideoQuality //
// stdcall
BOOL GLD_bGetViewportAttributes(
short param_1, short combinedWindowHandle,
GLD_ViewportAttributes
*out); // 0046f240 // GLD_bGetViewportAttributes // cdecl
int IPT_fn_hGetEntryActionHandle(
const char *param_1); // 00506510 // IPT_fn_hGetEntryActionHandle // cdecl
undefined FUN_0046f680(undefined param_1,
undefined4 param_2); // 0046f680 // FUN_0046f680 // cdecl
undefined FUN_00441f30(void); // 00441f30 // FUN_00441f30 // cdecl
undefined FUN_00470f20(void); // 00470f20 // FUN_00470f20 // cdecl
undefined FUN_0047bfe0(undefined4 param_1); // 0047bfe0 // FUN_0047bfe0 // cdecl
undefined FUN_00485320(undefined4* outPtr, undefined4 param_2,
undefined4 param_3, undefined4 unused); // 00485320 // FUN_00485320 // cdecl
undefined SND_fn_vKillAllObjectSound(
void); // 0040a220 // SND_fn_vKillAllObjectSound // cdecl
undefined *getMoviePath(void); // 0055aa00 // getMoviePath // cdecl
undefined FUN_004420f0(undefined4 param_1); // 004420f0 // FUN_004420f0 // cdecl
undefined r3_binkLoop(void); // 004427a0 // r3_binkLoop // cdecl
undefined FUN_00485400(undefined4 param_1); // 00485400 // FUN_00485400 // cdecl
undefined FUN_004422c0(undefined4 param_1); // 004422c0 // FUN_004422c0 // cdecl
undefined FUN_00444810(void); // 00444810 // FUN_00444810 // cdecl
HBINK r3_binkOpen(char *movieFilename,
ulong flags); // 00442240 // r3_binkOpen // cdecl
void Erm_fn_v_UpdateLastError(
ushort uwStartOfWarningsId, byte ucModuleId, ulong ulChannelId,
ushort uwErrNum, long lDebugData, uchar ucOpenInfoWindow,
uchar ucStopForDebug,
char *szPersonalMsg); // 0043e410 // Erm_fn_v_UpdateLastError // stdcall
undefined FUN_0046f410(uint unused0,
uint unused1); // 0046f410 // FUN_0046f410 // cdecl
void r3_checkMovieDisc(
char *movieName); // 00445a10 // r3_checkMovieDisc // stdcall
undefined FUN_0046ed40(undefined param_1, undefined param_2,
undefined2 param_3); // 0046ed40 // FUN_0046ed40 // cdecl
uint32_t r3_doesMovieHaveSoundtrack(
char *param_1); // 00442130 // r3_doesMovieHaveSoundtrack // cdecl
// 00442330
/* WARNING: Inlined function: FUN_00485390 */
void r3_BNK_playMovie(char *param_1, char param_2, int param_3)
{
uint uVar1;
byte bVar2;
undefined *puVar3;
char *puVar4;
int haveSoundtrack;
longlong lVar5;
longlong lVar6;
float fVar5;
float extraout_ST0;
undefined4 uVar7;
char auStack_1b4[65];
undefined1 auStack_b0[64];
GLD_ViewportAttributes GStack_70;
bVar2 = BYTE_007a2c54;
g_currentBinkMovie.drawSemaphore = (HANDLE)r3_getDrawSemaphore();
DAT_007a2e01 = FUN_0047bb10();
g_StopVideoActionHandle = IPT_fn_hGetEntryActionHandle(s_StopVideo_005bd740);
uVar1 = (uint)bVar2;
DWORD_005bd62c = uVar1;
if (param_2 != '\0') {
SND_fn_vKillAllObjectSound();
}
r3_validateBinkVideoQuality(g_bink_videoBpp, g_bink_realVideoQuality);
haveSoundtrack = FUN_00444810();
BinkSetSoundTrack(haveSoundtrack + 1);
if (param_1 == 0) {
r3_checkMovieDisc(*(char **)(DAT_007a2c4c + 4 + uVar1 * 8));
uVar7 = *(undefined4 *)(DAT_007a2c4c + 4 + uVar1 * 8);
/* maybe, not initialized yet */
puVar3 = getMoviePath();
sprintf((char *)auStack_1b4, s_percent_s_path_2, puVar3, uVar7);
puVar4 = strlwr(auStack_1b4);
haveSoundtrack = r3_doesMovieHaveSoundtrack(puVar4);
if (haveSoundtrack == 0) {
/* BINKIOSIZE | BINKNOSKIP | BINKSNDTRACK */
uVar7 = 0x1084000;
} else {
/* BINKIOSIZE | BINKNOSKIP */
uVar7 = 0x1080000;
}
g_binkHandle = (HBINK)r3_binkOpen(auStack_1b4, uVar7);
if (g_binkHandle != (HBINK)0x0)
goto LAB_00442549;
uVar7 = *(undefined4 *)(DAT_007a2c4c + 4 + uVar1 * 8);
puVar3 = getMoviePath();
sprintf((char *)auStack_1b4, s_percent_s_path_3, 0x5d26a8, puVar3, uVar7);
puVar4 = strlwr((char *)*(uint **)(DAT_007a2c4c + 4 + uVar1 * 8));
haveSoundtrack = r3_doesMovieHaveSoundtrack(puVar4);
if (haveSoundtrack == 0) {
/* BINKNOSKIP | BINKSNDTRACK | BINKPRELOADALL */
uVar7 = 0x86000;
} else {
/* BINKNOSKIP | BINKPRELOADALL */
uVar7 = 0x82000;
}
} else {
/* Similar logic to above */
r3_checkMovieDisc((char *)param_1);
sprintf((char *)auStack_1b4, s_percent_s_path_2, s_Videos_005bd72c,
param_1);
puVar4 = strlwr(auStack_1b4);
haveSoundtrack = r3_doesMovieHaveSoundtrack(puVar4);
if (haveSoundtrack == 0) {
/* BINKIOSIZE | BINKNOSKIP | BINKSNDTRACK */
uVar7 = 0x1084000;
} else {
/* BINKIOSIZE | BINKNOSKIP */
uVar7 = 0x1080000;
}
g_binkHandle = (HBINK)r3_binkOpen(auStack_1b4, uVar7);
if ((g_binkHandle != (HBINK)0x0) ||
(g_currentBinkMovie.movieName[0] == '\0'))
goto LAB_00442549;
/* g_currentBinkMovie.movieName */
sprintf((char *)auStack_1b4, s_percent_s_path_3,
g_currentBinkMovie.movieName, s_Videos_005bd72c, param_1);
puVar4 = strlwr(param_1);
haveSoundtrack = r3_doesMovieHaveSoundtrack(puVar4);
if (haveSoundtrack == 0) {
uVar7 = 0x86000;
} else {
uVar7 = 0x82000;
}
}
g_binkHandle = (HBINK)r3_binkOpen(auStack_1b4, uVar7);
if (g_binkHandle == (HBINK)0x0) {
return;
}
LAB_00442549:
g_binkMovieEnded = 0;
DAT_007a2dbc = 0;
DAT_007a2dc0 = 0;
DAT_007a2da8 = 0;
DAT_007a2dac = 0;
DAT_007a2db0 = 0;
DAT_007a2db8 = 0;
DAT_007a2e14 = 1;
if (g_binkHandle == (HBINK)0x0) {
Erm_fn_v_UpdateLastError(6, g_BNK_moduleId, 0, 7, -1, 0xff, 0xff,
(char *)auStack_1b4);
} else {
DAT_007a2dd4 = g_binkHandle->Width;
FLOAT_007a2dd8 = (float)g_binkHandle->Height;
g_bink_videoBpp = FUN_00485320(&g_binkDestStorage, g_binkHandle->Width,
g_binkHandle->Height, 0);
haveSoundtrack = g_binkDestStorage;
if (g_binkDestStorage != 0) {
r3_validateBinkVideoQuality(g_bink_videoBpp, g_bink_realVideoQuality);
FUN_00485400(haveSoundtrack, 0);
FUN_004420f0(0);
uVar7 = FUN_00401270();
FUN_0046f680(uVar7, 0);
FUN_0046ed40(0, 0, 1);
FUN_0046f410(0, 0xff);
FUN_0046ed40(0, 0, 1);
GLD_bGetViewportAttributes(0, 0, &GStack_70);
fVar5 = (float)DAT_007a2dd4 *
((float)GStack_70.dwWidth / (float)(DAT_007a2dd4 * 2));
extraout_ST0 = (float)(fVar5 + fVar5);
lVar5 = r3_ftol(extraout_ST0);
lVar6 = r3_ftol((float)((float)(uint)FLOAT_007a2dd8 * extraout_ST0));
DAT_007a2ddc = (GStack_70.dwHeight - (int)lVar6) >> 1;
DAT_007a2de0 = DAT_007a2ddc + (int)lVar6;
DAT_007a2de4 = (GStack_70.dwWidth - (int)lVar5) >> 1;
DAT_007a2de8 = DAT_007a2de4 + (int)lVar5;
BinkSetSoundOnOff(g_binkHandle, 1);
if (param_3 == -1) {
param_3 = DAT_007a2dd0;
}
BinkSetVolume(g_binkHandle, param_3);
FUN_0047bfe0(4);
FUN_00470f20();
r3_binkLoop();
g_binkDestStorage = 0;
BinkSetSoundOnOff(g_binkHandle, 0);
FUN_004422c0(g_binkHandle);
g_binkHandle = (HBINK)0x0;
FUN_00441f30();
FUN_0047bb20(4);
uVar7 = FUN_00401270(0, 0);
FUN_0046f680(uVar7);
FUN_0046ed40(0, 0, 3);
FUN_0046f410(0, 0xff);
FUN_0046ed40(0, 0, 3);
return;
}
}
return;
}
}

View File

@ -0,0 +1,28 @@
// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <r3/config/static.hpp>
#include <gh_global.h>
extern "C" {
// 00445f20
char *r3_getVignettePath(void)
{
char cVar1;
int iVar2;
char *pcVar3;
char *pcVar4;
char filename[256];
auto &config = getDefaultConfig();
strcpy(filename, config.gameRootDir.c_str());
strcat(filename, "/ubi.ini");
GetPrivateProfileStringA(lpAppName_005b68f0, s_VignettesFile_005be2dc,
(LPCSTR)&lpDefault_005cf96c,
(char *)&lpReturnedString_007d9aa0, 0xff, filename);
return (char *)&lpReturnedString_007d9aa0;
}
}

View File

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

View File

@ -5,8 +5,8 @@
extern "C" {
undefined FUN_00447130(void); // 00447130 // FUN_00447130 // cdecl
void doGraphics(byte param_1); // 00447460 // doGraphics // stdcall
bool UNKr3_renderViewport(byte viewportIdx); // 00447200 // ?r3_renderViewport // stdcall
void doGraphics(byte param_1); // 00447460 // doGraphics // cdecl
bool UNKr3_renderViewport(byte viewportIdx); // 00447200 // ?r3_renderViewport // cdecl
int get_one(void); // 0046f2c0 // get_one // cdecl
undefined FUN_00451530(undefined4 param_1); // 00451530 // FUN_00451530 // cdecl
undefined FUN_0048a920(undefined4 param_1); // 0048a920 // FUN_0048a920 // cdecl

View File

@ -4,10 +4,10 @@
#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
void r3_beginLoadLevel(void); // 00447860 // r3_beginLoadLevel // cdecl
FIL_ConcatFile * FIL_fn_vOpenConcatFile(char * fileName); // 0055d890 // FIL_fn_vOpenConcatFile // cdecl
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
void r3_unlockLoadLevelMutex(void); // 00447890 // r3_unlockLoadLevelMutex // cdecl
// 004fa4a0
void r3_loadVignette(char *param_1)

View File

@ -7,7 +7,7 @@ extern "C" {
undefined FUN_00470350(void); // 00470350 // FUN_00470350 // cdecl
undefined r3_load_textures_2(void); // 00471760 // r3_load_textures_2 // cdecl
void r3_levelDisplayFn(byte param); // 00446fc0 // r3_levelDisplayFn // cdecl
void r3_noop(void * p_cTxt1, void * p_cTxt2); // 00401100 // r3_noop // stdcall
void r3_noop(void * p_cTxt1, void * p_cTxt2); // 00401100 // r3_noop // cdecl
undefined r3_closeConcatTextureFile(void); // 004711d0 // r3_closeConcatTextureFile // cdecl
undefined FUN_00470db0(void); // 00470db0 // FUN_00470db0 // cdecl
undefined FUN_00503710(void); // 00503710 // FUN_00503710 // cdecl
@ -35,7 +35,7 @@ undefined FUN_0051a7a0(short hGLDDevice, undefined4 param_2); // 0051a7a0 // FUN
// 00401490
/* WARNING: Inlined function: r3_get_engine_mode */
undefined4 __stdcall r3_restore(undefined4 param_1)
undefined4 r3_restore(undefined4 param_1)
{
HWND hWnd;

View File

@ -8,7 +8,7 @@ undefined r3_setRendererState1(undefined4 param_1, undefined4 param_2, undefined
undefined FUN_0043e4f0(void); // 0043e4f0 // FUN_0043e4f0 // cdecl
undefined r3_gfxFrameUNK(void); // 0046fed0 // r3_gfxFrame? // cdecl
undefined FUN_00441d70(undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4, undefined4 param_5); // 00441d70 // FUN_00441d70 // cdecl
void IPT_fn_vReadInput(void); // 00505fe0 // IPT_fn_vReadInput // stdcall
void IPT_fn_vReadInput(void); // 00505fe0 // IPT_fn_vReadInput // cdecl
// 0043e540
int __cdecl r3_waitForDvd(const char *param_1,const char *param_2,uint param_3)

View File

@ -4,7 +4,7 @@
#include <gh_global.h>
extern "C" {
HWND getHWND(void); // 00401300 // getHWND // stdcall
HWND getHWND(void); // 00401300 // getHWND // cdecl
// 00401320
void __cdecl r3_windowLockCursor(void)
@ -27,7 +27,7 @@ void __cdecl r3_windowLockCursor(void)
RStack_30.top = local_20.bottom - tStack_10.bottom;
RStack_30.right = tStack_10.right + -5 + RStack_30.left;
RStack_30.bottom = RStack_30.top + -5 + tStack_10.bottom;
ClipCursor(&RStack_30);
// ClipCursor(&RStack_30);
// ShowCursor(0);
}
return;

View File

@ -65,6 +65,11 @@ undefined1& g_errModDInput= (undefined1&) GH_MEM(0x005bd29c);
undefined4& DAT_005bd454= (undefined4&) GH_MEM(0x005bd454);
const char* s__jc_z_d__s_005bd460 = "\\jc\\z%d:%s"; // 005bd460
undefined1& g_errModMmg= (undefined1&) GH_MEM(0x005bd58c);
dword& DWORD_005bd62c= (dword&) GH_MEM(0x005bd62c);
const char* s_Videos_005bd72c = "Videos"; // 005bd72c
const char* s_percent_s_path_3 = "%s\\%s\\%s"; // 005bd734
const char* s_StopVideo_005bd740 = "StopVideo"; // 005bd740
undefined1& g_BNK_moduleId= (undefined1&) GH_MEM(0x005bd7ac);
FnProcessInput PTR_r3_processInput1_005bdb1c = (FnProcessInput)GH_MEM(0x005bdb1c); // 005bdb1c
FnDisplay p_fn_vDisplayAll = (FnDisplay)GH_MEM(0x005bdb24); // 005bdb24
const char* s_R3_DVD_005bdfd8 = "R3_DVD"; // 005bdfd8
@ -74,6 +79,7 @@ const char* s_Die__s_DVDROM_kann_nicht_gelesen_005be130 = "Die %s DVDROM kann ni
const char* s_Impossibile_trovare_il_DVD____s_005be198 = "Impossibile trovare il DVD : %s"; // 005be198
const char* s_DVD_s_no_v_lido_005be1ec = "DVD %s no v£lido "; // 005be1ec
const char* s_Impossible_de_trouver_le_DVD_____005be238 = "Impossible de trouver le DVD : %s"; // 005be238
const char* s_VignettesFile_005be2dc = "VignettesFile"; // 005be2dc
pointer& s_Yes = (pointer&)GH_MEM(0x005be304); // 005be304
const char* s_SingleProcessor_005be308 = "SingleProcessor"; // 005be308
const char* lpDefault_005be318 = "No"; // 005be318
@ -148,8 +154,32 @@ char(&s_wndStrRestoring)[256] = reinterpret_cast<char(&)[256]>(GH_MEM(0x0077d5e0
char*& g_crt_cmdLine = (char*&)GH_MEM(0x0077ea84); // 0077ea84
char(&s_quitting1)[64] = reinterpret_cast<char(&)[64]>(GH_MEM(0x007825c0));
char(&s_wndStrQuiting)[56] = reinterpret_cast<char(&)[56]>(GH_MEM(0x00782600));
undefined4& DAT_007a2c4c= (undefined4&) GH_MEM(0x007a2c4c);
byte& BYTE_007a2c54= (byte&) GH_MEM(0x007a2c54);
HBINK& g_binkHandle= (HBINK&) GH_MEM(0x007a2d60);
undefined4& DAT_007a2da8= (undefined4&) GH_MEM(0x007a2da8);
undefined4& DAT_007a2dac= (undefined4&) GH_MEM(0x007a2dac);
undefined4& DAT_007a2db0= (undefined4&) GH_MEM(0x007a2db0);
undefined4& DAT_007a2db8= (undefined4&) GH_MEM(0x007a2db8);
undefined4& DAT_007a2dbc= (undefined4&) GH_MEM(0x007a2dbc);
undefined4& DAT_007a2dc0= (undefined4&) GH_MEM(0x007a2dc0);
undefined4& g_StopVideoActionHandle= (undefined4&) GH_MEM(0x007a2dc4);
undefined4& g_binkDestStorage= (undefined4&) GH_MEM(0x007a2dc8);
undefined4& DAT_007a2dd0= (undefined4&) GH_MEM(0x007a2dd0);
undefined4& DAT_007a2dd4= (undefined4&) GH_MEM(0x007a2dd4);
float& FLOAT_007a2dd8= (float&) GH_MEM(0x007a2dd8);
undefined4& DAT_007a2ddc= (undefined4&) GH_MEM(0x007a2ddc);
undefined4& DAT_007a2de0= (undefined4&) GH_MEM(0x007a2de0);
undefined4& DAT_007a2de4= (undefined4&) GH_MEM(0x007a2de4);
undefined4& DAT_007a2de8= (undefined4&) GH_MEM(0x007a2de8);
undefined1& g_binkMovieEnded= (undefined1&) GH_MEM(0x007a2dec);
byte& g_bink_videoBpp= (byte&) GH_MEM(0x007a2e00);
undefined4& DAT_007a2e01= (undefined4&) GH_MEM(0x007a2e01);
byte& g_bink_realVideoQuality= (byte&) GH_MEM(0x007a2e03);
undefined4& DAT_007a2e14= (undefined4&) GH_MEM(0x007a2e14);
GAM_EngineStructure& g_stEngineStructure= (GAM_EngineStructure&) GH_MEM(0x007d7dc0);
undefined1& DAT_007d98fc= (undefined1&) GH_MEM(0x007d98fc);
undefined4& lpReturnedString_007d9aa0= (undefined4&) GH_MEM(0x007d9aa0);
undefined4& DAT_007d9cc4= (undefined4&) GH_MEM(0x007d9cc4);
byte& g_config_unused0= (byte&) GH_MEM(0x007d9df0);
char(&g_driveLetter)[4] = reinterpret_cast<char(&)[4]>(GH_MEM(0x007d9e70));
@ -181,3 +211,5 @@ undefined4& g_GLI_adapter= (undefined4&) GH_MEM(0x007edd60);
undefined1& g_GLI_tnl= (undefined1&) GH_MEM(0x007edd64);
undefined1& g_config_tex_compressed= (undefined1&) GH_MEM(0x007edd65);
undefined1& g_GLI_trilinear= (undefined1&) GH_MEM(0x007edd66);
undefined4& DAT_00840e9c= (undefined4&) GH_MEM(0x00840e9c);
undefined4& DAT_00840ea0= (undefined4&) GH_MEM(0x00840ea0);

View File

@ -70,6 +70,11 @@ extern undefined1& g_errModDInput; // 005bd29c
extern undefined4& DAT_005bd454; // 005bd454
extern const char* s__jc_z_d__s_005bd460; // 005bd460
extern undefined1& g_errModMmg; // 005bd58c
extern dword& DWORD_005bd62c; // 005bd62c
extern const char* s_Videos_005bd72c; // 005bd72c
extern const char* s_percent_s_path_3; // 005bd734
extern const char* s_StopVideo_005bd740; // 005bd740
extern undefined1& g_BNK_moduleId; // 005bd7ac
extern FnProcessInput PTR_r3_processInput1_005bdb1c; // 005bdb1c
extern FnDisplay p_fn_vDisplayAll; // 005bdb24
extern const char* s_R3_DVD_005bdfd8; // 005bdfd8
@ -79,6 +84,7 @@ extern const char* s_Die__s_DVDROM_kann_nicht_gelesen_005be130; // 005be130
extern const char* s_Impossibile_trovare_il_DVD____s_005be198; // 005be198
extern const char* s_DVD_s_no_v_lido_005be1ec; // 005be1ec
extern const char* s_Impossible_de_trouver_le_DVD_____005be238; // 005be238
extern const char* s_VignettesFile_005be2dc; // 005be2dc
extern pointer& s_Yes; // 005be304
extern const char* s_SingleProcessor_005be308; // 005be308
extern const char* lpDefault_005be318; // 005be318
@ -153,8 +159,32 @@ extern char(&s_wndStrRestoring)[256]; // 0077d5e0
extern char*& g_crt_cmdLine; // 0077ea84
extern char(&s_quitting1)[64]; // 007825c0
extern char(&s_wndStrQuiting)[56]; // 00782600
extern undefined4& DAT_007a2c4c; // 007a2c4c
extern byte& BYTE_007a2c54; // 007a2c54
extern HBINK& g_binkHandle; // 007a2d60
extern undefined4& DAT_007a2da8; // 007a2da8
extern undefined4& DAT_007a2dac; // 007a2dac
extern undefined4& DAT_007a2db0; // 007a2db0
extern undefined4& DAT_007a2db8; // 007a2db8
extern undefined4& DAT_007a2dbc; // 007a2dbc
extern undefined4& DAT_007a2dc0; // 007a2dc0
extern undefined4& g_StopVideoActionHandle; // 007a2dc4
extern undefined4& g_binkDestStorage; // 007a2dc8
extern undefined4& DAT_007a2dd0; // 007a2dd0
extern undefined4& DAT_007a2dd4; // 007a2dd4
extern float& FLOAT_007a2dd8; // 007a2dd8
extern undefined4& DAT_007a2ddc; // 007a2ddc
extern undefined4& DAT_007a2de0; // 007a2de0
extern undefined4& DAT_007a2de4; // 007a2de4
extern undefined4& DAT_007a2de8; // 007a2de8
extern undefined1& g_binkMovieEnded; // 007a2dec
extern byte& g_bink_videoBpp; // 007a2e00
extern undefined4& DAT_007a2e01; // 007a2e01
extern byte& g_bink_realVideoQuality; // 007a2e03
extern undefined4& DAT_007a2e14; // 007a2e14
extern GAM_EngineStructure& g_stEngineStructure; // 007d7dc0
extern undefined1& DAT_007d98fc; // 007d98fc
extern undefined4& lpReturnedString_007d9aa0; // 007d9aa0
extern undefined4& DAT_007d9cc4; // 007d9cc4
extern byte& g_config_unused0; // 007d9df0
extern char(&g_driveLetter)[4]; // 007d9e70
@ -186,4 +216,6 @@ extern undefined4& g_GLI_adapter; // 007edd60
extern undefined1& g_GLI_tnl; // 007edd64
extern undefined1& g_config_tex_compressed; // 007edd65
extern undefined1& g_GLI_trilinear; // 007edd66
extern undefined4& DAT_00840e9c; // 00840e9c
extern undefined4& DAT_00840ea0; // 00840ea0
#endif // GH_GENERATED_GLOBALS_H

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>
// 0043e410
// Erm_fn_v_UpdateLastError
extern "C" void Erm_fn_v_UpdateLastError(ushort uwStartOfWarningsId, byte ucModuleId, ulong ulChannelId, ushort uwErrNum, long lDebugData, uchar ucOpenInfoWindow, uchar ucStopForDebug, char * szPersonalMsg) {
gh_stub_impl_stdcall<(stub_t)0x0043e410, void>(uwStartOfWarningsId, ucModuleId, ulChannelId, uwErrNum, lDebugData, ucOpenInfoWindow, ucStopForDebug, szPersonalMsg);
}

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>
// 00401270
// FUN_00401270
extern "C" undefined FUN_00401270(void) {
return gh_stub_impl_cdecl<(stub_t)0x00401270, undefined>();
}

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>
// 00441f30
// FUN_00441f30
extern "C" undefined FUN_00441f30(void) {
return gh_stub_impl_cdecl<(stub_t)0x00441f30, undefined>();
}

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>
// 004420f0
// FUN_004420f0
extern "C" undefined FUN_004420f0(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x004420f0, 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>
// 004422c0
// FUN_004422c0
extern "C" undefined FUN_004422c0(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x004422c0, 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>
// 00444810
// FUN_00444810
extern "C" undefined FUN_00444810(void) {
return gh_stub_impl_cdecl<(stub_t)0x00444810, undefined>();
}

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>
// 0046ed40
// FUN_0046ed40
extern "C" undefined FUN_0046ed40(undefined param_1, undefined param_2, undefined2 param_3) {
return gh_stub_impl_cdecl<(stub_t)0x0046ed40, undefined>(param_1, param_2, param_3);
}

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>
// 0046f410
// FUN_0046f410
extern "C" undefined4 FUN_0046f410(uint unused0, uint unused1) {
return gh_stub_impl_stdcall<(stub_t)0x0046f410, undefined4>(unused0, unused1);
}

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>
// 0046f680
// FUN_0046f680
extern "C" undefined FUN_0046f680(undefined param_1, undefined4 param_2) {
return gh_stub_impl_cdecl<(stub_t)0x0046f680, undefined>(param_1, param_2);
}

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>
// 00470f20
// FUN_00470f20
extern "C" undefined FUN_00470f20(void) {
return gh_stub_impl_cdecl<(stub_t)0x00470f20, undefined>();
}

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>
// 0047bb10
// FUN_0047bb10
extern "C" undefined FUN_0047bb10(void) {
return gh_stub_impl_cdecl<(stub_t)0x0047bb10, undefined>();
}

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>
// 0047bb20
// FUN_0047bb20
extern "C" undefined FUN_0047bb20(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x0047bb20, 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>
// 0047bfe0
// FUN_0047bfe0
extern "C" undefined FUN_0047bfe0(undefined4 param_1) {
return gh_stub_impl_cdecl<(stub_t)0x0047bfe0, 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>
// 00485320
// FUN_00485320
extern "C" uint FUN_00485320(undefined4 * outPtr, uint param_2, uint param_3, uint unused) {
return gh_stub_impl_cdecl<(stub_t)0x00485320, uint>(outPtr, param_2, param_3, 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>
// 00485400
// FUN_00485400
extern "C" undefined FUN_00485400(undefined4 param_1, undefined4 param_2) {
return gh_stub_impl_cdecl<(stub_t)0x00485400, undefined>(param_1, param_2);
}

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>
// 0046f240
// GLD_bGetViewportAttributes
extern "C" BOOL GLD_bGetViewportAttributes(short param_1, short combinedWindowHandle, GLD_ViewportAttributes * out) {
return gh_stub_impl_cdecl<(stub_t)0x0046f240, BOOL>(param_1, combinedWindowHandle, out);
}

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>
// 0040a220
// SND_fn_vKillAllObjectSound
extern "C" undefined SND_fn_vKillAllObjectSound(void) {
return gh_stub_impl_cdecl<(stub_t)0x0040a220, undefined>();
}

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>
// 0055aa00
// getMoviePath
extern "C" undefined * getMoviePath(void) {
return gh_stub_impl_cdecl<(stub_t)0x0055aa00, undefined *>();
}

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>
// 004427a0
// r3_binkLoop
extern "C" undefined r3_binkLoop(void) {
return gh_stub_impl_cdecl<(stub_t)0x004427a0, undefined>();
}

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>
// 00442240
// r3_binkOpen
extern "C" HBINK r3_binkOpen(char * movieFilename, ulong flags) {
return gh_stub_impl_cdecl<(stub_t)0x00442240, HBINK>(movieFilename, flags);
}

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>
// 00445a10
// r3_checkMovieDisc
extern "C" void r3_checkMovieDisc(char * movieName) {
gh_stub_impl_stdcall<(stub_t)0x00445a10, void>(movieName);
}

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>
// 00442130
// r3_doesMovieHaveSoundtrack
extern "C" int r3_doesMovieHaveSoundtrack(char * param_1) {
return gh_stub_impl_cdecl<(stub_t)0x00442130, int>(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>
// 00442090
// r3_validateBinkVideoQuality
extern "C" void r3_validateBinkVideoQuality(byte videoBpp, byte wantedVideoQuality) {
gh_stub_impl_cdecl<(stub_t)0x00442090, void>(videoBpp, wantedVideoQuality);
}

View File

@ -16,6 +16,8 @@
#include <stdio.h>
#include <string.h>
typedef struct BINK* HBINK;
typedef long long longlong;
typedef uint8_t undefined;
typedef uint32_t undefined4;
@ -49,4 +51,7 @@ typedef void *pointer;
typedef char *TerminatedCString;
typedef char *string;
using FnD3Create8 = IDirect3D8 *(__stdcall *)(UINT);
FnD3Create8 getDirect3DCreate8();
#endif /* A523F6DB_0645_4DEB_8AEB_3792CB732B49 */

View File

@ -19,6 +19,14 @@ void gh_pre_main(void);
#include <CLI11.hpp>
#include <magic_enum/magic_enum.hpp>
FnD3Create8 getDirect3DCreate8() {
HMODULE hModule = LoadLibrary("d3d8.dll");
if (hModule != NULL) {
return (FnD3Create8)GetProcAddress(hModule, "Direct3DCreate8");
}
return nullptr;
}
extern "C" int r3_main(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR *cmdline, int showCmd);
@ -73,8 +81,8 @@ static void setupWindowsStdErrLogging() {
SetStdHandle(STD_ERROR_HANDLE, conOut);
}
}
extern "C" int __declspec(dllexport) __cdecl re_dbg_attached(
const char *cmdLine_) {
extern "C" int
__declspec(dllexport) __cdecl re_dbg_attached(const char *cmdLine_) {
auto split = CLI::detail::split_program_name(cmdLine_);
auto cmdLine = std::move(split.second);

View File

@ -5,11 +5,12 @@ if(WIN32)
add_library(binkw32_imp SHARED IMPORTED)
set_target_properties(binkw32_imp PROPERTIES
IMPORTED_IMPLIB ${CMAKE_CURRENT_LIST_DIR}/bink/binkw32.lib
IMPORTED_IMPLIB ${CMAKE_CURRENT_LIST_DIR}/bink10p/binkw32.lib
)
add_library(binkw32 INTERFACE)
target_link_libraries(binkw32 INTERFACE binkw32_imp)
target_include_directories(binkw32 INTERFACE ${CMAKE_CURRENT_LIST_DIR}/bink10p)
set(SDK_LIB ${CMAKE_CURRENT_LIST_DIR}/mssdk/lib)

View File

@ -916,21 +916,21 @@ RADEXPFUNC void RADEXPLINK radfree(void PTR4* ptr);
// for multi-processor machines
#ifdef __RADNT__
#define LockedIncrement(var) __asm { lock inc [var] }
#define LockedDecrement(var) __asm { lock dec [var] }
void __inline LockedIncrementFunc(void PTR4* var) {
__asm {
mov eax,[var]
lock inc [eax]
}
}
// #define LockedIncrement(var) __asm { lock inc [var] }
// #define LockedDecrement(var) __asm { lock dec [var] }
// void __inline LockedIncrementFunc(void PTR4* var) {
// __asm {
// mov eax,[var]
// lock inc [eax]
// }
// }
void __inline LockedDecrementFunc(void PTR4* var) {
__asm {
mov eax,[var]
lock dec [eax]
}
}
// void __inline LockedDecrementFunc(void PTR4* var) {
// __asm {
// mov eax,[var]
// lock dec [eax]
// }
// }
#else