diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2019-06-02 05:15:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-02 05:15:00 +0200 |
commit | 809c81ea9ce66b998e0ebaf17965843337c4fdd9 (patch) | |
tree | c1b34122ddd4be0461a5310c964e8218b9f5781e /src/re3.cpp | |
parent | skeleton updated, windows specific stuff added (diff) | |
parent | implemented splashes; fixed zones (diff) | |
download | re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.tar re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.tar.gz re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.tar.bz2 re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.tar.lz re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.tar.xz re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.tar.zst re3-809c81ea9ce66b998e0ebaf17965843337c4fdd9.zip |
Diffstat (limited to '')
-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); |