summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2021-09-18 13:04:42 -0400
committerPheenoh <pheenoh@gmail.com>2021-09-18 13:04:42 -0400
commit8ce4c6a950a981fc4a4ca621fde48d1322d110e8 (patch)
treec5ff4e15819d719d63ce5807d71f280221ad82d6
parent5a180ab26b20bde532912b1ebaf4095dcf2829d9 (diff)
add region based macropr_tests
-rw-r--r--src/lib.cpp3
-rw-r--r--src/utils/hook.cpp10
2 files changed, 7 insertions, 6 deletions
diff --git a/src/lib.cpp b/src/lib.cpp
index 62f08d7..9695b72 100644
--- a/src/lib.cpp
+++ b/src/lib.cpp
@@ -59,9 +59,6 @@ void apply_lib_hooks() {
}
void init() {
- void *ptr = (void *)0x00000000; // a random memory address
- goto *ptr; // jump there -- probably crash
-
Font::load_font("tpgz/fonts/consola.fnt");
Draw::init();
PosSettingsMenu::initDefaults();
diff --git a/src/utils/hook.cpp b/src/utils/hook.cpp
index ae01f51..59b21e1 100644
--- a/src/utils/hook.cpp
+++ b/src/utils/hook.cpp
@@ -31,6 +31,10 @@ struct PadStatus {
#define PAD_READ_RETURN_OFFSET (0x2DC)
#endif
+#ifdef GCN_NTSCU
+#define CRASH_ADDRESS (0x80450580)
+#endif
+
HOOK_DEF(uint32_t, PADRead, (uint16_t*));
HOOK_DEF(uint32_t, checkHookshotStickBG, (void*, void*));
HOOK_DEF(void, setSpecialGravity, (float, float, int));
@@ -67,9 +71,9 @@ void drawHook(void* p1) {
void myExceptionCallbackHook(void) {
ExceptionCallbackTrampoline();
- *reinterpret_cast<uint32_t*>(0x80450580) = 1;
- DCFlushRange((void*)(0x80450580), sizeof(uint32_t));
- ICInvalidateRange((void*)(0x80450580), sizeof(uint32_t));
+ *reinterpret_cast<uint32_t*>(CRASH_ADDRESS) = 1;
+ DCFlushRange((void*)(CRASH_ADDRESS), sizeof(uint32_t));
+ ICInvalidateRange((void*)(CRASH_ADDRESS), sizeof(uint32_t));
}
uint32_t readControllerHook(uint16_t* p1) {