From 0eab48932a3a2f50b2af429286c2514b82d5101a Mon Sep 17 00:00:00 2001 From: NovaRain Date: Tue, 7 Nov 2017 10:44:57 +0800 Subject: [PATCH] Tweaked the way DebugMode works, now only DebugMode=2 sends debug output to a debug.log file. Any other non-0 value sends debug output to the screen. #123 --- sfall/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sfall/main.cpp b/sfall/main.cpp index 23a9c325..a8faaae8 100644 --- a/sfall/main.cpp +++ b/sfall/main.cpp @@ -1075,14 +1075,14 @@ static void DllMain2() { dlog("Applying debugmode patch.", DL_INIT); //If the player is using an exe with the debug patch already applied, just skip this block without erroring if (*((DWORD*)0x444A64) != 0x082327E8) { - SafeWrite32(0x444A64, 0x082327E8); - SafeWrite32(0x444A68, 0x0120E900); + SafeWrite32(0x444A64, 0x082327E8); // call debug_register_env_ + SafeWrite32(0x444A68, 0x0120E900); // jmp 0x444B8E SafeWrite8(0x444A6D, 0); SafeWrite32(0x444A6E, 0x90909090); } - SafeWrite8(0x4C6D9B, 0xB8); - if (tmp == 1) SafeWrite32(0x4C6D9C, (DWORD)debugGnw); - else SafeWrite32(0x4C6D9C, (DWORD)debugLog); + SafeWrite8(0x4C6D9B, 0xB8); // mov eax, GNW/LOG + if (tmp == 2) SafeWrite32(0x4C6D9C, (DWORD)debugLog); + else SafeWrite32(0x4C6D9C, (DWORD)debugGnw); dlogr(" Done", DL_INIT); } }