From 5e55afcfd726bf71d7c67acf3adedc5599d17bdf Mon Sep 17 00:00:00 2001 From: Phlex <3514085+PhlexPlexico@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:47:16 -0600 Subject: [PATCH] fix: Minor adjustments in gear screen. This will now properly show ocarinas if users have the ocarina and masks/used the ocarina once. --- code/mm.ld | 22 ++++++++++++++++++- code/source/asm/ocarina_hooks.s | 35 +++++++++++++++++++++++++++++++ code/source/asm/ocarina_patches.s | 25 ++++++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/code/mm.ld b/code/mm.ld index 30ddc61..5a2cc22 100644 --- a/code/mm.ld +++ b/code/mm.ld @@ -712,7 +712,27 @@ SECTIONS{ *(.patch_DisableExistingTrigger) } - .patch_SwapStoredTradeItems 0x5A6b44 : { + .patch_FixOcarinaGearScreenDefault 0x5A5D74 : { + *(.patch_FixOcarinaGearScreenDefault) + } + + .patch_FixOcarinaGearScreenDeku 0x5A5DA0 : { + *(.patch_FixOcarinaGearScreenDeku) + } + + .patch_FixOcarinaGearScreenGoron 0x5A5DF0 : { + *(.patch_FixOcarinaGearScreenGoron) + } + + .patch_FixOcarinaGearScreenZora 0x5A5E40 : { + *(.patch_FixOcarinaGearScreenZora) + } + + .patch_FixOcarinaGearScreenZoraTwo 0x5A5E54 : { + *(.patch_FixOcarinaGearScreenZoraTwo) + } + + .patch_SwapStoredTradeItems 0x5A6B44 : { *(.patch_SwapStoredTradeItems) } diff --git a/code/source/asm/ocarina_hooks.s b/code/source/asm/ocarina_hooks.s index fe2f7b9..38596d2 100644 --- a/code/source/asm/ocarina_hooks.s +++ b/code/source/asm/ocarina_hooks.s @@ -109,6 +109,41 @@ ocarinaAnimationPatchFive: cmp r0,#0x2 bx lr +.global hook_FixOcarinaGearScreenDefault +hook_FixOcarinaGearScreenDefault: + push {r1-r12, lr} + bl CheckIfOcarinaIsInInventory + pop {r1-r12, lr} + bx lr + +.global hook_FixOcarinaGearScreenDeku +hook_FixOcarinaGearScreenDeku: + push {r1-r12, lr} + bl CheckIfOcarinaIsInInventory + pop {r1-r12, lr} + bx lr + +.global hook_FixOcarinaGearScreenGoron +hook_FixOcarinaGearScreenGoron: + push {r1-r12, lr} + bl CheckIfOcarinaIsInInventory + pop {r1-r12, lr} + bx lr + +.global hook_FixOcarinaGearScreenZora +hook_FixOcarinaGearScreenZora: + push {r1-r12, lr} + bl CheckIfOcarinaIsInInventory + pop {r1-r12, lr} + bx lr + +.global hook_FixOcarinaGearScreenZoraTwo +hook_FixOcarinaGearScreenZoraTwo: + push {r1-r12, lr} + bl ZoraMaskCheck + pop {r1-r12, lr} + bx lr + .global hook_HandleOcarina hook_HandleOcarina: push {r0-r12, lr} diff --git a/code/source/asm/ocarina_patches.s b/code/source/asm/ocarina_patches.s index 42e77a0..caa0b85 100644 --- a/code/source/asm/ocarina_patches.s +++ b/code/source/asm/ocarina_patches.s @@ -50,6 +50,31 @@ patch_UpdateOcarinaVisibility: patch_DmSktOcarinaAnimationPatchFive: bl hook_DmSktOcarinaAnimationPatchFive +.section .patch_FixOcarinaGearScreenDefault +.global patch_FixOcarinaGearScreenDefault +patch_FixOcarinaGearScreenDefault: + bl hook_FixOcarinaGearScreenDefault + +.section .patch_FixOcarinaGearScreenDeku +.global patch_FixOcarinaGearScreenDeku +patch_FixOcarinaGearScreenDeku: + bl hook_FixOcarinaGearScreenDeku + +.section .patch_FixOcarinaGearScreenGoron +.global patch_FixOcarinaGearScreenGoron +patch_FixOcarinaGearScreenGoron: + bl hook_FixOcarinaGearScreenGoron + +.section .patch_FixOcarinaGearScreenZora +.global patch_FixOcarinaGearScreenZora +patch_FixOcarinaGearScreenZora: + bl hook_FixOcarinaGearScreenZora + +.section .patch_FixOcarinaGearScreenZoraTwo +.global patch_FixOcarinaGearScreenZoraTwo +patch_FixOcarinaGearScreenZoraTwo: + bl hook_FixOcarinaGearScreenZoraTwo + @ Adjusts ocarina songs to be in-line with restoration .section .patch_HandleOcarinaHooks .global patch_HandleOcarinaHooks