diff options
Diffstat (limited to 'src/re3.cpp')
-rw-r--r-- | src/re3.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/re3.cpp b/src/re3.cpp index b3484c60..b7404ba2 100644 --- a/src/re3.cpp +++ b/src/re3.cpp @@ -61,6 +61,8 @@ int (*open_script_orig)(const char *path, const char *mode); int open_script(const char *path, const char *mode) { + if(GetAsyncKeyState('G') & 0x8000) + return open_script_orig("main.scm", mode); if(GetAsyncKeyState('D') & 0x8000) return open_script_orig("main_d.scm", mode); // if(GetAsyncKeyState('R') & 0x8000) @@ -104,8 +106,6 @@ delayedPatches10(int a, int b) DebugMenuAddVarBool8("Debug", "Don't render Objects", (int8*)&gbDontRenderObjects, nil); DebugMenuAddVar("Debug", "Dbg Surface", &gDbgSurf, nil, 1, 0, 34, nil); - DebugMenuAddVar("Debug", "blur type", &TheCamera.m_BlurType, nil, 1, 0, 10, nil); - DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); } @@ -113,6 +113,30 @@ delayedPatches10(int a, int b) return RsEventHandler_orig(a, b); } +void __declspec(naked) HeadlightsFix() +{ + static const float fMinusOne = -1.0f; + _asm + { + fld [esp+708h-690h] + fcomp fMinusOne + fnstsw ax + and ah, 5 + cmp ah, 1 + jnz HeadlightsFix_DontLimit + fld fMinusOne + fstp [esp+708h-690h] + +HeadlightsFix_DontLimit: + fld [esp+708h-690h] + fabs + fld st + push 0x5382F2 + retn + } +} + + void patch() { @@ -121,6 +145,10 @@ patch() Patch<float>(0x46BC61+6, 1.0f); // car distance InjectHook(0x59E460, printf, PATCH_JUMP); + // stolen from silentpatch (sorry) + Patch<WORD>(0x5382BF, 0x0EEB); + InjectHook(0x5382EC, HeadlightsFix, PATCH_JUMP); + InterceptCall(&open_script_orig, open_script, 0x438869); InterceptCall(&RsEventHandler_orig, delayedPatches10, 0x58275E); |