Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Fix some crashes on XP, add TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
PiKeyAr committed Jun 25, 2023
1 parent 3e605d1 commit cd7ba8e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sadx-debug-mode/FreeMovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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;
}
2 changes: 2 additions & 0 deletions sadx-debug-mode/mod.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TODO: Rewrite with symbol names, fix XP crash with LoadPVM hook

#include <SADXModLoader.h>
#include "IniFile.hpp"
#include "Trampoline.h"
Expand Down
1 change: 1 addition & 0 deletions sadx-debug-mode/sadx-debug-mode.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<ClInclude Include="InfoSound.h" />
<ClInclude Include="Keys.h" />
<ClInclude Include="Lantern.h" />
<ClInclude Include="stdafx.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
3 changes: 3 additions & 0 deletions sadx-debug-mode/sadx-debug-mode.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@
<ClInclude Include="InfoCollision.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions sadx-debug-mode/stdafx.h
Original file line number Diff line number Diff line change
@@ -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 <Windows.h>

#define TARGET_DYNAMIC(name) ((decltype(name##_r)*)name##_t->Target())
#define TARGET_STATIC(name) ((decltype(name##_r)*)name##_t.Target())

0 comments on commit cd7ba8e

Please sign in to comment.