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

This commit is contained in:
NovaRain
2017-11-07 10:44:57 +08:00
parent 6c3efc5b84
commit 0eab48932a
+5 -5
View File
@@ -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);
}
}