From 52f751c6c88a5af88baa2f3af6570955bffd9657 Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Fri, 18 Oct 2024 00:10:18 +0100 Subject: [PATCH] Implemented XButtonHoming hook --- UnleashedRecomp/game.cpp | 5 +++++ UnleashedRecompLib/config/SWA.toml | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/game.cpp b/UnleashedRecomp/game.cpp index 67d9c7f..b605763 100644 --- a/UnleashedRecomp/game.cpp +++ b/UnleashedRecomp/game.cpp @@ -162,6 +162,11 @@ bool DisableHintsMidAsmHook() return !Config::Hints; } +void SetXButtonHomingMidAsmHook(PPCRegister& r30) +{ + r30.u32 = Config::XButtonHoming; +} + /* Hook function that gets the game region and force result to zero for Japanese to display the correct logos. */ diff --git a/UnleashedRecompLib/config/SWA.toml b/UnleashedRecompLib/config/SWA.toml index 6ad1b8d..147927b 100644 --- a/UnleashedRecompLib/config/SWA.toml +++ b/UnleashedRecompLib/config/SWA.toml @@ -146,4 +146,9 @@ jump_address_on_true = 0x827A251C [[midasm_hook]] name = "DisableHintsMidAsmHook" address = 0x827A2E34 -jump_address_on_true = 0x827A2E4C \ No newline at end of file +jump_address_on_true = 0x827A2E4C + +[[midasm_hook]] +name = "SetXButtonHomingMidAsmHook" +address = 0x8237AC88 +registers = ["r30"] \ No newline at end of file