diff --git a/sadx-debug-mode/FreeMovement.cpp b/sadx-debug-mode/FreeMovement.cpp index 5d729f4..4f9def6 100644 --- a/sadx-debug-mode/FreeMovement.cpp +++ b/sadx-debug-mode/FreeMovement.cpp @@ -27,8 +27,7 @@ void __cdecl Tails_Main_r(ObjectMaster* obj) { { Debug_FreeMovement(data); } - - ObjectFunc(original, Tails_Main_t->Target()); + const auto original = TARGET_DYNAMIC(Tails_Main); original(obj); SetFreeMovement(data); @@ -42,7 +41,7 @@ void Gamma_Main_r(ObjectMaster* obj) { Debug_FreeMovement(data); } - ObjectFunc(original, Gamma_Main_t->Target()); + const auto original = TARGET_DYNAMIC(Gamma_Main); original(obj); SetFreeMovement(data); @@ -56,7 +55,7 @@ void __cdecl Big_Main_r(ObjectMaster* obj) { Debug_FreeMovement(data); } - ObjectFunc(original, Big_Main_t->Target()); + const auto original = TARGET_DYNAMIC(Big_Main); original(obj); SetFreeMovement(data); @@ -67,5 +66,4 @@ void InitFreeMovement() Tails_Main_t = new Trampoline((int)Tails_Main, (int)Tails_Main + 0x7, Tails_Main_r); Gamma_Main_t = new Trampoline((int)Gamma_Main, (int)Gamma_Main + 0x7, Gamma_Main_r); Big_Main_t = new Trampoline((int)Big_Main, (int)Big_Main + 0x5, Big_Main_r); - return; } \ No newline at end of file diff --git a/sadx-debug-mode/mod.cpp b/sadx-debug-mode/mod.cpp index 6f35041..8020999 100644 --- a/sadx-debug-mode/mod.cpp +++ b/sadx-debug-mode/mod.cpp @@ -1,3 +1,5 @@ +// TODO: Rewrite with symbol names, fix XP crash with LoadPVM hook + #include #include "IniFile.hpp" #include "Trampoline.h" diff --git a/sadx-debug-mode/sadx-debug-mode.vcxproj b/sadx-debug-mode/sadx-debug-mode.vcxproj index 48127a4..0bb27e0 100644 --- a/sadx-debug-mode/sadx-debug-mode.vcxproj +++ b/sadx-debug-mode/sadx-debug-mode.vcxproj @@ -97,6 +97,7 @@ + diff --git a/sadx-debug-mode/sadx-debug-mode.vcxproj.filters b/sadx-debug-mode/sadx-debug-mode.vcxproj.filters index 14d29c7..4e5fb36 100644 --- a/sadx-debug-mode/sadx-debug-mode.vcxproj.filters +++ b/sadx-debug-mode/sadx-debug-mode.vcxproj.filters @@ -65,5 +65,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/sadx-debug-mode/stdafx.h b/sadx-debug-mode/stdafx.h new file mode 100644 index 0000000..4379ca4 --- /dev/null +++ b/sadx-debug-mode/stdafx.h @@ -0,0 +1,14 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +// Windows Header Files: +#include + +#define TARGET_DYNAMIC(name) ((decltype(name##_r)*)name##_t->Target()) +#define TARGET_STATIC(name) ((decltype(name##_r)*)name##_t.Target()) \ No newline at end of file