summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdestroy_tracker.yaml9
-rwxr-xr-xsrc/destroy_tracker.cpp19
2 files changed, 28 insertions, 0 deletions
diff --git a/destroy_tracker.yaml b/destroy_tracker.yaml
new file mode 100755
index 0000000..6af40a9
--- /dev/null
+++ b/destroy_tracker.yaml
@@ -0,0 +1,9 @@
+---
+source_files: [../src/destroy_tracker.cpp]
+hooks:
+ - name: CallDestroyTracker
+ type: branch_insn
+ branch_type: b
+ src_addr_pal: 0x801626C0
+ target_func: 'trackDestroy(int)'
+
diff --git a/src/destroy_tracker.cpp b/src/destroy_tracker.cpp
new file mode 100755
index 0000000..15bace9
--- /dev/null
+++ b/src/destroy_tracker.cpp
@@ -0,0 +1,19 @@
+#include <common.h>
+
+// @@ %SET_OFFSET 817F4000
+
+// @@ %IFREGION pal
+// @@ %PATCH 801626C0 %b:817F4000
+// @@ %ENDIF
+
+int trackDestroy(int objptr) {
+ int oldLR;
+ __asm__ __volatile__ (
+ "mflr %0"
+ : "=r" (oldLR)
+ );
+ OSReport("D%x @%x", objptr, oldLR);
+ return objptr;
+}
+
+