From d56d7aa80449e27ceda2ba190a364ec7e63f3789 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:22:44 +0100 Subject: [PATCH 1/9] Move ASM files --- code/linker_script_patch.py | 4 ++-- code/src/{ => asm}/csvc.s | 0 code/src/{ => asm}/hooks.s | 0 code/src/{ => asm}/patches.s | 0 code/src/{ => asm}/svc.s | 0 code/src/{ => asm}/svc_loader.s | 0 6 files changed, 2 insertions(+), 2 deletions(-) rename code/src/{ => asm}/csvc.s (100%) rename code/src/{ => asm}/hooks.s (100%) rename code/src/{ => asm}/patches.s (100%) rename code/src/{ => asm}/svc.s (100%) rename code/src/{ => asm}/svc_loader.s (100%) diff --git a/code/linker_script_patch.py b/code/linker_script_patch.py index 78a00ca9..9d933c2b 100644 --- a/code/linker_script_patch.py +++ b/code/linker_script_patch.py @@ -69,8 +69,8 @@ print('Order is correct') else: # Add the template asm to `patches.s` and `hooks.s` - with open('src/patches.s', 'a', newline='') as file: + with open('src/asm/patches.s', 'a', newline='') as file: file.write(ASM_PATCH_TEMPLATE % (newPatchName, newPatchName, newPatchName, newPatchName)) - with open('src/hooks.s', 'a', newline='') as file: + with open('src/asm/hooks.s', 'a', newline='') as file: file.write(ASM_HOOK_TEMPLATE % (newPatchName, newPatchName, newPatchName)) print('Patch added') diff --git a/code/src/csvc.s b/code/src/asm/csvc.s similarity index 100% rename from code/src/csvc.s rename to code/src/asm/csvc.s diff --git a/code/src/hooks.s b/code/src/asm/hooks.s similarity index 100% rename from code/src/hooks.s rename to code/src/asm/hooks.s diff --git a/code/src/patches.s b/code/src/asm/patches.s similarity index 100% rename from code/src/patches.s rename to code/src/asm/patches.s diff --git a/code/src/svc.s b/code/src/asm/svc.s similarity index 100% rename from code/src/svc.s rename to code/src/asm/svc.s diff --git a/code/src/svc_loader.s b/code/src/asm/svc_loader.s similarity index 100% rename from code/src/svc_loader.s rename to code/src/asm/svc_loader.s From 68847b1b2b7177bb5ece1e8ea3387212488c9f86 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:37:16 +0100 Subject: [PATCH 2/9] Add ASM macros --- code/src/asm/hooks.s | 785 ++++++----------- code/src/asm/patches.s | 1869 +++++++++++----------------------------- 2 files changed, 745 insertions(+), 1909 deletions(-) diff --git a/code/src/asm/hooks.s b/code/src/asm/hooks.s index b3a90c75..8d9810f8 100644 --- a/code/src/asm/hooks.s +++ b/code/src/asm/hooks.s @@ -2,9 +2,13 @@ .text .syntax unified +.macro HOOK name + .global hook_\name +hook_\name: +.endm + .section .loader -.global hook_into_loader -hook_into_loader: +HOOK into_loader push {r0-r12, lr} bl loader_main pop {r0-r12, lr} @@ -13,53 +17,46 @@ hook_into_loader: .section .text.randomizer_hooks -.global hook_before_GlobalContext_Update -hook_before_GlobalContext_Update: +HOOK before_GlobalContext_Update push {r0-r12, lr} bl before_GlobalContext_Update pop {r0-r12, lr} cpy r7,r0 bx lr -.global hook_after_GlobalContext_Update -hook_after_GlobalContext_Update: +HOOK after_GlobalContext_Update push {r0-r12, lr} bl after_GlobalContext_Update pop {r0-r12, lr} b 0x2E25F0 -.global hook_Gfx_Update -hook_Gfx_Update: +HOOK Gfx_Update push {r0-r12, lr} bl Gfx_Update pop {r0-r12, lr} pop {r4-r8, pc} -.global hook_Draw_PreSwapBuffers -hook_Draw_PreSwapBuffers: +HOOK Draw_PreSwapBuffers push {r0-r12, lr} bl Draw_PreSwapBuffers pop {r0-r12, lr} bx lr -.global hook_Gfx_SleepQueryCallback -hook_Gfx_SleepQueryCallback: +HOOK Gfx_SleepQueryCallback push {r0-r12, lr} bl Gfx_SleepQueryCallback pop {r0-r12, lr} add r0,r0,#0x9C b 0x3FD6C8 -.global hook_Gfx_AwakeCallback -hook_Gfx_AwakeCallback: +HOOK Gfx_AwakeCallback push {r0-r12, lr} bl Gfx_AwakeCallback pop {r0-r12, lr} add r0,r0,#0x9C b 0x3FD440 -.global hook_IncomingGetItemID -hook_IncomingGetItemID: +HOOK IncomingGetItemID push {r0-r12, lr} cpy r0,r5 cpy r1,r6 @@ -68,8 +65,7 @@ hook_IncomingGetItemID: pop {r0-r12, lr} bx lr -.global hook_SaveFile_Init -hook_SaveFile_Init: +HOOK SaveFile_Init push {r0-r12, lr} mov r0, r5 bl SaveFile_Init @@ -81,8 +77,7 @@ hook_SaveFile_Init: .rActiveItemRow_addr: .word rActiveItemRow -.global hook_OverrideTextID -hook_OverrideTextID: +HOOK OverrideTextID ldr r1,.rActiveItemRow_addr ldr r1,[r1] cmp r1,#0x0 @@ -92,8 +87,7 @@ noOverrideTextID: ldrb r1,[r6,#0x4] b 0x2BC1C8 -.global hook_OverrideItemID -hook_OverrideItemID: +HOOK OverrideItemID ldr r1,.rActiveItemRow_addr ldr r1,[r1] cmp r1,#0x0 @@ -107,24 +101,21 @@ noOverrideItemID: ldrb r1,[r6,#0x0] b 0x2BC1D4 -.global hook_OverrideDrawItemOne -hook_OverrideDrawItemOne: +HOOK OverrideDrawItemOne push {r1-r12, lr} bl ItemOverride_GetDrawItem pop {r1-r12, lr} ldrh r0,[r0] bx lr -.global hook_OverrideDrawItemTwo -hook_OverrideDrawItemTwo: +HOOK OverrideDrawItemTwo add r0,r1,r0,lsl #0x1 push {r1-r12, lr} bl ItemOverride_GetDrawItem pop {r1-r12, lr} bx lr -.global hook_OverrideDrawItemThree -hook_OverrideDrawItemThree: +HOOK OverrideDrawItemThree add r5,r0,r1,lsl #0x1 push {r0-r4,r6-r12, lr} cpy r0,r5 @@ -133,32 +124,28 @@ hook_OverrideDrawItemThree: pop {r0-r4,r6-r12, lr} bx lr -.global hook_OverrideGiDrawIdPlusOne -hook_OverrideGiDrawIdPlusOne: +HOOK OverrideGiDrawIdPlusOne push {r1-r12, lr} bl ItemOverride_OverrideGiDrawIdPlusOne pop {r1-r12, lr} strh r0,[r6,#0x4e] bx lr -.global hook_EditDrawGetItemBeforeModelSpawn -hook_EditDrawGetItemBeforeModelSpawn: +HOOK EditDrawGetItemBeforeModelSpawn push {r0-r12, lr} bl ItemOverride_EditDrawGetItemBeforeModelSpawn pop {r0-r12, lr} mov r7,#0x0 bx lr -.global hook_EditDrawDetItemAfterModelSpawn -hook_EditDrawDetItemAfterModelSpawn: +HOOK EditDrawDetItemAfterModelSpawn push {r0-r12, lr} bl ItemOverride_EditDrawGetItemAfterModelSpawn pop {r0-r12, lr} str r0,[r6,#0x78] bx lr -.global hook_EditDrawGetItemAfterMatrixUpdate -hook_EditDrawGetItemAfterMatrixUpdate: +HOOK EditDrawGetItemAfterMatrixUpdate push {r0-r12, lr} cpy r0,r1 @ SkeletonAnimationModel bl ItemOverride_EditDrawGetItemAfterMatrixUpdate @@ -168,38 +155,33 @@ hook_EditDrawGetItemAfterMatrixUpdate: # TODO: Text ID in game gets messed up, # Gives the "What's that?" text instead of # the text about moving the statue -.global hook_AdultRollingGoronTwo -hook_AdultRollingGoronTwo: +HOOK AdultRollingGoronTwo mov r0,#0x3000 add r0,r0,#0x38 b 0x1954B0 -.global hook_DaruniaStrengthCheck -hook_DaruniaStrengthCheck: +HOOK DaruniaStrengthCheck push {r0-r12, lr} bl EnDu_CheckRewardFlag cmp r0,#0x1 pop {r0-r12, lr} b 0x1E48A0 -.global hook_GetToken -hook_GetToken: +HOOK GetToken push {r0-r12, lr} cpy r0,r4 bl ItemOverride_GetSkulltulaToken pop {r0-r12, lr} bx lr -.global hook_PoeCollectorCheckPoints -hook_PoeCollectorCheckPoints: +HOOK PoeCollectorCheckPoints push {r0-r12, lr} bl EnGb_CheckPoints cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_ItemEtceteraModelDraw -hook_ItemEtceteraModelDraw: +HOOK ItemEtceteraModelDraw push {r0-r12, lr} bl Model_DrawByActor cmp r0,#0x1 @@ -208,16 +190,14 @@ hook_ItemEtceteraModelDraw: cpy r4,r0 bx lr -.global hook_KokiriCheckOpenForest -hook_KokiriCheckOpenForest: +HOOK KokiriCheckOpenForest push {r0-r12, lr} bl EnKo_CheckOpenForest cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_EnExItemModelDraw -hook_EnExItemModelDraw: +HOOK EnExItemModelDraw push {r0-r12, lr} mov r0,r4 bl Model_DrawByActor @@ -227,8 +207,7 @@ hook_EnExItemModelDraw: add r1,r4,#0x148 bx lr -.global hook_DemoEffectMedallionDraw -hook_DemoEffectMedallionDraw: +HOOK DemoEffectMedallionDraw push {r0-r12, lr} mov r0,r4 bl Model_DrawByActor @@ -238,8 +217,7 @@ hook_DemoEffectMedallionDraw: ldr r0,[r4,#0x2A8] b 0x372150 -.global hook_DemoEffectStoneDraw -hook_DemoEffectStoneDraw: +HOOK DemoEffectStoneDraw push {r0-r12, lr} mov r0,r4 bl Model_DrawByActor @@ -249,24 +227,21 @@ hook_DemoEffectStoneDraw: ldr r0,[r4,#0x2A8] b 0x1D20A0 -.global hook_EnKoInitCheckForest -hook_EnKoInitCheckForest: +HOOK EnKoInitCheckForest push {r1-r12, lr} bl EnKo_CheckForestTempleBeat tst r0,#0x1 pop {r1-r12, lr} bx lr -.global hook_FireArrowCheckChestFlag -hook_FireArrowCheckChestFlag: +HOOK FireArrowCheckChestFlag push {r0-r12, lr} bl ShotSun_CheckChestFlag cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_SerenadeCheckChestFlag -hook_SerenadeCheckChestFlag: +HOOK SerenadeCheckChestFlag push {r0-r12, lr} bl Cutscene_SerenadeCheckChestFlag cmp r0,#0x0 @@ -274,62 +249,54 @@ hook_SerenadeCheckChestFlag: cpy r0,r5 bx lr -.global hook_ScarecrowCheckToBeActivated -hook_ScarecrowCheckToBeActivated: +HOOK ScarecrowCheckToBeActivated push {r0-r12, lr} bl Scarecrow_CheckToBeActivated cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_EponasSongCheckFlag -hook_EponasSongCheckFlag: +HOOK EponasSongCheckFlag push {r0-r12, lr} bl Cutscene_CheckEponasSongFlag cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_SariasSongCheckFlag -hook_SariasSongCheckFlag: +HOOK SariasSongCheckFlag push {r0-r12, lr} bl Cutscene_CheckSariasSongFlag cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_PoeCollectorGetFirstTextbox -hook_PoeCollectorGetFirstTextbox: +HOOK PoeCollectorGetFirstTextbox push {r1-r12, lr} bl EnGb_GetFirstTextbox pop {r1-r12, lr} bx lr -.global hook_ApplyDamageMultiplier -hook_ApplyDamageMultiplier: +HOOK ApplyDamageMultiplier push {r0-r3, r5-r12, lr} bl Settings_ApplyDamageMultiplier cpy r4,r0 pop {r0-r3, r5-r12, lr} bx lr -.global hook_ActorUpdate -hook_ActorUpdate: +HOOK ActorUpdate push {r0-r12, lr} bl Actor_rUpdate pop {r0-r12, lr} bx lr -.global hook_SceneInitAfterCopyScenes -hook_SceneInitAfterCopyScenes: +HOOK SceneInitAfterCopyScenes push {r0-r12, lr} bl 0x371738 bl Scene_Init pop {r0-r12, lr} bx lr -.global hook_StoreChildBButtonEquip -hook_StoreChildBButtonEquip: +HOOK StoreChildBButtonEquip push {r0-r12, lr} bl SaveFile_SaveChildBButton pop {r0-r12, lr} @@ -339,16 +306,14 @@ hook_StoreChildBButtonEquip: b 0x45F210 .endif -.global hook_LullabyCheckFlag -hook_LullabyCheckFlag: +HOOK LullabyCheckFlag push {r0-r12, lr} bl Cutscene_CheckLullabyFlag cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_FishingIgnoreTempBOne -hook_FishingIgnoreTempBOne: +HOOK FishingIgnoreTempBOne bne 0x2C3A14 push {r0-r12, lr} bl isFishing @@ -358,8 +323,7 @@ hook_FishingIgnoreTempBOne: moveq r0,#89 b 0x2C3A14 -.global hook_FishingIgnoreTempBTwo -hook_FishingIgnoreTempBTwo: +HOOK FishingIgnoreTempBTwo blt 0x34CFD0 push {r0-r12, lr} bl isFishing @@ -369,16 +333,14 @@ hook_FishingIgnoreTempBTwo: ldrb r1,[r4,#0x80] b 0x34CFD0 -.global hook_ConvertBombDropOne -hook_ConvertBombDropOne: +HOOK ConvertBombDropOne push {r1-r12, lr} bl Item_ConvertBombDrop pop {r1-r12, lr} cpy r12,r0 b 0x35E474 -.global hook_ConvertBombDropTwo -hook_ConvertBombDropTwo: +HOOK ConvertBombDropTwo push {r1-r12, lr} cpy r0,r6 bl Item_ConvertBombDrop @@ -386,16 +348,14 @@ hook_ConvertBombDropTwo: cpy r6,r0 b 0x3747B0 -.global hook_BeanDaddyModifyBeansBought -hook_BeanDaddyModifyBeansBought: +HOOK BeanDaddyModifyBeansBought push {r1-r12, lr} bl EnMs_ModifyBeansBought pop {r1-r12, lr} cmp r0,#0xa bx lr -.global hook_BeanDaddyModifyPrice -hook_BeanDaddyModifyPrice: +HOOK BeanDaddyModifyPrice push {r0,r2-r12, lr} cpy r0,r1 bl EnMs_ModifyPrice @@ -404,31 +364,27 @@ hook_BeanDaddyModifyPrice: cmp r0,r1 bx lr -.global hook_CheckGerudoToken -hook_CheckGerudoToken: +HOOK CheckGerudoToken push {r1-r12, lr} bl SaveFile_CheckGerudoToken pop {r1-r12, lr} bx lr -.global hook_CowBottleCheck -hook_CowBottleCheck: +HOOK CowBottleCheck push {r1-r12, lr} cpy r0,r4 bl EnCow_BottleCheck pop {r1-r12, lr} bx lr -.global hook_CowItemOverride -hook_CowItemOverride: +HOOK CowItemOverride push {r0-r1, r3-r12, lr} bl EnCow_ItemOverride cpy r2,r0 pop {r0-r1, r3-r12, lr} b 0x3EE37C -.global hook_AnjuCheckCuccoAmount -hook_AnjuCheckCuccoAmount: +HOOK AnjuCheckCuccoAmount push {r1-r12, lr} bl EnNiwLady_CheckCuccoAmount pop {r1-r12, lr} @@ -436,31 +392,27 @@ hook_AnjuCheckCuccoAmount: cpylt r8,r0 b 0x179424 -.global hook_KingZoraCheckMovedFlag -hook_KingZoraCheckMovedFlag: +HOOK KingZoraCheckMovedFlag push {r1-r12, lr} bl EnKz_CheckMovedFlag pop {r1-r12, lr} cmp r0,#0x0 bx lr -.global hook_FrogReward -hook_FrogReward: +HOOK FrogReward push {r0-r12, lr} bl EnFr_rSetReward pop {r0-r12, lr} b 0x389930 -.global hook_CanPlayBombchuBowling -hook_CanPlayBombchuBowling: +HOOK CanPlayBombchuBowling push {r0-r12, lr} bl EnBomBowlMan_CheckExplosives cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_SlidingDoorDestroyCustomModels -hook_SlidingDoorDestroyCustomModels: +HOOK SlidingDoorDestroyCustomModels push {r0-r12, lr} cpy r0,r4 bl Door_CheckToDeleteCustomModels @@ -468,8 +420,7 @@ hook_SlidingDoorDestroyCustomModels: mov r0,#0x0 bx lr -.global hook_HandleDoorDestroyCustomModels -hook_HandleDoorDestroyCustomModels: +HOOK HandleDoorDestroyCustomModels push {r0-r12, lr} cpy r0,r4 bl Door_CheckToDeleteCustomModels @@ -477,62 +428,54 @@ hook_HandleDoorDestroyCustomModels: str r0,[r4,#0x3E4] bx lr -.global hook_TalonGetCastleTextbox -hook_TalonGetCastleTextbox: +HOOK TalonGetCastleTextbox push {r0, r2-r12, lr} bl EnTa_GetCastleTextbox mov r1, r0 pop {r0, r2-r12, lr} bx lr -.global hook_MidoCheckSpawn -hook_MidoCheckSpawn: +HOOK MidoCheckSpawn push {r0-r12, lr} bl EnMd_ShouldSpawn cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_MidoForestDialog -hook_MidoForestDialog: +HOOK MidoForestDialog push {r1-r12, lr} bl EnMd_GetTextKokiriForest pop {r1-r12, lr} bx lr -.global hook_CheckDekuTreeClear -hook_CheckDekuTreeClear: +HOOK CheckDekuTreeClear push {r0-r12, lr} bl Dungeon_CheckDekuTreeClear tst r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_CheckCurrentDungeonMode -hook_CheckCurrentDungeonMode: +HOOK CheckCurrentDungeonMode push {r0-r12, lr} bl Dungeon_GetCurrentDungeonMode cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_DungeonCheckJabuMQBox -hook_DungeonCheckJabuMQBox: +HOOK DungeonCheckJabuMQBox push {r0-r12, lr} bl Dungeon_GetCurrentDungeonMode cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_JabuSwitchRutoCheck -hook_JabuSwitchRutoCheck: +HOOK JabuSwitchRutoCheck cmp r0,#0xA1 bxeq lr cmp r0,#0x110 bx lr -.global hook_JabuBoxCheckRuto -hook_JabuBoxCheckRuto: +HOOK JabuBoxCheckRuto tst r0,#0x80 push {r0-r12, lr} bleq ObjKibako_CheckRuto @@ -540,8 +483,7 @@ hook_JabuBoxCheckRuto: pop {r0-r12, lr} bx lr -.global hook_CanReadHints -hook_CanReadHints: +HOOK CanReadHints push {r0-r12, lr} bl Hints_CanReadHints cmp r0,#0x1 @@ -567,8 +509,7 @@ hook_CanReadHints: add r0,r0,#0x400 bx lr -.global hook_GossipStoneAddSariaHint -hook_GossipStoneAddSariaHint: +HOOK GossipStoneAddSariaHint ldrh r0,[r5,#0x16] push {r0-r12, lr} add r0,r0,#0x600 @@ -576,39 +517,34 @@ hook_GossipStoneAddSariaHint: pop {r0-r12, lr} bx lr -.global hook_FastChests -hook_FastChests: +HOOK FastChests push {r0-r12, lr} bl Chest_OverrideAnimation cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_FastOwlCutscenes -hook_FastOwlCutscenes: +HOOK FastOwlCutscenes push {r0-r12, lr} bl EnOwl_FastCutscene pop {r0-r12, lr} mov r1,#0xa bx lr -.global hook_SetChildCustomTunic -hook_SetChildCustomTunic: +HOOK SetChildCustomTunic push {r0-r12, lr} bl Player_SetChildCustomTunicCMAB pop {r0-r12, lr} b 0x191E60 -.global hook_ShortenRainbowBridgeCS -hook_ShortenRainbowBridgeCS: +HOOK ShortenRainbowBridgeCS push {r0-r12, lr} bl ShortenRainbowBridgeCS pop {r0-r12, lr} cpy r4,r0 bx lr -.global hook_Chest_OverrideIceSmoke -hook_Chest_OverrideIceSmoke: +HOOK Chest_OverrideIceSmoke push {r0-r12, lr} mov r0,r4 bl Chest_OverrideIceSmoke @@ -618,16 +554,14 @@ hook_Chest_OverrideIceSmoke: bne 0x1D5E64 b 0x1D5E60 -.global hook_EnableFW -hook_EnableFW: +HOOK EnableFW push {r0-r12, lr} bl EnableFW pop {r0-r12, lr} add sp,sp,#0x14 bx lr -.global hook_FWUnset -hook_FWUnset: +HOOK FWUnset push {r0-r12, lr} bl MagicWind_Unset mov r0,#-0x1 @@ -635,8 +569,7 @@ hook_FWUnset: pop {r0-r12, lr} bx lr -.global hook_FWGetSet -hook_FWGetSet: +HOOK FWGetSet push {r0-r12, lr} bl MagicWind_CheckSet cmp r0,#0x1 @@ -644,38 +577,33 @@ hook_FWGetSet: beq 0x351A64 b 0x3519D0 -.global hook_SetSavewarpEntrance -hook_SetSavewarpEntrance: +HOOK SetSavewarpEntrance push {r0-r12, lr} bl Entrance_SetSavewarpEntrance pop {r0-r12, lr} bx lr -.global hook_SetGameOverEntrance -hook_SetGameOverEntrance: +HOOK SetGameOverEntrance push {r0-r12, lr} bl Entrance_SetGameOverEntrance pop {r0-r12, lr} bx lr -.global hook_SetGameOverRespawnFlag -hook_SetGameOverRespawnFlag: +HOOK SetGameOverRespawnFlag push {r0-r12, lr} bl Grotto_ForceGrottoReturn pop {r0-r12, lr} cmp r8,#0x3 bx lr -.global hook_SetSunsSongRespawnFlag -hook_SetSunsSongRespawnFlag: +HOOK SetSunsSongRespawnFlag push {r0-r12, lr} bl Grotto_ForceGrottoReturn pop {r0-r12, lr} cpy r0,r6 bx lr -.global hook_SunsSongEndCloseTextbox -hook_SunsSongEndCloseTextbox: +HOOK SunsSongEndCloseTextbox push {r0-r12, lr} bl Settings_SunsSongEndCloseTextbox pop {r0-r12, lr} @@ -685,51 +613,44 @@ hook_SunsSongEndCloseTextbox: b 0x45B518 .endif -.global hook_SetSpecialVoidOutRespawnFlag -hook_SetSpecialVoidOutRespawnFlag: +HOOK SetSpecialVoidOutRespawnFlag push {r0-r12, lr} bl Grotto_ForceRegularVoidOut pop {r0-r12, lr} mov r1,#0x104 bx lr -.global hook_NoHealFromHealthUpgrades -hook_NoHealFromHealthUpgrades: +HOOK NoHealFromHealthUpgrades push {r1-r12, lr} bl NoHealFromHealthUpgrades pop {r1-r12, lr} bx lr -.global hook_NoHealFromBombchuBowlingPrize -hook_NoHealFromBombchuBowlingPrize: +HOOK NoHealFromBombchuBowlingPrize push {r1-r12, lr} bl NoHealFromBombchuBowlingPrize pop {r1-r12, lr} bx lr -.global hook_FairyPickupHealAmount -hook_FairyPickupHealAmount: +HOOK FairyPickupHealAmount push {r0-r12, lr} bl FairyPickupHealAmount pop {r0-r12, lr} bx lr -.global hook_FairyReviveHealAmount -hook_FairyReviveHealAmount: +HOOK FairyReviveHealAmount push {r1-r12, lr} bl FairyReviveHealAmount pop {r1-r12, lr} bx lr -.global hook_FairyUseHealAmount -hook_FairyUseHealAmount: +HOOK FairyUseHealAmount push {r1-r12, lr} bl FairyUseHealAmount pop {r1-r12, lr} bx lr -.global hook_MedigoronCheckFlagOne -hook_MedigoronCheckFlagOne: +HOOK MedigoronCheckFlagOne push {r0-r12, lr} bl EnGm_CheckRewardFlag cmp r0,#1 @@ -739,8 +660,7 @@ hook_MedigoronCheckFlagOne: tst r12,r3 b 0x130250 -.global hook_MedigoronCheckFlagTwo -hook_MedigoronCheckFlagTwo: +HOOK MedigoronCheckFlagTwo bne childLink push {r0-r12, lr} bl EnGm_CheckRewardFlag @@ -751,32 +671,28 @@ hook_MedigoronCheckFlagTwo: childLink: b 0x1302F0 -.global hook_MedigoronSetRewardFlag -hook_MedigoronSetRewardFlag: +HOOK MedigoronSetRewardFlag mvn r0,#0xc7 push {r0-r12, lr} bl EnGm_SetRewardFlag pop {r0-r12, lr} b 0x16C91C -.global hook_MedigoronItemOverrideOne -hook_MedigoronItemOverrideOne: +HOOK MedigoronItemOverrideOne push {r0-r1, r3-r12, lr} bl EnGm_ItemOverride cpy r2,r0 pop {r0-r1, r3-r12, lr} b 0x14D960 -.global hook_MedigoronItemOverrideTwo -hook_MedigoronItemOverrideTwo: +HOOK MedigoronItemOverrideTwo push {r0-r1, r3-r12, lr} bl EnGm_ItemOverride cpy r2,r0 pop {r0-r1, r3-r12, lr} b 0x16C9C0 -.global hook_MedigoronGetCustomText -hook_MedigoronGetCustomText: +HOOK MedigoronGetCustomText push {r0-r12, lr} bl EnGm_UseCustomText cmp r0,#1 @@ -787,8 +703,7 @@ hook_MedigoronGetCustomText: addne r2,r2,#0x4F b 0x130260 -.global hook_CarpetSalesmanCheckFlagOne -hook_CarpetSalesmanCheckFlagOne: +HOOK CarpetSalesmanCheckFlagOne push {r0-r12, lr} bl EnJs_CheckRewardFlag cmp r0,#1 @@ -796,8 +711,7 @@ hook_CarpetSalesmanCheckFlagOne: cmpne r0,#0 bx lr -.global hook_CarpetSalesmanCheckFlagTwo -hook_CarpetSalesmanCheckFlagTwo: +HOOK CarpetSalesmanCheckFlagTwo push {r0-r12, lr} bl EnJs_CheckRewardFlag cmp r0,#1 @@ -806,24 +720,21 @@ hook_CarpetSalesmanCheckFlagTwo: strh r1,[r0,r4] bx lr -.global hook_CarpetSalesmanSetFlag -hook_CarpetSalesmanSetFlag: +HOOK CarpetSalesmanSetFlag push {r0-r12, lr} bl EnJs_SetRewardFlag pop {r0-r12, lr} mvn r0,#0xC7 bx lr -.global hook_KakarikoGateCheck -hook_KakarikoGateCheck: +HOOK KakarikoGateCheck push {r0-r12, lr} bl KakGate_CheckToFixBug cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_DoorOfTimeCheck -hook_DoorOfTimeCheck: +HOOK DoorOfTimeCheck cmp r0,#0x4 bne 0x274B70 push {r0-r12, lr} @@ -832,8 +743,7 @@ hook_DoorOfTimeCheck: pop {r0-r12, lr} bx lr -.global hook_SongOfTimeJingle -hook_SongOfTimeJingle: +HOOK SongOfTimeJingle mov r1,#0x0 push {r0-r12, lr} bl DoorOfTime_RequirementCheck @@ -842,16 +752,14 @@ hook_SongOfTimeJingle: addne r0,r0,#0x4 bx lr -.global hook_GKSetDurability -hook_GKSetDurability: +HOOK GKSetDurability push {r0-r12, lr} bl GK_SetDurability strh r0,[r8,#0x4a] pop {r0-r12, lr} b 0x376BE0 -.global hook_TurboTextAdvance -hook_TurboTextAdvance: +HOOK TurboTextAdvance push {r0-r12, lr} bl Settings_IsTurboText cmp r0,#0x0 @@ -859,15 +767,13 @@ hook_TurboTextAdvance: cmpeq r0,#0x0 bx lr -.global hook_ItemsMenuDraw -hook_ItemsMenuDraw: +HOOK ItemsMenuDraw push {r0-r12, lr} bl ItemsMenu_Draw pop {r0-r12, lr} b 0x2F8160 -.global hook_GearMenuEmptySlot -hook_GearMenuEmptySlot: +HOOK GearMenuEmptySlot push {r0,r2-r12, lr} bl GearMenu_GetRewardHint cpy r1,r0 @@ -877,24 +783,21 @@ hook_GearMenuEmptySlot: mov r2,#0x1 b 0x2E9A3C @ print reward hint -.global hook_PlaySound -hook_PlaySound: +HOOK PlaySound push {r1-r12, lr} bl SetBGM pop {r1-r12, lr} push {r3-r7, lr} b 0x35C52C -.global hook_SetBGMEntrance -hook_SetBGMEntrance: +HOOK SetBGMEntrance push {r1-r12, lr} bl SetBGM pop {r1-r12, lr} push {r4-r6, lr} b 0x33104C -.global hook_SetBGMDayNight -hook_SetBGMDayNight: +HOOK SetBGMDayNight push {r1-r12, lr} bl SetBGM pop {r1-r12, lr} @@ -905,8 +808,7 @@ hook_SetBGMDayNight: b 0x483C8C .endif -.global hook_SetBGMEvent -hook_SetBGMEvent: +HOOK SetBGMEvent push {r0, r2-r12, lr} cpy r0,r1 bl SetBGM @@ -915,16 +817,14 @@ hook_SetBGMEvent: push {r4-r11, lr} b 0x36EC44 -.global hook_SetSFX -hook_SetSFX: +HOOK SetSFX push {r1-r12, lr} bl SetSFX pop {r1-r12, lr} push {r0-r11, lr} b 0x375480 -.global hook_TurboTextClose -hook_TurboTextClose: +HOOK TurboTextClose push {r0-r12, lr} bl Settings_IsTurboText cmp r0,#0x0 @@ -932,8 +832,7 @@ hook_TurboTextClose: cmpeq r0,#0x0 bx lr -.global hook_TurboTextSignalNPC -hook_TurboTextSignalNPC: +HOOK TurboTextSignalNPC movne r4,#0x1 push {r0-r12, lr} bl Settings_IsTurboText @@ -946,8 +845,7 @@ hook_TurboTextSignalNPC: movne r4,#0x1 bx lr -.global hook_SkipSongReplays_TimeBlocksFix -hook_SkipSongReplays_TimeBlocksFix: +HOOK SkipSongReplays_TimeBlocksFix bne 0x208008 push {r0-r12, lr} bl Settings_GetSongReplaysOption @@ -958,8 +856,7 @@ hook_SkipSongReplays_TimeBlocksFix: cmp r0,r0 b 0x208008 -.global hook_SkipSongReplays_WarpBlocksFix -hook_SkipSongReplays_WarpBlocksFix: +HOOK SkipSongReplays_WarpBlocksFix bne 0x20806C push {r0-r12, lr} bl Settings_GetSongReplaysOption @@ -970,39 +867,34 @@ hook_SkipSongReplays_WarpBlocksFix: cmp r0,r0 b 0x20806C -.global hook_CarpenterBossSetTradedSawFlag -hook_CarpenterBossSetTradedSawFlag: +HOOK CarpenterBossSetTradedSawFlag push {r0-r12, lr} bl EnToryo_SetTradedSawFlag pop {r0-r12, lr} str r0,[r4,#0xB10] bx lr -.global hook_KingZoraSetTradedPrescriptionFlag -hook_KingZoraSetTradedPrescriptionFlag: +HOOK KingZoraSetTradedPrescriptionFlag push {r0-r12, lr} bl EnKz_SetTradedPrescriptionFlag pop {r0-r12, lr} mov r2,#0x24 b 0x1C52A4 -.global hook_SkipTimeTravelCutsceneOne -hook_SkipTimeTravelCutsceneOne: +HOOK SkipTimeTravelCutsceneOne push {r0-r12, lr} bl TimeTravelAdvanceCutsceneTimer pop {r0-r12, lr} ldmia sp!,{r4,r5,r6,pc} -.global hook_SkipTimeTravelCutsceneTwo -hook_SkipTimeTravelCutsceneTwo: +HOOK SkipTimeTravelCutsceneTwo push {r0-r12, lr} bl SetTimeTraveled pop {r0-r12, lr} mov r1,#0x324 bx lr -.global hook_SkipMasterSwordFanfare -hook_SkipMasterSwordFanfare: +HOOK SkipMasterSwordFanfare push {r0-r12, lr} bl ShouldSkipMasterSwordCutscene cmp r0,#0x1 @@ -1011,24 +903,21 @@ hook_SkipMasterSwordFanfare: mov r1,#0x0 bx lr -.global hook_EnteredLocation -hook_EnteredLocation: +HOOK EnteredLocation cpy r4,r0 push {r0-r12, lr} bl Entrance_EnteredLocation pop {r0-r12, lr} bx lr -.global hook_LostWoodsBridgeMusic -hook_LostWoodsBridgeMusic: +HOOK LostWoodsBridgeMusic push {r0-r12, lr} bl Entrance_IsLostWoodsBridge cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_BeforeLoadGame -hook_BeforeLoadGame: +HOOK BeforeLoadGame add r0, r4, r5 push {r0-r12, lr} bl SaveFile_BeforeLoadGame @@ -1039,23 +928,20 @@ hook_BeforeLoadGame: b 0x447384 .endif -.global hook_AfterLoadGame -hook_AfterLoadGame: +HOOK AfterLoadGame push {r0-r12, lr} bl SaveFile_AfterLoadGame pop {r0-r12, lr} pop {r4-r6, pc} -.global hook_FileSelect_CopyFile -hook_FileSelect_CopyFile: +HOOK FileSelect_CopyFile push {r0-r12, lr} bl SaveFile_BeforeCopy pop {r0-r12, lr} sub sp,sp,#0x240 bx lr -.global hook_SaveGame -hook_SaveGame: +HOOK SaveGame cmp r5, #0 beq .notSaving push {r0-r12, lr} @@ -1067,8 +953,7 @@ hook_SaveGame: push {r4-r9, lr} b 0x2fbfac -.global hook_SaveMenuIgnoreOpen -hook_SaveMenuIgnoreOpen: +HOOK SaveMenuIgnoreOpen push {r0-r12, lr} bl SaveMenu_IgnoreOpen cmp r0,#0x1 @@ -1080,15 +965,13 @@ hook_SaveMenuIgnoreOpen: .endif bx lr -.global hook_GameOverStart -hook_GameOverStart: +HOOK GameOverStart push {r0-r12, lr} bl SaveFile_OnGameOver pop {r0-r12, lr} bx lr -.global hook_PermadeathSkipMenu -hook_PermadeathSkipMenu: +HOOK PermadeathSkipMenu push {r0-r12, lr} bl Permadeath_GetOption cmp r0,#0x0 @@ -1097,8 +980,7 @@ hook_PermadeathSkipMenu: moveq r0,#0x2 bx lr -.global hook_PermadeathForceQuit -hook_PermadeathForceQuit: +HOOK PermadeathForceQuit ldrbeq r8,[r11,#0x9] bxne lr push {r0-r12, lr} @@ -1112,21 +994,18 @@ hook_PermadeathForceQuit: .endif bxeq lr -.global hook_OverrideFogDuringGameplayInit -hook_OverrideFogDuringGameplayInit: +HOOK OverrideFogDuringGameplayInit push {r0-r12, lr} bl Fog_OverrideState pop {r0-r12, lr} bx lr -.global hook_SkipTwinrovaQuarrelCutscene -hook_SkipTwinrovaQuarrelCutscene: +HOOK SkipTwinrovaQuarrelCutscene mov r0,#0x500 add r0,r0,#0x9 bx lr -.global hook_FixItemsMenuSlotDuplication -hook_FixItemsMenuSlotDuplication: +HOOK FixItemsMenuSlotDuplication mov r4,#0xFF mov lr,#0xFF add r10,r10,#0x1 @@ -1136,8 +1015,7 @@ hook_FixItemsMenuSlotDuplication: b 0x456B94 .endif -.global hook_PlayEntranceCutscene -hook_PlayEntranceCutscene: +HOOK PlayEntranceCutscene .if _EUR_==1 bgt 0x44F0C4 .else @@ -1156,16 +1034,14 @@ hook_PlayEntranceCutscene: b 0x44F06C .endif -.global hook_SkipJabuOpeningCutscene -hook_SkipJabuOpeningCutscene: +HOOK SkipJabuOpeningCutscene ldrh r0,[r0,#0x0] push {r0-r12, lr} bl Jabu_SkipOpeningCutscene pop {r0-r12, lr} bx lr -.global hook_MultiplyPlayerSpeed -hook_MultiplyPlayerSpeed: +HOOK MultiplyPlayerSpeed vldr.32 s0,[r6,#0x21C] push {r0-r12, lr} bl Player_GetSpeedMultiplier @@ -1174,8 +1050,7 @@ hook_MultiplyPlayerSpeed: vmul.f32 s0,s1 bx lr -.global hook_RunAnimationSpeed -hook_RunAnimationSpeed: +HOOK RunAnimationSpeed vldr.32 s17,[r5,#0x21C] push {r0-r12, lr} bl Player_GetSpeedMultiplier @@ -1184,8 +1059,7 @@ hook_RunAnimationSpeed: vmul.f32 s17,s1 bx lr -.global hook_NaviNotifications -hook_NaviNotifications: +HOOK NaviNotifications push {r0-r12, lr} bl Navi_GetNotificationOption cmp r0,#0x1 @@ -1198,8 +1072,7 @@ hook_NaviNotifications: ldr r0,[r0,#0x4C] bx lr -.global hook_ChestMinigame_KeyChestVisibility -hook_ChestMinigame_KeyChestVisibility: +HOOK ChestMinigame_KeyChestVisibility push {r0-r12, lr} bl Settings_GetChestMinigameOption cmp r0,#0x0 @@ -1208,8 +1081,7 @@ hook_ChestMinigame_KeyChestVisibility: orreq r10,r7,#0x4000 bx lr -.global hook_ChestMinigame_DontOpenChestsOnInit -hook_ChestMinigame_DontOpenChestsOnInit: +HOOK ChestMinigame_DontOpenChestsOnInit cmp r0,#0x0 bxeq lr push {r0-r12, lr} @@ -1219,16 +1091,14 @@ hook_ChestMinigame_DontOpenChestsOnInit: pop {r0-r12, lr} bx lr -.global hook_GameplayDestroy -hook_GameplayDestroy: +HOOK GameplayDestroy cpy r4,r0 push {r0-r12, lr} bl Entrance_CheckEpona pop {r0-r12, lr} bx lr -.global hook_SceneExitOverride -hook_SceneExitOverride: +HOOK SceneExitOverride ldrsh r9, [r1,r0] push {r0-r8, r10-r12, lr} cpy r0, r9 @@ -1237,31 +1107,27 @@ hook_SceneExitOverride: pop {r0-r8, r10-r12, lr} bx lr -.global hook_SceneExitDynamicOverride -hook_SceneExitDynamicOverride: +HOOK SceneExitDynamicOverride push {r0-r12, lr} bl Entrance_OverrideDynamicExit pop {r0-r12, lr} bx lr -.global hook_OverrideGrottoActorEntrance -hook_OverrideGrottoActorEntrance: +HOOK OverrideGrottoActorEntrance push {r0-r12, lr} cpy r0, r4 bl Grotto_OverrideActorEntrance pop {r0-r12, lr} b 0x3F22C4 -.global hook_ReturnFW -hook_ReturnFW: +HOOK ReturnFW push {r0-r12, lr} bl Grotto_SetupReturnInfoOnFWReturn pop {r0-r12, lr} add sp,sp,#0x8 bx lr -.global hook_WarpSongEntranceOverride -hook_WarpSongEntranceOverride: +HOOK WarpSongEntranceOverride push {r0-r1, r3-r12, lr} cpy r0, r2 bl Entrance_OverrideNextIndex @@ -1270,8 +1136,7 @@ hook_WarpSongEntranceOverride: strh r2,[r1,#0x1c] bx lr -.global hook_OwlEntranceOverride -hook_OwlEntranceOverride: +HOOK OwlEntranceOverride push {r0, r2-r12, lr} cpy r0, r1 bl Entrance_OverrideNextIndex @@ -1279,40 +1144,35 @@ hook_OwlEntranceOverride: pop {r0, r2-r12, lr} b 0x3716F0 -.global hook_SavewarpSetRespawnFlag -hook_SavewarpSetRespawnFlag: +HOOK SavewarpSetRespawnFlag push {r0-r12, lr} bl Grotto_ForceGrottoReturnOnSpecialEntrance pop {r0-r12, lr} mov r0,#0xFF bx lr -.global hook_AdultItemsCMABsAsChild -hook_AdultItemsCMABsAsChild: +HOOK AdultItemsCMABsAsChild push {r0-r12, lr} bl Player_ShouldApplyAdultItemsCMABs cmp r0,#0x1 pop {r0-r12, lr} bx lr -.global hook_Model_EnableMeshGroupByIndex -hook_Model_EnableMeshGroupByIndex: +HOOK Model_EnableMeshGroupByIndex push {r0,r2-r12,lr} bl Model_OverrideMesh cpy r1,r0 pop {r0,r2-r12,lr} b 0x4C8B8C -.global hook_ArrowsOrSeeds -hook_ArrowsOrSeeds: +HOOK ArrowsOrSeeds push {r0-r12, lr} bl Player_ShouldUseSlingshot cmp r0,#0x0 pop {r0-r12, lr} bx lr -.global hook_HookshotDrawChain -hook_HookshotDrawChain: +HOOK HookshotDrawChain push {r0-r12, lr} bl Player_IsAdult cmp r0,#0x0 @@ -1321,16 +1181,14 @@ hook_HookshotDrawChain: ldr r0,[r4,#0x290] b 0x2202A4 -.global hook_HookshotRotation -hook_HookshotRotation: +HOOK HookshotRotation push {r0-r12, lr} bl Hookshot_GetZRotation vmov.f32 s0,r0 pop {r0-r12, lr} bx lr -.global hook_LinkReflection -hook_LinkReflection: +HOOK LinkReflection push {r0-r12, lr} bl Player_IsAdult cmp r0,#0x1 @@ -1338,8 +1196,7 @@ hook_LinkReflection: streq r1,[r0,#0x714] bx lr -.global hook_ChildCanOpenBowSubMenu -hook_ChildCanOpenBowSubMenu: +HOOK ChildCanOpenBowSubMenu push {r0-r12, lr} bl Settings_BowAsChild cmp r0,#0x1 @@ -1348,8 +1205,7 @@ hook_ChildCanOpenBowSubMenu: cmp r12,#0x0 b 0x2EB2DC -.global hook_RedBoulderExplode -hook_RedBoulderExplode: +HOOK RedBoulderExplode ldrb r0,[r5,#0x1B5] push {r0-r12, lr} cpy r0,r5 @@ -1359,15 +1215,13 @@ hook_RedBoulderExplode: bge 0x26FE9C b 0x26FE80 -.global hook_Multiplayer_UpdatePrevActorFlags -hook_Multiplayer_UpdatePrevActorFlags: +HOOK Multiplayer_UpdatePrevActorFlags str r0,[r5,#0x1b8] push {r0-r12, lr} bl Multiplayer_Sync_UpdatePrevActorFlags pop {r0-r12, pc} -.global hook_Multiplayer_OnLoadFile -hook_Multiplayer_OnLoadFile: +HOOK Multiplayer_OnLoadFile strh r6,[r0,#0x4C] push {r0-r12, lr} bl Multiplayer_OnFileLoad @@ -1378,8 +1232,7 @@ hook_Multiplayer_OnLoadFile: b 0x449F00 .endif -.global hook_SendDroppedBottleContents -hook_SendDroppedBottleContents: +HOOK SendDroppedBottleContents add r0,r0,#0x8C push {r0-r12, lr} cpy r0,r2 @@ -1390,8 +1243,7 @@ hook_SendDroppedBottleContents: pop {r0-r12, lr} bx lr -.global hook_IgnoreMaskReaction -hook_IgnoreMaskReaction: +HOOK IgnoreMaskReaction ldrh r0,[r0,#0x0] push {r0-r12, lr} cpy r0,r4 @@ -1401,23 +1253,20 @@ hook_IgnoreMaskReaction: moveq r0,#0x0 b 0x36BBC8 -.global hook_MasterQuestGoldSkulltulaCheck -hook_MasterQuestGoldSkulltulaCheck: +HOOK MasterQuestGoldSkulltulaCheck push {r0-r5,r7-r12, lr} bl Settings_IsMasterQuestDungeon cpy r6,r0 pop {r0-r5,r7-r12, lr} b 0x3415CC -.global hook_WaterSpoutMasterQuestCheck -hook_WaterSpoutMasterQuestCheck: +HOOK WaterSpoutMasterQuestCheck push {r1-r12, lr} bl Settings_IsMasterQuestDungeon pop {r1-r12, lr} bx lr -.global hook_PierreSoftlockFixTwo -hook_PierreSoftlockFixTwo: +HOOK PierreSoftlockFixTwo cpy r6,r1 push {r0-r12, lr} mov r2,#0x1 @@ -1427,8 +1276,7 @@ hook_PierreSoftlockFixTwo: pop {r0-r12, lr} bx lr -.global hook_StoreTargetActorType -hook_StoreTargetActorType: +HOOK StoreTargetActorType push {r0-r12, lr} cpy r0,r6 bl Fairy_StoreTargetActorType @@ -1436,8 +1284,7 @@ hook_StoreTargetActorType: cmp r5,#0x0 bx lr -.global hook_ForceTrailEffectUpdate -hook_ForceTrailEffectUpdate: +HOOK ForceTrailEffectUpdate push {r1-r12, lr} cpy r0,r4 bl forceTrailEffectUpdate @@ -1445,16 +1292,14 @@ hook_ForceTrailEffectUpdate: cmp r0,#0x10 bx lr -.global hook_RainbowSwordTrail -hook_RainbowSwordTrail: +HOOK RainbowSwordTrail push {r0-r12, lr} bl updateSwordTrailColors pop {r0-r12, lr} add r8,r7,#0x100 bx lr -.global hook_BoomerangTrailEffect -hook_BoomerangTrailEffect: +HOOK BoomerangTrailEffect push {r0-r12, lr} bl updateBoomerangTrailEffect cmp r0,#0x1 @@ -1463,8 +1308,7 @@ hook_BoomerangTrailEffect: strb r4,[r0,#0x282] bx lr -.global hook_RainbowChuTrail -hook_RainbowChuTrail: +HOOK RainbowChuTrail push {r0-r12, lr} bl updateChuTrailColors cmp r0,#0x1 @@ -1473,8 +1317,7 @@ hook_RainbowChuTrail: strb r7,[r0,#0x282] bx lr -.global hook_TimerExpiration -hook_TimerExpiration: +HOOK TimerExpiration mov r0,#0x5 push {r0-r12,lr} bl IceTrap_IsCurseActive @@ -1486,8 +1329,7 @@ hook_TimerExpiration: strh r0,[r4,#0x62] bx lr -.global hook_FWandWarpSongTimerDepletion -hook_FWandWarpSongTimerDepletion: +HOOK FWandWarpSongTimerDepletion moveq r1,#0x1 movne r1,#0xEF push {r0-r12,lr} @@ -1498,8 +1340,7 @@ hook_FWandWarpSongTimerDepletion: strh r1,[r0,#0x64] bx lr -.global hook_Timer2TickSound -hook_Timer2TickSound: +HOOK Timer2TickSound push {r0-r12,lr} bl IceTrap_IsCurseActive cmp r0,#0x1 @@ -1508,15 +1349,13 @@ hook_Timer2TickSound: cmp r0,#0x3C bx lr -.global hook_CurseTrapDizzyStick -hook_CurseTrapDizzyStick: +HOOK CurseTrapDizzyStick push {r0-r12,lr} bl IceTrap_ReverseStick pop {r0-r12,lr} b 0x2FF258 -.global hook_CurseTrapDizzyButtons -hook_CurseTrapDizzyButtons: +HOOK CurseTrapDizzyButtons push {r0,r3-r12,lr} # R1 and R2 contain button status fields # Apply the curse effect to both @@ -1537,8 +1376,7 @@ hook_CurseTrapDizzyButtons: b 0x41ABE0 .endif -.global hook_CrouchStabHitbox -hook_CrouchStabHitbox: +HOOK CrouchStabHitbox push {r0-r12,lr} bl IceTrap_IsSlashHitboxDisabled cmp r0,#0x0 @@ -1547,16 +1385,14 @@ hook_CrouchStabHitbox: strb r10,[r6,#0x227] bx lr -.global hook_BossChallenge_Enter -hook_BossChallenge_Enter: +HOOK BossChallenge_Enter push {r0-r12,lr} bl BossChallenge_Enter pop {r0-r12,lr} cpy r4,r0 bx lr -.global hook_BossChallenge_ExitMenu -hook_BossChallenge_ExitMenu: +HOOK BossChallenge_ExitMenu push {r0-r12,lr} cpy r0,r8 bl BossChallenge_ExitMenu @@ -1564,8 +1400,7 @@ hook_BossChallenge_ExitMenu: cmp r8,#0x0 bx lr -.global hook_RestoreISG -hook_RestoreISG: +HOOK RestoreISG push {lr} push {r0-r12} bl Settings_IsIsgEnabled @@ -1575,15 +1410,13 @@ hook_RestoreISG: pop {lr} bx lr -.global hook_GrannyTextID -hook_GrannyTextID: +HOOK GrannyTextID push {r1-r12,lr} bl EnDs_GetTextID pop {r1-r12,lr} bx lr -.global hook_GrannyBottleCheck -hook_GrannyBottleCheck: +HOOK GrannyBottleCheck push {r0-r12,lr} bl EnDs_ShouldIgnoreBottle cmp r0,#0x0 @@ -1591,24 +1424,21 @@ hook_GrannyBottleCheck: beq 0x377A04 @Check for bottle bx lr -.global hook_GrannyItemOverride -hook_GrannyItemOverride: +HOOK GrannyItemOverride push {r0,r1,r3-r12,lr} bl EnDs_ItemOverride cpy r2,r0 pop {r0,r1,r3-r12,lr} b 0x3724DC @GiveItem -.global hook_GrannySetRewardFlag -hook_GrannySetRewardFlag: +HOOK GrannySetRewardFlag push {r0-r12,lr} bl EnDs_SetRewardFlag pop {r0-r12,lr} mov r0,#0x0 bx lr -.global hook_BecomeAdult -hook_BecomeAdult: +HOOK BecomeAdult strh r3,[r2,#0x5e] push {r0-r12,lr} bl SaveFile_BecomeAdult @@ -1617,8 +1447,7 @@ hook_BecomeAdult: ldrb r3,[r2,#0x60] bx lr -.global hook_SwordlessPatchCheck -hook_SwordlessPatchCheck: +HOOK SwordlessPatchCheck cmp r1,#0x0 bxne lr push {r0-r12,lr} @@ -1627,16 +1456,14 @@ hook_SwordlessPatchCheck: pop {r0-r12,lr} bx lr -.global hook_HandleBButton -hook_HandleBButton: +HOOK HandleBButton cmp r0,#0x3B cmpne r0,#0x3C cmpne r0,#0x3D cmpne r0,#0xFE bx lr -.global hook_LoadFileSwordless -hook_LoadFileSwordless: +HOOK LoadFileSwordless push {lr} push {r0-r12} bl SaveFile_LoadFileSwordless @@ -1645,8 +1472,7 @@ hook_LoadFileSwordless: pop {lr} bx lr -.global hook_GanonRestoreMSOnDeath -hook_GanonRestoreMSOnDeath: +HOOK GanonRestoreMSOnDeath tst r0,r1 bxne lr push {r0-r12,lr} @@ -1655,8 +1481,7 @@ hook_GanonRestoreMSOnDeath: pop {r0-r12,lr} bx lr -.global hook_CriticalHealthCheck -hook_CriticalHealthCheck: +HOOK CriticalHealthCheck cmp r0,#0x10 movle r0,#0x00 bxle lr @@ -1667,24 +1492,21 @@ hook_CriticalHealthCheck: movle r0,#0x18 bx lr -.global hook_InitSceneMirrorWorld -hook_InitSceneMirrorWorld: +HOOK InitSceneMirrorWorld push {r0-r12,lr} bl Entrance_UpdateMQFlag pop {r0-r12,lr} cpy r4,r0 bx lr -.global hook_InitSceneEntranceOverride -hook_InitSceneEntranceOverride: +HOOK InitSceneEntranceOverride push {r0-r12,lr} bl Entrance_OverrideSpawnScene pop {r0-r12,lr} mov r0, #0x14 bx lr -.global hook_CollisionATvsAC -hook_CollisionATvsAC: +HOOK CollisionATvsAC ldr r12,[sp,#0x18] push {r0-r12,lr} cpy r0,r1 @ AT collider @@ -1695,8 +1517,7 @@ hook_CollisionATvsAC: bxeq lr b 0x3192E4 -.global hook_CollisionCheck_SetAll_Once -hook_CollisionCheck_SetAll_Once: +HOOK CollisionCheck_SetAll_Once cpy r5,r2 push {r0-r12,lr} bl HyperActors_GetExtraUpdate @@ -1705,8 +1526,7 @@ hook_CollisionCheck_SetAll_Once: addeq lr,#0x8 bx lr -.global hook_GanonDrawMasterSword -hook_GanonDrawMasterSword: +HOOK GanonDrawMasterSword ldrh r0,[r4,#0x2E] push {r0-r12,lr} bl SaveFile_SwordlessPatchesEnabled @@ -1716,16 +1536,14 @@ hook_GanonDrawMasterSword: strb r10,[r4,#0x0] @ delete MS effect bx lr -.global hook_SetFWPlayerParams -hook_SetFWPlayerParams: +HOOK SetFWPlayerParams push {r0-r9,r11-r12,lr} bl Grotto_ChooseFWPlayerParams mov r10,r0 pop {r0-r9,r11-r12,lr} bx lr -.global hook_AboutToPickUpActor -hook_AboutToPickUpActor: +HOOK AboutToPickUpActor ldrh r0,[r7] push {r0-r12,lr} mov r0,r7 @@ -1735,8 +1553,7 @@ hook_AboutToPickUpActor: subeq lr,lr,#0x8 bx lr -.global hook_TargetReticleColor -hook_TargetReticleColor: +HOOK TargetReticleColor mov r4,#0x0 push {r0-r12,lr} cpy r0,r6 @ Target Context @@ -1750,8 +1567,7 @@ hook_TargetReticleColor: b 0x47B2E8 .endif -.global hook_TargetPointerColor -hook_TargetPointerColor: +HOOK TargetPointerColor ldr r0,[r6,#0x120] push {r0-r12,lr} cpy r0,r6 @ Target Context @@ -1766,8 +1582,7 @@ hook_TargetPointerColor: b 0x47BB30 .endif -.global hook_ShadowShip_Speed -hook_ShadowShip_Speed: +HOOK ShadowShip_Speed add r0,r4,#0x6C push {r0-r12,lr} vpush {s0-s1} @@ -1783,8 +1598,7 @@ hook_ShadowShip_Speed: vmul.f32 s0,s2 bx lr -.global hook_MaskSalesmanBorrowMask -hook_MaskSalesmanBorrowMask: +HOOK MaskSalesmanBorrowMask ldrsh r1,[r6,#0x1C] push {r0-r12,lr} cpy r0,r1 @@ -1792,8 +1606,7 @@ hook_MaskSalesmanBorrowMask: pop {r0-r12,lr} bx lr -.global hook_MaskSalesmanGiveMaskOfTruth -hook_MaskSalesmanGiveMaskOfTruth: +HOOK MaskSalesmanGiveMaskOfTruth orr r1,r1,#0x400 push {r0-r12,lr} mov r0,#0x22 @ Mask of Truth SI id @@ -1801,29 +1614,25 @@ hook_MaskSalesmanGiveMaskOfTruth: pop {r0-r12,lr} bx lr -.global hook_OoBBombchuOne -hook_OoBBombchuOne: +HOOK OoBBombchuOne cmp r5,#0x0 bxeq lr ldrsh r0,[r5,#0xA] bx lr -.global hook_OoBBombchuTwo -hook_OoBBombchuTwo: +HOOK OoBBombchuTwo cmp r5,#0x0 bxeq lr ldrsh r0,[r5,#0xC] bx lr -.global hook_OoBBombchuThree -hook_OoBBombchuThree: +HOOK OoBBombchuThree cmp r5,#0x0 bxeq lr ldrsh r0,[r5,#0xE] bx lr -.global hook_BombchuShopInfinitePurchases -hook_BombchuShopInfinitePurchases: +HOOK BombchuShopInfinitePurchases ldrsh r3,[r1,#0x1C] push {r0-r12,lr} bl Settings_IsLogicVanilla @@ -1832,8 +1641,7 @@ hook_BombchuShopInfinitePurchases: movne r3,#0x0 @ Skip setting itemGetInf flag b 0x188D40 -.global hook_CamRoll -hook_CamRoll: +HOOK CamRoll push {r0,lr} mov r0,#0x0 strh r0,[r5,#0xA2] @@ -1846,8 +1654,7 @@ hook_CamRoll: pop {r0,lr} bx lr -.global hook_CamUpdate -hook_CamUpdate: +HOOK CamUpdate push {r0-r12,lr} cpy r0,r1 bl Camera_FreeCamEnabled @@ -1858,8 +1665,7 @@ hook_CamUpdate: bl Camera_FreeCamUpdate ldmia sp!,{r4-r11,pc} -.global hook_Sheik_GetTextID -hook_Sheik_GetTextID: +HOOK Sheik_GetTextID push {r0, r2-r12, lr} cpy r0,r4 bl Sheik_GetTextID @@ -1867,8 +1673,7 @@ hook_Sheik_GetTextID: pop {r0, r2-r12, lr} b 0x2A4B4C -.global hook_OnActorSetup_SceneChange -hook_OnActorSetup_SceneChange: +HOOK OnActorSetup_SceneChange cpy r4,r5 push {r0-r12, lr} cpy r0,r5 @@ -1886,8 +1691,7 @@ hook_OnActorSetup_SceneChange: b 0x4522A4 .endif -.global hook_AfterActorSetup_SceneChange -hook_AfterActorSetup_SceneChange: +HOOK AfterActorSetup_SceneChange strb r0,[r7,#0xC03] push {r0-r12, lr} bl ActorSetup_Extra @@ -1898,8 +1702,7 @@ hook_AfterActorSetup_SceneChange: b 0x4522BC .endif -.global hook_OnActorSetup_RoomChange -hook_OnActorSetup_RoomChange: +HOOK OnActorSetup_RoomChange cpy r4,r6 push {r0-r12, lr} cpy r0,r6 @@ -1917,8 +1720,7 @@ hook_OnActorSetup_RoomChange: b 0x461424 .endif -.global hook_AfterActorSetup_RoomChange -hook_AfterActorSetup_RoomChange: +HOOK AfterActorSetup_RoomChange strb r10,[r8,#0xC03] push {r0-r12, lr} bl ActorSetup_Extra @@ -1929,8 +1731,7 @@ hook_AfterActorSetup_RoomChange: b 0x461438 .endif -.global hook_RandomGsLoc_CustomTangibilityCheck -hook_RandomGsLoc_CustomTangibilityCheck: +HOOK RandomGsLoc_CustomTangibilityCheck sub sp,sp,#0x18 push {r0-r12, lr} mov r1,#0x1 @@ -1949,8 +1750,7 @@ hook_RandomGsLoc_CustomTangibilityCheck: # Return false b 0x341BEC -.global hook_RandomGsLoc_CustomTokenSpawnOffset -hook_RandomGsLoc_CustomTokenSpawnOffset: +HOOK RandomGsLoc_CustomTokenSpawnOffset vadd.f32 s0,s3,s0 push {r0-r12, lr} cpy r0,r4 @@ -1969,8 +1769,7 @@ hook_RandomGsLoc_CustomTokenSpawnOffset: pop {r0-r12, lr} bx lr -.global hook_RandomGsLoc_BlockSpawn_Crate -hook_RandomGsLoc_BlockSpawn_Crate: +HOOK RandomGsLoc_BlockSpawn_Crate push {r0-r12, lr} cpy r0,r4 mov r1,#0x2 @@ -1984,8 +1783,7 @@ hook_RandomGsLoc_BlockSpawn_Crate: orr r0,r2,#0x8000 bx lr -.global hook_RandomGsLoc_BlockSpawn_Tree -hook_RandomGsLoc_BlockSpawn_Tree: +HOOK RandomGsLoc_BlockSpawn_Tree push {r0-r12, lr} cpy r0,r4 mov r1,#0x3 @@ -1999,8 +1797,7 @@ hook_RandomGsLoc_BlockSpawn_Tree: orr r0,r0,#0xE000 bx lr -.global hook_RandomGsLoc_BlockSpawn_Soil -hook_RandomGsLoc_BlockSpawn_Soil: +HOOK RandomGsLoc_BlockSpawn_Soil push {r0-r12, lr} cpy r0,r4 mov r1,#0x4 @@ -2014,8 +1811,7 @@ hook_RandomGsLoc_BlockSpawn_Soil: ldrh r0,[r4,#0x1C] bx lr -.global hook_RandomGsLoc_SkipSoilJingle -hook_RandomGsLoc_SkipSoilJingle: +HOOK RandomGsLoc_SkipSoilJingle push {r0-r12, lr} mov r1,#0x4 mov r2,#0x1 @@ -2028,15 +1824,13 @@ hook_RandomGsLoc_SkipSoilJingle: ldrsh r0,[r0,#0x1C] bx lr -.global hook_ActorDraw -hook_ActorDraw: +HOOK ActorDraw push {r0-r12, lr} bl Actor_rDraw pop {r0-r12, lr} bx lr -.global hook_FlyingPotCollision -hook_FlyingPotCollision: +HOOK FlyingPotCollision strh r0,[r4,#0xBE] push {r0-r12, lr} cpy r0,r4 @ Actor @@ -2046,8 +1840,7 @@ hook_FlyingPotCollision: bne 0x11DEE4 @ Skip collision checks and return bx lr -.global hook_FlyingTileCollision -hook_FlyingTileCollision: +HOOK FlyingTileCollision cpy r0,r5 push {r0-r12, lr} cpy r0,r4 @ Actor @@ -2057,8 +1850,7 @@ hook_FlyingTileCollision: addne lr,lr,#0x8 @ Skip setting actionFunc bx lr -.global hook_ShabomAfterDamagePlayer -hook_ShabomAfterDamagePlayer: +HOOK ShabomAfterDamagePlayer push {r0-r12, lr} bl Shabom_CheckEnemySoul cmp r0,#0x0 @@ -2067,8 +1859,7 @@ hook_ShabomAfterDamagePlayer: strh r10,[r5,#0x80] bx lr -.global hook_DodongoAfterSwallowBomb -hook_DodongoAfterSwallowBomb: +HOOK DodongoAfterSwallowBomb mov r1,#0xA push {r0-r12, lr} cpy r0,r4 @ Actor @@ -2078,8 +1869,7 @@ hook_DodongoAfterSwallowBomb: bne 0x11E4F4 bx lr -.global hook_BabyDodongoAfterSwallowBomb -hook_BabyDodongoAfterSwallowBomb: +HOOK BabyDodongoAfterSwallowBomb mov r3,#0x8 push {r0-r12, lr} cpy r0,r4 @ Actor @@ -2089,8 +1879,7 @@ hook_BabyDodongoAfterSwallowBomb: bne 0x1C4370 bx lr -.global hook_OcarinaNoteButtonsDraw -hook_OcarinaNoteButtonsDraw: +HOOK OcarinaNoteButtonsDraw push {r0-r12, lr} bl OcarinaNotes_MoveButtons pop {r0-r12, lr} @@ -2099,16 +1888,14 @@ hook_OcarinaNoteButtonsDraw: mov r3,r3,lsl #0x1 @ original code bx lr -.global hook_OcarinaNoteButtonsPress -hook_OcarinaNoteButtonsPress: +HOOK OcarinaNoteButtonsPress cpy r0,r6 push {r1-r12, lr} bl OcarinaNotes_HandleInputs pop {r1-r12, lr} bx lr -.global hook_HandleTextControlCode -hook_HandleTextControlCode: +HOOK HandleTextControlCode ldrb r0,[r6,#0x4] @ Control Code identifier push {r0-r12, lr} cpy r1,r5 @ Text Object @@ -2119,8 +1906,7 @@ hook_HandleTextControlCode: bxeq lr @ Not a custom control char, resume base game code b 0x2E0ED4 @ Handled custom control char, skip base game code -.global hook_CheckForTextControlCode -hook_CheckForTextControlCode: +HOOK CheckForTextControlCode push {r1-r12, lr} cpy r2,r5 @ Text Object cpy r3,r9 @ Char Index (loop counter) @@ -2128,24 +1914,21 @@ hook_CheckForTextControlCode: pop {r1-r12, lr} bx lr -.global hook_PlayInit -hook_PlayInit: +HOOK PlayInit push {r0-r12, lr} bl before_Play_Init pop {r0-r12, lr} cpy r5,r0 bx lr -.global hook_GetObjectEntry_Generic -hook_GetObjectEntry_Generic: +HOOK GetObjectEntry_Generic push {r1-r12, lr} @ r0 = slot bl Object_GetEntry pop {r1-r12, lr} bx lr -.global hook_GetObjectEntry_33AB24 -hook_GetObjectEntry_33AB24: +HOOK GetObjectEntry_33AB24 push {r1-r12, lr} ldr r0,[r4,#0x4] ldr r0,[r0,r5,lsl #0x3] @ objectId @@ -2153,48 +1936,42 @@ hook_GetObjectEntry_33AB24: pop {r1-r12, lr} bx lr -.global hook_ExtendObjectGetSlot -hook_ExtendObjectGetSlot: +HOOK ExtendObjectGetSlot push {r1-r12, lr} cpy r0,r1 @ objectId bl ExtendedObject_GetSlot pop {r1-r12, lr} bx lr -.global hook_OverrideObjectIsLoaded -hook_OverrideObjectIsLoaded: +HOOK OverrideObjectIsLoaded push {r1-r12, lr} @ r0,r1 = ObjectContext,slot bl Object_IsLoaded pop {r1-r12, lr} bx lr -.global hook_OverrideObjectIsLoadedForCutscenes -hook_OverrideObjectIsLoadedForCutscenes: +HOOK OverrideObjectIsLoadedForCutscenes push {r1-r12, lr} @ r0,r1 = ObjectContext,slot bl Object_IsLoaded_ForCutscenes pop {r1-r12, lr} bx lr -.global hook_AfterObjectListCommand -hook_AfterObjectListCommand: +HOOK AfterObjectListCommand push {r0-r12, lr} bl ExtendedObject_AfterObjectListCommand pop {r0-r12, lr} mov r0,#0x1 bx lr -.global hook_GetObjectEntry_34F270 -hook_GetObjectEntry_34F270: +HOOK GetObjectEntry_34F270 push {r1-r12, lr} @ r0 = slot bl Object_GetEntry pop {r1-r12, lr} b 0x34F274 -.global hook_AltHeadersCommand -hook_AltHeadersCommand: +HOOK AltHeadersCommand add r2,r7,r1 push {r0-r12, lr} cpy r0,r2 @ alt headers pointers list @@ -2202,8 +1979,7 @@ hook_AltHeadersCommand: pop {r0-r12, lr} bx lr -.global hook_GohmaLarvaDeathSignalParent -hook_GohmaLarvaDeathSignalParent: +HOOK GohmaLarvaDeathSignalParent ldr r1,[r4,#0x124] @ if parent pointer is null, skip @ setting childrenGohmaState @@ -2211,8 +1987,7 @@ hook_GohmaLarvaDeathSignalParent: addeq lr,lr,#0x10 bx lr -.global hook_GohmaEggDeathSignalParent -hook_GohmaEggDeathSignalParent: +HOOK GohmaEggDeathSignalParent ldr r0,[r4,#0x124] @ if parent pointer is null, skip @ setting childrenGohmaState @@ -2220,8 +1995,7 @@ hook_GohmaEggDeathSignalParent: addeq lr,lr,#0x10 bx lr -.global hook_StalchildDespawn_13DB68 -hook_StalchildDespawn_13DB68: +HOOK StalchildDespawn_13DB68 push {r0-r12, lr} cpy r0,r4 @ actor bl Stalchild_CanDespawn @@ -2232,8 +2006,7 @@ hook_StalchildDespawn_13DB68: cmp r0,r1 @ base game code bx lr -.global hook_StalchildDespawn_366338 -hook_StalchildDespawn_366338: +HOOK StalchildDespawn_366338 cmp r0,#0x0 bxne lr @ doesn't despawn push {r0-r12, lr} @@ -2243,13 +2016,11 @@ hook_StalchildDespawn_366338: pop {r0-r12, lr} bx lr -.global hook_SkullwalltulaAttack_35F834 -hook_SkullwalltulaAttack_35F834: +HOOK SkullwalltulaAttack_35F834 cpy r5,r0 b SkullwalltulaAttack -.global hook_SkullwalltulaAttack_35F328 -hook_SkullwalltulaAttack_35F328: +HOOK SkullwalltulaAttack_35F328 cpy r4,r0 SkullwalltulaAttack: push {r0-r12, lr} @@ -2262,8 +2033,7 @@ SkullwalltulaAttack: moveq r0,#0x0 @ don't attack pop {r4-r7,pc} @ return and skip vanilla checks -.global hook_SkullwalltulaTargetRotation -hook_SkullwalltulaTargetRotation: +HOOK SkullwalltulaTargetRotation sxth r0,r0 push {r1-r12, lr} cpy r1,r4 @ actor @@ -2271,8 +2041,7 @@ hook_SkullwalltulaTargetRotation: pop {r1-r12, lr} bx lr -.global hook_SkullKidPoacherSawCheck -hook_SkullKidPoacherSawCheck: +HOOK SkullKidPoacherSawCheck cmp r1,#0x32 bxge lr @ higher than poacher's saw, resume vanilla code push {r0-r12, lr} @@ -2282,8 +2051,7 @@ hook_SkullKidPoacherSawCheck: pop {r0-r12, lr} bx lr -.global hook_LeeverSandCheck -hook_LeeverSandCheck: +HOOK LeeverSandCheck cmpne r0,#0x7 bxeq lr push {r0-r12, lr} @@ -2293,16 +2061,14 @@ hook_LeeverSandCheck: pop {r0-r12, lr} bx lr -.global hook_LeeverAfterSink -hook_LeeverAfterSink: +HOOK LeeverAfterSink push {r0-r12, lr} @ r0 = actor bl Leever_AfterSink pop {r0-r12, lr} bx lr -.global hook_LeeverAfterDie -hook_LeeverAfterDie: +HOOK LeeverAfterDie push {r0-r12, lr} cpy r0,r4 @ actor bl Leever_AfterDie @@ -2310,31 +2076,27 @@ hook_LeeverAfterDie: cmp r0,#0x0 bx lr -.global hook_PlayerCheckVoidOut -hook_PlayerCheckVoidOut: +HOOK PlayerCheckVoidOut ldrb r0,[r4,#0x2] @ actor->type cmp r0,#0x2 @ ACTORTYPE_PLAYER addne lr,lr,#0x17C @ Dark Link, skip void out (USA: 0x132CE4) cmpeq r8,#0x0 @ Normal Player, continue as normal bx lr -.global hook_EnBlkobj_SpawnDarkLink -hook_EnBlkobj_SpawnDarkLink: +HOOK EnBlkobj_SpawnDarkLink push {r1-r12, lr} cpy r0,r4 @ EnBlkobj actor bl DarkLink_Spawn pop {r1-r12, lr} bx lr -.global hook_EnBlkobj_FindDarkLink -hook_EnBlkobj_FindDarkLink: +HOOK EnBlkobj_FindDarkLink push {r1-r12, lr} bl DarkLink_IsAlive pop {r1-r12, lr} bx lr -.global hook_EnEncount1_SpawnStalchildWolfos -hook_EnEncount1_SpawnStalchildWolfos: +HOOK EnEncount1_SpawnStalchildWolfos cpy r1,r9 push {r0-r12, lr} cpy r0,r9 @ this EnEncount1 @@ -2344,8 +2106,7 @@ hook_EnEncount1_SpawnStalchildWolfos: pop {r0-r12, lr} bx lr -.global hook_EnEncount1_SpawnLeever -hook_EnEncount1_SpawnLeever: +HOOK EnEncount1_SpawnLeever push {r0-r12, lr} cpy r0,r5 @ this EnEncount1 add r1,sp,#0xC @ actorId (r3) @@ -2355,8 +2116,7 @@ hook_EnEncount1_SpawnLeever: str r8,[sp,#0xC] bx lr -.global hook_EnEncount1_SetLeeverAimType -hook_EnEncount1_SetLeeverAimType: +HOOK EnEncount1_SetLeeverAimType push {r0} ldrh r0,[r7] @ actor->id cmp r0,#0x1C @ Leever actor id @@ -2364,8 +2124,7 @@ hook_EnEncount1_SetLeeverAimType: strheq r0,[r1,r7] @ Set aimType only if actor is Leever bx lr -.global hook_DarkLinkPlayerRecoil -hook_DarkLinkPlayerRecoil: +HOOK DarkLinkPlayerRecoil cmp r1,r6 bxne lr @ not recoiling push {r0-r12, lr} @@ -2374,8 +2133,7 @@ hook_DarkLinkPlayerRecoil: pop {r0-r12, lr} bx lr -.global hook_BabyDodongoWallCheck -hook_BabyDodongoWallCheck: +HOOK BabyDodongoWallCheck tst r0,#0x8 bxeq lr @ no wall detected, return push {r0-r12, lr} @@ -2386,8 +2144,7 @@ hook_BabyDodongoWallCheck: pop {r0-r12, lr} bx lr -.global hook_PeahatLarvaGroundCheck -hook_PeahatLarvaGroundCheck: +HOOK PeahatLarvaGroundCheck tsteq r1,#0x1 bxeq lr @ did not hit ground push {r0-r12, lr} @@ -2398,8 +2155,7 @@ hook_PeahatLarvaGroundCheck: @ Prevent death when hitting ground without soul. bx lr -.global hook_RedeadCanFreezePlayer -hook_RedeadCanFreezePlayer: +HOOK RedeadCanFreezePlayer cmp r1,r0 bxgt lr @ far away, resume vanilla checks ldr r0,const_RedeadMaxYDist @@ -2411,8 +2167,7 @@ hook_RedeadCanFreezePlayer: const_RedeadMaxYDist: .float 200.0 -.global hook_DeadHandHandCanGrabPlayer -hook_DeadHandHandCanGrabPlayer: +HOOK DeadHandHandCanGrabPlayer cmp r0,r1 bxgt lr @ far away, resume vanilla checks vpush {s0} @@ -2426,8 +2181,7 @@ hook_DeadHandHandCanGrabPlayer: const_DeadHandHandMaxYDist: .float 100.0 -.global hook_GerudoBattleMusic -hook_GerudoBattleMusic: +HOOK GerudoBattleMusic push {r0-r12, lr} bl GerudoFighter_IsRandomized cmp r0,#0x0 @@ -2439,8 +2193,7 @@ hook_GerudoBattleMusic: @ certain conditions will get killed on every frame and never deleted. @ Fig's explanation from OoT Discord: https://discord.com/channels/82938430371139584/82991320754294784/1002187734946947113 @ With Enemy Randomizer, these "zombie" enemy actors can prevent a room from being cleared. -.global hook_FixActorKillLoop -hook_FixActorKillLoop: +HOOK FixActorKillLoop bxne lr @ object is loaded, continue without killing actor push {r0-r12, lr} @ check if actor is already killed so that it doesn't get @@ -2451,16 +2204,14 @@ hook_FixActorKillLoop: pop {r0-r12, lr} bx lr -.global hook_AfterInvalidatingRoomObjects -hook_AfterInvalidatingRoomObjects: +HOOK AfterInvalidatingRoomObjects push {r0-r12, lr} bl ExtendedObject_InvalidateRoomObjects pop {r0-r12, lr} ldr r0,[sp,#0x18] bx lr -.global hook_DrawHeartIcon -hook_DrawHeartIcon: +HOOK DrawHeartIcon push {r0-r12, lr} cpy r0,r1 @ heart icon index bl Gloom_ShouldDrawHeartBorder @@ -2468,8 +2219,7 @@ hook_DrawHeartIcon: pop {r0-r12, lr} bx lr -.global hook_OcarinaNoteSound_Player -hook_OcarinaNoteSound_Player: +HOOK OcarinaNoteSound_Player push {r0,r2,r3,lr} bl 0x2CFE00 @ original instruction, sets vibrato mov r0,#0x0 @ default ocarina instrument @@ -2478,8 +2228,7 @@ hook_OcarinaNoteSound_Player: pop {r0,r2,r3,lr} b 0x2CFD24 @ set instrument -.global hook_OcarinaNoteSound_Npc -hook_OcarinaNoteSound_Npc: +HOOK OcarinaNoteSound_Npc and r1,r0,#0xFF @ instrument push {r0, r2-r12, lr} cpy r0,r1 @@ -2488,8 +2237,7 @@ hook_OcarinaNoteSound_Npc: pop {r0, r2-r12, lr} bx lr -.global hook_Item00GiveAutomaticItemDrop -hook_Item00GiveAutomaticItemDrop: +HOOK Item00GiveAutomaticItemDrop ldrsh r0,[r4,#0x1c] push {r0-r12, lr} cpy r0,r4 @ actor @@ -2499,8 +2247,7 @@ hook_Item00GiveAutomaticItemDrop: addne lr,lr,#0x8 @ Item overridden, skip Item_Give bx lr -.global hook_Item00GiveCollectedItemDrop -hook_Item00GiveCollectedItemDrop: +HOOK Item00GiveCollectedItemDrop ldrsh r0,[r5,#0x1c] push {r0-r12, lr} cpy r0,r5 @ actor @@ -2510,16 +2257,14 @@ hook_Item00GiveCollectedItemDrop: addne lr,lr,#0x8 @ Item overridden, skip Item_Give bx lr -.global hook_GanonFinalBlow -hook_GanonFinalBlow: +HOOK GanonFinalBlow push {r0-r12, lr} bl Ganon_OnFinalBlow pop {r0-r12, lr} mov r1,#0x1 bx lr -.global hook_PlayerBonk -hook_PlayerBonk: +HOOK PlayerBonk strh r8,[r7,#0x38] push {r0-r12, lr} bl Player_OnBonk diff --git a/code/src/asm/patches.s b/code/src/asm/patches.s index e63e74a7..d9a258b7 100644 --- a/code/src/asm/patches.s +++ b/code/src/asm/patches.s @@ -1,292 +1,194 @@ .arm -.section .patch_loader -.global loader_patch -loader_patch: +.macro PATCH name + .section .patch_\name + .global \name\()_patch +\name\()_patch: +.endm + +PATCH loader b hook_into_loader -.section .patch_before_GlobalContext_Update -.global before_GlobalContext_Update_patch -before_GlobalContext_Update_patch: +PATCH before_GlobalContext_Update bl hook_before_GlobalContext_Update -.section .patch_after_GlobalContext_Update -.global after_GlobalContext_Update_patch -after_GlobalContext_Update_patch: +PATCH after_GlobalContext_Update b hook_after_GlobalContext_Update -.section .patch_Gfx_Update -.global GfX_Update_patch -GfX_Update_patch: +PATCH Gfx_Update b hook_Gfx_Update -.section .patch_IncomingGetItemID -.global IncomingGetItemID_patch -IncomingGetItemID_patch: +PATCH IncomingGetItemID str r5,[r4,#0x2B0] bl hook_IncomingGetItemID -.section .patch_SaveFile_Init -.global SaveFile_Init_patch -SaveFile_Init_patch: +PATCH SaveFile_Init bl hook_SaveFile_Init -.section .patch_OverrideOcarinaSongs -.global OverrideOcarinaSongs_patch -OverrideOcarinaSongs_patch: +PATCH OverrideOcarinaSongs bl Cutscene_OverrideOcarinaSongs -.section .patch_OverrideTextID -.global OverrideTextID_patch -OverrideTextID_patch: +PATCH OverrideTextID b hook_OverrideTextID -.section .patch_OverrideItemID -.global OverrideItemID_patch -OverrideItemID_patch: +PATCH OverrideItemID b hook_OverrideItemID -.section .patch_OverrideDrawItemOne -.global OverrideDrawItemOne_patch -OverrideDrawItemOne_patch: +PATCH OverrideDrawItemOne b hook_OverrideDrawItemOne -.section .patch_OverrideDrawItemTwo -.global OverrideDrawItemTwo_patch -OverrideDrawItemTwo_patch: +PATCH OverrideDrawItemTwo bl hook_OverrideDrawItemTwo -.section .patch_OverrideDrawItemThree -.global OverrideDrawItemThree_patch -OverrideDrawItemThree_patch: +PATCH OverrideDrawItemThree bl hook_OverrideDrawItemThree -.section .patch_OverrideGiDrawIdPlusOne_Ground -.global OverrideGiDrawIdPlusOne_Ground_patch -OverrideGiDrawIdPlusOne_Ground_patch: +PATCH OverrideGiDrawIdPlusOne_Ground bl hook_OverrideGiDrawIdPlusOne -.section .patch_OverrideGiDrawIdPlusOne_Water -.global OverrideGiDrawIdPlusOne_Water_patch -OverrideGiDrawIdPlusOne_Water_patch: +PATCH OverrideGiDrawIdPlusOne_Water bl hook_OverrideGiDrawIdPlusOne -.section .patch_EditDrawGetItemBeforeModelSpawn -.global EditDrawGetItemBeforeModelSpawn_patch -EditDrawGetItemBeforeModelSpawn_patch: +PATCH EditDrawGetItemBeforeModelSpawn bl hook_EditDrawGetItemBeforeModelSpawn -.section .patch_EditDrawGetItemAfterModelSpawn -.global EditDrawGetItemAfterModelSpawn_patch -EditDrawGetItemAfterModelSpawn_patch: +PATCH EditDrawGetItemAfterModelSpawn bl hook_EditDrawDetItemAfterModelSpawn -.section .patch_EditDrawGetItemAfterMatrixUpdate -.global EditDrawGetItemAfterMatrixUpdate_patch -EditDrawGetItemAfterMatrixUpdate_patch: +PATCH EditDrawGetItemAfterMatrixUpdate bl hook_EditDrawGetItemAfterMatrixUpdate -.section .patch_NoLensOfTruthNaviText +PATCH NoLensOfTruthNaviText nop -.section .patch_NoSilverGauntletsCutsceneWarp +PATCH NoSilverGauntletsCutsceneWarp b 0x2BC350 -.section .patch_ChildShootingGallery -.global ChildShootingGallery_patch -ChildShootingGallery_patch: +PATCH ChildShootingGallery mov r0,#0x60 nop -.section .patch_AdultShootingGallery -.global AdultShootingGallery_patch -AdultShootingGallery_patch: +PATCH AdultShootingGallery nop mov r0,#0x30 b 0x38AB78 -.section .patch_GerudoArcheryOne -.global GerudoArcheryOne_patch -GerudoArcheryOne_patch: +PATCH GerudoArcheryOne mov r4,#0x30 b 0x3AFA44 nop nop -.section .patch_GerudoArcheryTwo -.global GerudoArcheryTwo_patch -GerudoArcheryTwo_patch: +PATCH GerudoArcheryTwo mov r5,#0x30 b 0x3C2D90 nop nop -.section .patch_ScrubStickUpgradeOne -.global ScrubStickUpgradeOne_patch -ScrubStickUpgradeOne_patch: +PATCH ScrubStickUpgradeOne nop -.section .patch_ScrubNutUpgradeOne -.global ScrubNutUpgradeOne_patch -ScrubNutUpgradeOne_patch: +PATCH ScrubNutUpgradeOne nop -.section .patch_ScrubStickUpgradeTwo -.global ScrubStickUpgradeTwo_patch -ScrubStickUpgradeTwo_patch: +PATCH ScrubStickUpgradeTwo nop -.section .patch_ScrubNutUpgradeTwo -.global ScrubNutUpgradeTwo_patch -ScrubNutUpgradeTwo_patch: +PATCH ScrubNutUpgradeTwo nop -.section .patch_ChildRollingGoron -.global ChildRollingGoron_patch -ChildRollingGoron_patch: +PATCH ChildRollingGoron mov r2,#0x34 nop -.section .patch_ChildRollingGoronDontCheckBombBag -.global ChildRollingGoronDontCheckBombBag_patch -ChildRollingGoronDontCheckBombBag_patch: +PATCH ChildRollingGoronDontCheckBombBag nop -.section .patch_AdultRollingGoronIgnoreMedallion -.global AdultRollingGoronIgnoreMedallion_patch -AdultRollingGoronIgnoreMedallion_patch: +PATCH AdultRollingGoronIgnoreMedallion b 0x19546C -.section .patch_AdultRollingGoronOne -.global AdultRollingGoronOne_patch -AdultRollingGoronOne_patch: +PATCH AdultRollingGoronOne b 0x19549C -.section .patch_AdultRollingGoronTwo -.global AdultRollingGoronTwo_patch -AdultRollingGoronTwo_patch: +PATCH AdultRollingGoronTwo b hook_AdultRollingGoronTwo -.section .patch_DaruniaCheckStrength -.global DaruniaStrengthCheck_patch -DaruniaStrengthCheck_patch: +PATCH DaruniaCheckStrength b hook_DaruniaStrengthCheck -.section .patch_LostWoodsShootingGame -.global LostWoodsShootingGame_patch -LostWoodsShootingGame_patch: +PATCH LostWoodsShootingGame mov r2,#0x60 nop -.section .patch_LostWoodsShootingGameTwo -.global LostWoodsShootingGameTwo_patch -LostWoodsShootingGameTwo_patch: +PATCH LostWoodsShootingGameTwo mov r2,#0x60 nop -.section .patch_SkulltulaRewardOne -.global SkulltulaRewardOne_patch -SkulltulaRewardOne_patch: +PATCH SkulltulaRewardOne b 0x12CC9C -.section .patch_SkulltulaRewardTwo -.global SkulltulaRewardTwo_patch -SkulltulaRewardTwo_patch: +PATCH SkulltulaRewardTwo b 0x12CD6C -.section .patch_KingZoraGiveTunic -.global KingZoraGiveTunic_patch -KingZoraGiveTunic_patch: +PATCH KingZoraGiveTunic mov r0,#0x4000 add r0,r0,#0x12 -.section .patch_KingZoraSecondTunic -.global KingZoraSecondTunic_patch -KingZoraSecondTunic_patch: +PATCH KingZoraSecondTunic b 0x1B6A40 -.section .patch_KingZoraCheckMovedFlag -.global KingZoraCheckMovedFlag_patch -KingZoraCheckMovedFlag_patch: +PATCH KingZoraCheckMovedFlag bl hook_KingZoraCheckMovedFlag -.section .patch_KingZoraIgnoreSapphire -.global KingZoraIgnoreSapphire_patch -KingZoraIgnoreSapphire_patch: +PATCH KingZoraIgnoreSapphire nop nop -.section .patch_DampeRollHigh -.global DampeRollHigh_patch -DampeRollHigh_patch: +PATCH DampeRollHigh mov r0,#0x3 b 0x3C3458 -.section .patch_DampeCheckRewardFlag -.global DampeCheckRewardFlag_patch -DampeCheckRewardFlag_patch: +PATCH DampeCheckRewardFlag cpyeq r0,r4 bleq EnTk_SetRewardFlag -.section .patch_DampeSetCollectibleFlag +PATCH DampeSetCollectibleFlag .word 0x00000806 -.section .patch_DampeCheckCanDig1 -.global DampeCheckCanDig1_patch -DampeCheckCanDig1_patch: +PATCH DampeCheckCanDig1 mov r0,#0x01 -.section .patch_DampeCheckCanDig2 -.global DampeCheckCanDig2_patch -DampeCheckCanDig2_patch: +PATCH DampeCheckCanDig2 mov r0,#0x01 -.section .patch_TokenNoItemGive1 -.global TokenNoItemGive1_patch -TokenNoItemGive1_patch: +PATCH TokenNoItemGive1 nop -.section .patch_TokenNoItemGive2 -.global TokenNoItemGive2_patch -TokenNoItemGive2_patch: +PATCH TokenNoItemGive2 nop -.section .patch_GetToken1 -.global GetToken1_patch -GetToken1_patch: +PATCH GetToken1 bl hook_GetToken -.section .patch_GetToken2 -.global GetToken2_patch -GetToken2_patch: +PATCH GetToken2 bl hook_GetToken -.section .patch_GetCustomMessageEntryOne -.global GetCustomMessageEntryOne_patch -GetCustomMessageEntryOne_patch: +PATCH GetCustomMessageEntryOne bl Message_GetCustomEntry -.section .patch_GetCustomMessageEntryTwo -.global GetCustomMessageEntryTwo_patch -GetCustomMessageEntryTwo_patch: +PATCH GetCustomMessageEntryTwo bl Message_GetCustomEntry -.section .patch_GetCustomMessageTextOne -.global GetCustomMessageTextOne_patch -GetCustomMessageTextOne_patch: +PATCH GetCustomMessageTextOne bl Message_GetCustomText -.section .patch_GetCustomMessageTextTwo -.global GetCustomMessageTextTwo_patch -GetCustomMessageTextTwo_patch: +PATCH GetCustomMessageTextTwo bl Message_GetCustomText -.section .patch_FastChests -.global FastChests_patch -FastChests_patch: +PATCH FastChests bl hook_FastChests -.section .patch_FastChestsTwo +PATCH FastChestsTwo bl hook_FastChests bne 0x3F10B0 nop @@ -298,16 +200,12 @@ FastChests_patch: nop nop -.section .patch_DampeChest -.global DampeChest_patch -DampeChest_patch: +PATCH DampeChest cpy r0,r4 bl EnPoRelay_CheckChestFlag nop -.section .patch_RainbowBridge -.global RainbowBridge_patch -RainbowBridge_patch: +PATCH RainbowBridge push {r0-r12, lr} bl BgGjyoBridge_CheckCondition cmp r0,#0x0 @@ -315,82 +213,56 @@ RainbowBridge_patch: beq 0x3E7D70 b 0x3E7D34 -.section .patch_ExtendedObjectClear -.global ExtendedObjectClear_patch -ExtendedObjectClear_patch: +PATCH ExtendedObjectClear bl ExtendedObject_Clear -.section .patch_SariasGift -.global SariasGift_patch -SariasGift_patch: +PATCH SariasGift bl ItemOverride_GiveSariasGift nop nop -.section .patch_DekuTheaterSkullMask -.global DekuTheaterSkullMask_patch -DekuTheaterSkullMask_patch: +PATCH DekuTheaterSkullMask mov r0,#0x77 nop -.section .patch_DekuTheaterMaskOfTruth -.global DekuTheaterMaskOfTruth_patch -DekuTheaterMaskOfTruth_patch: +PATCH DekuTheaterMaskOfTruth mov r0,#0x7A nop -.section .patch_PoeCollectorCheckPoints -.global PoeCollectorCheckPoints_patch -PoeCollectorCheckPoints_patch: +PATCH PoeCollectorCheckPoints bl hook_PoeCollectorCheckPoints -.section .patch_LACSConditionOne -.global LACSConditionOne_patch -LACSConditionOne_patch: +PATCH LACSConditionOne nop -.section .patch_LACSConditionTwo -.global LACSConditionTwo_patch -LACSConditionTwo_patch: +PATCH LACSConditionTwo bl Cutscene_OverrideLACS nop nop nop nop -.section .patch_MinuetLocation -.global MinuetLocation_patch -MinuetLocation_patch: +PATCH MinuetLocation bl Cutscene_OverrideMinuet b 0x26C47C -.section .patch_BoleroLocation -.global BoleroLocation_patch -BoleroLocation_patch: +PATCH BoleroLocation bl Cutscene_OverrideBolero b 0x26C47C -.section .patch_SerenadeCheckChestFlag -.global SerenadeCheckChestFlag_patch -SerenadeCheckChestFlag_patch: +PATCH SerenadeCheckChestFlag bl hook_SerenadeCheckChestFlag -.section .patch_SerenadeLocation -.global SerenadeLocation_patch -SerenadeLocation_patch: +PATCH SerenadeLocation bl Cutscene_OverrideSerenade b 0x2B25A8 -.section .patch_RequiemLocation -.global RequiemLocation_patch -RequiemLocation_patch: +PATCH RequiemLocation nop nop bl Cutscene_OverrideRequiem -.section .patch_NocturneLocation -.global NocturneLocation_patch -NocturneLocation_patch: +PATCH NocturneLocation bl Cutscene_OverrideNocturne .if _EUR_==1 b 0x44F1A0 @@ -398,750 +270,503 @@ NocturneLocation_patch: b 0x44F180 .endif -.section .patch_FreeScarecrow -.global FreeScarecrow_patch -FreeScarecrow_patch: +PATCH FreeScarecrow bl hook_ScarecrowCheckToBeActivated -.section .patch_MasterSwordAlwaysDrop -.global MasterSwordAlwaysDrop_patch -MasterSwordAlwaysDrop_patch: +PATCH MasterSwordAlwaysDrop nop -.section .patch_PreludeLocation -.global PreludeLocation_patch -PreludeLocation_patch: +PATCH PreludeLocation bl Cutscene_OverridePrelude cmp r0,#0x0 beq 0x18DAD0 b 0x18DA38 -.section .patch_LullabyLocation -.global LullabyLocation_patch -LullabyLocation_patch: +PATCH LullabyLocation bl Cutscene_OverrideLullaby b 0x3A0AC8 -.section .patch_EponasSongCheckFlag -.global EponasSongCheckFlag_patch -EponasSongCheckFlag_patch: +PATCH EponasSongCheckFlag bl hook_EponasSongCheckFlag -.section .patch_EponasSongCheckFlagTwo -.global EponasSongCheckFlagTwo_patch -EponasSongCheckFlagTwo_patch: +PATCH EponasSongCheckFlagTwo bl hook_EponasSongCheckFlag -.section .patch_EponasSongLocation -.global EponasSongLocation_patch -EponasSongLocation_patch: +PATCH EponasSongLocation bl Cutscene_OverrideEponasSong b 0x3C61CC -.section .patch_MalonNextAction -.global MalonNextAction_patch -MalonNextAction_patch: +PATCH MalonNextAction .word 0x3D2A14 -.section .patch_SariasSongCheckFlag -.global SariasSongCheckFlag_patch -SariasSongCheckFlag_patch: +PATCH SariasSongCheckFlag bl hook_SariasSongCheckFlag -.section .patch_SariasSongItemGive -.global SariasSongItemGive_patch -SariasSongItemGive_patch: +PATCH SariasSongItemGive nop -.section .patch_SariasSongLocation -.global SariasSongLocation_patch -SariasSongLocation_patch: +PATCH SariasSongLocation bl Cutscene_OverrideSariasSong b 0x12C92C -.section .patch_SunsSongLocation -.global SunsSongLocation_patch -SunsSongLocation_patch: +PATCH SunsSongLocation bl Cutscene_OverrideSunsSong b 0x2888F0 -.section .patch_SongOfTimeLocation -.global SongOfTimeLocation_patch -SongOfTimeLocation_patch: +PATCH SongOfTimeLocation cpy r0,r5 bl Cutscene_OverrideSongOfTime b 0x3C3780 -.section .patch_SongOfStormsLocation -.global SongOfStormsLocation_patch -SongOfStormsLocation_patch: +PATCH SongOfStormsLocation bl Cutscene_OverrideSongOfStorms b 0x1427F8 -.section .patch_BiggoronDayCheck -.global BiggoronDayCheck_patch -BiggoronDayCheck_patch: +PATCH BiggoronDayCheck mov r0,#0x3 -.section .patch_BiggoronGetTextId -.global BiggoronGetTextId_patch -BiggoronGetTextId_patch: +PATCH BiggoronGetTextId bl EnGo2_rGetTextIdGoronDmtBiggoron b 0x195524 -.section .patch_BiggoronCheckBGSFlag -.global BiggoronCheckBGSFlag_patch -BiggoronCheckBGSFlag_patch: +PATCH BiggoronCheckBGSFlag nop nop nop -.section .patch_BiggoronDontSetBGSFlag -.global BiggoronDontSetBGSFlag_patch -BiggoronDontSetBGSFlag_patch: +PATCH BiggoronDontSetBGSFlag nop -.section .patch_BiggoronSetTextId -.global BiggoronSetTextId_patch -BiggoronSetTextId_patch: +PATCH BiggoronSetTextId push {r0-r12, lr} cpy r0,r4 bl EnGo2_rBiggoronSetTextId pop {r0-r12, lr} b 0x1D8B80 -.section .patch_BiggoronAfterGiveItem -.global BiggoronAfterGiveItem_patch -BiggoronAfterGiveItem_patch: +PATCH BiggoronAfterGiveItem .word EnGo2_AfterGiveItem -.section .patch_ItemEtceteraModelDraw -.global ItemEtceteraModelDraw_patch -ItemEtceteraModelDraw_patch: +PATCH ItemEtceteraModelDraw bl hook_ItemEtceteraModelDraw -.section .patch_KokiriCheckOpenForest -.global Kokiri_CheckOpenForest_patch -Kokiri_CheckOpenForest_patch: +PATCH KokiriCheckOpenForest bl hook_KokiriCheckOpenForest -.section .patch_BombchuBowlingStaticReward -.global BombchuBowlingStaticReward_patch -BombchuBowlingStaticReward_patch: +PATCH BombchuBowlingStaticReward b 0x20618C -.section .patch_ChildBlueWarpOverride -.global ChildBlueWarpOverride_patch -ChildBlueWarpOverride_patch: +PATCH ChildBlueWarpOverride push {r0-r12, lr} bl Cutscene_BlueWarpOverride pop {r0-r12, lr} b 0x3F58A8 -.section .patch_RutoBlueWarpOverride -.global RutoBlueWarpOverride_patch -RutoBlueWarpOverride_patch: +PATCH RutoBlueWarpOverride push {r0-r12, lr} bl Cutscene_BlueWarpOverride pop {r0-r12, lr} b 0x1A1944 -.section .patch_AdultBlueWarpOverride -.global AdultBlueWarpOverride_patch -AdultBlueWarpOverride_patch: +PATCH AdultBlueWarpOverride push {r0-r12, lr} bl Cutscene_BlueWarpOverride pop {r0-r12, lr} b 0x1E4274 -.section .patch_EnExItemModelDraw -.global EnExItemModelDraw_patch -EnExItemModelDraw_patch: +PATCH EnExItemModelDraw bl hook_EnExItemModelDraw -.section .patch_DemoEffectMedallionDraw -.global DemoEffectMedallionDraw_patch -DemoEffectMedallionDraw_patch: +PATCH DemoEffectMedallionDraw b hook_DemoEffectMedallionDraw -.section .patch_DemoEffectStoneDraw -.global DemoEffectStoneDraw_patch -DemoEffectStoneDraw_patch: +PATCH DemoEffectStoneDraw b hook_DemoEffectStoneDraw -.section .patch_DekuSproutCheckForest -.global DekuSproutCheckForest_patch -DekuSproutCheckForest_patch: +PATCH DekuSproutCheckForest ldr r0, [r0,#0xEF4] nop tst r0,#0x100 -.section .patch_EnKoInitCheckForest_165834 -.global EnKoInitCheckForest_165834_patch -EnKoInitCheckForest_165834_patch: +PATCH EnKoInitCheckForest_165834 bl hook_EnKoInitCheckForest nop nop -.section .patch_EnKoInitCheckForest_165878 -.global EnKoInitCheckForest_165878_patch -EnKoInitCheckForest_165878_patch: +PATCH EnKoInitCheckForest_165878 bl hook_EnKoInitCheckForest nop nop -.section .patch_EnKoInitCheckForest_1658C0 -.global EnKoInitCheckForest_1658C0_patch -EnKoInitCheckForest_1658C0_patch: +PATCH EnKoInitCheckForest_1658C0 bl hook_EnKoInitCheckForest nop nop -.section .patch_EnKoInitCheckForest_1658F0 -.global EnKoInitCheckForest_1658F0_patch -EnKoInitCheckForest_1658F0_patch: +PATCH EnKoInitCheckForest_1658F0 bl hook_EnKoInitCheckForest nop nop -.section .patch_FireArrowCheckChestFlagOne -.global FireArrowCheckChestFlagOne_patch -FireArrowCheckChestFlagOne_patch: +PATCH FireArrowCheckChestFlagOne bl hook_FireArrowCheckChestFlag -.section .patch_FireArrowCheckChestFlagTwo -.global FireArrowCheckChestFlagTwo_patch -FireArrowCheckChestFlagTwo_patch: +PATCH FireArrowCheckChestFlagTwo bl hook_FireArrowCheckChestFlag -.section .patch_FireArrowRequirement -.global FireArrowRequirement_patch -FireArrowRequirement_patch: +PATCH FireArrowRequirement ldr r2, [r1,#0xEF4] nop tst r2,#0x400 -.section .patch_BusinessScrubCheckFlags -.global BusinessScrubCheckFlags_patch -BusinessScrubCheckFlags_patch: +PATCH BusinessScrubCheckFlags cpy r0,r4 bl EnShopnnuts_rCheckFlags cmp r0,#0x0 -.section .patch_BusinessScrubTable -.global BusinessScrubTable_patch -.global rScrubTable -BusinessScrubTable_patch: +PATCH BusinessScrubTable .word rScrubTable -.section .patch_KakarikoGateCheck -.global KakarikoGateCheck_patch -KakarikoGateCheck_patch: +PATCH KakarikoGateCheck bl hook_KakarikoGateCheck -.section .patch_FairyReward -.global FairyReward_patch -FairyReward_patch: +PATCH FairyReward cpy r0,r4 bl Cutscene_OverrideFairyReward b 0x3E75F8 -.section .patch_PoeCollectorGetFirstTextbox -.global PoeCollectorGetFirstTextbox_patch -PoeCollectorGetFirstTextbox_patch: +PATCH PoeCollectorGetFirstTextbox bl hook_PoeCollectorGetFirstTextbox -.section .patch_OcarinaMinigameRewardsOrder -.global OcarinaMinigameRewardsOrder_patch -OcarinaMinigameRewardsOrder_patch: +PATCH OcarinaMinigameRewardsOrder .word 0x76 .word 0x4D .word 0x4E -.section .patch_OcarinaMinigameEndAfterWin -.global OcarinaMinigameEndAfterWin_patch -OcarinaMinigameEndAfterWin_patch: +PATCH OcarinaMinigameEndAfterWin nop -.section .patch_ISGPutaway -.global ISGPutaway_patch -ISGPutaway_patch: +PATCH ISGPutaway bl hook_RestoreISG -.section .patch_ISGCrouchStab -.global ISGCrouchStab_patch -ISGCrouchStab_patch: +PATCH ISGCrouchStab bl hook_RestoreISG -.section .patch_ApplyDamageMultiplier -.global ApplyDamageMultiplier_patch -ApplyDamageMultiplier_patch: +PATCH ApplyDamageMultiplier bl hook_ApplyDamageMultiplier -.section .patch_SceneInitAfterCopyScenes -.global SceneInitAfterCopyScenes_patch -SceneInitAfterCopyScenes_patch: +PATCH SceneInitAfterCopyScenes b hook_SceneInitAfterCopyScenes -.section .patch_StoreChildBButtonEquip -.global StoreChildBButtonEquip_patch -StoreChildBButtonEquip_patch: +PATCH StoreChildBButtonEquip b hook_StoreChildBButtonEquip -.section .patch_AlwaysRestoreChildEquips -.global AlwaysRestoreChildEquips_patch -AlwaysRestoreChildEquips_patch: +PATCH AlwaysRestoreChildEquips nop -.section .patch_ChildDontEquipSwordSlotByDefault -.global ChildDontEquipSwordSlotByDefault_patch -ChildDontEquipSwordSlotByDefault_patch: +PATCH ChildDontEquipSwordSlotByDefault push {r1-r12, lr} bl SaveFile_RestoreChildEquips pop {r1-r12, lr} nop -.section .patch_LullabyCheckFlag -.global LullabyCheckFlag_patch -LullabyCheckFlag_patch: +PATCH LullabyCheckFlag bl hook_LullabyCheckFlag -.section .patch_FishingIgnoreTempBOne -.global FishingIgnoreTempBOne_patch -FishingIgnoreTempBOne_patch: +PATCH FishingIgnoreTempBOne b hook_FishingIgnoreTempBOne -.section .patch_FishingIgnoreTempBTwo -.global FishingIgnoreTempBTwo_patch -FishingIgnoreTempBTwo_patch: +PATCH FishingIgnoreTempBTwo b hook_FishingIgnoreTempBTwo -.section .patch_ItemGiveBombchuDropOne -.global ItemGiveBombchuDropOne_patch -ItemGiveBombchuDropOne_patch: +PATCH ItemGiveBombchuDropOne mov r1,#0x96 -.section .patch_ItemGiveBombchuDropTwo -.global ItemGiveBombchuDropTwo_patch -ItemGiveBombchuDropTwo_patch: +PATCH ItemGiveBombchuDropTwo mov r1,#0x96 -.section .patch_ConvertBombDropOne -.global ConvertBombDropOne_patch -ConvertBombDropOne_patch: +PATCH ConvertBombDropOne b hook_ConvertBombDropOne -.section .patch_ConvertBombDropTwo -.global ConvertBombDropTwo_patch -ConvertBombDropTwo_patch: +PATCH ConvertBombDropTwo b hook_ConvertBombDropTwo -.section .patch_BeanDaddyModifyBeansBought -.global BeanDaddyModifyBeansBought_patch -BeanDaddyModifyBeansBought_patch: +PATCH BeanDaddyModifyBeansBought bl hook_BeanDaddyModifyBeansBought -.section .patch_BeanDaddyModifyPrice -.global BeanDaddyModifyPrice_patch -BeanDaddyModifyPrice_patch: +PATCH BeanDaddyModifyPrice bl hook_BeanDaddyModifyPrice -.section .patch_BeanDaddyPurchase -.global BeanDaddyPurchase_patch -BeanDaddyTakeRupees_patch: +PATCH BeanDaddyPurchase bl EnMs_Purchase -.section .patch_CheckGerudoToken_18B368 -.global CheckGerudoToken_18B368_patch -CheckGerudoToken_18B368_patch: +PATCH CheckGerudoToken_18B368 push {r1-r12, lr} bl SaveFile_CheckGerudoToken pop {r1-r12, lr} cmp r0,#0x0 -.section .patch_CheckGerudoToken_18B3A0 -.global CheckGerudoToken_18B3A0_patch -CheckGerudoToken_18B3A0_patch: +PATCH CheckGerudoToken_18B3A0 push {r1-r12, lr} bl SaveFile_CheckGerudoToken pop {r1-r12, lr} cmp r0,#0x0 -.section .patch_CheckGerudoToken_18B3C0 -.global CheckGerudoToken_18B3C0_patch -CheckGerudoToken_18B3C0_patch: +PATCH CheckGerudoToken_18B3C0 push {r1-r12, lr} bl SaveFile_CheckGerudoToken pop {r1-r12, lr} cmp r0,#0x0 -.section .patch_CheckGerudoToken_18B448 -.global CheckGerudoToken_18B448_patch -CheckGerudoToken_18B448_patch: +PATCH CheckGerudoToken_18B448 push {r1-r12, lr} bl SaveFile_CheckGerudoToken pop {r1-r12, lr} cmp r0,#0x0 -.section .patch_CheckGerudoToken_18B6F4 -.global CheckGerudoToken_18B6F4_patch -CheckGerudoToken_18B6F4_patch: +PATCH CheckGerudoToken_18B6F4 bl hook_CheckGerudoToken cmp r0,#0x1 -.section .patch_CheckGerudoToken_18B710 -.global CheckGerudoToken_18B710_patch -CheckGerudoToken_18B710_patch: +PATCH CheckGerudoToken_18B710 bl hook_CheckGerudoToken cmp r0,#0x1 -.section .patch_CheckGerudoToken_1D7AD4 -.global CheckGerudoToken_1D7AD4_patch -CheckGerudoToken_1D7AD4_patch: +PATCH CheckGerudoToken_1D7AD4 bl hook_CheckGerudoToken cmp r0,#0x1 -.section .patch_CheckGerudoToken_269884 -.global CheckGerudoToken_269884_patch -CheckGerudoToken_269884_patch: +PATCH CheckGerudoToken_269884 bl hook_CheckGerudoToken cmp r0,#0x1 -.section .patch_MovableBlockSpeed +PATCH MovableBlockSpeed .word 0x40800000 -.section .patch_MovableBlockCooldownTimer -.global MovableBlockCooldownTimer_patch -MovableBlockCooldownTimer_patch: +PATCH MovableBlockCooldownTimer mov r0,#0x1 -.section .patch_MilkCrateSpeed +PATCH MilkCrateSpeed .word 0x40800000 -.section .patch_MilkCrateCooldownTimer -.global MilkCrateCooldownTimer_patch -MilkCrateCooldownTimer_patch: +PATCH MilkCrateCooldownTimer mov r0,#0x1 -.section .patch_AmyBlockSpeed +PATCH AmyBlockSpeed .word 0x40800000 -.section .patch_AmyBlockCooldownTimer -.global AmyBlockCooldownTimer_patch -AmyBlockCooldownTimer_patch: +PATCH AmyBlockCooldownTimer mov r1,#0x1 -.section .patch_FireBlockSpeed +PATCH FireBlockSpeed .word 0x3DCCCCCD -.section .patch_ArmosPushSpeed +PATCH ArmosPushSpeed .word 0x3F800000 -.section .patch_ArmosCooldownTimer +PATCH ArmosCooldownTimer mov r0,#0xC -.section .patch_ForestTempleBasementPuzzleDelay -.global ForestTempleBasementPuzzleDelay_patch -ForestTempleBasementPuzzleDelay_patch: +PATCH ForestTempleBasementPuzzleDelay cmp r0,#0x1 -.section .patch_CowBottleCheck -.global CowBottleCheck_patch -CowBottleCheck_patch: +PATCH CowBottleCheck bl hook_CowBottleCheck -.section .patch_CowItemOverride -.global CowItemOverride_patch -CowItemOverride_patch: +PATCH CowItemOverride b hook_CowItemOverride -.section .patch_AnjuCheckCuccoAmount -.global AnjuCheckCuccoAmount_patch -AnjuCheckCuccoAmount_patch: +PATCH AnjuCheckCuccoAmount b hook_AnjuCheckCuccoAmount -.section .patch_FrogReward -.global FrogReward_patch -FrogReward_patch: +PATCH FrogReward b hook_FrogReward -.section .patch_FrogRewardPurple -.global FrogRewardPurple_patch -FrogRewardPurple_patch: +PATCH FrogRewardPurple beq hook_FrogReward -.section .patch_CanPlayBombchuBowlingOne -.global CanPlayBombchuBowlingOne_patch -CanPlayBombchuBowlingOne_patch: +PATCH CanPlayBombchuBowlingOne bl hook_CanPlayBombchuBowling -.section .patch_CanPlayBombchuBowlingTwo -.global CanPlayBombchuBowlingTwo_patch -CanPlayBombchuBowlingTwo_patch: +PATCH CanPlayBombchuBowlingTwo bl hook_CanPlayBombchuBowling -.section .patch_BombchuBowlingAlwaysFirstPrize -.global BombchuBowlingAlwaysFirstPrize_patch -BombchuBowlingAlwaysFirstPrize_patch: +PATCH BombchuBowlingAlwaysFirstPrize mov r0,#0x0 -.section .patch_BombchuBowlingPrizeOrder -.global BombchuBowlingPrizeOrder_patch -BombchuBowlingPrizeOrder_patch: +PATCH BombchuBowlingPrizeOrder .word 0x0021CAFC .word 0x0021CB0C .word 0x0021CAF4 -.section .patch_CourtyardCheckForVisitedZeldaOne -.global CourtyardCheckForVisitedZeldaOne_patch -CourtyardCheckForVisitedZeldaOne_patch: +PATCH CourtyardCheckForVisitedZeldaOne ldreqh r0,[r0,#0xF4] -.section .patch_CourtyardCheckForVisitedZeldaTwo -.global CourtyardCheckForVisitedZeldaTwo_patch -CourtyardCheckForVisitedZeldaTwo_patch: +PATCH CourtyardCheckForVisitedZeldaTwo ldreqh r0,[r0,#0xF4] -.section .patch_ImpaInCourtyardCheckForVisitedZelda -.global ImpaInCourtyardCheckForVisitedZelda_patch -ImpaInCourtyardCheckForVisitedZelda_patch: +PATCH ImpaInCourtyardCheckForVisitedZelda ldrh r2,[r1,#0xF4] -.section .patch_LikeLikeNeverEatTunic -.global LikeLikeNeverEatTunic_patch -LikeLikeNeverEatTunic_patch: +PATCH LikeLikeNeverEatTunic b 0x355C48 -.section .patch_SwapFaroresWind -.global SwapFaroresWind_patch -SwapFaroresWind_patch: +PATCH SwapFaroresWind bl SaveFile_SwapFaroresWind nop -.section .patch_BombchuShopAlwaysOpen -.global BombchuShopAlwaysOpen_patch -BombchuShopAlwaysOpen_patch: +PATCH BombchuShopAlwaysOpen nop -.section .patch_BombchuCheapestPriceOne +PATCH BombchuCheapestPriceOne .word 0x0063FFFF -.section .patch_BombchuCheapestPriceTwo +PATCH BombchuCheapestPriceTwo .word 0x0063FFFF -.section .patch_BombchuCheapestPriceThree +PATCH BombchuCheapestPriceThree .word 0x0063FFFF -.section .patch_BombchuCheapestPriceFour +PATCH BombchuCheapestPriceFour .word 0x0063FFFF -.section .patch_BombchuPurchaseableCheck -.global BombchuPurchaseableCheck_patch -BombchuPurchaseableCheck_patch: +PATCH BombchuPurchaseableCheck bl Shop_CheckCanBuyBombchus nop nop nop -.section .patch_BombPurchaseableCheck -.global BombPurchaseableCheck_patch -BombPurchaseableCheck_patch: +PATCH BombPurchaseableCheck nop -.section .patch_BombchuShopInfinitePurchases -.global BombchuShopInfinitePurchases_patch -BombchuShopInfinitePurchases_patch: +PATCH BombchuShopInfinitePurchases b hook_BombchuShopInfinitePurchases -.section .patch_GanonBattleDeathWarp -.global GanonBattleDeathWarp_patch -GanonBattleDeathWarp_patch: +PATCH GanonBattleDeathWarp bl Entrance_DeathInGanonBattle -.section .patch_SlidingDoorDestroyCustomModels -.global SlidingDoorDestroyCustomModels_patch -SlidingDoorDestroyCustomModels_patch: +PATCH SlidingDoorDestroyCustomModels bl hook_SlidingDoorDestroyCustomModels -.section .patch_HandleDoorDestroyCustomModels -.global HandleDoorDestroyCustomModels_patch -HandleDoorDestroyCustomModels_patch: +PATCH HandleDoorDestroyCustomModels bl hook_HandleDoorDestroyCustomModels -.section .patch_DoorOfTimeOpenCutscene -.global DoorOfTimeOpenCutscene_patch -DoorOfTimeOpenCutscene_patch: +PATCH DoorOfTimeOpenCutscene add r0,r6,#0x100 ldrh r0,[r0,#0x4] cmp r0,#0x43 -.section .patch_DungeonCheckJabuMQBox -.global DungeonCheckJabuMQBox_patch -DungeonCheckJabuMQBox_patch: +PATCH DungeonCheckJabuMQBox bl hook_DungeonCheckJabuMQBox nop -.section .patch_JabuSwitchRutoCheck -.global JabuSwitchRutoCheck_patch -JabuSwitchRutoCheck_patch: +PATCH JabuSwitchRutoCheck bl hook_JabuSwitchRutoCheck -.section .patch_JabuBoxCheckRuto -.global JabuBoxCheckRuto_patch -JabuBoxCheckRuto_patch: +PATCH JabuBoxCheckRuto bl hook_JabuBoxCheckRuto -.section .patch_TalonGetCastleTextbox -.global TalonGetCastleTextbox_patch -TalonGetCastleTextbox_patch: +PATCH TalonGetCastleTextbox bl hook_TalonGetCastleTextbox -.section .patch_MidoCheckSpawn -.global MidoCheckSpawn_patch -MidoCheckSpawn_patch: +PATCH MidoCheckSpawn bl hook_MidoCheckSpawn beq 0x1661B8 b 0x1661A8 -.section .patch_MidoForestDialog -.global MidoForestDialog_patch -MidoForestDialog_patch: +PATCH MidoForestDialog nop nop nop nop bl hook_MidoForestDialog -.section .patch_MidoCheckDekuTreeClearOne -.global MidoCheckDekuTreeClearOne_patch -MidoCheckDekuTreeClearOne_patch: +PATCH MidoCheckDekuTreeClearOne nop nop bl hook_CheckDekuTreeClear -.section .patch_MidoCheckDekuTreeClearTwo -.global MidoCheckDekuTreeClearTwo_patch -MidoCheckDekuTreeClearTwo_patch: +PATCH MidoCheckDekuTreeClearTwo nop nop bl hook_CheckDekuTreeClear -.section .patch_MidoCheckDekuTreeClearThree -.global MidoCheckDekuTreeClearThree_patch -MidoCheckDekuTreeClearThree_patch: +PATCH MidoCheckDekuTreeClearThree nop nop bl hook_CheckDekuTreeClear -.section .patch_MidoCheckDekuTreeClearFour -.global MidoCheckDekuTreeClearFour_patch -MidoCheckDekuTreeClearFour_patch: +PATCH MidoCheckDekuTreeClearFour nop nop bl hook_CheckDekuTreeClear -.section .patch_CorrectCompassChests -.global CorrectCompassChests_patch -CorrectCompassChests_patch: +PATCH CorrectCompassChests bl hook_CheckCurrentDungeonMode -.section .patch_CorrectCompassChestsTwo -.global CorrectCompassChestsTwo_patch -CorrectCompassChestsTwo_patch: +PATCH CorrectCompassChestsTwo bl hook_CheckCurrentDungeonMode -.section .patch_FishingNewRecord -.global FishingNewRecord_patch -FishingNewRecord_patch: +PATCH FishingNewRecord mov r0,#0x0 cmp r0,#0x1 -.section .patch_FishingSizeIgnoreChild -.global FishingSizeIgnoreChild_patch -FishingSizeIgnoreChild_patch: +PATCH FishingSizeIgnoreChild nop -.section .patch_FishingSizeIgnoreAdult -.global FishingSizeIgnoreAdult_patch -FishingSizeIgnoreAdult_patch: +PATCH FishingSizeIgnoreAdult nop -.section .patch_TycoonWalletSize +PATCH TycoonWalletSize .word 0x03E701F4 -.section .patch_ReadGossipStoneHints -.global ReadGossipStoneHints_patch -ReadGossipStoneHints_patch: +PATCH ReadGossipStoneHints bl hook_CanReadHints nop nop nop nop -.section .patch_GossipStoneAddSariaHint -.global GossipStoneAddSariaHint_patch -GossipStoneAddSariaHint_patch: +PATCH GossipStoneAddSariaHint bl hook_GossipStoneAddSariaHint -.section .patch_GoronShopPurchaseableCheck -.global GoronShopPurchaseableCheck_patch -GoronShopPurchaseableCheck_patch: +PATCH GoronShopPurchaseableCheck nop -.section .patch_PlayerEditAndRetrieveCMB -.global PlayerEditAndRetrieveCMB_patch -PlayerEditAndRetrieveCMB_patch: +PATCH PlayerEditAndRetrieveCMB bl Player_EditAndRetrieveCMB -.section .patch_PlayerGetCustomTunicCMAB -.global PlayerGetCustomTunicCMAB_patch -PlayerGetCustomTunicCMAB_patch: +PATCH PlayerGetCustomTunicCMAB bl Player_GetCustomTunicCMAB -.section .patch_SetChildCustomTunic -.global SetChildCustomTunic_patch -SetChildCustomTunic_patch: +PATCH SetChildCustomTunic bne hook_SetChildCustomTunic -.section .patch_FastOwlCutscenes -.global FastOwlCutscenes_patch -FastOwlCutscenes_patch: +PATCH FastOwlCutscenes bl hook_FastOwlCutscenes -.section .patch_ShopItemDontSetAnimSpeedOne +PATCH ShopItemDontSetAnimSpeedOne nop -.section .patch_ShopItemDontSetAnimSpeedTwo +PATCH ShopItemDontSetAnimSpeedTwo nop -.section .patch_BugsRecatchable -.global BugsRecatchable_patch -BugsRecatchable_patch: +PATCH BugsRecatchable nop -.section .patch_SkipDaruniaDanceOne -.global SkipDaruniaDanceOne_patch -SkipDaruniaDanceOne_patch: +PATCH SkipDaruniaDanceOne nop -.section .patch_SkipDaruniaDanceTwo -.global SkipDaruniaDanceTwo_patch -SkipDaruniaDanceTwo_patch: +PATCH SkipDaruniaDanceTwo nop -.section .patch_SkipDaruniaDanceThree -.global SkipDaruniaDanceThree_patch -SkipDaruniaDanceThree_patch: +PATCH SkipDaruniaDanceThree nop -.section .patch_ShortenRainbowBridgeCS -.global ShortenRainbowBridgeCS_patch -ShortenRainbowBridgeCS_patch: +PATCH ShortenRainbowBridgeCS bl hook_ShortenRainbowBridgeCS -.section .patch_RemoveWaterfallCS -.global RemoveWaterfallCS_patch -RemoveWaterfallCS_patch: +PATCH RemoveWaterfallCS nop cpy r0,r10 add r1,r10,#0x800 @@ -1149,39 +774,25 @@ RemoveWaterfallCS_patch: ldr r2,[r6,#0x1A4] bl 0x36B940 -.section .patch_OwlMagicCheck -.global OwlMagicCheck_patch -OwlMagicCheck_patch: +PATCH OwlMagicCheck mov r0,#0x1 -.section .patch_ChestIceSmoke -.global ChestIceSmoke_patch -ChestIceSmoke_patch: +PATCH ChestIceSmoke b hook_Chest_OverrideIceSmoke -.section .patch_EnableFW -.global EnableFW_patch -EnableFW_patch: +PATCH EnableFW bl hook_EnableFW -.section .patch_FWKeepWarpPoint -.global FWKeepWarpPoint_patch -FWKeepWarpPoint_patch: +PATCH FWKeepWarpPoint blmi hook_FWUnset -.section .patch_FWLoadSet -.global FWLoadSet_patch -FWLoadSet_patch: +PATCH FWLoadSet ldr r2,[r1,#-0x668] -.section .patch_FWGetSet -.global FWGetSet_patch -FWGetSet_patch: +PATCH FWGetSet b hook_FWGetSet -.section .patch_SetSavewarpEntrance -.global SetSavewarpEntrance_patch -SetSavewarpEntrance_patch: +PATCH SetSavewarpEntrance bl hook_SetSavewarpEntrance .if _EUR_==1 b 0x44FD00 @@ -1189,9 +800,7 @@ SetSavewarpEntrance_patch: b 0x44FCE0 .endif -.section .patch_SetGameOverEntrance -.global SetGameOverEntrance_patch -SetGameOverEntrance_patch: +PATCH SetGameOverEntrance bl hook_SetGameOverEntrance .if _EUR_==1 b 0x458EE8 @@ -1199,785 +808,491 @@ SetGameOverEntrance_patch: b 0x458EC8 .endif -.section .patch_SetGameOverRespawnFlag -.global SetGameOverRespawnFlag_patch -SetGameOverRespawnFlag_patch: +PATCH SetGameOverRespawnFlag bl hook_SetGameOverRespawnFlag -.section .patch_SetSunsSongRespawnFlag -.global SetSunsSongRespawnFlag_patch -SetSunsSongRespawnFlag_patch: +PATCH SetSunsSongRespawnFlag bl hook_SetSunsSongRespawnFlag -.section .patch_SunsSongEndCloseTextbox -.global SunsSongsEndCloseTextbox_patch -SunsSongsEndCloseTextbox_patch: +PATCH SunsSongEndCloseTextbox beq hook_SunsSongEndCloseTextbox -.section .patch_SetSpecialVoidOutRespawnFlag -.global SetSpecialVoidOutRespawnFlag_patch -SetSpecialVoidOutRespawnFlag_patch: +PATCH SetSpecialVoidOutRespawnFlag bl hook_SetSpecialVoidOutRespawnFlag -.section .patch_SariasSongHintsOne -.global SariasSongHintsOne_patch -SariasSongHintsOne_patch: +PATCH SariasSongHintsOne bl Hints_GetNextSariasSongHint -.section .patch_SariasSongHintsTwo -.global SariasSongHintsTwo_patch -SariasSongHintsTwo_patch: +PATCH SariasSongHintsTwo bl Hints_GetNextSariasSongHint -.section .patch_ActorUpdate -.global ActorUpdate_patch -ActorUpdate_patch: +PATCH ActorUpdate bl hook_ActorUpdate -.section .patch_TitleCardUpdate -.global TitleCardUpdate_patch -TitleCardUpdate_patch: +PATCH TitleCardUpdate bl TitleCard_rUpdate -.section .patch_NoHealFromHealthUpgrades -.global NoHealFromHealthUpgrades_patch -NoHealFromHealthUpgrades_patch: +PATCH NoHealFromHealthUpgrades bl hook_NoHealFromHealthUpgrades -.section .patch_NoHealFromBombchuBowlingPrize -.global NoHealFromBombchuBowlingPrize_patch -NoHealFromBombchuBowlingPrize_patch: +PATCH NoHealFromBombchuBowlingPrize bl hook_NoHealFromBombchuBowlingPrize -.section .patch_FairyPickupHealAmount -.global FairyPickupHealAmount_patch -FairyPickupHealAmount_patch: +PATCH FairyPickupHealAmount bl hook_FairyPickupHealAmount -.section .patch_FairyReviveHealAmount -.global FairyReviveHealAmount_patch -FairyReviveHealAmount_patch: +PATCH FairyReviveHealAmount bl hook_FairyReviveHealAmount -.section .patch_FairyUseHealAmount -.global FairyUseHealAmount_patch -FairyUseHealAmount_patch: +PATCH FairyUseHealAmount bl hook_FairyUseHealAmount -.section .patch_MedigoronCheckFlagOne -.global MedigoronCheckFlagOne_patch -MedigoronCheckFlagOne_patch: +PATCH MedigoronCheckFlagOne b hook_MedigoronCheckFlagOne -.section .patch_MedigoronCheckFlagTwo -.global MedigoronCheckFlagTwo_patch -MedigoronCheckFlagTwo_patch: +PATCH MedigoronCheckFlagTwo b hook_MedigoronCheckFlagTwo -.section .patch_MedigoronSetRewardFlag -.global MedigoronSetRewardFlag_patch -MedigoronSetRewardFlag_patch: +PATCH MedigoronSetRewardFlag b hook_MedigoronSetRewardFlag -.section .patch_MedigoronGetCustomText -.global MedigoronGetCustomText_patch -MedigoronGetCustomText_patch: +PATCH MedigoronGetCustomText b hook_MedigoronGetCustomText nop -.section .patch_MedigoronItemOverrideOne -.global MedigoronItemOverrideOne_patch -MedigoronItemOverrideOne_patch: +PATCH MedigoronItemOverrideOne b hook_MedigoronItemOverrideOne -.section .patch_MedigoronItemOverrideTwo -.global MedigoronItemOverrideTwo_patch -MedigoronItemOverrideTwo_patch: +PATCH MedigoronItemOverrideTwo b hook_MedigoronItemOverrideTwo -.section .patch_CarpetSalesmanCheckFlagOne -.global CarpetSalesmanCheckFlagOne_patch -CarpetSalesmanCheckFlagOne_patch: +PATCH CarpetSalesmanCheckFlagOne bl hook_CarpetSalesmanCheckFlagOne -.section .patch_CarpetSalesmanCheckFlagTwo -.global CarpetSalesmanCheckFlagTwo_patch -CarpetSalesmanCheckFlagTwo_patch: +PATCH CarpetSalesmanCheckFlagTwo bl hook_CarpetSalesmanCheckFlagTwo -.section .patch_CarpetSalesmanSetFlag -.global CarpetSalesmanSetFlag_patch -CarpetSalesmanSetFlag_patch: +PATCH CarpetSalesmanSetFlag bl hook_CarpetSalesmanSetFlag -.section .patch_DoorOfTimeCheck -.global DoorOfTimeCheck_patch -DoorOfTimeCheck_patch: +PATCH DoorOfTimeCheck bl hook_DoorOfTimeCheck -.section .patch_SongOfTimeJingle -.global SongOfTimeJingle_patch -SongOfTimeJingle_patch: +PATCH SongOfTimeJingle bl hook_SongOfTimeJingle -.section .patch_GKSetDurability -.global GKSetDurability_patch -GKSetDurability_patch: +PATCH GKSetDurability b hook_GKSetDurability -.section .patch_TurboTextAdvance -.global TurboTextAdvance_patch -TurboTextAdvance_patch: +PATCH TurboTextAdvance bl hook_TurboTextAdvance -.section .patch_TurboTextClose -.global TurboTextClose_patch -TurboTextClose_patch: +PATCH TurboTextClose bl hook_TurboTextClose -.section .patch_TurboTextSignalNPC -.global TurboTextSignalNPC_patch -TurboTextSignalNPC_patch: +PATCH TurboTextSignalNPC bl hook_TurboTextSignalNPC -.section .patch_SkipSongReplays_TimeBlocksFix -.global SkipSongReplays_TimeBlocksFix_patch -SkipSongReplays_TimeBlocksFix_patch: +PATCH SkipSongReplays_TimeBlocksFix b hook_SkipSongReplays_TimeBlocksFix -.section .patch_ItemsMenuNumSprites -.global ItemsMenuNumSprites_patch -ItemsMenuNumSprites_patch: +PATCH ItemsMenuNumSprites mov r1,#0x19 -.section .patch_ItemsMenuDraw -.global ItemsMenuDraw_patch -ItemsMenuDraw_patch: +PATCH ItemsMenuDraw bl hook_ItemsMenuDraw -.section .patch_GearMenuEmptySlot -.global GearMenuEmptySlot_patch -GearMenuEmptySlot_patch: +PATCH GearMenuEmptySlot b hook_GearMenuEmptySlot -.section .patch_PreSwapBuffers -.global PreSwapBuffers_patch -PreSwapBuffers_patch: +PATCH PreSwapBuffers bl hook_Draw_PreSwapBuffers -.section .patch_SleepQueryCallback -.global SleepQueryCallback_patch -SleepQueryCallback_patch: +PATCH SleepQueryCallback b hook_Gfx_SleepQueryCallback -.section .patch_AwakeCallback -.global AwakeCallback_patch -AwakeCallback_patch: +PATCH AwakeCallback b hook_Gfx_AwakeCallback -.section .patch_AnjuGiveCojiro -.global AnjuGiveCojiro_patch -AnjuGiveCojiro_patch: +PATCH AnjuGiveCojiro .word EnNiwLady_rGiveCojiro -.section .patch_GrogCheckForShouldDespawn -.global GrogCheckForShouldDespawn_patch -GrogCheckForShouldDespawn_patch: +PATCH GrogCheckForShouldDespawn push {r0-r12, lr} cpy r0,r4 bl EnHs_CheckForShouldDespawn pop {r0-r12, lr} nop -.section .patch_GrogSetTradedCojiroFlag -.global GrogSetTradedCojiroFlag_patch -GrogSetTradedCojiroFlag_patch: +PATCH GrogSetTradedCojiroFlag .word EnHs_SetTradedCojiroFlag -.section .patch_CheckFadoCanSpawnInLostWoods -.global CheckFadoCanSpawnInLostWoods_patch -CheckFadoCanSpawnInLostWoods_patch: +PATCH CheckFadoCanSpawnInLostWoods push {r1-r12, lr} bl EnKo_CheckFadoCanSpawnInLostWoods pop {r1-r12, lr} -.section .patch_CarpenterBossSetTradedSawFlag -.global CarpenterBossSetTradedSawFlag_patch -CarpenterBossSetTradedSawFlag_patch: +PATCH CarpenterBossSetTradedSawFlag bl hook_CarpenterBossSetTradedSawFlag -.section .patch_CarpenterBossDontNullExchangeItem -.global CarpenterBossDontNullExchangeItem_patch -CarpenterBossDontNullExchangeItem_patch: +PATCH CarpenterBossDontNullExchangeItem nop -.section .patch_LabScientistDontStartTimerAndSetFlag -.global LabScientistDontStartTimerAndSetFlag_patch -LabScientistDontStartTimerAndSetFlag_patch: +PATCH LabScientistDontStartTimerAndSetFlag nop push {r0-r12, lr} bl EnMk_SetTradedEyeballFrogFlag pop {r0-r12, lr} nop -.section .patch_LabScientistIgnoreEyedropsInInventory -.global LabScientistIgnoreEyedropsInInventory_patch -LabScientistIgnoreEyedropsInInventory_patch: +PATCH LabScientistIgnoreEyedropsInInventory b 0x3F0B5C -.section .patch_KingZoraDontStartTimer -.global KingZoraDontStartTimer_patch -KingZoraDontStartTimer_patch: +PATCH KingZoraDontStartTimer nop nop nop nop nop -.section .patch_KingZoraSetTradedPrescriptionFlag -.global KingZoraSetTradedPrescriptionFlag_patch -KingZoraSetTradedPrescriptionFlag_patch: +PATCH KingZoraSetTradedPrescriptionFlag beq hook_KingZoraSetTradedPrescriptionFlag -.section .patch_CheckForWeirdEggHatchGameplayInit -.global CheckForWeirdEggHatchGameplayInit_patch -CheckForWeirdEggHatchGameplayInit_patch: +PATCH CheckForWeirdEggHatchGameplayInit bl SaveFile_CheckForWeirdEggHatch -.section .patch_CheckForPocketCuccoHatchGameplayInit -.global CheckForPocketCuccoHatchGameplayInit_patch -CheckForPocketCuccoHatchGameplayInit_patch: +PATCH CheckForPocketCuccoHatchGameplayInit bl SaveFile_CheckForPocketCuccoHatch -.section .patch_CheckForWeirdEggHatchKankyo -.global CheckForWeirdEggHatchKankyo_patch -CheckForWeirdEggHatchKankyo_patch: +PATCH CheckForWeirdEggHatchKankyo bl SaveFile_CheckForWeirdEggHatch -.section .patch_CheckForPocketCuccoHatchKankyo -.global CheckForPocketCuccoHatchKankyo_patch -CheckForPocketCuccoHatchKankyo_patch: +PATCH CheckForPocketCuccoHatchKankyo bl SaveFile_CheckForPocketCuccoHatch -.section .patch_SkipSongReplays_WarpBlocksFix -.global SkipSongReplays_WarpBlocksFix_patch -SkipSongReplays_WarpBlocksFix_patch: +PATCH SkipSongReplays_WarpBlocksFix b hook_SkipSongReplays_WarpBlocksFix -.section .patch_PlaySound -.global PlaySound_patch -PlaySound_patch: +PATCH PlaySound b hook_PlaySound -.section .patch_SetBGMEntrance -.global SetBGMEntrance_patch -SetBGMEntrance_patch: +PATCH SetBGMEntrance b hook_SetBGMEntrance -.section .patch_SetBGMDayNight -.global SetBGMDayNight_patch -SetBGMDayNight_patch: +PATCH SetBGMDayNight b hook_SetBGMDayNight -.section .patch_SetBGMEvent -.global SetBGMEvent_patch -SetBGMEvent_patch: +PATCH SetBGMEvent b hook_SetBGMEvent -.section .patch_SetSFX -.global SetSFX_patch -SetSFX_patch: +PATCH SetSFX b hook_SetSFX -.section .patch_GiantsKnifeWithoutKokiriSword -.global GiantsKnifeWithoutKokiriSword_patch -GiantsKnifeWithoutKokiriSword_patch: +PATCH GiantsKnifeWithoutKokiriSword cmp r3,#0x8 blt 0x376C54 -.section .patch_SkipTimeTravelCutsceneOne -.global SkipTimeTravelCutsceneOne_patch -SkipTimeTravelCutsceneOne_patch: +PATCH SkipTimeTravelCutsceneOne b hook_SkipTimeTravelCutsceneOne -.section .patch_SkipTimeTravelCutsceneTwo -.global SkipTimeTravelCutsceneTwo_patch -SkipTimeTravelCutsceneTwo_patch: +PATCH SkipTimeTravelCutsceneTwo bl hook_SkipTimeTravelCutsceneTwo -.section .patch_SwapAgeIgnoreSceneSetup -.global SwapAgeIgnoreSceneSetup_patch -SwapAgeIgnoreSceneSetup_patch: +PATCH SwapAgeIgnoreSceneSetup nop -.section .patch_SkipMasterSwordFanfare -.global SkipMasterSwordFanfare_patch -SkipMasterSwordFanfare_patch: +PATCH SkipMasterSwordFanfare bl hook_SkipMasterSwordFanfare -.section .patch_GameOverDontSpoilTradeItems -.global GameOverDontSpoilTradeItems_patch -GameOverDontSpoilTradeItems_patch: +PATCH GameOverDontSpoilTradeItems .if _EUR_==1 b 0x458CC0 .else b 0x458CA0 .endif -.section .patch_InterfaceDrawDontSpoilTradeItems -.global InterfaceDrawDontSpoilTradeItems_patch -InterfaceDrawDontSpoilTradeItems_patch: +PATCH InterfaceDrawDontSpoilTradeItems .if _EUR_==1 b 0x45A230 .else b 0x45A210 .endif -.section .patch_OpenSaveDontSpoilTradeItems -.global OpenSaveDontSpoilTradeItems_patch -OpenSaveDontSpoilTradeItems_patch: +PATCH OpenSaveDontSpoilTradeItems .if _EUR_==1 b 0x44FED8 .else b 0x44FEB8 .endif -.section .patch_EnteredLocation -.global EnteredLocation_patch -EnteredLocation_patch: +PATCH EnteredLocation bl hook_EnteredLocation -.section .patch_LostWoodsBridgeMusic -.global LostWoodsBridgeMusic_patch -LostWoodsBridgeMusic_patch: +PATCH LostWoodsBridgeMusic bl hook_LostWoodsBridgeMusic -.section .patch_BeforeLoadGame -.global BeforeLoadGame_patch -BeforeLoadGame_patch: +PATCH BeforeLoadGame b hook_BeforeLoadGame -.section .patch_AfterLoadGame -.global AfterLoadGame_patch -AfterLoadGame_patch: +PATCH AfterLoadGame b hook_AfterLoadGame -.section .patch_FileSelect_CopyFile -.global FileSelect_CopyFile_patch -FileSelect_CopyFile_patch: +PATCH FileSelect_CopyFile bl hook_FileSelect_CopyFile -.section .patch_SaveGame -.global .SaveGame_patch -SaveGame_patch: +PATCH SaveGame b hook_SaveGame -.section .patch_DontSetMotionSetting -.global .DontSetMotionSetting_patch -DontSetMotionSetting_patch: +PATCH DontSetMotionSetting nop -.section .patch_SaveMenuIgnoreOpen -.global SaveMenuIgnoreOpen_patch -SaveMenuIgnoreOpen_patch: +PATCH SaveMenuIgnoreOpen bl hook_SaveMenuIgnoreOpen -.section .patch_GameOverStart -.global GameOverStart_patch -GameOverStart_patch: +PATCH GameOverStart bl hook_GameOverStart -.section .patch_PermadeathSkipMenu -.global PermadeathSkipMenu_patch -PermadeathSkipMenu_patch: +PATCH PermadeathSkipMenu bl hook_PermadeathSkipMenu -.section .patch_PermadeathForceQuit -.global PermadeathForceQuit_patch -PermadeathForceQuit_patch: +PATCH PermadeathForceQuit bl hook_PermadeathForceQuit -.section .patch_OverrideFogDuringGameplayInit -.global OverrideFogDuringGameplayInit_patch -OverrideFogDuringGameplayInit_patch: +PATCH OverrideFogDuringGameplayInit bl hook_OverrideFogDuringGameplayInit -.section .patch_KotakeDontPlayBattleMusic -.global KotakeDontPlayBattleMusic_patch -KotakeDontPlayBattleMusic_patch: +PATCH KotakeDontPlayBattleMusic nop -.section .patch_SkipTwinrovaQuarrelCutsceneOne -.global SkipTwinrovaQuarrelCutsceneOne_patch -SkipTwinrovaQuarrelCutsceneOne_patch: +PATCH SkipTwinrovaQuarrelCutsceneOne sub r1,r1,#0x500 -.section .patch_SkipTwinrovaQuarrelCutsceneTwo -.global SkipTwinrovaQuarrelCutsceneTwo_patch -SkipTwinrovaQuarrelCutsceneTwo_patch: +PATCH SkipTwinrovaQuarrelCutsceneTwo bl hook_SkipTwinrovaQuarrelCutscene -.section .patch_FixItemsMenuSlotDuplication -.global FixItemsMenuSlotDuplication_patch -FixItemsMenuSlotDuplication_patch: +PATCH FixItemsMenuSlotDuplication b hook_FixItemsMenuSlotDuplication -.section .patch_PlayEntranceCutscene -.global PlayEntranceCutscene_patch -PlayEntranceCutscene_patch: +PATCH PlayEntranceCutscene b hook_PlayEntranceCutscene -.section .patch_SkipJabuOpeningCutscene -.global SkipJabuOpeningCutscene_patch -SkipJabuOpeningCutscene_patch: +PATCH SkipJabuOpeningCutscene bl hook_SkipJabuOpeningCutscene -.section .patch_MultiplyPlayerSpeed -.global MultiplyPlayerSpeed_patch -MultiplyPlayerSpeed_patch: +PATCH MultiplyPlayerSpeed bl hook_MultiplyPlayerSpeed -.section .patch_RunAnimationSpeed -.global RunAnimationSpeed_patch -RunAnimationSpeed_patch: +PATCH RunAnimationSpeed bl hook_RunAnimationSpeed -.section .patch_NaviNotifications -.global NaviNotifications_patch -NaviNotifications_patch: +PATCH NaviNotifications bl hook_NaviNotifications -.section .patch_ChestMinigame_RewardChestVisibility -.global ChestMinigame_RewardChestVisibility_patch -ChestMinigame_RewardChestVisibility_patch: +PATCH ChestMinigame_RewardChestVisibility .word 0x00000EC0 .word 0x00000EA0 -.section .patch_ChestMinigame_KeyChestVisibility -.global ChestMinigame_KeyChestVisibility_patch -ChestMinigame_KeyChestVisibility_patch: +PATCH ChestMinigame_KeyChestVisibility bl hook_ChestMinigame_KeyChestVisibility -.section .patch_ChestMinigame_DontOpenChestsOnInit -.global ChestMinigame_DontOpenChestsOnInit_patch -ChestMinigame_DontOpenChestsOnInit_patch: +PATCH ChestMinigame_DontOpenChestsOnInit bl hook_ChestMinigame_DontOpenChestsOnInit -.section .patch_GameplayDestroy -.global GameplayDestroy_patch -GameplayDestroy_patch: +PATCH GameplayDestroy bl hook_GameplayDestroy -.section .patch_SceneExitOverride -.global SceneExitOverride_patch -SceneExitOverride_patch: +PATCH SceneExitOverride bl hook_SceneExitOverride -.section .patch_SceneExitDynamicOverride -.global SceneExitDynamicOverride_patch -SceneExitDynamicOverride_patch: +PATCH SceneExitDynamicOverride bl hook_SceneExitDynamicOverride -.section .patch_OverrideGrottoActorEntrance -.global OverrideGrottoActorEntrance_patch -OverrideGrottoActorEntrance_patch: +PATCH OverrideGrottoActorEntrance b hook_OverrideGrottoActorEntrance -.section .patch_ReturnFW -.global ReturnFW_patch -ReturnFW_patch: +PATCH ReturnFW bl hook_ReturnFW -.section .patch_WarpSongEntranceOverride -.global WarpSongEntranceOverride_patch -WarpSongEntranceOverride_patch: +PATCH WarpSongEntranceOverride bl hook_WarpSongEntranceOverride -.section .patch_DMTOwlEntranceOverride -.global DMTOwlEntranceOverride_patch -DMTOwlEntranceOverride_patch: +PATCH DMTOwlEntranceOverride b hook_OwlEntranceOverride -.section .patch_LHOwlEntranceOverride -.global LHOwlEntranceOverride_patch -LHOwlEntranceOverride_patch: +PATCH LHOwlEntranceOverride b hook_OwlEntranceOverride -.section .patch_SavewarpSetRespawnFlag -.global SavewarpSetRespawnFlag_patch -SavewarpSetRespawnFlag_patch: +PATCH SavewarpSetRespawnFlag bl hook_SavewarpSetRespawnFlag -.section .patch_AdultItemsCMABsAsChild -.global AdultItemsCMABsAsChild_patch -AdultItemsCMABsAsChild_patch: +PATCH AdultItemsCMABsAsChild bl hook_AdultItemsCMABsAsChild -.section .patch_Model_EnableMeshGroupByIndex -.global Model_EnableMeshGroupByIndex_patch -Model_EnableMeshGroupByIndex_patch: +PATCH Model_EnableMeshGroupByIndex b hook_Model_EnableMeshGroupByIndex -.section .patch_NockArrow -.global NockArrow_patch -NockArrow_patch: +PATCH NockArrow bl hook_ArrowsOrSeeds -.section .patch_DecreaseArrowCount -.global DecreaseArrowCount_patch -DecreaseArrowCount_patch: +PATCH DecreaseArrowCount bl hook_ArrowsOrSeeds -.section .patch_HookshotDrawChain -.global HookshotDrawChain_patch -HookshotDrawChain_patch: +PATCH HookshotDrawChain b hook_HookshotDrawChain -.section .patch_HookshotRotation -.global HookshotRotation_patch -HookshotRotation_patch: +PATCH HookshotRotation bl hook_HookshotRotation -.section .patch_LinkReflection -.global LinkReflection_patch -LinkReflection_patch: +PATCH LinkReflection b hook_LinkReflection -.section .patch_ChildCanOpenBowSubMenu -.global ChildCanOpenBowSubMenu_patch -ChildCanOpenBowSubMenu_patch: +PATCH ChildCanOpenBowSubMenu b hook_ChildCanOpenBowSubMenu -.section .patch_RedBoulderExplode -.global RedBoulderExplode_patch -RedBoulderExplode_patch: +PATCH RedBoulderExplode b hook_RedBoulderExplode -.section .patch_Multiplayer_UpdatePrevActorFlags -.global Multiplayer_UpdatePrevActorFlags_patch -Multiplayer_UpdatePrevActorFlags_patch: +PATCH Multiplayer_UpdatePrevActorFlags bl hook_Multiplayer_UpdatePrevActorFlags -.section .patch_Multiplayer_OnLoadFile -.global Multiplayer_OnLoadFile_patch -Multiplayer_OnLoadFile_patch: +PATCH Multiplayer_OnLoadFile b hook_Multiplayer_OnLoadFile -.section .patch_SendDroppedBottleContents -.global SendDroppedBottleContents_patch -SendDroppedBottleContents_patch: +PATCH SendDroppedBottleContents bl hook_SendDroppedBottleContents -.section .patch_IgnoreMaskReaction -.global IgnoreMaskReaction_patch -IgnoreMaskReaction_patch: +PATCH IgnoreMaskReaction b hook_IgnoreMaskReaction -.section .patch_MasterQuestGoldSkulltulaCheck -.global MasterQuestGoldSkulltulaCheck_patch -MasterQuestGoldSkulltulaCheck_patch: +PATCH MasterQuestGoldSkulltulaCheck b hook_MasterQuestGoldSkulltulaCheck -.section .patch_WaterSpoutMasterQuestCheck -.global WaterSpoutMasterQuestCheck_patch -WaterSpoutMasterQuestCheck_patch: +PATCH WaterSpoutMasterQuestCheck bl hook_WaterSpoutMasterQuestCheck -.section .patch_PierreSoftlockFixOne -.global PierreSoftlockFixOne_patch -PierreSoftlockFixOne_patch: +PATCH PierreSoftlockFixOne pop {r3-r7,lr} bx lr -.section .patch_PierreSoftlockFixTwo -.global PierreSoftlockFixTwo_patch -PierreSoftlockFixTwo_patch: +PATCH PierreSoftlockFixTwo bl hook_PierreSoftlockFixTwo -.section .patch_PierreSoftlockFixThree -.global PierreSoftlockFixThree_patch -PierreSoftlockFixThree_patch: +PATCH PierreSoftlockFixThree nop nop nop nop -.section .patch_StoreTargetActorType -.global StoreTargetActorType_patch -StoreTargetActorType_patch: +PATCH StoreTargetActorType bl hook_StoreTargetActorType -.section .patch_SwordTrailDurationGrezzoFix -.global SwordTrailDurationGrezzoFix_patch -SwordTrailDurationGrezzoPatch_patch: +PATCH SwordTrailDurationGrezzoFix nop -.section .patch_ForceTrailEffectUpdate -.global ForceTrailEffectUpdate_patch -ForceTrailEffectUpdate_patch: +PATCH ForceTrailEffectUpdate blne hook_ForceTrailEffectUpdate -.section .patch_RainbowSwordTrail -.global RainbowSwordTrail_patch -RainbowSwordTrail_patch: +PATCH RainbowSwordTrail bl hook_RainbowSwordTrail -.section .patch_BoomerangTrailEffect -.global BoomerangTrailEffect_patch -BoomerangTrailEffect_patch: +PATCH BoomerangTrailEffect bl hook_BoomerangTrailEffect -.section .patch_RainbowChuTrailOne -.global RainbowChuTrailOne_patch -RainbowChuTrailOne_patch: +PATCH RainbowChuTrailOne bl hook_RainbowChuTrail -.section .patch_RainbowChuTrailTwo -.global RainbowChuTrailTwo_patch -RainbowChuTrailTwo_patch: +PATCH RainbowChuTrailTwo bl hook_RainbowChuTrail -.section .patch_FWandWarpSongTimerDepletion -.global FWandWarpSongTimerDepletion_patch -FWandWarpSongTimerDepletion_patch: +PATCH FWandWarpSongTimerDepletion push {lr} bl hook_FWandWarpSongTimerDepletion pop {lr} -.section .patch_TimerExpiration -.global TimerExpiration_patch -TimerExpiration_patch: +PATCH TimerExpiration bl hook_TimerExpiration -.section .patch_Timer2TickSound -.global Timer2TickSound_patch -Timer2TickSound_patch: +PATCH Timer2TickSound bl hook_Timer2TickSound -.section .patch_CurseTrapDizzyStick -.global CurseTrapDizzyStick_patch -CurseTrapDizzyStick_patch: +PATCH CurseTrapDizzyStick bl hook_CurseTrapDizzyStick -.section .patch_CurseTrapDizzyButtons -.global CurseTrapDizzyButtons_patch -CurseTrapDizzyButtons_patch: +PATCH CurseTrapDizzyButtons b hook_CurseTrapDizzyButtons -.section .patch_CrouchStabHitbox -.global CrouchStabHitbox_patch -CrouchStabHitbox_patch: +PATCH CrouchStabHitbox bl hook_CrouchStabHitbox -.section .patch_MasterSwordTimerCheck -.global MasterSwordTimerCheck_patch -MasterSwordTimerCheck_patch: +PATCH MasterSwordTimerCheck nop -.section .patch_BossChallenge_Enter -.global BossChallenge_Enter_patch -BossChallenge_Enter_patch: +PATCH BossChallenge_Enter bl hook_BossChallenge_Enter -.section .patch_BossChallenge_ExitMenu -.global BossChallenge_ExitMenu_patch -BossChallenge_ExitMenu_patch: +PATCH BossChallenge_ExitMenu bl hook_BossChallenge_ExitMenu -.section .patch_TruthSpinnerSpeed -.global TruthSpinnerSpeed_patch -TruthSpinnerSpeed_patch: +PATCH TruthSpinnerSpeed cmp r2,#0x20 strh r2,[r4,#0xC4] movgt r2,#0x20 -.section .patch_LostWoodsTargetCutscene -.global LostWoodsTargetCutscene_patch -LostWoodsTargetCutscene_patch: +PATCH LostWoodsTargetCutscene nop -.section .patch_LostWoodsTargetTimer -.global LostWoodsTargetTimer_patch -LostWoodsTargetTimer_patch: +PATCH LostWoodsTargetTimer mov r0,#0x1 -.section .patch_GrannyTextID -.global GrannyTextID_patch -GrannyTextID_patch: +PATCH GrannyTextID bl hook_GrannyTextID -.section .patch_GrannyBottleCheck -.global GrannyBottleCheck_patch -GrannyBottleCheck_patch: +PATCH GrannyBottleCheck bl hook_GrannyBottleCheck -.section .patch_GrannyItemOverrideOne -.global GrannyItemOverrideOne_patch -GrannyItemOverrideOne_patch: +PATCH GrannyItemOverrideOne bl hook_GrannyItemOverride -.section .patch_GrannyItemOverrideTwo -.global GrannyItemOverrideTwo_patch -GrannyItemOverrideTwo_patch: +PATCH GrannyItemOverrideTwo b hook_GrannyItemOverride -.section .patch_GrannySetRewardFlag -.global GrannySetRewardFlag_patch -GrannySetRewardFlag_patch: +PATCH GrannySetRewardFlag bl hook_GrannySetRewardFlag -.section .patch_BecomeAdult -.global BecomeAdult_patch -BecomeAdult_patch: +PATCH BecomeAdult push {lr} bl hook_BecomeAdult pop {lr} -.section .patch_PickUpMasterSword -.global PickUpMasterSword_patch -PickUpMasterSword_patch: +PATCH PickUpMasterSword bl Pedestal_PickUpMasterSword -.section .patch_SaveFileSwordless -.global SaveFileSwordless_patch -SaveFileSwordless_patch: +PATCH SaveFileSwordless push {lr} bl hook_HandleBButton pop {lr} -.section .patch_LoadFileSwordless -.global LoadFileSwordless_patch -LoadFileSwordless_patch: +PATCH LoadFileSwordless bl hook_LoadFileSwordless -.section .patch_DeathHandleBButton -.global DeathHandleBButton_patch -DeathHandleBButton_patch: +PATCH DeathHandleBButton push {lr} bl hook_HandleBButton pop {lr} -.section .patch_GanonCSEquipMS -.global GanonCSEquipMS_patch -GanonCSEquipMS_patch: +PATCH GanonCSEquipMS bl Ganon_CSEquipMS nop nop nop -.section .patch_GanonRestoreMSOnDeath -.global GanonRestoreMSOnDeath_patch -GanonRestoreMSOnDeath_patch: +PATCH GanonRestoreMSOnDeath bl hook_GanonRestoreMSOnDeath -.section .patch_GanonGiveMSMidFight -.global GanonGiveMSMidFight_patch -GanonGiveMSMidFight_patch: +PATCH GanonGiveMSMidFight bl Ganon_GiveMSMidFight -.section .patch_GiveItemMasterSword -.global GiveItemMasterSword_patch -GiveItemMasterSword_patch: +PATCH GiveItemMasterSword push {r0-r12,lr} bl ItemEffect_EquipMasterSword pop {r0-r12,lr} @@ -1986,583 +1301,359 @@ GiveItemMasterSword_patch: nop nop -.section .patch_CriticalHealthCheckOne -.global CriticalHealthCheckOne_Patch -CriticalHealthCheckOne_patch: +PATCH CriticalHealthCheckOne bl hook_CriticalHealthCheck nop nop nop nop -.section .patch_CriticalHealthCheckTwo -.global CriticalHealthCheckTwo_patch -CriticalHealthCheckTwo_patch: +PATCH CriticalHealthCheckTwo bl hook_CriticalHealthCheck nop nop nop nop -.section .patch_CriticalHealthCheckThree -.global CriticalHealthCheckThree_patch -CriticalHealthCheckThree_patch: +PATCH CriticalHealthCheckThree push {lr} bl hook_CriticalHealthCheck pop {lr} nop nop -.section .patch_InitSceneMirrorWorld -.global InitSceneMirrorWorld_patch -InitSceneMirrorWorld_patch: +PATCH InitSceneMirrorWorld bl hook_InitSceneMirrorWorld -.section .patch_InitSceneEntranceOverride -.global InitSceneEntranceOverride_patch -InitSceneEntranceOverride_patch: +PATCH InitSceneEntranceOverride bl hook_InitSceneEntranceOverride -.section .patch_CollisionATvsAC -.global CollisionATvsAC_patch -CollisionATvsAC_patch: +PATCH CollisionATvsAC bl hook_CollisionATvsAC -.section .patch_CollisionCheck_SetAC_Once -.global CollisionCheck_SetAC_Once_patch -CollisionCheck_SetAC_Once_patch: +PATCH CollisionCheck_SetAC_Once bl hook_CollisionCheck_SetAll_Once -.section .patch_CollisionCheck_SetAT_Once -.global CollisionCheck_SetAT_Once_patch -CollisionCheck_SetAT_Once_patch: +PATCH CollisionCheck_SetAT_Once bl hook_CollisionCheck_SetAll_Once -.section .patch_CollisionCheck_SetOC_Once -.global CollisionCheck_SetOC_Once_patch -CollisionCheck_SetOC_Once_patch: +PATCH CollisionCheck_SetOC_Once bl hook_CollisionCheck_SetAll_Once -.section .patch_GanonDrawMasterSword -.global GanonDrawMasterSword_patch -GanonDrawMasterSword_patch: +PATCH GanonDrawMasterSword bl hook_GanonDrawMasterSword -.section .patch_SetFWPlayerParams -.global SetFWPlayerParams_patch -SetFWPlayerParams_patch: +PATCH SetFWPlayerParams bl hook_SetFWPlayerParams -.section .patch_AboutToPickUpActor -.global AboutToPickUpActor_patch -AboutToPickUpActor_patch: +PATCH AboutToPickUpActor bl hook_AboutToPickUpActor -.section .patch_TargetReticleColor -.global TargetReticleColor_patch -TargetReticleColor_patch: +PATCH TargetReticleColor bl hook_TargetReticleColor -.section .patch_TargetPointerColor -.global TargetPointerColor_patch -TargetPointerColor_patch: +PATCH TargetPointerColor bl hook_TargetPointerColor -.section .patch_ShadowShip_CSTimer -.global ShadowShip_CSTimer_patch -ShadowShip_CSTimer_patch: +PATCH ShadowShip_CSTimer .word 0xC3 -.section .patch_ShadowShip_Speed -.global ShadowShip_Speed_patch -ShadowShip_Speed_patch: +PATCH ShadowShip_Speed bl hook_ShadowShip_Speed -.section .patch_MaskSalesmanCheckNoMaskOne -.global MaskSalesmanCheckNoMaskOne_patch -MaskSalesmanCheckNoMaskOne_patch: +PATCH MaskSalesmanCheckNoMaskOne push {r0,r1,r4-r12,lr} bl SaveFile_MaskSlotValue -.section .patch_MaskSalesmanCheckNoMaskTwo -.global MaskSalesmanCheckNoMaskTwo_patch -MaskSalesmanCheckNoMaskTwo_patch: +PATCH MaskSalesmanCheckNoMaskTwo cpy r2,r0 pop {r0,r1,r4-r12,lr} -.section .patch_MaskSalesmanBorrowMask -.global MaskSalesmanBorrowMask_patch -MaskSalesmanBorrowMask_patch: +PATCH MaskSalesmanBorrowMask bl hook_MaskSalesmanBorrowMask -.section .patch_MaskSalesmanGiveMaskOfTruth -.global MaskSalesmanGiveMaskOfTruth_patch -MaskSalesmanGiveMaskOfTruth_patch: +PATCH MaskSalesmanGiveMaskOfTruth bl hook_MaskSalesmanGiveMaskOfTruth -.section .patch_OoBBombchuOne -.global OoBBombchuOne_patch -OoBBombchuOne_patch: +PATCH OoBBombchuOne bl hook_OoBBombchuOne -.section .patch_OoBBombchuTwo -.global OoBBombchuTwo_patch -OoBBombchuTwo_patch: +PATCH OoBBombchuTwo bl hook_OoBBombchuTwo -.section .patch_OoBBombchuThree -.global OoBBombchuThree_patch -OoBBombchuThree_patch: +PATCH OoBBombchuThree bl hook_OoBBombchuThree -.section .patch_CamRoll -.global CamRoll_patch -CamRoll_patch: +PATCH CamRoll bl hook_CamRoll -.section .patch_CamUpdate -.global CamUpdate_patch -CamUpdate_patch: +PATCH CamUpdate bl hook_CamUpdate -.section .patch_Sheik_GetTextID -.global Sheik_GetTextID_patch -Sheik_GetTextID_patch: +PATCH Sheik_GetTextID b hook_Sheik_GetTextID -.section .patch_OnActorSetup_SceneChange -.global OnActorSetup_SceneChange_patch -OnActorSetup_SceneChange_patch: +PATCH OnActorSetup_SceneChange bl hook_OnActorSetup_SceneChange -.section .patch_AfterActorSetup_SceneChange -.global AfterActorSetup_SceneChange_patch -AfterActorSetup_SceneChange_patch: +PATCH AfterActorSetup_SceneChange b hook_AfterActorSetup_SceneChange -.section .patch_OnActorSetup_RoomChange -.global OnActorSetup_RoomChange_patch -OnActorSetup_RoomChange_patch: +PATCH OnActorSetup_RoomChange bl hook_OnActorSetup_RoomChange -.section .patch_AfterActorSetup_RoomChange -.global AfterActorSetup_RoomChange_patch -AfterActorSetup_RoomChange_patch: +PATCH AfterActorSetup_RoomChange b hook_AfterActorSetup_RoomChange -.section .patch_RandomGsLoc_CustomTangibilityCheck -.global RandomGsLoc_CustomTangibilityCheck_patch -RandomGsLoc_CustomTangibilityCheck_patch: +PATCH RandomGsLoc_CustomTangibilityCheck b hook_RandomGsLoc_CustomTangibilityCheck -.section .patch_RandomGsLoc_CustomTokenSpawnOffset -.global RandomGsLoc_CustomTokenSpawnOffset_patch -RandomGsLoc_CustomTokenSpawnOffset_patch: +PATCH RandomGsLoc_CustomTokenSpawnOffset bl hook_RandomGsLoc_CustomTokenSpawnOffset -.section .patch_RandomGsLoc_BlockSpawn_Crate -.global RandomGsLoc_BlockSpawn_Crate_patch -RandomGsLoc_BlockSpawn_Crate_patch: +PATCH RandomGsLoc_BlockSpawn_Crate bl hook_RandomGsLoc_BlockSpawn_Crate -.section .patch_RandomGsLoc_BlockSpawn_Tree -.global RandomGsLoc_BlockSpawn_Tree_patch -RandomGsLoc_BlockSpawn_Tree_patch: +PATCH RandomGsLoc_BlockSpawn_Tree bl hook_RandomGsLoc_BlockSpawn_Tree -.section .patch_RandomGsLoc_BlockSpawn_Soil -.global RandomGsLoc_BlockSpawn_Soil_patch -RandomGsLoc_BlockSpawn_Soil_patch: +PATCH RandomGsLoc_BlockSpawn_Soil bl hook_RandomGsLoc_BlockSpawn_Soil -.section .patch_RandomGsLoc_SkipSoilJingle -.global RandomGsLoc_SkipSoilJingle_patch -RandomGsLoc_SkipSoilJingle_patch: +PATCH RandomGsLoc_SkipSoilJingle bl hook_RandomGsLoc_SkipSoilJingle -.section .patch_ActorDraw -.global ActorDraw_patch -ActorDraw_patch: +PATCH ActorDraw bl hook_ActorDraw -.section .patch_FlyingPotCollision -.global FlyingPotCollision_patch -FlyingPotCollision_patch: +PATCH FlyingPotCollision bl hook_FlyingPotCollision -.section .patch_FlyingTileCollision -.global FlyingTileCollision_patch -FlyingTileCollision_patch: +PATCH FlyingTileCollision bl hook_FlyingTileCollision -.section .patch_ShabomAfterDamagePlayer -.global ShabomAfterDamagePlayer_patch -ShabomAfterDamagePlayer_patch: +PATCH ShabomAfterDamagePlayer bl hook_ShabomAfterDamagePlayer -.section .patch_DodongoAfterSwallowBomb -.global DodongoAfterSwallowBomb_patch -DodongoAfterSwallowBomb_patch: +PATCH DodongoAfterSwallowBomb bl hook_DodongoAfterSwallowBomb -.section .patch_BabyDodongoAfterSwallowBomb -.global BabyDodongoAfterSwallowBomb_patch -BabyDodongoAfterSwallowBomb_patch: +PATCH BabyDodongoAfterSwallowBomb bl hook_BabyDodongoAfterSwallowBomb -.section .patch_OcarinaNoteButtonsDraw -.global OcarinaNoteButtonsDraw_patch -OcarinaNoteButtonsDraw_patch: +PATCH OcarinaNoteButtonsDraw push {lr} bl hook_OcarinaNoteButtonsDraw pop {lr} -.section .patch_OcarinaNoteButtonsPress -.global OcarinaNoteButtonsPress_patch -OcarinaNoteButtonsPress_patch: +PATCH OcarinaNoteButtonsPress bl hook_OcarinaNoteButtonsPress -.section .patch_HandleTextControlCode -.global HandleTextControlCode_patch -HandleTextControlCode_patch: +PATCH HandleTextControlCode bl hook_HandleTextControlCode -.section .patch_CheckForTextControlCode -.global CheckForTextControlCode_patch -CheckForTextControlCode_patch: +PATCH CheckForTextControlCode bl hook_CheckForTextControlCode -.section .patch_PlayInit -.global PlayInit_patch -PlayInit_patch: +PATCH PlayInit bl hook_PlayInit -.section .patch_TitleLinkObject -.global TitleLinkObject_patch -TitleLinkObject_patch: +PATCH TitleLinkObject .word 0xFFFF0014 -.section .patch_ExtendObjectGetSlot -.global ExtendObjectGetSlot_patch -ExtendObjectGetSlot_patch: +PATCH ExtendObjectGetSlot b hook_ExtendObjectGetSlot -.section .patch_OverrideObjectIsLoaded -.global OverrideObjectIsLoaded_patch -OverrideObjectIsLoaded_patch: +PATCH OverrideObjectIsLoaded b hook_OverrideObjectIsLoaded -.section .patch_Cutscene_CheckObjectLoaded -.global Cutscene_CheckObjectLoaded_patch -Cutscene_CheckObjectLoaded_patch: +PATCH Cutscene_CheckObjectLoaded bl hook_OverrideObjectIsLoadedForCutscenes -.section .patch_AfterObjectListCommand -.global AfterObjectListCommand_patch -AfterObjectListCommand_patch: +PATCH AfterObjectListCommand bl hook_AfterObjectListCommand -.section .patch_GetObjectEntry_33AB24 -.global GetObjectEntry_33AB24_patch -GetObjectEntry_33AB24_patch: +PATCH GetObjectEntry_33AB24 bl hook_GetObjectEntry_33AB24 -.section .patch_GetObjectEntry_353CE4 -.global GetObjectEntry_353CE4_patch -GetObjectEntry_353CE4_patch: +PATCH GetObjectEntry_353CE4 bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_36A96C -.global GetObjectEntry_36A96C_patch -GetObjectEntry_36A96C_patch: +PATCH GetObjectEntry_36A96C bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_372F7C -.global GetObjectEntry_372F7C_patch -GetObjectEntry_372F7C_patch: +PATCH GetObjectEntry_372F7C bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnSiInit -.global GetObjectEntry_EnSiInit_patch -GetObjectEntry_EnSiInit_patch: +PATCH GetObjectEntry_EnSiInit bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnXcInit -.global GetObjectEntry_EnXcInit_patch -GetObjectEntry_EnXcInit_patch: +PATCH GetObjectEntry_EnXcInit bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_ObjSwitchInit -.global GetObjectEntry_ObjSwitchInit_patch -GetObjectEntry_ObjSwitchInit_patch: +PATCH GetObjectEntry_ObjSwitchInit bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_34FE68 -.global GetObjectEntry_34FE68_patch -GetObjectEntry_34FE68_patch: +PATCH GetObjectEntry_34FE68 bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_352F28 -.global GetObjectEntry_352F28_patch -GetObjectEntry_352F28_patch: +PATCH GetObjectEntry_352F28 bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_33A950 -.global GetObjectEntry_33A950_patch -GetObjectEntry_33A950_patch: +PATCH GetObjectEntry_33A950 bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnTiteInit -.global GetObjectEntry_EnTiteInit_patch -GetObjectEntry_EnTiteInit_patch: +PATCH GetObjectEntry_EnTiteInit bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_339DFC -.global GetObjectEntry_339DFC_patch -GetObjectEntry_339DFC_patch: +PATCH GetObjectEntry_339DFC bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnGomaInit_One -.global GetObjectEntry_EnGomaInit_One_patch -GetObjectEntry_EnGomaInit_One_patch: +PATCH GetObjectEntry_EnGomaInit_One bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnGomaInit_Two -.global GetObjectEntry_EnGomaInit_Two_patch -GetObjectEntry_EnGomaInit_Two_patch: +PATCH GetObjectEntry_EnGomaInit_Two bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnRdInit_One -.global GetObjectEntry_EnRdInit_One_patch -GetObjectEntry_EnRdInit_One_patch: +PATCH GetObjectEntry_EnRdInit_One bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnRdInit_Two -.global GetObjectEntry_EnRdInit_Two_patch -GetObjectEntry_EnRdInit_Two_patch: +PATCH GetObjectEntry_EnRdInit_Two bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_34F270 -.global GetObjectEntry_34F270_patch -GetObjectEntry_34F270_patch: +PATCH GetObjectEntry_34F270 b hook_GetObjectEntry_34F270 -.section .patch_GetObjectEntry_1F85B0 -.global GetObjectEntry_1F85B0_patch -GetObjectEntry_1F85B0_patch: +PATCH GetObjectEntry_1F85B0 bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_164BC8 -.global GetObjectEntry_164BC8_patch -GetObjectEntry_164BC8_patch: +PATCH GetObjectEntry_164BC8 bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnDekunutsInit -.global GetObjectEntry_EnDekunutsInit_patch -GetObjectEntry_EnDekunutsInit_patch: +PATCH GetObjectEntry_EnDekunutsInit bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnNutsballInit -.global GetObjectEntry_EnNutsballInit_patch -GetObjectEntry_EnNutsballInit_patch: +PATCH GetObjectEntry_EnNutsballInit bl hook_GetObjectEntry_Generic -.section .patch_GetObjectEntry_EnHintnutsInit -.global GetObjectEntry_EnHintnutsInit_patch -GetObjectEntry_EnHintnutsInit_patch: +PATCH GetObjectEntry_EnHintnutsInit bl hook_GetObjectEntry_Generic -.section .patch_AltHeadersCommand -.global AltHeadersCommand_patch -AltHeadersCommand_patch: +PATCH AltHeadersCommand bl hook_AltHeadersCommand -.section .patch_GohmaLarvaDeathSignalParent -.global GohmaLarvaDeathSignalParent_patch -GohmaLarvaDeathSignalParent_patch: +PATCH GohmaLarvaDeathSignalParent bl hook_GohmaLarvaDeathSignalParent -.section .patch_GohmaEggDeathSignalParent -.global GohmaEggDeathSignalParent_patch -GohmaEggDeathSignalParent_patch: +PATCH GohmaEggDeathSignalParent bl hook_GohmaEggDeathSignalParent -.section .patch_StalchildDespawn_13DB68 -.global StalchildDespawn_13DB68_patch -StalchildDespawn_13DB68_patch: +PATCH StalchildDespawn_13DB68 bl hook_StalchildDespawn_13DB68 -.section .patch_StalchildDespawn_366338 -.global StalchildDespawn_366338_patch -StalchildDespawn_366338_patch: +PATCH StalchildDespawn_366338 bl hook_StalchildDespawn_366338 -.section .patch_SkullwalltulaAttack_35F834 -.global SkullwalltulaAttack_35F834_patch -SkullwalltulaAttack_35F834_patch: +PATCH SkullwalltulaAttack_35F834 bl hook_SkullwalltulaAttack_35F834 -.section .patch_SkullwalltulaAttack_35F328 -.global SkullwalltulaAttack_35F328_patch -SkullwalltulaAttack_35F328_patch: +PATCH SkullwalltulaAttack_35F328 bl hook_SkullwalltulaAttack_35F328 -.section .patch_SkullwalltulaTargetRotation -.global SkullwalltulaTargetRotation_patch -SkullwalltulaTargetRotation_patch: +PATCH SkullwalltulaTargetRotation bl hook_SkullwalltulaTargetRotation -.section .patch_AnubisFlameCircleCheck -.global AnubisFlameCircleCheck_patch -AnubisFlameCircleCheck_patch: +PATCH AnubisFlameCircleCheck @ check alpha instead of timer ldrb r1,[r1,#0xAB] -.section .patch_SkullKidPoacherSawCheck -.global SkullKidPoacherSawCheck_patch -SkullKidPoacherSawCheck_patch: +PATCH SkullKidPoacherSawCheck bl hook_SkullKidPoacherSawCheck -.section .patch_LeeverSandCheck_Init -.global LeeverSandCheck_Init_patch -LeeverSandCheck_Init_patch: +PATCH LeeverSandCheck_Init bl hook_LeeverSandCheck -.section .patch_LeeverSandCheck_Small -.global LeeverSandCheck_Small_patch -LeeverSandCheck_Small_patch: +PATCH LeeverSandCheck_Small bl hook_LeeverSandCheck -.section .patch_LeeverSandCheck_Big -.global LeeverSandCheck_Big_patch -LeeverSandCheck_Big_patch: +PATCH LeeverSandCheck_Big bl hook_LeeverSandCheck -.section .patch_LeeverAfterSink -.global LeeverAfterSink_patch -LeeverAfterSink_patch: +PATCH LeeverAfterSink blt hook_LeeverAfterSink -.section .patch_LeeverAfterDie -.global LeeverAfterDie_patch -LeeverAfterDie_patch: +PATCH LeeverAfterDie bl hook_LeeverAfterDie -.section .patch_LeeverDontChangeCategory -.global LeeverDontChangeCategory_patch -LeeverDontChangeCategory_patch: +PATCH LeeverDontChangeCategory @ Big Leevers change category from Misc to Enemy in OoT. @ But in OoT3D they're already in the Enemy category @ from the start, so changing it is useless and can @ trigger room clears during Enemy Randomizer. nop -.section .patch_FlyingPotDontChangeCategory -.global FlyingPotDontChangeCategory_patch -FlyingPotDontChangeCategory_patch: +PATCH FlyingPotDontChangeCategory nop -.section .patch_PlayerCheckVoidOut -.global PlayerCheckVoidOut_patch -PlayerCheckVoidOut_patch: +PATCH PlayerCheckVoidOut bl hook_PlayerCheckVoidOut -.section .patch_EnBlkobj_SpawnDarkLink -.global EnBlkobj_SpawnDarkLink_patch -EnBlkobj_SpawnDarkLink_patch: +PATCH EnBlkobj_SpawnDarkLink bl hook_EnBlkobj_SpawnDarkLink -.section .patch_EnBlkobj_FindDarkLink -.global EnBlkobj_FindDarkLink_patch -EnBlkobj_FindDarkLink_patch: +PATCH EnBlkobj_FindDarkLink bl hook_EnBlkobj_FindDarkLink -.section .patch_EnEncount1_SpawnStalchildWolfos -.global EnEncount1_SpawnStalchildWolfos_patch -EnEncount1_SpawnStalchildWolfos_patch: +PATCH EnEncount1_SpawnStalchildWolfos bl hook_EnEncount1_SpawnStalchildWolfos -.section .patch_EnEncount1_SpawnLeever -.global EnEncount1_SpawnLeever_patch -EnEncount1_SpawnLeever_patch: +PATCH EnEncount1_SpawnLeever bl hook_EnEncount1_SpawnLeever -.section .patch_EnEncount1_SetLeeverAimType -.global EnEncount1_SetLeeverAimType_patch -EnEncount1_SetLeeverAimType_patch: +PATCH EnEncount1_SetLeeverAimType bl hook_EnEncount1_SetLeeverAimType -.section .patch_DarkLinkPlayerRecoil -.global DarkLinkPlayerRecoil_patch -DarkLinkPlayerRecoil_patch: +PATCH DarkLinkPlayerRecoil bl hook_DarkLinkPlayerRecoil -.section .patch_BabyDodongoWallCheck -.global BabyDodongoWallCheck_patch -BabyDodongoWallCheck_patch: +PATCH BabyDodongoWallCheck bl hook_BabyDodongoWallCheck -.section .patch_PeahatLarvaGroundCheck -.global PeahatLarvaGroundCheck_patch -PeahatLarvaGroundCheck_patch: +PATCH PeahatLarvaGroundCheck bl hook_PeahatLarvaGroundCheck -.section .patch_RedeadCanFreezePlayer -.global RedeadCanFreezePlayer_patch -RedeadCanFreezePlayer_patch: +PATCH RedeadCanFreezePlayer bl hook_RedeadCanFreezePlayer -.section .patch_DeadHandHandCanGrabPlayer -.global DeadHandHandCanGrabPlayer_patch -DeadHandHandCanGrabPlayer_patch: +PATCH DeadHandHandCanGrabPlayer bl hook_DeadHandHandCanGrabPlayer -.section .patch_GerudoBattleMusic -.global GerudoBattleMusic_patch -GerudoBattleMusic_patch: +PATCH GerudoBattleMusic bl hook_GerudoBattleMusic -.section .patch_FixActorKillLoop -.global FixActorKillLoop_patch -FixActorKillLoop_patch: +PATCH FixActorKillLoop bl hook_FixActorKillLoop -.section .patch_AfterInvalidatingRoomObjects -.global AfterInvalidatingRoomObjects_patch -AfterInvalidatingRoomObjects_patch: +PATCH AfterInvalidatingRoomObjects bl hook_AfterInvalidatingRoomObjects -.section .patch_DrawHeartIcon -.global DrawHeartIcon_patch -DrawHeartIcon_patch: +PATCH DrawHeartIcon bl hook_DrawHeartIcon -.section .patch_OcarinaNoteSound_Player -.global OcarinaNoteSound_Player_patch -OcarinaNoteSound_Player_patch: +PATCH OcarinaNoteSound_Player b hook_OcarinaNoteSound_Player -.section .patch_OcarinaNoteSound_Npc -.global OcarinaNoteSound_Npc_patch -OcarinaNoteSound_Npc_patch: +PATCH OcarinaNoteSound_Npc bl hook_OcarinaNoteSound_Npc -.section .patch_Item00GiveAutomaticItemDrop -.global Item00GiveAutomaticItemDrop_patch -Item00GiveAutomaticItemDrop_patch: +PATCH Item00GiveAutomaticItemDrop bl hook_Item00GiveAutomaticItemDrop -.section .patch_Item00GiveCollectedItemDrop -.global Item00GiveCollectedItemDrop_patch -Item00GiveCollectedItemDrop_patch: +PATCH Item00GiveCollectedItemDrop bl hook_Item00GiveCollectedItemDrop -.section .patch_GanonFinalBlow -.global GanonFinalBlow_patch -GanonFinalBlow_patch: +PATCH GanonFinalBlow bl hook_GanonFinalBlow -.section .patch_PlayerBonk -.global PlayerBonk_patch -PlayerBonk_patch: +PATCH PlayerBonk bl hook_PlayerBonk From bb4cebd4b01c5a965ab8574c1b89489337275327 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Sat, 28 Mar 2026 10:23:28 +0100 Subject: [PATCH 3/9] Remove some unused stuff --- code/include/z3D/z3D.h | 1 - code/include/z3D/z3Dequipment.h | 45 --------------------------------- code/src/asm/patches.s | 3 --- code/src/cutscenes.c | 5 ---- 4 files changed, 54 deletions(-) delete mode 100644 code/include/z3D/z3Dequipment.h diff --git a/code/include/z3D/z3D.h b/code/include/z3D/z3D.h index 4dca4b0c..dd938bb6 100644 --- a/code/include/z3D/z3D.h +++ b/code/include/z3D/z3D.h @@ -4,7 +4,6 @@ #include #include "z3Dactor.h" #include "z3Dvec.h" -// #include "z3Dequipment.h" #include "z3Dcutscene.h" #include "z3Ditem.h" #include "z3Dmath.h" diff --git a/code/include/z3D/z3Dequipment.h b/code/include/z3D/z3Dequipment.h deleted file mode 100644 index 9b0eb543..00000000 --- a/code/include/z3D/z3Dequipment.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _Z3DEQUIPMENT_H_ -#define _Z3DEQUIPMENT_H_ - -enum { - NO_BULLET_BAG = 0, - BULLET_BAG_30 = 1, - BULLET_BAG_40 = 2, - BULLET_BAG_50 = 3, -} BulletBag; - -enum { - NO_QUIVER = 0, - QUIVER_30 = 1, - QUIVER_40 = 2, - QUIVER_50 = 3, -} Quiver; - -enum { - NO_BOMB_BAG = 0, - BOMB_BAG_20 = 1, - BOMB_BAG_30 = 2, - BOMB_BAG_40 = 3, -} BombBag; - -enum { - NO_STRENGTH = 0, - GORON_BRACELET = 1, - SILVER_GAUNTLETS = 2, - GOLDEN_GAUNTLETS = 3, -} Strength; - -enum { - NO_DIVE_UPGRADE = 0, - SILVER_SCALE = 1, - GOLDEN_SCALE = 2, -} DiveMeter; - -enum { - DEFAULT_WALLET = 0, - ADULTS_WALLET = 1, - GIANTS_WALLET = 2, - NO_RUPEES_SHOWN = 3, -} Wallet; - -#endif diff --git a/code/src/asm/patches.s b/code/src/asm/patches.s index d9a258b7..50afd081 100644 --- a/code/src/asm/patches.s +++ b/code/src/asm/patches.s @@ -25,9 +25,6 @@ PATCH IncomingGetItemID PATCH SaveFile_Init bl hook_SaveFile_Init -PATCH OverrideOcarinaSongs - bl Cutscene_OverrideOcarinaSongs - PATCH OverrideTextID b hook_OverrideTextID diff --git a/code/src/cutscenes.c b/code/src/cutscenes.c index 97b78243..8ff37766 100644 --- a/code/src/cutscenes.c +++ b/code/src/cutscenes.c @@ -6,11 +6,6 @@ #include "z3D/actors/z_bg_dy_yoseizo.h" #include -// Patched over call to Item_Give -void Cutscene_OverrideOcarinaSongs(GlobalContext* GlobalContext, ItemID songId) { - ItemOverride_PushDelayedOverride(songId - ITEM_SONG_MINUET + 0x20); // TODO remove the hardcoded constant? -} - u32 LACS_ConditionVanilla(void) { return ((gSaveContext.questItems & 0x8) && (gSaveContext.questItems & 0x10)); } From 0b6db850f5357ae951fabda527e42c2d3493d2fb Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:20:26 +0200 Subject: [PATCH 4/9] Update linker script structure --- code/ld_addr.py | 113 ++ code/linker_script_patch.py | 76 -- code/oot.ld | 2426 ++++++++--------------------------- code/patch.py | 3 + 4 files changed, 629 insertions(+), 1989 deletions(-) create mode 100644 code/ld_addr.py delete mode 100644 code/linker_script_patch.py diff --git a/code/ld_addr.py b/code/ld_addr.py new file mode 100644 index 00000000..bf68db68 --- /dev/null +++ b/code/ld_addr.py @@ -0,0 +1,113 @@ +# This script adds a new symbol or patch address to the linker script, checking that the order is correct. +# When creating a patch, it also adds template asm instructions to the relevant files. +# Use by passing, in any order, `s` or `p` for Symbol or Patch, the hexadecimal address and a name (e.g. `p 0x4352F4 PlayInit`). +# Call with no arguments to just check the address order in the linker script. + +import sys, re +from pathlib import Path + +TYPE_PATCH = 'p' +TYPE_SYMBOL = 's' + +newAddress = None +newName = None +type = None + +if len(sys.argv) > 1: + # interpret passed arguments + for arg in sys.argv[1:]: + if arg in [TYPE_PATCH, TYPE_SYMBOL]: + type = arg + else: + try: + newAddress = int(arg, 16) + except ValueError: + newName = arg + + # require values for missing parameters + while type != TYPE_PATCH and type != TYPE_SYMBOL: + type = input('Symbol or Patch? [s/p]: ') + while not newName: + newName = input('Insert name for the new %s' % ('patch: patch_' if type == TYPE_PATCH else 'symbol: ')) + while not newAddress: + addressString = input('Insert address (hexadecimal): ') + try: + newAddress = int(addressString, 16) + except ValueError: + print('Invalid value') + + +LD_SYM_TEMPLATE='''\ + %s = 0x%X + _LD_OFF;\ +''' + +LD_PATCH_TEMPLATE='''\ + .patch_%s 0x%X + _LD_OFF : { *(.patch_%s) }\ +''' + +ASM_PATCH_TEMPLATE=''' +PATCH %s + bl hook_%s +''' + +ASM_HOOK_TEMPLATE=''' +HOOK %s + push {r0-r12, lr} + bl %s + pop {r0-r12, lr} + cpy r0,r0 + bx lr +''' + +lastAddress = 0 +insertIndex = 0 + +ldFile = Path('oot.ld') +ldLines = ldFile.read_text().splitlines() +for lineIndex, line in enumerate(ldLines): + # Search lines with memory addresses + result = re.search(r'0x[a-fA-F0-9]{6,}', line) + if not result: + continue + addressString = result.group(0) + address = int(addressString, 16) + # Detect errors in the address order + if lastAddress > address: + sys.exit('Order error detected: line %d, address %s' % (lineIndex, addressString)) + lastAddress = address + if not newAddress: + continue + # Check existing addresses for potential conflicts + if (type == TYPE_PATCH if '.patch_' in line else type == TYPE_SYMBOL): + typeString = 'patch' if type == TYPE_PATCH else 'symbol' + if address == newAddress: + sys.exit('ERROR: another %s is at the same address [0x%X]' % (typeString, address)) + if abs(address - newAddress) < 0x10: + print('WARNING: another %s is at nearby address [0x%X]' % (typeString, address)) + # Select this line index for inserting new address, but continue loop to keep checking order + if not insertIndex and address > newAddress: + if '/*' in line and ldLines[lineIndex - 1] == '': + insertIndex = lineIndex - 1 + else: + insertIndex = lineIndex + +# Add the new address +if newAddress: + if type == TYPE_PATCH: + newLine = LD_PATCH_TEMPLATE % (newName, newAddress, newName) + else: + newLine = LD_SYM_TEMPLATE % (newName, newAddress) + ldLines.insert(insertIndex, newLine) + ldFile.write_text('\n'.join(ldLines) + '\n', newline='') + +if not newAddress: + print('Order is correct') +elif type == TYPE_PATCH: + # Add the template asm to `patches.s` and `hooks.s` + with open('src/asm/patches.s', 'a', newline='') as file: + file.write(ASM_PATCH_TEMPLATE % (newName, newName)) + with open('src/asm/hooks.s', 'a', newline='') as file: + file.write(ASM_HOOK_TEMPLATE % (newName, newName)) + print('Patch added') +else: + print('Symbol added') diff --git a/code/linker_script_patch.py b/code/linker_script_patch.py deleted file mode 100644 index 9d933c2b..00000000 --- a/code/linker_script_patch.py +++ /dev/null @@ -1,76 +0,0 @@ -# This script adds a new patch to `oot.ld`, checking that the address order is correct. -# It also adds template asm instructions to `patches.s` and `hooks.s`. -# Use by passing the hexadecimal address and the patch name (e.g. `0x4352F4 PlayInit`), -# or no arguments to just check the address order in `oot.ld`. - -import sys, re - -newPatchAddress = int(sys.argv[1], 16) if len(sys.argv) > 1 else None -newPatchName = sys.argv[2] if len(sys.argv) > 2 else None - -LD_PATCH_TEMPLATE='''\ - .patch_%s 0x%X %s: { - *(.patch_%s) - } - -''' - -ASM_PATCH_TEMPLATE=''' -.section .patch_%s -.global %s_patch -%s_patch: - bl hook_%s -''' - -ASM_HOOK_TEMPLATE=''' -.global hook_%s -hook_%s: - push {r0-r12, lr} - bl %s - pop {r0-r12, lr} - cpy r0,r0 - bx lr -''' - -lastAddress = 0 -isOrderCorrect = True -insertIndex = 0 - -with open('oot.ld', 'r+', newline='') as file: - lines = file.readlines() - for lineIndex, line in enumerate(lines): - # Search lines with memory addresses - result = re.search("0x[a-f-A-F0-9]{6,}", line) - if result: - addressString = result.group(0) - address = int(addressString, 16) - # Detect errors in the patches order - if lastAddress > address: - print('Order error detected: line %d, address %s' % (lineIndex, addressString)) - isOrderCorrect=False - lastAddress = address - # Choose where the new patch will be added - if newPatchAddress: - if abs(address - newPatchAddress) < 0x10: - print('WARNING: another patch is at address 0x%X' % address) - if not insertIndex and address > newPatchAddress: - insertIndex = lineIndex - # Add the new patch if no errors have been detected - if newPatchAddress and isOrderCorrect: - if not newPatchName: - newPatchName = input('Insert name for the new patch: patch_') - regionOffsetString = '+ region_offset ' if newPatchAddress >= 0x41A144 and newPatchAddress < 0x4A5AE0 else '' - lines.insert(insertIndex, LD_PATCH_TEMPLATE % (newPatchName, newPatchAddress, regionOffsetString, newPatchName)) - file.seek(0) - file.writelines(lines) - -if isOrderCorrect: - if not newPatchAddress: - print('Order is correct') - else: - # Add the template asm to `patches.s` and `hooks.s` - with open('src/asm/patches.s', 'a', newline='') as file: - file.write(ASM_PATCH_TEMPLATE % (newPatchName, newPatchName, newPatchName, newPatchName)) - with open('src/asm/hooks.s', 'a', newline='') as file: - file.write(ASM_HOOK_TEMPLATE % (newPatchName, newPatchName, newPatchName)) - print('Patch added') diff --git a/code/oot.ld b/code/oot.ld index 489fe927..961b2679 100644 --- a/code/oot.ld +++ b/code/oot.ld @@ -3,1932 +3,532 @@ OUTPUT_ARCH(arm) ENTRY(loader_patch) SECTIONS { - . = 0x100000; - .patch_loader 0x100000 : { - *(.patch_loader) - } - - .patch_GrogSetTradedCojiroFlag 0x104C50 : { - *(.patch_GrogSetTradedCojiroFlag) - } - - .patch_MidoCheckDekuTreeClearTwo 0x105CD4 : { - *(.patch_MidoCheckDekuTreeClearTwo) - } - - .patch_ArmosCooldownTimer 0x10B41C : { - *(.patch_ArmosCooldownTimer) - } - - .patch_ArmosPushSpeed 0x10B5C4 : { - *(.patch_ArmosPushSpeed) - } - - .patch_ShortenRainbowBridgeCS 0x10B904 : { - *(.patch_ShortenRainbowBridgeCS) - } - - .patch_GrannyTextID 0x10DCD0 : { - *(.patch_GrannyTextID) - } - - .patch_LabScientistDontStartTimerAndSetFlag 0x112440 : { - *(.patch_LabScientistDontStartTimerAndSetFlag) - } - - .patch_BombchuPurchaseableCheck 0x112ED0 : { - *(.patch_BombchuPurchaseableCheck) - } - - .patch_PoeCollectorGetFirstTextbox 0x113844 : { - *(.patch_PoeCollectorGetFirstTextbox) - } - - .patch_ItemEtceteraModelDraw 0x117080 : { - *(.patch_ItemEtceteraModelDraw) - } - - .patch_FlyingPotCollision 0x11DB34 : { - *(.patch_FlyingPotCollision) - } - - .patch_DodongoAfterSwallowBomb 0x11E4B8 : { - *(.patch_DodongoAfterSwallowBomb) - } - - .patch_SariasSongItemGive 0x12C84C : { - *(.patch_SariasSongItemGive) - } - - .patch_SariasSongLocation 0x12C8F8 : { - *(.patch_SariasSongLocation) - } - - .patch_SkulltulaRewardOne 0x12CC68 : { - *(.patch_SkulltulaRewardOne) - } - - .patch_SkulltulaRewardTwo 0x12CD38 : { - *(.patch_SkulltulaRewardTwo) - } - - .patch_MedigoronCheckFlagOne 0x13024C : { - *(.patch_MedigoronCheckFlagOne) - } - - .patch_MedigoronGetCustomText 0x130258 : { - *(.patch_MedigoronGetCustomText) - } - - .patch_MedigoronCheckFlagTwo 0x1302C4 : { - *(.patch_MedigoronCheckFlagTwo) - } - - .patch_BeanDaddyModifyBeansBought 0x130CEC : { - *(.patch_BeanDaddyModifyBeansBought) - } - - .patch_PlayerCheckVoidOut 0x132B64 : { - *(.patch_PlayerCheckVoidOut) - } - - .patch_BiggoronDontSetBGSFlag 0x133F7C : { - *(.patch_BiggoronDontSetBGSFlag) - } - - .patch_KingZoraDontStartTimer 0x134D7C : { - *(.patch_KingZoraDontStartTimer) - } - - .patch_GanonFinalBlow 0x13B684 : { - *(.patch_GanonFinalBlow) - } - - .patch_StalchildDespawn_13DB68 0x13DB68 : { - *(.patch_StalchildDespawn_13DB68) - } - - .patch_SongOfStormsLocation 0x1427E0 : { - *(.patch_SongOfStormsLocation) - } - - .patch_JabuSwitchRutoCheck 0x143AC8 : { - *(.patch_JabuSwitchRutoCheck) - } - - .patch_OwlMagicCheck 0x144B44 : { - *(.patch_OwlMagicCheck) - } - - .patch_MedigoronItemOverrideOne 0x14D95C : { - *(.patch_MedigoronItemOverrideOne) - } - - .patch_BeanDaddyPurchase 0x14EDA8 : { - *(.patch_BeanDaddyPurchase) - } - - .patch_BeanDaddyModifyPrice 0x14EE98 : { - *(.patch_BeanDaddyModifyPrice) - } - - .patch_SkipTwinrovaQuarrelCutsceneOne 0x15273C : { - *(.patch_SkipTwinrovaQuarrelCutsceneOne) - } - - .patch_FairyPickupHealAmount 0x15CA4C : { - *(.patch_FairyPickupHealAmount) - } - - .patch_RandomGsLoc_SkipSoilJingle 0x15DBD8 : { - *(.patch_RandomGsLoc_SkipSoilJingle) - } - - .patch_GrannyBottleCheck 0x161044 : { - *(.patch_GrannyBottleCheck) - } - - .patch_GrannyItemOverrideOne 0x161094 : { - *(.patch_GrannyItemOverrideOne) - } - - .patch_ScrubStickUpgradeOne 0x161898 : { - *(.patch_ScrubStickUpgradeOne) - } - - .patch_ScrubNutUpgradeOne 0x1618EC : { - *(.patch_ScrubNutUpgradeOne) - } - - .patch_GrogCheckForShouldDespawn 0x16485C : { - *(.patch_GrogCheckForShouldDespawn) - } - - .patch_GetObjectEntry_164BC8 0x164BC8 : { - *(.patch_GetObjectEntry_164BC8) - } - - .patch_CheckFadoCanSpawnInLostWoods 0x1657EC : { - *(.patch_CheckFadoCanSpawnInLostWoods) - } - - .patch_EnKoInitCheckForest_165834 0x165834 : { - *(.patch_EnKoInitCheckForest_165834) - } - - .patch_EnKoInitCheckForest_165878 0x165878 : { - *(.patch_EnKoInitCheckForest_165878) - } - - .patch_EnKoInitCheckForest_1658C0 0x1658C0 : { - *(.patch_EnKoInitCheckForest_1658C0) - } - - .patch_EnKoInitCheckForest_1658F0 0x1658F0 : { - *(.patch_EnKoInitCheckForest_1658F0) - } - - .patch_KingZoraCheckMovedFlag 0x165A60 : { - *(.patch_KingZoraCheckMovedFlag) - } - - .patch_MidoCheckSpawn 0x166154 : { - *(.patch_MidoCheckSpawn) - } - - .patch_MidoCheckDekuTreeClearOne 0x16623C : { - *(.patch_MidoCheckDekuTreeClearOne) - } - - .patch_GetObjectEntry_EnRdInit_One 0x167DA4 : { - *(.patch_GetObjectEntry_EnRdInit_One) - } - - .patch_GetObjectEntry_EnRdInit_Two 0x167E38 : { - *(.patch_GetObjectEntry_EnRdInit_Two) - } - - .patch_SariasSongCheckFlag 0x1686A0 : { - *(.patch_SariasSongCheckFlag) - } - - .patch_GetObjectEntry_EnSiInit 0x168B20 : { - *(.patch_GetObjectEntry_EnSiInit) - } - - .patch_RandomGsLoc_BlockSpawn_Tree 0x16C43C : { - *(.patch_RandomGsLoc_BlockSpawn_Tree) - } - - .patch_MedigoronSetRewardFlag 0x16C918 : { - *(.patch_MedigoronSetRewardFlag) - } - - .patch_MedigoronItemOverrideTwo 0x16C9BC : { - *(.patch_MedigoronItemOverrideTwo) - } - - .patch_MaskSalesmanBorrowMask 0x16D148 : { - *(.patch_MaskSalesmanBorrowMask) - } - - .patch_KingZoraIgnoreSapphire 0x1736B8 : { - *(.patch_KingZoraIgnoreSapphire) - } - - .patch_MidoForestDialog 0x173944 : { - *(.patch_MidoForestDialog) - } - - .patch_LeeverSandCheck_Big 0x1743D0 : { - *(.patch_LeeverSandCheck_Big) - } - - .patch_SkipTimeTravelCutsceneOne 0x174DEC : { - *(.patch_SkipTimeTravelCutsceneOne) - } - - .patch_SkipTwinrovaQuarrelCutsceneTwo 0x176110 : { - *(.patch_SkipTwinrovaQuarrelCutsceneTwo) - } - - .patch_LostWoodsTargetCutscene 0x178058 : { - *(.patch_LostWoodsTargetCutscene) - } - - .patch_CarpenterBossDontNullExchangeItem 0x178BE4 : { - *(.patch_CarpenterBossDontNullExchangeItem) - } - - .patch_CarpenterBossSetTradedSawFlag 0x178D58 : { - *(.patch_CarpenterBossSetTradedSawFlag) - } - - .patch_AnjuCheckCuccoAmount 0x179420 : { - *(.patch_AnjuCheckCuccoAmount) - } - - .patch_FastOwlCutscenes 0x188584 : { - *(.patch_FastOwlCutscenes) - } - - .patch_BombchuShopInfinitePurchases 0x188D3C : { - *(.patch_BombchuShopInfinitePurchases) - } - - .patch_BusinessScrubTable 0x18A634 : { - *(.patch_BusinessScrubTable) - } - - .patch_CheckGerudoToken_18B368 0x18B368 : { - *(.patch_CheckGerudoToken_18B368) - } - - .patch_CheckGerudoToken_18B3A0 0x18B3A0 : { - *(.patch_CheckGerudoToken_18B3A0) - } - - .patch_CheckGerudoToken_18B3C0 0x18B3C0 : { - *(.patch_CheckGerudoToken_18B3C0) - } - - .patch_CheckGerudoToken_18B448 0x18B448 : { - *(.patch_CheckGerudoToken_18B448) - } - - .patch_CheckGerudoToken_18B6F4 0x18B6F4 : { - *(.patch_CheckGerudoToken_18B6F4) - } - - .patch_CheckGerudoToken_18B710 0x18B710 : { - *(.patch_CheckGerudoToken_18B710) - } - - .patch_EponasSongCheckFlag 0x18C56C : { - *(.patch_EponasSongCheckFlag) - } - - .patch_GetObjectEntry_EnXcInit 0x18D7AC : { - *(.patch_GetObjectEntry_EnXcInit) - } - - .patch_PreludeLocation 0x18D9FC : { - *(.patch_PreludeLocation) - } - - .patch_SkullKidPoacherSawCheck 0x18ED80 : { - *(.patch_SkullKidPoacherSawCheck) - } - - .patch_PoeCollectorCheckPoints 0x19091C : { - *(.patch_PoeCollectorCheckPoints) - } - - .patch_GoronShopPurchaseableCheck 0x19120C : { - *(.patch_GoronShopPurchaseableCheck) - } - - .patch_PlayerEditAndRetrieveCMB 0x191970 : { - *(.patch_PlayerEditAndRetrieveCMB) - } - - .patch_AdultItemsCMABsAsChild 0x191BB0 : { - *(.patch_AdultItemsCMABsAsChild) - } - - .patch_SetChildCustomTunic 0x191DB0 : { - *(.patch_SetChildCustomTunic) - } - - .patch_PlayerGetCustomTunicCMAB 0x191DD4 : { - *(.patch_PlayerGetCustomTunicCMAB) - } - - .patch_SkipDaruniaDanceOne 0x19493C : { - *(.patch_SkipDaruniaDanceOne) - } - - .patch_SkipDaruniaDanceTwo 0x194944 : { - *(.patch_SkipDaruniaDanceTwo) - } - - .patch_ChildRollingGoron 0x194B18 : { - *(.patch_ChildRollingGoron) - } - - .patch_BiggoronCheckBGSFlag 0x194DA0 : { - *(.patch_BiggoronCheckBGSFlag) - } - - .patch_ChildRollingGoronDontCheckBombBag 0x195414 : { - *(.patch_ChildRollingGoronDontCheckBombBag) - } - - .patch_AdultRollingGoronIgnoreMedallion 0x195450 : { - *(.patch_AdultRollingGoronIgnoreMedallion) - } - - .patch_AdultRollingGoronOne 0x195480 : { - *(.patch_AdultRollingGoronOne) - } - - .patch_AdultRollingGoronTwo 0x1954AC : { - *(.patch_AdultRollingGoronTwo) - } - - .patch_BiggoronGetTextId 0x1954F8 : { - *(.patch_BiggoronGetTextId) - } - - .patch_EponasSongCheckFlagTwo 0x195CFC : { - *(.patch_EponasSongCheckFlagTwo) - } - - .patch_GohmaLarvaDeathSignalParent 0x1968DC : { - *(.patch_GohmaLarvaDeathSignalParent) - } - - .patch_AmyBlockCooldownTimer 0x196ECC : { - *(.patch_AmyBlockCooldownTimer) - } - - .patch_AmyBlockSpeed 0x196F3C : { - *(.patch_AmyBlockSpeed) - } - - .patch_DampeChest 0x19A420 : { - *(.patch_DampeChest) - } - - .patch_PierreSoftlockFixOne 0x19C734 : { - *(.patch_PierreSoftlockFixOne) - } - - .patch_EnBlkobj_FindDarkLink 0x1A0BC8 : { - *(.patch_EnBlkobj_FindDarkLink) - } - - .patch_EnBlkobj_SpawnDarkLink 0x1A137C : { - *(.patch_EnBlkobj_SpawnDarkLink) - } - - .patch_RutoBlueWarpOverride 0x1A1900 : { - *(.patch_RutoBlueWarpOverride) - } - - .patch_KotakeDontPlayBattleMusic 0x1A8218 : { - *(.patch_KotakeDontPlayBattleMusic) - } - - .patch_GetObjectEntry_EnGomaInit_One 0x1B3130 : { - *(.patch_GetObjectEntry_EnGomaInit_One) - } - - .patch_GetObjectEntry_EnGomaInit_Two 0x1B3208 : { - *(.patch_GetObjectEntry_EnGomaInit_Two) - } - - .patch_GossipStoneAddSariaHint 0x1B3968 : { - *(.patch_GossipStoneAddSariaHint) - } - - .patch_ReadGossipStoneHints 0x1B3A44 : { - *(.patch_ReadGossipStoneHints) - } - - .patch_SkipJabuOpeningCutscene 0x1B583C : { - *(.patch_SkipJabuOpeningCutscene) - } - - .patch_KingZoraSecondTunic 0x1B6A18 : { - *(.patch_KingZoraSecondTunic) - } - - .patch_KingZoraGiveTunic 0x1B6A64 : { - *(.patch_KingZoraGiveTunic) - } - - .patch_MidoCheckDekuTreeClearThree 0x1B7414 : { - *(.patch_MidoCheckDekuTreeClearThree) - } - - .patch_GetObjectEntry_EnTiteInit 0x1BBC9C : { - *(.patch_GetObjectEntry_EnTiteInit) - } - - .patch_FishingNewRecord 0x1C3AA4 : { - *(.patch_FishingNewRecord) - } - - .patch_FishingSizeIgnoreChild 0x1C3DFC : { - *(.patch_FishingSizeIgnoreChild) - } - - .patch_FishingSizeIgnoreAdult 0x1C3E40 : { - *(.patch_FishingSizeIgnoreAdult) - } - - .patch_BabyDodongoAfterSwallowBomb 0x1C42DC : { - *(.patch_BabyDodongoAfterSwallowBomb) - } - - .patch_BiggoronAfterGiveItem 0x1C4E4C : { - *(.patch_BiggoronAfterGiveItem) - } - - .patch_KingZoraSetTradedPrescriptionFlag 0x1C52A0 : { - *(.patch_KingZoraSetTradedPrescriptionFlag) - } - - .patch_GerudoBattleMusic 0x1C6FD8 : { - *(.patch_GerudoBattleMusic) - } - - .patch_EnEncount1_SpawnLeever 0x1CC94C : { - *(.patch_EnEncount1_SpawnLeever) - } - - .patch_EnEncount1_SetLeeverAimType 0x1CC984 : { - *(.patch_EnEncount1_SetLeeverAimType) - } - - .patch_TruthSpinnerSpeed 0x1CD814 : { - *(.patch_TruthSpinnerSpeed) - } - - .patch_DemoEffectStoneDraw 0x1D209C : { - *(.patch_DemoEffectStoneDraw) - } - - .patch_ChestIceSmoke 0x1D5E5C : { - *(.patch_ChestIceSmoke) - } - - .patch_CheckGerudoToken_1D7AD4 0x1D7AD4 : { - *(.patch_CheckGerudoToken_1D7AD4) - } - - .patch_BiggoronSetTextId 0x1D8A10 : { - *(.patch_BiggoronSetTextId) - } - - .patch_BombchuShopAlwaysOpen 0x1DC6B0 : { - *(.patch_BombchuShopAlwaysOpen) - } - - .patch_LeeverDontChangeCategory 0x1DE010 : { - *(.patch_LeeverDontChangeCategory) - } - - .patch_LeeverSandCheck_Init 0x1DE078 : { - *(.patch_LeeverSandCheck_Init) - } - - .patch_AdultBlueWarpOverride 0x1E3F50 : { - *(.patch_AdultBlueWarpOverride) - } - - .patch_DaruniaCheckStrength 0x1E489C : { - *(.patch_DaruniaCheckStrength) - } - - .patch_CanPlayBombchuBowlingTwo 0x1EA1D4 : { - *(.patch_CanPlayBombchuBowlingTwo) - } - - .patch_BoomerangTrailEffect 0x1F4220 : { - *(.patch_BoomerangTrailEffect) - } /*EnBoom_Draw*/ - - .patch_GohmaEggDeathSignalParent 0x1F5F48 : { - *(.patch_GohmaEggDeathSignalParent) - } - - .patch_Item00GiveAutomaticItemDrop 0x1F6E4C : { - *(.patch_Item00GiveAutomaticItemDrop) - } - - .patch_ItemGiveBombchuDropOne 0x1F6F70 : { - *(.patch_ItemGiveBombchuDropOne) - } - - .patch_GetObjectEntry_1F85B0 0x1F85B0 : { - *(.patch_GetObjectEntry_1F85B0) - } - - .patch_BombchuBowlingStaticReward 0x206150 : { - *(.patch_BombchuBowlingStaticReward) - } - - .patch_SkipSongReplays_TimeBlocksFix 0x208004 : { - *(.patch_SkipSongReplays_TimeBlocksFix) - } - - .patch_SkipSongReplays_WarpBlocksFix 0x208068 : { - *(.patch_SkipSongReplays_WarpBlocksFix) - } - - .patch_ChestMinigame_DontOpenChestsOnInit 0x20EC8C : { - *(.patch_ChestMinigame_DontOpenChestsOnInit) - } - - .patch_ChestMinigame_KeyChestVisibility 0x20EDB8 : { - *(.patch_ChestMinigame_KeyChestVisibility) - } - - .patch_ChestMinigame_RewardChestVisibility 0x20EFE0 : { - *(.patch_ChestMinigame_RewardChestVisibility) - } - - .patch_ShopItemDontSetAnimSpeedOne 0x2101BC : { - *(.patch_ShopItemDontSetAnimSpeedOne) - } - - .patch_ShopItemDontSetAnimSpeedTwo 0x2101CC : { - *(.patch_ShopItemDontSetAnimSpeedTwo) - } - - .patch_CourtyardCheckForVisitedZeldaOne 0x210C4C : { - *(.patch_CourtyardCheckForVisitedZeldaOne) - } - - .patch_CourtyardCheckForVisitedZeldaTwo 0x210C78 : { - *(.patch_CourtyardCheckForVisitedZeldaTwo) - } - - .patch_BugsRecatchable 0x212090 : { - *(.patch_BugsRecatchable) - } - - .patch_WaterSpoutMasterQuestCheck 0x212BDC : { - *(.patch_WaterSpoutMasterQuestCheck) - } - - .patch_DekuSproutCheckForest 0x2153A4 : { - *(.patch_DekuSproutCheckForest) - } - - .patch_DungeonCheckJabuMQBox 0x21590C : { - *(.patch_DungeonCheckJabuMQBox) - } - - .patch_JabuBoxCheckRuto 0x215934 : { - *(.patch_JabuBoxCheckRuto) - } - - .patch_GetObjectEntry_ObjSwitchInit 0x215A60 : { - *(.patch_GetObjectEntry_ObjSwitchInit) - } - - .patch_EnEncount1_SpawnStalchildWolfos 0x21C020 : { - *(.patch_EnEncount1_SpawnStalchildWolfos) - } - - .patch_DekuTheaterMaskOfTruth 0x21CA30 : { - *(.patch_DekuTheaterMaskOfTruth) - } - - .patch_BombchuBowlingPrizeOrder 0x21CAD4 : { - *(.patch_BombchuBowlingPrizeOrder) - } - - .patch_NoHealFromBombchuBowlingPrize 0x21D170 : { - *(.patch_NoHealFromBombchuBowlingPrize) - } - - .patch_HookshotDrawChain 0x2202A0 : { - *(.patch_HookshotDrawChain) - } - - .patch_GetObjectEntry_EnDekunutsInit 0x2293AC : { - *(.patch_GetObjectEntry_EnDekunutsInit) - } - - .patch_GetObjectEntry_EnHintnutsInit 0x22AB70 : { - *(.patch_GetObjectEntry_EnHintnutsInit) - } - - .patch_Item00GiveCollectedItemDrop 0x22B974 : { - *(.patch_Item00GiveCollectedItemDrop) - } - - .patch_patch_ItemGiveBombchuDropTwo 0x22BAE4 : { - *(.patch_ItemGiveBombchuDropTwo) - } - - .patch_GetObjectEntry_EnNutsballInit 0x22DEC4 : { - *(.patch_GetObjectEntry_EnNutsballInit) - } - - .patch_BusinessScrubCheckFlags 0x22EE64 : { - *(.patch_BusinessScrubCheckFlags) - } - - .patch_DarkLinkPlayerRecoil 0x22F838 : { - *(.patch_DarkLinkPlayerRecoil) - } - - .patch_GanonCSEquipMS 0x2359A4 : { - *(.patch_GanonCSEquipMS) - } - - .patch_AnubisFlameCircleCheck 0x246F64 : { - *(.patch_AnubisFlameCircleCheck) - } - - .patch_RainbowChuTrailOne 0x247FC0 : { - *(.patch_RainbowChuTrailOne) - } /*Bombchus use 2 EffectBlure instances*/ - - .patch_RainbowChuTrailTwo 0x2480A4 : { - *(.patch_RainbowChuTrailTwo) - } /*Bombchus use 2 EffectBlure instances*/ - - .patch_EnExItemModelDraw 0x249C94 : { - *(.patch_EnExItemModelDraw) - } - - .patch_RedeadCanFreezePlayer 0x24DC2C : { - *(.patch_RedeadCanFreezePlayer) - } - - .patch_SwordTrailDurationGrezzoFix 0x2507D0 : { - *(.patch_SwordTrailDurationGrezzoFix) - } /*duration is set to 6 due to framerate increase. NOP to allow custom duration*/ - - .patch_MultiplyPlayerSpeed 0x251D34 : { - *(.patch_MultiplyPlayerSpeed) - } - - .patch_GameOverStart 0x252424 : { - *(.patch_GameOverStart) - } - - .patch_SkipDaruniaDanceThree 0x257F00 : { - *(.patch_SkipDaruniaDanceThree) - } - - .patch_LostWoodsTargetTimer 0x2592B8 : { - *(.patch_LostWoodsTargetTimer) - } - - .patch_LostWoodsShootingGame 0x259E4C : { - *(.patch_LostWoodsShootingGame) - } - - .patch_CanPlayBombchuBowlingOne 0x25A744 : { - *(.patch_CanPlayBombchuBowlingOne) - } - - .patch_GanonDrawMasterSword 0x26207C : { - *(.patch_GanonDrawMasterSword) - } - - .patch_NaviNotifications 0x267E04 : { - *(.patch_NaviNotifications) - } - - .patch_CheckGerudoToken_269884 0x269884 : { - *(.patch_CheckGerudoToken_269884) - } - - .patch_MinuetLocation 0x26C388 : { - *(.patch_MinuetLocation) - } - - .patch_BoleroLocation 0x26C448 : { - *(.patch_BoleroLocation) - } - - .patch_FlyingTileCollision 0x26E730 : { - *(.patch_FlyingTileCollision) - } - - .patch_DeadHandHandCanGrabPlayer 0x26EB58 : { - *(.patch_DeadHandHandCanGrabPlayer) - } - - .patch_RedBoulderExplode 0x26FE7C : { - *(.patch_RedBoulderExplode) - } - - .patch_MaskSalesmanGiveMaskOfTruth 0x271D48 : { - *(.patch_MaskSalesmanGiveMaskOfTruth) - } - - .patch_SongOfTimeJingle 0x274B1C : { - *(.patch_SongOfTimeJingle) - } - - .patch_DoorOfTimeCheck 0x274B68 : { - *(.patch_DoorOfTimeCheck) - } - - .patch_ImpaInCourtyardCheckForVisitedZelda 0x27DEF8 : { - *(.patch_ImpaInCourtyardCheckForVisitedZelda) - } - - .patch_GanonGiveMSMidFight 0x288030 : { - *(.patch_GanonGiveMSMidFight) - } - - .patch_AnjuGiveCojiro 0x2884F4 : { - *(.patch_AnjuGiveCojiro) - } - - .patch_SunsSongLocation 0x2888C8 : { - *(.patch_SunsSongLocation) - } - - .patch_PierreSoftlockFixTwo 0x288914 : { - *(.patch_PierreSoftlockFixTwo) - } - - .patch_PierreSoftlockFixThree 0x2889D4 : { - *(.patch_PierreSoftlockFixThree) - } - - .patch_KakarikoGateCheck 0x28A678 : { - *(.patch_KakarikoGateCheck) - } - - .patch_BombchuBowlingAlwaysFirstPrize 0x291924 : { - *(.patch_BombchuBowlingAlwaysFirstPrize) - } - - .patch_LostWoodsShootingGameTwo 0x2990E8 : { - *(.patch_LostWoodsShootingGameTwo) - } - - .patch_Sheik_GetTextID 0x2A4B44 : { - *(.patch_Sheik_GetTextID) - } - - .patch_SerenadeCheckChestFlag 0x2B2544 : { - *(.patch_SerenadeCheckChestFlag) - } - - .patch_SerenadeLocation 0x2B2574 : { - *(.patch_SerenadeLocation) - } - - .patch_RainbowSwordTrail 0x2B9AD0 : { - *(.patch_RainbowSwordTrail) - } - - .patch_OverrideTextID 0x2BC1C4 : { - *(.patch_OverrideTextID) - } - - .patch_OverrideItemID 0x2BC1D0 : { - *(.patch_OverrideItemID) - } - - .patch_NoSilverGauntletsCutsceneWarp 0x2BC2A0 : { - *(.patch_NoSilverGauntletsCutsceneWarp) - } - - .patch_RunAnimationSpeed 0x2BE70C : { - *(.patch_RunAnimationSpeed) - } - - .patch_FishingIgnoreTempBOne 0x2C3A10 : { - *(.patch_FishingIgnoreTempBOne) - } - - .patch_DoorOfTimeOpenCutscene 0x2C6218 : { - *(.patch_DoorOfTimeOpenCutscene) - } - - .patch_NoHealFromHealthUpgrades 0x2CD07C : { - *(.patch_NoHealFromHealthUpgrades) - } - - .patch_GetCustomMessageEntryOne 0x2CD3A4 : { - *(.patch_GetCustomMessageEntryOne) - } - - .patch_GetCustomMessageTextOne 0x2CD3EC : { - *(.patch_GetCustomMessageTextOne) - } - - .patch_ActorDraw 0x2D6310 : { - *(.patch_ActorDraw) - } - - .patch_OcarinaNoteSound_Player 0x2D6A04 : { - *(.patch_OcarinaNoteSound_Player) - } - - .patch_CamUpdate 0x2D84C8 : { - *(.patch_CamUpdate) - } - - .patch_CamRoll 0x2D88E4 : { - *(.patch_CamRoll) - } - - .patch_CheckForTextControlCode 0x2E0490 : { - *(.patch_CheckForTextControlCode) - } - - .patch_HandleTextControlCode 0x2E057C : { - *(.patch_HandleTextControlCode) - } - - .patch_SceneInitAfterCopyScenes 0x2EAFDC : { - *(.patch_SceneInitAfterCopyScenes) - } - - .patch_ChildCanOpenBowSubMenu 0x2EB2D8 : { - *(.patch_ChildCanOpenBowSubMenu) - } - - .patch_FileSelect_CopyFile 0x2EDA04 : { - *(.patch_FileSelect_CopyFile) - } - - .patch_CorrectCompassChests 0x2F161C : { - *(.patch_CorrectCompassChests) - } - - .patch_CorrectCompassChestsTwo 0x2F1770 : { - *(.patch_CorrectCompassChestsTwo) - } - - .patch_OverrideDrawItemOne 0x2F7498 : { - *(.patch_OverrideDrawItemOne) - } - - .patch_OcarinaNoteButtonsDraw 0x2F9430 : { - *(.patch_OcarinaNoteButtonsDraw) - } - - .patch_SaveGame 0x2FBFA8 : { - *(.patch_SaveGame) - } - - .patch_SaveFileSwordless 0x2FDCE4 : { - *(.patch_SaveFileSwordless) - } - - .patch_Gfx_Update 0x310254 : { - *(.patch_Gfx_Update) - } - - .patch_OverrideDrawItemTwo 0x3148A8 : { - *(.patch_OverrideDrawItemTwo) - } - - .patch_OoBBombchuOne 0x315120 : { - *(.patch_OoBBombchuOne) - } - - .patch_OoBBombchuTwo 0x31513C : { - *(.patch_OoBBombchuTwo) - } - - .patch_OoBBombchuThree 0x315150 : { - *(.patch_OoBBombchuThree) - } - - .patch_CollisionATvsAC 0x3191B0 : { - *(.patch_CollisionATvsAC) - } - - .patch_ISGPutaway 0x32B4AC : { - *(.patch_ISGPutaway) - } - - .patch_SetBGMEntrance 0x331048 : { - *(.patch_SetBGMEntrance) - } - - .patch_NockArrow 0x33615C : { - *(.patch_NockArrow) - } - - .patch_DecreaseArrowCount 0x3362C4 : { - *(.patch_DecreaseArrowCount) - } - - .patch_SceneExitOverride 0x3366EC : { - *(.patch_SceneExitOverride) - } - - .patch_SceneExitDynamicOverride 0x33676C : { - *(.patch_SceneExitDynamicOverride) - } - - .patch_EnteredLocation 0x338DB8 : { - *(.patch_EnteredLocation) - } - - .patch_LostWoodsBridgeMusic 0x338DD8 : { - *(.patch_LostWoodsBridgeMusic) - } - - .patch_GetObjectEntry_339DFC 0x339DFC : { - *(.patch_GetObjectEntry_339DFC) - } - - .patch_GetObjectEntry_33A950 0x33A950 : { - *(.patch_GetObjectEntry_33A950) - } - - .patch_GetObjectEntry_33AB24 0x33AB24 : { - *(.patch_GetObjectEntry_33AB24) - } /* Used for: chest ice trap smoke effect */ - - .patch_BiggoronDayCheck 0x33DCC0 : { - *(.patch_BiggoronDayCheck) - } - - .patch_FWandWarpSongTimerDepletion 0x33DE84 : { - *(.patch_FWandWarpSongTimerDepletion) - } - - .patch_RandomGsLoc_CustomTangibilityCheck 0x3415B0 : { - *(.patch_RandomGsLoc_CustomTangibilityCheck) - } - - .patch_MasterQuestGoldSkulltulaCheck 0x3415C8 : { - *(.patch_MasterQuestGoldSkulltulaCheck) - } - - .patch_TurboTextSignalNPC 0x3469F4 : { - *(.patch_TurboTextSignalNPC) - } - - .patch_FairyReviveHealAmount 0x34AF48 : { - *(.patch_FairyReviveHealAmount) - } - - .patch_FishingIgnoreTempBTwo 0x34CFCC : { - *(.patch_FishingIgnoreTempBTwo) - } - - .patch_FWLoadSet 0x34D9E8 : { - *(.patch_FWLoadSet) - } - - .patch_GetObjectEntry_34F270 0x34F270 : { - *(.patch_GetObjectEntry_34F270) - } - - .patch_GetObjectEntry_34FE68 0x34FE68 : { - *(.patch_GetObjectEntry_34FE68) - } - - .patch_FWGetSet 0x3519CC : { - *(.patch_FWGetSet) - } - - .patch_ApplyDamageMultiplier 0x352DC0 : { - *(.patch_ApplyDamageMultiplier) - } - - .patch_GetObjectEntry_352F28 0x352F28 : { - *(.patch_GetObjectEntry_352F28) - } /* Used for: Flare Dancer */ - - .patch_GetObjectEntry_353CE4 0x353CE4 : { - *(.patch_GetObjectEntry_353CE4) - } - - .patch_FastChests 0x354CD4 : { - *(.patch_FastChests) - } - - .patch_AboutToPickUpActor 0x354DD8 : { - *(.patch_AboutToPickUpActor) - } - - .patch_MasterSwordTimerCheck 0x354DFC : { - *(.patch_MasterSwordTimerCheck) - } - - .patch_LikeLikeNeverEatTunic 0x355C2C : { - *(.patch_LikeLikeNeverEatTunic) - } - - .patch_PlaySound 0x35C528 : { - *(.patch_PlaySound) - } - - .patch_ConvertBombDropOne 0x35E46C : { - *(.patch_ConvertBombDropOne) - } - - .patch_SkullwalltulaAttack_35F328 0x35F328 : { - *(.patch_SkullwalltulaAttack_35F328) - } - - .patch_SkullwalltulaTargetRotation 0x35F828 : { - *(.patch_SkullwalltulaTargetRotation) - } - - .patch_SkullwalltulaAttack_35F834 0x35F834 : { - *(.patch_SkullwalltulaAttack_35F834) - } - - .patch_ISGCrouchStab 0x360690 : { - *(.patch_ISGCrouchStab) - } - - .patch_ForceTrailEffectUpdate 0x362108 : { - *(.patch_ForceTrailEffectUpdate) - } /*EffectBlure_AddVertex*/ - - .patch_ExtendObjectGetSlot 0x363CB4 : { - *(.patch_ExtendObjectGetSlot) - } - - .patch_StalchildDespawn_366338 0x366338 : { - *(.patch_StalchildDespawn_366338) - } - - .patch_GetObjectEntry_36A96C 0x36A96C : { - *(.patch_GetObjectEntry_36A96C) - } /* Used for: freestanding item models */ - - .patch_IgnoreMaskReaction 0x36BBC4 : { - *(.patch_IgnoreMaskReaction) - } - - .patch_SetBGMEvent 0x36EC40 : { - *(.patch_SetBGMEvent) - } - - .patch_DemoEffectMedallionDraw 0x37214C : { - *(.patch_DemoEffectMedallionDraw) - } - - .patch_IncomingGetItemID 0x3725AC : { - *(.patch_IncomingGetItemID) - } - - .patch_Model_EnableMeshGroupByIndex 0x372670 : { - *(.patch_Model_EnableMeshGroupByIndex) - } - - .patch_MaskSalesmanCheckNoMaskOne 0x372B64 : { - *(.patch_MaskSalesmanCheckNoMaskOne) - } - - .patch_MaskSalesmanCheckNoMaskTwo 0x372B70 : { - *(.patch_MaskSalesmanCheckNoMaskTwo) - } - - .patch_GetObjectEntry_372F7C 0x372F7C : { - *(.patch_GetObjectEntry_372F7C) - } - - .patch_OverrideObjectIsLoaded 0x373074 : { - *(.patch_OverrideObjectIsLoaded) - } - - .patch_ConvertBombDropTwo 0x3747A4 : { - *(.patch_ConvertBombDropTwo) - } - - .patch_SetSFX 0x37547C : { - *(.patch_SetSFX) - } - - .patch_CollisionCheck_SetAC_Once 0x376174 : { - *(.patch_CollisionCheck_SetAC_Once) - } - - .patch_CollisionCheck_SetAT_Once 0x3761FC : { - *(.patch_CollisionCheck_SetAT_Once) - } - - .patch_CollisionCheck_SetOC_Once 0x3762B0 : { - *(.patch_CollisionCheck_SetOC_Once) - } - - .patch_GKSetDurability 0x376BDC : { - *(.patch_GKSetDurability) - } - - .patch_GiantsKnifeWithoutKokiriSword 0x376BEC : { - *(.patch_GiantsKnifeWithoutKokiriSword) - } - - .patch_GiveItemMasterSword 0x376C18 : { - *(.patch_GiveItemMasterSword) - } - - .patch_NoLensOfTruthNaviText 0x37798C : { - *(.patch_NoLensOfTruthNaviText) - } - - .patch_AltHeadersCommand 0x379020 : { - *(.patch_AltHeadersCommand) - } - - .patch_FrogRewardPurple 0x3898F0 : { - *(.patch_FrogRewardPurple) - } - - .patch_FrogReward 0x38992C : { - *(.patch_FrogReward) - } - - .patch_ChildShootingGallery 0x38AB70 : { - *(.patch_ChildShootingGallery) - } - - .patch_AdultShootingGallery 0x38ABA0 : { - *(.patch_AdultShootingGallery) - } - - .patch_SariasSongHintsOne 0x390620 : { - *(.patch_SariasSongHintsOne) - } - - .patch_SariasSongHintsTwo 0x39073C : { - *(.patch_SariasSongHintsTwo) - } - - .patch_PeahatLarvaGroundCheck 0x391740 : { - *(.patch_PeahatLarvaGroundCheck) - } - - .patch_OcarinaMinigameEndAfterWin 0x39DF38 : { - *(.patch_OcarinaMinigameEndAfterWin) - } - - .patch_LullabyLocation 0x3A0A7C : { - *(.patch_LullabyLocation) - } - - .patch_OverrideDrawItemThree 0x3A0EA8 : { - *(.patch_OverrideDrawItemThree) - } - - .patch_AfterInvalidatingRoomObjects 0x3A7698 : { - *(.patch_AfterInvalidatingRoomObjects) - } - - .patch_AfterObjectListCommand 0x3A7708 : { - *(.patch_AfterObjectListCommand) - } - - .patch_KokiriCheckOpenForest 0x3ACCFC : { - *(.patch_KokiriCheckOpenForest) - } - - .patch_TokenNoItemGive2 0x3AD270 : { - *(.patch_TokenNoItemGive2) - } - - .patch_GetToken2 0x3AD2F0 : { - *(.patch_GetToken2) - } - - .patch_TokenNoItemGive1 0x3ADD68 : { - *(.patch_TokenNoItemGive1) - } - - .patch_GetToken1 0x3ADDE4 : { - *(.patch_GetToken1) - } - - .patch_TalonGetCastleTextbox 0x3AE6E8 : { - *(.patch_TalonGetCastleTextbox) - } - - .patch_GerudoArcheryOne 0x3AFA34 : { - *(.patch_GerudoArcheryOne) - } - - .patch_ShabomAfterDamagePlayer 0x3B5060 : { - *(.patch_ShabomAfterDamagePlayer) - } - - .patch_BabyDodongoWallCheck 0x3B833C : { - *(.patch_BabyDodongoWallCheck) - } - - .patch_RandomGsLoc_CustomTokenSpawnOffset 0x3B94C4 : { - *(.patch_RandomGsLoc_CustomTokenSpawnOffset) - } - - .patch_RandomGsLoc_BlockSpawn_Crate 0x3BCA68 : { - *(.patch_RandomGsLoc_BlockSpawn_Crate) - } - - .patch_MovableBlockCooldownTimer 0x3BD46C : { - *(.patch_MovableBlockCooldownTimer) - } - - .patch_MovableBlockSpeed 0x3BD508 : { - *(.patch_MovableBlockSpeed) - } - - .patch_MilkCrateCooldownTimer 0x3BD85C : { - *(.patch_MilkCrateCooldownTimer) - } - - .patch_MilkCrateSpeed 0x3BD88C : { - *(.patch_MilkCrateSpeed) - } - - .patch_RandomGsLoc_BlockSpawn_Soil 0x3BF690 : { - *(.patch_RandomGsLoc_BlockSpawn_Soil) - } - - .patch_ForestTempleBasementPuzzleDelay 0x3BFA8C : { - *(.patch_ForestTempleBasementPuzzleDelay) - } - - .patch_GerudoArcheryTwo 0x3C2D80 : { - *(.patch_GerudoArcheryTwo) - } - - .patch_DampeCheckCanDig1 0x3C3354 : { - *(.patch_DampeCheckCanDig1) - } - - .patch_DampeRollHigh 0x3C3418 : { - *(.patch_DampeRollHigh) - } - - .patch_DampeCheckRewardFlag 0x3C3598 : { - *(.patch_DampeCheckRewardFlag) - } - - .patch_DampeCheckCanDig2 0x3C35D0 : { - *(.patch_DampeCheckCanDig2) - } - - .patch_SongOfTimeLocation 0x3C375C : { - *(.patch_SongOfTimeLocation) - } - - .patch_EponasSongLocation 0x3C6194 : { - *(.patch_EponasSongLocation) - } - - .patch_MalonNextAction 0x3C6210 : { - *(.patch_MalonNextAction) - } - - .patch_BombPurchaseableCheck 0x3CE800 : { - *(.patch_BombPurchaseableCheck) - } - - .patch_ScrubStickUpgradeTwo 0x3CE990 : { - *(.patch_ScrubStickUpgradeTwo) - } - - .patch_ScrubNutUpgradeTwo 0x3CE9DC : { - *(.patch_ScrubNutUpgradeTwo) - } - - .patch_GrannySetRewardFlag 0x3D0E34 : { - *(.patch_GrannySetRewardFlag) - } - - .patch_GrannyItemOverrideTwo 0x3D0E60 : { - *(.patch_GrannyItemOverrideTwo) - } - - .patch_MidoCheckDekuTreeClearFour 0x3D2C18 : { - *(.patch_MidoCheckDekuTreeClearFour) - } - - .patch_LeeverAfterDie 0x3D4E10 : { - *(.patch_LeeverAfterDie) - } - - .patch_LeeverAfterSink 0x3D6188 : { - *(.patch_LeeverAfterSink) - } - - .patch_LeeverSandCheck_Small 0x3DE2A0 : { - *(.patch_LeeverSandCheck_Small) - } - - .patch_ShadowShip_Speed 0x3DFB30 : { - *(.patch_ShadowShip_Speed) - } - - .patch_FireBlockSpeed 0x3E0BB4 : { - *(.patch_FireBlockSpeed) - } - - .patch_FreeScarecrow 0x3E55A8 : { - *(.patch_FreeScarecrow) - } - - .patch_MasterSwordAlwaysDrop 0x3E5E98 : { - *(.patch_MasterSwordAlwaysDrop) - } - - .patch_PickUpMasterSword 0x3E5EC8 : { - *(.patch_PickUpMasterSword) - } - - .patch_SkipMasterSwordFanfare 0x3E5F60 : { - *(.patch_SkipMasterSwordFanfare) - } - - .patch_ShadowShip_CSTimer 0x3E6C50 : { - *(.patch_ShadowShip_CSTimer) - } - - .patch_FlyingPotDontChangeCategory 0x3E7008 : { - *(.patch_FlyingPotDontChangeCategory) - } - - .patch_FairyReward 0x3E7598 : { - *(.patch_FairyReward) - } - - .patch_RainbowBridge 0x3E7CAC : { - *(.patch_RainbowBridge) - } - - .patch_RemoveWaterfallCS 0x3E7F64 : { - *(.patch_RemoveWaterfallCS) - } - - .patch_DekuTheaterSkullMask 0x3EAF38 : { - *(.patch_DekuTheaterSkullMask) - } - - .patch_CowItemOverride 0x3EE378 : { - *(.patch_CowItemOverride) - } - - .patch_CowBottleCheck 0x3F065C : { - *(.patch_CowBottleCheck) - } - - .patch_CarpetSalesmanCheckFlagOne 0x3F0A18 : { - *(.patch_CarpetSalesmanCheckFlagOne) - } - - .patch_CarpetSalesmanCheckFlagTwo 0x3F0A64 : { - *(.patch_CarpetSalesmanCheckFlagTwo) - } - - .patch_LabScientistIgnoreEyedropsInInventory 0x3F0B44 : { - *(.patch_LabScientistIgnoreEyedropsInInventory) - } - - .patch_FastChestsTwo 0x3F1048 : { - *(.patch_FastChestsTwo) - } - - .patch_HandleDoorDestroyCustomModels 0x3F1B88 : { - *(.patch_HandleDoorDestroyCustomModels) - } - - .patch_OverrideGrottoActorEntrance 0x3F2254 : { - *(.patch_OverrideGrottoActorEntrance) - } - - .patch_FireArrowRequirement 0x3F23AC : { - *(.patch_FireArrowRequirement) - } - - .patch_FireArrowCheckChestFlagOne 0x3F23FC : { - *(.patch_FireArrowCheckChestFlagOne) - } - - .patch_FireArrowCheckChestFlagTwo 0x3F2448 : { - *(.patch_FireArrowCheckChestFlagTwo) - } - - .patch_LinkReflection 0x3F2F0C : { - *(.patch_LinkReflection) - } - - .patch_SlidingDoorDestroyCustomModels 0x3F4A70 : { - *(.patch_SlidingDoorDestroyCustomModels) - } - - .patch_ChildBlueWarpOverride 0x3F5774 : { - *(.patch_ChildBlueWarpOverride) - } - - .patch_CarpetSalesmanSetFlag 0x3F9550 : { - *(.patch_CarpetSalesmanSetFlag) - } - - .patch_PreSwapBuffers 0x3FD384 : { - *(.patch_PreSwapBuffers) - } - - .patch_AwakeCallback 0x3FD43C : { - *(.patch_AwakeCallback) - } - - .patch_SleepQueryCallback 0x3FD6C4 : { - *(.patch_SleepQueryCallback) - } - - /* Start of regional differences: 0x41A144 */ - region_offset = DEFINED(_EUR_) ? 0x24 : 0; - - .patch_OcarinaNoteButtonsPress 0x41AAAC + region_offset : { - *(.patch_OcarinaNoteButtonsPress) - } - - .patch_CurseTrapDizzyStick 0x41AB24 + region_offset : { - *(.patch_CurseTrapDizzyStick) - } - - .patch_CurseTrapDizzyButtons 0x41ABDC + region_offset : { - *(.patch_CurseTrapDizzyButtons) - } - - .patch_PermadeathSkipMenu 0x41C980 + region_offset : { - *(.patch_PermadeathSkipMenu) - } - - .patch_SaveMenuIgnoreOpen 0x42EC00 + region_offset : { - *(.patch_SaveMenuIgnoreOpen) - } - - .patch_ItemsMenuDraw 0x434C08 + region_offset : { - *(.patch_ItemsMenuDraw) - } - - .patch_PlayInit 0x4352F4 + region_offset : { - *(.patch_PlayInit) - } - - /* Variation of regional differences: 0x436690 */ - region_offset = DEFINED(_EUR_) ? 0x20 : 0; - - .patch_GearMenuEmptySlot 0x438C00 + region_offset : { - *(.patch_GearMenuEmptySlot) - } - - .patch_DrawHeartIcon 0x444368 + region_offset : { - *(.patch_DrawHeartIcon) - } - - .patch_BeforeLoadGame 0x447380 + region_offset : { - *(.patch_BeforeLoadGame) - } - - .patch_DontSetMotionSetting 0x447410 + region_offset : { - *(.patch_DontSetMotionSetting) - } - - .patch_OverrideFogDuringGameplayInit 0x4485B4 + region_offset : { - *(.patch_OverrideFogDuringGameplayInit) - } - - .patch_CheckForWeirdEggHatchGameplayInit 0x448A64 + region_offset : { - *(.patch_CheckForWeirdEggHatchGameplayInit) - } - - .patch_CheckForPocketCuccoHatchGameplayInit 0x448A80 + region_offset : { - *(.patch_CheckForPocketCuccoHatchGameplayInit) - } - - .patch_InitSceneMirrorWorld 0x4490DC + region_offset : { - *(.patch_InitSceneMirrorWorld) - } - - .patch_InitSceneEntranceOverride 0x449190 + region_offset : { - *(.patch_InitSceneEntranceOverride) - } - - .patch_InitSceneClearExtendedObjects 0x449218 + region_offset : { - *(.patch_InitSceneClearExtendedObjects) - } - - .patch_SaveFile_Init 0x449A04 + region_offset : { - *(.patch_SaveFile_Init) - } - - .patch_SavewarpSetRespawnFlag 0x449E40 + region_offset : { - *(.patch_SavewarpSetRespawnFlag) - } - - .patch_Multiplayer_OnLoadFile 0x449EFC + region_offset : { - *(.patch_Multiplayer_OnLoadFile) - } - - .patch_AfterLoadGame 0x449F00 + region_offset : { - *(.patch_AfterLoadGame) - } - - .patch_GetCustomMessageEntryTwo 0x44D564 + region_offset : { - *(.patch_GetCustomMessageEntryTwo) - } - - .patch_GetCustomMessageTextTwo 0x44D5A4 + region_offset : { - *(.patch_GetCustomMessageTextTwo) - } - - .patch_GameplayDestroy 0x44E294 + region_offset : { - *(.patch_GameplayDestroy) - } - - .patch_ExtendedObjectClear 0x44E758 + region_offset : { - *(.patch_ExtendedObjectClear) - } - - .patch_Multiplayer_UpdatePrevActorFlags 0x44E878 + region_offset : { - *(.patch_Multiplayer_UpdatePrevActorFlags) - } - - .patch_PlayEntranceCutscene 0x44F068 + region_offset : { - *(.patch_PlayEntranceCutscene) - } - - .patch_RequiemLocation 0x44F104 + region_offset : { - *(.patch_RequiemLocation) - } - - .patch_NocturneLocation 0x44F12C + region_offset : { - *(.patch_NocturneLocation) - } - - .patch_SariasGift 0x44F188 + region_offset : { - *(.patch_SariasGift) - } - - .patch_LACSConditionOne 0x44F1D4 + region_offset : { - *(.patch_LACSConditionOne) - } - - .patch_LACSConditionTwo 0x44F20C + region_offset : { - *(.patch_LACSConditionTwo) - } - - .patch_BossChallenge_Enter 0x44F634 + region_offset : { - *(.patch_BossChallenge_Enter) - } - - .patch_SetSavewarpEntrance 0x44FBE4 + region_offset : { - *(.patch_SetSavewarpEntrance) - } - - .patch_LullabyCheckFlag 0x44FD54 + region_offset : { - *(.patch_LullabyCheckFlag) - } - - .patch_LoadFileSwordless 0x44FD98 + region_offset : { - *(.patch_LoadFileSwordless) - } - - .patch_OpenSaveDontSpoilTradeItems 0x44FDF8 + region_offset : { - *(.patch_OpenSaveDontSpoilTradeItems) - } - - .patch_OnActorSetup_SceneChange 0x452250 + region_offset : { - *(.patch_OnActorSetup_SceneChange) - } - - .patch_AfterActorSetup_SceneChange 0x4522B8 + region_offset : { - *(.patch_AfterActorSetup_SceneChange) - } - - .patch_before_GlobalContext_Update 0x452390 + region_offset : { - *(.patch_before_GlobalContext_Update) - } - - .patch_after_GlobalContext_Update 0x452434 + region_offset : { - *(.patch_after_GlobalContext_Update) - } - - .patch_FixItemsMenuSlotDuplication 0x456B90 + region_offset : { - *(.patch_FixItemsMenuSlotDuplication) - } - - .patch_GameOverDontSpoilTradeItems 0x458BE0 + region_offset : { - *(.patch_GameOverDontSpoilTradeItems) - } - - .patch_DeathHandleBButton 0x458CA8 + region_offset : { - *(.patch_DeathHandleBButton) - } - - .patch_PermadeathForceQuit 0x458E20 + region_offset : { - *(.patch_PermadeathForceQuit) - } - - .patch_SetGameOverEntrance 0x458E3C + region_offset : { - *(.patch_SetGameOverEntrance) - } - - .patch_SetGameOverRespawnFlag 0x458EF0 + region_offset : { - *(.patch_SetGameOverRespawnFlag) - } - - .patch_InterfaceDrawDontSpoilTradeItems 0x45A17C + region_offset : { - *(.patch_InterfaceDrawDontSpoilTradeItems) - } - - .patch_TimerExpiration 0x45A948 + region_offset : { - *(.patch_TimerExpiration) - } - - .patch_Timer2TickSound 0x45A9B4 + region_offset : { - *(.patch_Timer2TickSound) - } - - .patch_SunsSongEndCloseTextbox 0x45B514 + region_offset : { - *(.patch_SunsSongEndCloseTextbox) - } - - .patch_SetSunsSongRespawnFlag 0x45B660 + region_offset : { - *(.patch_SetSunsSongRespawnFlag) - } - - .patch_BossChallenge_ExitMenu 0x45CCA4 + region_offset : { - *(.patch_BossChallenge_ExitMenu) - } - - .patch_StoreChildBButtonEquip 0x45F20C + region_offset : { - *(.patch_StoreChildBButtonEquip) - } - - .patch_BecomeAdult 0x45F230 + region_offset : { - *(.patch_BecomeAdult) - } - - .patch_AlwaysRestoreChildEquips 0x45F3B0 + region_offset : { - *(.patch_AlwaysRestoreChildEquips) - } - - .patch_ChildDontEquipSwordSlotByDefault 0x45F49C + region_offset : { - *(.patch_ChildDontEquipSwordSlotByDefault) - } - - .patch_OnActorSetup_RoomChange 0x4613C4 + region_offset : { - *(.patch_OnActorSetup_RoomChange) - } - - .patch_AfterActorSetup_RoomChange 0x461434 + region_offset : { - *(.patch_AfterActorSetup_RoomChange) - } - - .patch_FixActorKillLoop 0x4615E0 + region_offset : { - *(.patch_FixActorKillLoop) - } - - .patch_ActorUpdate 0x461790 + region_offset : { - *(.patch_ActorUpdate) - } - - .patch_TitleCardUpdate 0x4618B8 + region_offset : { - *(.patch_TitleCardUpdate) - } - - .patch_ItemsMenuNumSprites 0x46B758 + region_offset : { - *(.patch_ItemsMenuNumSprites) - } - - .patch_CheckForWeirdEggHatchKankyo 0x470D00 + region_offset : { - *(.patch_CheckForWeirdEggHatchKankyo) - } - - .patch_CheckForPocketCuccoHatchKankyo 0x470D1C + region_offset : { - *(.patch_CheckForPocketCuccoHatchKankyo) - } - - .patch_CriticalHealthCheckOne 0x4715B8 + region_offset : { - *(.patch_CriticalHealthCheckOne) - } - - .patch_CriticalHealthCheckTwo 0x4716D4 + region_offset : { - *(.patch_CriticalHealthCheckTwo) - } - - .patch_EnableFW 0x476D1C + region_offset : { - *(.patch_EnableFW) - } - - .patch_OcarinaNoteSound_Npc 0x477C08 + region_offset : { - *(.patch_OcarinaNoteSound_Npc) - } - - .patch_StoreTargetActorType 0x479984 + region_offset : { - *(.patch_StoreTargetActorType) - } - - .patch_TargetReticleColor 0x47B284 + region_offset : { - *(.patch_TargetReticleColor) - } - - .patch_TargetPointerColor 0x47BAE8 + region_offset : { - *(.patch_TargetPointerColor) - } - - .patch_FWKeepWarpPoint 0x47C3C0 + region_offset : { - *(.patch_FWKeepWarpPoint) - } - - .patch_TurboTextAdvance 0x480928 + region_offset : { - *(.patch_TurboTextAdvance) - } - - .patch_SetBGMDayNight 0x483C88 + region_offset : { - *(.patch_SetBGMDayNight) - } - - .patch_Cutscene_CheckObjectLoaded 0x4849D8 + region_offset : { - *(.patch_Cutscene_CheckObjectLoaded) - } - - .patch_TurboTextClose 0x488214 + region_offset : { - *(.patch_TurboTextClose) - } - - .patch_WarpSongEntranceOverride 0x488850 + region_offset : { - *(.patch_WarpSongEntranceOverride) - } - - .patch_SetFWPlayerParams 0x4911B8 + region_offset : { - *(.patch_SetFWPlayerParams) - } - - .patch_SwapFaroresWind 0x49186C + region_offset : { - *(.patch_SwapFaroresWind) - } - - .patch_SwapAgeIgnoreSceneSetup 0x4918B0 + region_offset : { - *(.patch_SwapAgeIgnoreSceneSetup) - } - - .patch_SkipTimeTravelCutsceneTwo 0x4918C8 + region_offset : { - *(.patch_SkipTimeTravelCutsceneTwo) - } - - .patch_DMTOwlEntranceOverride 0x492064 + region_offset : { - *(.patch_DMTOwlEntranceOverride) - } - - .patch_LHOwlEntranceOverride 0x492080 + region_offset : { - *(.patch_LHOwlEntranceOverride) - } - - .patch_PlayerBonk 0x492CD0 + region_offset : { - *(.patch_PlayerBonk) - } - - .patch_FairyUseHealAmount 0x4968B4 + region_offset : { - *(.patch_FairyUseHealAmount) - } - - .patch_SendDroppedBottleContents 0x496A1C + region_offset : { - *(.patch_SendDroppedBottleContents) - } - - .patch_ReturnFW 0x496B88 + region_offset : { - *(.patch_ReturnFW) - } - - .patch_SetSpecialVoidOutRespawnFlag 0x496C70 + region_offset : { - *(.patch_SetSpecialVoidOutRespawnFlag) - } - - .patch_GanonBattleDeathWarp 0x496C98 + region_offset : { - *(.patch_GanonBattleDeathWarp) - } - - .patch_GanonRestoreMSOnDeath 0x496CB4 + region_offset : { - *(.patch_GanonRestoreMSOnDeath) - } - - .patch_CriticalHealthCheckThree 0x49F294 + region_offset : { - *(.patch_CriticalHealthCheckThree) - } - - /* End of regional differences: 0x4A5AE0 */ - region_offset = 0; - - .patch_OverrideGiDrawIdPlusOne_Ground 0x4BC610 : { - *(.patch_OverrideGiDrawIdPlusOne_Ground) - } - - .patch_OverrideGiDrawIdPlusOne_Water 0x4BD5DC : { - *(.patch_OverrideGiDrawIdPlusOne_Water) - } - - .patch_EditDrawGetItemBeforeModelSpawn 0x4C0FD0 : { - *(.patch_EditDrawGetItemBeforeModelSpawn) - } - - .patch_HookshotRotation 0x4C2524 : { - *(.patch_HookshotRotation) - } - - .patch_EditDrawGetItemAfterMatrixUpdate 0x4C4D14 : { - *(.patch_EditDrawGetItemAfterMatrixUpdate) - } - - .patch_EditDrawGetItemAfterModelSpawn 0x4C61A4 : { - *(.patch_EditDrawGetItemAfterModelSpawn) - } - - .patch_CrouchStabHitbox 0x4C85D4 : { - *(.patch_CrouchStabHitbox) - } - - . = 0x4C99A8; + _LD_OFF = 0; + + . = 0x100000 + _LD_OFF; + .patch_loader 0x100000 + _LD_OFF : { *(.patch_loader) } + .patch_GrogSetTradedCojiroFlag 0x104C50 + _LD_OFF : { *(.patch_GrogSetTradedCojiroFlag) } + .patch_MidoCheckDekuTreeClearTwo 0x105CD4 + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearTwo) } + .patch_ArmosCooldownTimer 0x10B41C + _LD_OFF : { *(.patch_ArmosCooldownTimer) } + .patch_ArmosPushSpeed 0x10B5C4 + _LD_OFF : { *(.patch_ArmosPushSpeed) } + .patch_ShortenRainbowBridgeCS 0x10B904 + _LD_OFF : { *(.patch_ShortenRainbowBridgeCS) } + .patch_GrannyTextID 0x10DCD0 + _LD_OFF : { *(.patch_GrannyTextID) } + .patch_LabScientistDontStartTimerAndSetFlag 0x112440 + _LD_OFF : { *(.patch_LabScientistDontStartTimerAndSetFlag) } + .patch_BombchuPurchaseableCheck 0x112ED0 + _LD_OFF : { *(.patch_BombchuPurchaseableCheck) } + .patch_PoeCollectorGetFirstTextbox 0x113844 + _LD_OFF : { *(.patch_PoeCollectorGetFirstTextbox) } + .patch_ItemEtceteraModelDraw 0x117080 + _LD_OFF : { *(.patch_ItemEtceteraModelDraw) } + .patch_FlyingPotCollision 0x11DB34 + _LD_OFF : { *(.patch_FlyingPotCollision) } + .patch_DodongoAfterSwallowBomb 0x11E4B8 + _LD_OFF : { *(.patch_DodongoAfterSwallowBomb) } + .patch_SariasSongItemGive 0x12C84C + _LD_OFF : { *(.patch_SariasSongItemGive) } + .patch_SariasSongLocation 0x12C8F8 + _LD_OFF : { *(.patch_SariasSongLocation) } + .patch_SkulltulaRewardOne 0x12CC68 + _LD_OFF : { *(.patch_SkulltulaRewardOne) } + .patch_SkulltulaRewardTwo 0x12CD38 + _LD_OFF : { *(.patch_SkulltulaRewardTwo) } + .patch_MedigoronCheckFlagOne 0x13024C + _LD_OFF : { *(.patch_MedigoronCheckFlagOne) } + .patch_MedigoronGetCustomText 0x130258 + _LD_OFF : { *(.patch_MedigoronGetCustomText) } + .patch_MedigoronCheckFlagTwo 0x1302C4 + _LD_OFF : { *(.patch_MedigoronCheckFlagTwo) } + .patch_BeanDaddyModifyBeansBought 0x130CEC + _LD_OFF : { *(.patch_BeanDaddyModifyBeansBought) } + .patch_PlayerCheckVoidOut 0x132B64 + _LD_OFF : { *(.patch_PlayerCheckVoidOut) } + .patch_BiggoronDontSetBGSFlag 0x133F7C + _LD_OFF : { *(.patch_BiggoronDontSetBGSFlag) } + .patch_KingZoraDontStartTimer 0x134D7C + _LD_OFF : { *(.patch_KingZoraDontStartTimer) } + .patch_GanonFinalBlow 0x13B684 + _LD_OFF : { *(.patch_GanonFinalBlow) } + .patch_StalchildDespawn_13DB68 0x13DB68 + _LD_OFF : { *(.patch_StalchildDespawn_13DB68) } + .patch_SongOfStormsLocation 0x1427E0 + _LD_OFF : { *(.patch_SongOfStormsLocation) } + .patch_JabuSwitchRutoCheck 0x143AC8 + _LD_OFF : { *(.patch_JabuSwitchRutoCheck) } + .patch_OwlMagicCheck 0x144B44 + _LD_OFF : { *(.patch_OwlMagicCheck) } + .patch_MedigoronItemOverrideOne 0x14D95C + _LD_OFF : { *(.patch_MedigoronItemOverrideOne) } + .patch_BeanDaddyPurchase 0x14EDA8 + _LD_OFF : { *(.patch_BeanDaddyPurchase) } + .patch_BeanDaddyModifyPrice 0x14EE98 + _LD_OFF : { *(.patch_BeanDaddyModifyPrice) } + .patch_SkipTwinrovaQuarrelCutsceneOne 0x15273C + _LD_OFF : { *(.patch_SkipTwinrovaQuarrelCutsceneOne) } + .patch_FairyPickupHealAmount 0x15CA4C + _LD_OFF : { *(.patch_FairyPickupHealAmount) } + .patch_RandomGsLoc_SkipSoilJingle 0x15DBD8 + _LD_OFF : { *(.patch_RandomGsLoc_SkipSoilJingle) } + .patch_GrannyBottleCheck 0x161044 + _LD_OFF : { *(.patch_GrannyBottleCheck) } + .patch_GrannyItemOverrideOne 0x161094 + _LD_OFF : { *(.patch_GrannyItemOverrideOne) } + .patch_ScrubStickUpgradeOne 0x161898 + _LD_OFF : { *(.patch_ScrubStickUpgradeOne) } + .patch_ScrubNutUpgradeOne 0x1618EC + _LD_OFF : { *(.patch_ScrubNutUpgradeOne) } + .patch_GrogCheckForShouldDespawn 0x16485C + _LD_OFF : { *(.patch_GrogCheckForShouldDespawn) } + .patch_GetObjectEntry_164BC8 0x164BC8 + _LD_OFF : { *(.patch_GetObjectEntry_164BC8) } + .patch_CheckFadoCanSpawnInLostWoods 0x1657EC + _LD_OFF : { *(.patch_CheckFadoCanSpawnInLostWoods) } + .patch_EnKoInitCheckForest_165834 0x165834 + _LD_OFF : { *(.patch_EnKoInitCheckForest_165834) } + .patch_EnKoInitCheckForest_165878 0x165878 + _LD_OFF : { *(.patch_EnKoInitCheckForest_165878) } + .patch_EnKoInitCheckForest_1658C0 0x1658C0 + _LD_OFF : { *(.patch_EnKoInitCheckForest_1658C0) } + .patch_EnKoInitCheckForest_1658F0 0x1658F0 + _LD_OFF : { *(.patch_EnKoInitCheckForest_1658F0) } + .patch_KingZoraCheckMovedFlag 0x165A60 + _LD_OFF : { *(.patch_KingZoraCheckMovedFlag) } + .patch_MidoCheckSpawn 0x166154 + _LD_OFF : { *(.patch_MidoCheckSpawn) } + .patch_MidoCheckDekuTreeClearOne 0x16623C + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearOne) } + .patch_GetObjectEntry_EnRdInit_One 0x167DA4 + _LD_OFF : { *(.patch_GetObjectEntry_EnRdInit_One) } + .patch_GetObjectEntry_EnRdInit_Two 0x167E38 + _LD_OFF : { *(.patch_GetObjectEntry_EnRdInit_Two) } + .patch_SariasSongCheckFlag 0x1686A0 + _LD_OFF : { *(.patch_SariasSongCheckFlag) } + .patch_GetObjectEntry_EnSiInit 0x168B20 + _LD_OFF : { *(.patch_GetObjectEntry_EnSiInit) } + .patch_RandomGsLoc_BlockSpawn_Tree 0x16C43C + _LD_OFF : { *(.patch_RandomGsLoc_BlockSpawn_Tree) } + .patch_MedigoronSetRewardFlag 0x16C918 + _LD_OFF : { *(.patch_MedigoronSetRewardFlag) } + .patch_MedigoronItemOverrideTwo 0x16C9BC + _LD_OFF : { *(.patch_MedigoronItemOverrideTwo) } + .patch_MaskSalesmanBorrowMask 0x16D148 + _LD_OFF : { *(.patch_MaskSalesmanBorrowMask) } + .patch_KingZoraIgnoreSapphire 0x1736B8 + _LD_OFF : { *(.patch_KingZoraIgnoreSapphire) } + .patch_MidoForestDialog 0x173944 + _LD_OFF : { *(.patch_MidoForestDialog) } + .patch_LeeverSandCheck_Big 0x1743D0 + _LD_OFF : { *(.patch_LeeverSandCheck_Big) } + .patch_SkipTimeTravelCutsceneOne 0x174DEC + _LD_OFF : { *(.patch_SkipTimeTravelCutsceneOne) } + .patch_SkipTwinrovaQuarrelCutsceneTwo 0x176110 + _LD_OFF : { *(.patch_SkipTwinrovaQuarrelCutsceneTwo) } + .patch_LostWoodsTargetCutscene 0x178058 + _LD_OFF : { *(.patch_LostWoodsTargetCutscene) } + .patch_CarpenterBossDontNullExchangeItem 0x178BE4 + _LD_OFF : { *(.patch_CarpenterBossDontNullExchangeItem) } + .patch_CarpenterBossSetTradedSawFlag 0x178D58 + _LD_OFF : { *(.patch_CarpenterBossSetTradedSawFlag) } + .patch_AnjuCheckCuccoAmount 0x179420 + _LD_OFF : { *(.patch_AnjuCheckCuccoAmount) } + .patch_FastOwlCutscenes 0x188584 + _LD_OFF : { *(.patch_FastOwlCutscenes) } + .patch_BombchuShopInfinitePurchases 0x188D3C + _LD_OFF : { *(.patch_BombchuShopInfinitePurchases) } + .patch_BusinessScrubTable 0x18A634 + _LD_OFF : { *(.patch_BusinessScrubTable) } + .patch_CheckGerudoToken_18B368 0x18B368 + _LD_OFF : { *(.patch_CheckGerudoToken_18B368) } + .patch_CheckGerudoToken_18B3A0 0x18B3A0 + _LD_OFF : { *(.patch_CheckGerudoToken_18B3A0) } + .patch_CheckGerudoToken_18B3C0 0x18B3C0 + _LD_OFF : { *(.patch_CheckGerudoToken_18B3C0) } + .patch_CheckGerudoToken_18B448 0x18B448 + _LD_OFF : { *(.patch_CheckGerudoToken_18B448) } + .patch_CheckGerudoToken_18B6F4 0x18B6F4 + _LD_OFF : { *(.patch_CheckGerudoToken_18B6F4) } + .patch_CheckGerudoToken_18B710 0x18B710 + _LD_OFF : { *(.patch_CheckGerudoToken_18B710) } + .patch_EponasSongCheckFlag 0x18C56C + _LD_OFF : { *(.patch_EponasSongCheckFlag) } + .patch_GetObjectEntry_EnXcInit 0x18D7AC + _LD_OFF : { *(.patch_GetObjectEntry_EnXcInit) } + .patch_PreludeLocation 0x18D9FC + _LD_OFF : { *(.patch_PreludeLocation) } + .patch_SkullKidPoacherSawCheck 0x18ED80 + _LD_OFF : { *(.patch_SkullKidPoacherSawCheck) } + .patch_PoeCollectorCheckPoints 0x19091C + _LD_OFF : { *(.patch_PoeCollectorCheckPoints) } + .patch_GoronShopPurchaseableCheck 0x19120C + _LD_OFF : { *(.patch_GoronShopPurchaseableCheck) } + .patch_PlayerEditAndRetrieveCMB 0x191970 + _LD_OFF : { *(.patch_PlayerEditAndRetrieveCMB) } + .patch_AdultItemsCMABsAsChild 0x191BB0 + _LD_OFF : { *(.patch_AdultItemsCMABsAsChild) } + .patch_SetChildCustomTunic 0x191DB0 + _LD_OFF : { *(.patch_SetChildCustomTunic) } + .patch_PlayerGetCustomTunicCMAB 0x191DD4 + _LD_OFF : { *(.patch_PlayerGetCustomTunicCMAB) } + .patch_SkipDaruniaDanceOne 0x19493C + _LD_OFF : { *(.patch_SkipDaruniaDanceOne) } + .patch_SkipDaruniaDanceTwo 0x194944 + _LD_OFF : { *(.patch_SkipDaruniaDanceTwo) } + .patch_ChildRollingGoron 0x194B18 + _LD_OFF : { *(.patch_ChildRollingGoron) } + .patch_BiggoronCheckBGSFlag 0x194DA0 + _LD_OFF : { *(.patch_BiggoronCheckBGSFlag) } + .patch_ChildRollingGoronDontCheckBombBag 0x195414 + _LD_OFF : { *(.patch_ChildRollingGoronDontCheckBombBag) } + .patch_AdultRollingGoronIgnoreMedallion 0x195450 + _LD_OFF : { *(.patch_AdultRollingGoronIgnoreMedallion) } + .patch_AdultRollingGoronOne 0x195480 + _LD_OFF : { *(.patch_AdultRollingGoronOne) } + .patch_AdultRollingGoronTwo 0x1954AC + _LD_OFF : { *(.patch_AdultRollingGoronTwo) } + .patch_BiggoronGetTextId 0x1954F8 + _LD_OFF : { *(.patch_BiggoronGetTextId) } + .patch_EponasSongCheckFlagTwo 0x195CFC + _LD_OFF : { *(.patch_EponasSongCheckFlagTwo) } + .patch_GohmaLarvaDeathSignalParent 0x1968DC + _LD_OFF : { *(.patch_GohmaLarvaDeathSignalParent) } + .patch_AmyBlockCooldownTimer 0x196ECC + _LD_OFF : { *(.patch_AmyBlockCooldownTimer) } + .patch_AmyBlockSpeed 0x196F3C + _LD_OFF : { *(.patch_AmyBlockSpeed) } + .patch_DampeChest 0x19A420 + _LD_OFF : { *(.patch_DampeChest) } + .patch_PierreSoftlockFixOne 0x19C734 + _LD_OFF : { *(.patch_PierreSoftlockFixOne) } + .patch_EnBlkobj_FindDarkLink 0x1A0BC8 + _LD_OFF : { *(.patch_EnBlkobj_FindDarkLink) } + .patch_EnBlkobj_SpawnDarkLink 0x1A137C + _LD_OFF : { *(.patch_EnBlkobj_SpawnDarkLink) } + .patch_RutoBlueWarpOverride 0x1A1900 + _LD_OFF : { *(.patch_RutoBlueWarpOverride) } + .patch_KotakeDontPlayBattleMusic 0x1A8218 + _LD_OFF : { *(.patch_KotakeDontPlayBattleMusic) } + .patch_GetObjectEntry_EnGomaInit_One 0x1B3130 + _LD_OFF : { *(.patch_GetObjectEntry_EnGomaInit_One) } + .patch_GetObjectEntry_EnGomaInit_Two 0x1B3208 + _LD_OFF : { *(.patch_GetObjectEntry_EnGomaInit_Two) } + .patch_GossipStoneAddSariaHint 0x1B3968 + _LD_OFF : { *(.patch_GossipStoneAddSariaHint) } + .patch_ReadGossipStoneHints 0x1B3A44 + _LD_OFF : { *(.patch_ReadGossipStoneHints) } + .patch_SkipJabuOpeningCutscene 0x1B583C + _LD_OFF : { *(.patch_SkipJabuOpeningCutscene) } + .patch_KingZoraSecondTunic 0x1B6A18 + _LD_OFF : { *(.patch_KingZoraSecondTunic) } + .patch_KingZoraGiveTunic 0x1B6A64 + _LD_OFF : { *(.patch_KingZoraGiveTunic) } + .patch_MidoCheckDekuTreeClearThree 0x1B7414 + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearThree) } + .patch_GetObjectEntry_EnTiteInit 0x1BBC9C + _LD_OFF : { *(.patch_GetObjectEntry_EnTiteInit) } + .patch_FishingNewRecord 0x1C3AA4 + _LD_OFF : { *(.patch_FishingNewRecord) } + .patch_FishingSizeIgnoreChild 0x1C3DFC + _LD_OFF : { *(.patch_FishingSizeIgnoreChild) } + .patch_FishingSizeIgnoreAdult 0x1C3E40 + _LD_OFF : { *(.patch_FishingSizeIgnoreAdult) } + .patch_BabyDodongoAfterSwallowBomb 0x1C42DC + _LD_OFF : { *(.patch_BabyDodongoAfterSwallowBomb) } + .patch_BiggoronAfterGiveItem 0x1C4E4C + _LD_OFF : { *(.patch_BiggoronAfterGiveItem) } + .patch_KingZoraSetTradedPrescriptionFlag 0x1C52A0 + _LD_OFF : { *(.patch_KingZoraSetTradedPrescriptionFlag) } + .patch_GerudoBattleMusic 0x1C6FD8 + _LD_OFF : { *(.patch_GerudoBattleMusic) } + .patch_EnEncount1_SpawnLeever 0x1CC94C + _LD_OFF : { *(.patch_EnEncount1_SpawnLeever) } + .patch_EnEncount1_SetLeeverAimType 0x1CC984 + _LD_OFF : { *(.patch_EnEncount1_SetLeeverAimType) } + .patch_TruthSpinnerSpeed 0x1CD814 + _LD_OFF : { *(.patch_TruthSpinnerSpeed) } + .patch_DemoEffectStoneDraw 0x1D209C + _LD_OFF : { *(.patch_DemoEffectStoneDraw) } + .patch_ChestIceSmoke 0x1D5E5C + _LD_OFF : { *(.patch_ChestIceSmoke) } + .patch_CheckGerudoToken_1D7AD4 0x1D7AD4 + _LD_OFF : { *(.patch_CheckGerudoToken_1D7AD4) } + .patch_BiggoronSetTextId 0x1D8A10 + _LD_OFF : { *(.patch_BiggoronSetTextId) } + .patch_BombchuShopAlwaysOpen 0x1DC6B0 + _LD_OFF : { *(.patch_BombchuShopAlwaysOpen) } + .patch_LeeverDontChangeCategory 0x1DE010 + _LD_OFF : { *(.patch_LeeverDontChangeCategory) } + .patch_LeeverSandCheck_Init 0x1DE078 + _LD_OFF : { *(.patch_LeeverSandCheck_Init) } + .patch_AdultBlueWarpOverride 0x1E3F50 + _LD_OFF : { *(.patch_AdultBlueWarpOverride) } + .patch_DaruniaCheckStrength 0x1E489C + _LD_OFF : { *(.patch_DaruniaCheckStrength) } + .patch_CanPlayBombchuBowlingTwo 0x1EA1D4 + _LD_OFF : { *(.patch_CanPlayBombchuBowlingTwo) } + .patch_BoomerangTrailEffect 0x1F4220 + _LD_OFF : { *(.patch_BoomerangTrailEffect) } /*EnBoom_Draw*/ + .patch_GohmaEggDeathSignalParent 0x1F5F48 + _LD_OFF : { *(.patch_GohmaEggDeathSignalParent) } + .patch_Item00GiveAutomaticItemDrop 0x1F6E4C + _LD_OFF : { *(.patch_Item00GiveAutomaticItemDrop) } + .patch_ItemGiveBombchuDropOne 0x1F6F70 + _LD_OFF : { *(.patch_ItemGiveBombchuDropOne) } + .patch_GetObjectEntry_1F85B0 0x1F85B0 + _LD_OFF : { *(.patch_GetObjectEntry_1F85B0) } + .patch_BombchuBowlingStaticReward 0x206150 + _LD_OFF : { *(.patch_BombchuBowlingStaticReward) } + .patch_SkipSongReplays_TimeBlocksFix 0x208004 + _LD_OFF : { *(.patch_SkipSongReplays_TimeBlocksFix) } + .patch_SkipSongReplays_WarpBlocksFix 0x208068 + _LD_OFF : { *(.patch_SkipSongReplays_WarpBlocksFix) } + .patch_ChestMinigame_DontOpenChestsOnInit 0x20EC8C + _LD_OFF : { *(.patch_ChestMinigame_DontOpenChestsOnInit) } + .patch_ChestMinigame_KeyChestVisibility 0x20EDB8 + _LD_OFF : { *(.patch_ChestMinigame_KeyChestVisibility) } + .patch_ChestMinigame_RewardChestVisibility 0x20EFE0 + _LD_OFF : { *(.patch_ChestMinigame_RewardChestVisibility) } + .patch_ShopItemDontSetAnimSpeedOne 0x2101BC + _LD_OFF : { *(.patch_ShopItemDontSetAnimSpeedOne) } + .patch_ShopItemDontSetAnimSpeedTwo 0x2101CC + _LD_OFF : { *(.patch_ShopItemDontSetAnimSpeedTwo) } + .patch_CourtyardCheckForVisitedZeldaOne 0x210C4C + _LD_OFF : { *(.patch_CourtyardCheckForVisitedZeldaOne) } + .patch_CourtyardCheckForVisitedZeldaTwo 0x210C78 + _LD_OFF : { *(.patch_CourtyardCheckForVisitedZeldaTwo) } + .patch_BugsRecatchable 0x212090 + _LD_OFF : { *(.patch_BugsRecatchable) } + .patch_WaterSpoutMasterQuestCheck 0x212BDC + _LD_OFF : { *(.patch_WaterSpoutMasterQuestCheck) } + .patch_DekuSproutCheckForest 0x2153A4 + _LD_OFF : { *(.patch_DekuSproutCheckForest) } + .patch_DungeonCheckJabuMQBox 0x21590C + _LD_OFF : { *(.patch_DungeonCheckJabuMQBox) } + .patch_JabuBoxCheckRuto 0x215934 + _LD_OFF : { *(.patch_JabuBoxCheckRuto) } + .patch_GetObjectEntry_ObjSwitchInit 0x215A60 + _LD_OFF : { *(.patch_GetObjectEntry_ObjSwitchInit) } + .patch_EnEncount1_SpawnStalchildWolfos 0x21C020 + _LD_OFF : { *(.patch_EnEncount1_SpawnStalchildWolfos) } + .patch_DekuTheaterMaskOfTruth 0x21CA30 + _LD_OFF : { *(.patch_DekuTheaterMaskOfTruth) } + .patch_BombchuBowlingPrizeOrder 0x21CAD4 + _LD_OFF : { *(.patch_BombchuBowlingPrizeOrder) } + .patch_NoHealFromBombchuBowlingPrize 0x21D170 + _LD_OFF : { *(.patch_NoHealFromBombchuBowlingPrize) } + .patch_HookshotDrawChain 0x2202A0 + _LD_OFF : { *(.patch_HookshotDrawChain) } + .patch_GetObjectEntry_EnDekunutsInit 0x2293AC + _LD_OFF : { *(.patch_GetObjectEntry_EnDekunutsInit) } + .patch_GetObjectEntry_EnHintnutsInit 0x22AB70 + _LD_OFF : { *(.patch_GetObjectEntry_EnHintnutsInit) } + .patch_Item00GiveCollectedItemDrop 0x22B974 + _LD_OFF : { *(.patch_Item00GiveCollectedItemDrop) } + .patch_patch_ItemGiveBombchuDropTwo 0x22BAE4 + _LD_OFF : { *(.patch_ItemGiveBombchuDropTwo) } + .patch_GetObjectEntry_EnNutsballInit 0x22DEC4 + _LD_OFF : { *(.patch_GetObjectEntry_EnNutsballInit) } + .patch_BusinessScrubCheckFlags 0x22EE64 + _LD_OFF : { *(.patch_BusinessScrubCheckFlags) } + .patch_DarkLinkPlayerRecoil 0x22F838 + _LD_OFF : { *(.patch_DarkLinkPlayerRecoil) } + .patch_GanonCSEquipMS 0x2359A4 + _LD_OFF : { *(.patch_GanonCSEquipMS) } + .patch_AnubisFlameCircleCheck 0x246F64 + _LD_OFF : { *(.patch_AnubisFlameCircleCheck) } + .patch_RainbowChuTrailOne 0x247FC0 + _LD_OFF : { *(.patch_RainbowChuTrailOne) } /*Bombchus use 2 EffectBlure instances*/ + .patch_RainbowChuTrailTwo 0x2480A4 + _LD_OFF : { *(.patch_RainbowChuTrailTwo) } /*Bombchus use 2 EffectBlure instances*/ + .patch_EnExItemModelDraw 0x249C94 + _LD_OFF : { *(.patch_EnExItemModelDraw) } + .patch_RedeadCanFreezePlayer 0x24DC2C + _LD_OFF : { *(.patch_RedeadCanFreezePlayer) } + .patch_SwordTrailDurationGrezzoFix 0x2507D0 + _LD_OFF : { *(.patch_SwordTrailDurationGrezzoFix) } /*duration is set to 6 due to framerate increase. NOP to allow custom duration*/ + .patch_MultiplyPlayerSpeed 0x251D34 + _LD_OFF : { *(.patch_MultiplyPlayerSpeed) } + .patch_GameOverStart 0x252424 + _LD_OFF : { *(.patch_GameOverStart) } + .patch_SkipDaruniaDanceThree 0x257F00 + _LD_OFF : { *(.patch_SkipDaruniaDanceThree) } + .patch_LostWoodsTargetTimer 0x2592B8 + _LD_OFF : { *(.patch_LostWoodsTargetTimer) } + .patch_LostWoodsShootingGame 0x259E4C + _LD_OFF : { *(.patch_LostWoodsShootingGame) } + .patch_CanPlayBombchuBowlingOne 0x25A744 + _LD_OFF : { *(.patch_CanPlayBombchuBowlingOne) } + .patch_GanonDrawMasterSword 0x26207C + _LD_OFF : { *(.patch_GanonDrawMasterSword) } + .patch_NaviNotifications 0x267E04 + _LD_OFF : { *(.patch_NaviNotifications) } + .patch_CheckGerudoToken_269884 0x269884 + _LD_OFF : { *(.patch_CheckGerudoToken_269884) } + .patch_MinuetLocation 0x26C388 + _LD_OFF : { *(.patch_MinuetLocation) } + .patch_BoleroLocation 0x26C448 + _LD_OFF : { *(.patch_BoleroLocation) } + .patch_FlyingTileCollision 0x26E730 + _LD_OFF : { *(.patch_FlyingTileCollision) } + .patch_DeadHandHandCanGrabPlayer 0x26EB58 + _LD_OFF : { *(.patch_DeadHandHandCanGrabPlayer) } + .patch_RedBoulderExplode 0x26FE7C + _LD_OFF : { *(.patch_RedBoulderExplode) } + .patch_MaskSalesmanGiveMaskOfTruth 0x271D48 + _LD_OFF : { *(.patch_MaskSalesmanGiveMaskOfTruth) } + .patch_SongOfTimeJingle 0x274B1C + _LD_OFF : { *(.patch_SongOfTimeJingle) } + .patch_DoorOfTimeCheck 0x274B68 + _LD_OFF : { *(.patch_DoorOfTimeCheck) } + .patch_ImpaInCourtyardCheckForVisitedZelda 0x27DEF8 + _LD_OFF : { *(.patch_ImpaInCourtyardCheckForVisitedZelda) } + .patch_GanonGiveMSMidFight 0x288030 + _LD_OFF : { *(.patch_GanonGiveMSMidFight) } + .patch_AnjuGiveCojiro 0x2884F4 + _LD_OFF : { *(.patch_AnjuGiveCojiro) } + .patch_SunsSongLocation 0x2888C8 + _LD_OFF : { *(.patch_SunsSongLocation) } + .patch_PierreSoftlockFixTwo 0x288914 + _LD_OFF : { *(.patch_PierreSoftlockFixTwo) } + .patch_PierreSoftlockFixThree 0x2889D4 + _LD_OFF : { *(.patch_PierreSoftlockFixThree) } + .patch_KakarikoGateCheck 0x28A678 + _LD_OFF : { *(.patch_KakarikoGateCheck) } + .patch_BombchuBowlingAlwaysFirstPrize 0x291924 + _LD_OFF : { *(.patch_BombchuBowlingAlwaysFirstPrize) } + .patch_LostWoodsShootingGameTwo 0x2990E8 + _LD_OFF : { *(.patch_LostWoodsShootingGameTwo) } + .patch_Sheik_GetTextID 0x2A4B44 + _LD_OFF : { *(.patch_Sheik_GetTextID) } + .patch_SerenadeCheckChestFlag 0x2B2544 + _LD_OFF : { *(.patch_SerenadeCheckChestFlag) } + .patch_SerenadeLocation 0x2B2574 + _LD_OFF : { *(.patch_SerenadeLocation) } + .patch_RainbowSwordTrail 0x2B9AD0 + _LD_OFF : { *(.patch_RainbowSwordTrail) } + .patch_OverrideTextID 0x2BC1C4 + _LD_OFF : { *(.patch_OverrideTextID) } + .patch_OverrideItemID 0x2BC1D0 + _LD_OFF : { *(.patch_OverrideItemID) } + .patch_NoSilverGauntletsCutsceneWarp 0x2BC2A0 + _LD_OFF : { *(.patch_NoSilverGauntletsCutsceneWarp) } + .patch_RunAnimationSpeed 0x2BE70C + _LD_OFF : { *(.patch_RunAnimationSpeed) } + .patch_FishingIgnoreTempBOne 0x2C3A10 + _LD_OFF : { *(.patch_FishingIgnoreTempBOne) } + .patch_DoorOfTimeOpenCutscene 0x2C6218 + _LD_OFF : { *(.patch_DoorOfTimeOpenCutscene) } + .patch_NoHealFromHealthUpgrades 0x2CD07C + _LD_OFF : { *(.patch_NoHealFromHealthUpgrades) } + .patch_GetCustomMessageEntryOne 0x2CD3A4 + _LD_OFF : { *(.patch_GetCustomMessageEntryOne) } + .patch_GetCustomMessageTextOne 0x2CD3EC + _LD_OFF : { *(.patch_GetCustomMessageTextOne) } + .patch_ActorDraw 0x2D6310 + _LD_OFF : { *(.patch_ActorDraw) } + .patch_OcarinaNoteSound_Player 0x2D6A04 + _LD_OFF : { *(.patch_OcarinaNoteSound_Player) } + .patch_CamUpdate 0x2D84C8 + _LD_OFF : { *(.patch_CamUpdate) } + .patch_CamRoll 0x2D88E4 + _LD_OFF : { *(.patch_CamRoll) } + .patch_CheckForTextControlCode 0x2E0490 + _LD_OFF : { *(.patch_CheckForTextControlCode) } + .patch_HandleTextControlCode 0x2E057C + _LD_OFF : { *(.patch_HandleTextControlCode) } + .patch_SceneInitAfterCopyScenes 0x2EAFDC + _LD_OFF : { *(.patch_SceneInitAfterCopyScenes) } + .patch_ChildCanOpenBowSubMenu 0x2EB2D8 + _LD_OFF : { *(.patch_ChildCanOpenBowSubMenu) } + .patch_FileSelect_CopyFile 0x2EDA04 + _LD_OFF : { *(.patch_FileSelect_CopyFile) } + .patch_CorrectCompassChests 0x2F161C + _LD_OFF : { *(.patch_CorrectCompassChests) } + .patch_CorrectCompassChestsTwo 0x2F1770 + _LD_OFF : { *(.patch_CorrectCompassChestsTwo) } + .patch_OverrideDrawItemOne 0x2F7498 + _LD_OFF : { *(.patch_OverrideDrawItemOne) } + .patch_OcarinaNoteButtonsDraw 0x2F9430 + _LD_OFF : { *(.patch_OcarinaNoteButtonsDraw) } + .patch_SaveGame 0x2FBFA8 + _LD_OFF : { *(.patch_SaveGame) } + .patch_SaveFileSwordless 0x2FDCE4 + _LD_OFF : { *(.patch_SaveFileSwordless) } + .patch_Gfx_Update 0x310254 + _LD_OFF : { *(.patch_Gfx_Update) } + .patch_OverrideDrawItemTwo 0x3148A8 + _LD_OFF : { *(.patch_OverrideDrawItemTwo) } + .patch_OoBBombchuOne 0x315120 + _LD_OFF : { *(.patch_OoBBombchuOne) } + .patch_OoBBombchuTwo 0x31513C + _LD_OFF : { *(.patch_OoBBombchuTwo) } + .patch_OoBBombchuThree 0x315150 + _LD_OFF : { *(.patch_OoBBombchuThree) } + .patch_CollisionATvsAC 0x3191B0 + _LD_OFF : { *(.patch_CollisionATvsAC) } + .patch_ISGPutaway 0x32B4AC + _LD_OFF : { *(.patch_ISGPutaway) } + .patch_SetBGMEntrance 0x331048 + _LD_OFF : { *(.patch_SetBGMEntrance) } + .patch_NockArrow 0x33615C + _LD_OFF : { *(.patch_NockArrow) } + .patch_DecreaseArrowCount 0x3362C4 + _LD_OFF : { *(.patch_DecreaseArrowCount) } + .patch_SceneExitOverride 0x3366EC + _LD_OFF : { *(.patch_SceneExitOverride) } + .patch_SceneExitDynamicOverride 0x33676C + _LD_OFF : { *(.patch_SceneExitDynamicOverride) } + .patch_EnteredLocation 0x338DB8 + _LD_OFF : { *(.patch_EnteredLocation) } + .patch_LostWoodsBridgeMusic 0x338DD8 + _LD_OFF : { *(.patch_LostWoodsBridgeMusic) } + .patch_GetObjectEntry_339DFC 0x339DFC + _LD_OFF : { *(.patch_GetObjectEntry_339DFC) } + .patch_GetObjectEntry_33A950 0x33A950 + _LD_OFF : { *(.patch_GetObjectEntry_33A950) } + .patch_GetObjectEntry_33AB24 0x33AB24 + _LD_OFF : { *(.patch_GetObjectEntry_33AB24) } /* Used for: chest ice trap smoke effect */ + .patch_BiggoronDayCheck 0x33DCC0 + _LD_OFF : { *(.patch_BiggoronDayCheck) } + .patch_FWandWarpSongTimerDepletion 0x33DE84 + _LD_OFF : { *(.patch_FWandWarpSongTimerDepletion) } + .patch_RandomGsLoc_CustomTangibilityCheck 0x3415B0 + _LD_OFF : { *(.patch_RandomGsLoc_CustomTangibilityCheck) } + .patch_MasterQuestGoldSkulltulaCheck 0x3415C8 + _LD_OFF : { *(.patch_MasterQuestGoldSkulltulaCheck) } + .patch_TurboTextSignalNPC 0x3469F4 + _LD_OFF : { *(.patch_TurboTextSignalNPC) } + .patch_FairyReviveHealAmount 0x34AF48 + _LD_OFF : { *(.patch_FairyReviveHealAmount) } + .patch_FishingIgnoreTempBTwo 0x34CFCC + _LD_OFF : { *(.patch_FishingIgnoreTempBTwo) } + .patch_FWLoadSet 0x34D9E8 + _LD_OFF : { *(.patch_FWLoadSet) } + .patch_GetObjectEntry_34F270 0x34F270 + _LD_OFF : { *(.patch_GetObjectEntry_34F270) } + .patch_GetObjectEntry_34FE68 0x34FE68 + _LD_OFF : { *(.patch_GetObjectEntry_34FE68) } + .patch_FWGetSet 0x3519CC + _LD_OFF : { *(.patch_FWGetSet) } + .patch_ApplyDamageMultiplier 0x352DC0 + _LD_OFF : { *(.patch_ApplyDamageMultiplier) } + .patch_GetObjectEntry_352F28 0x352F28 + _LD_OFF : { *(.patch_GetObjectEntry_352F28) } /* Used for: Flare Dancer */ + .patch_GetObjectEntry_353CE4 0x353CE4 + _LD_OFF : { *(.patch_GetObjectEntry_353CE4) } + .patch_FastChests 0x354CD4 + _LD_OFF : { *(.patch_FastChests) } + .patch_AboutToPickUpActor 0x354DD8 + _LD_OFF : { *(.patch_AboutToPickUpActor) } + .patch_MasterSwordTimerCheck 0x354DFC + _LD_OFF : { *(.patch_MasterSwordTimerCheck) } + .patch_LikeLikeNeverEatTunic 0x355C2C + _LD_OFF : { *(.patch_LikeLikeNeverEatTunic) } + .patch_PlaySound 0x35C528 + _LD_OFF : { *(.patch_PlaySound) } + .patch_ConvertBombDropOne 0x35E46C + _LD_OFF : { *(.patch_ConvertBombDropOne) } + .patch_SkullwalltulaAttack_35F328 0x35F328 + _LD_OFF : { *(.patch_SkullwalltulaAttack_35F328) } + .patch_SkullwalltulaTargetRotation 0x35F828 + _LD_OFF : { *(.patch_SkullwalltulaTargetRotation) } + .patch_SkullwalltulaAttack_35F834 0x35F834 + _LD_OFF : { *(.patch_SkullwalltulaAttack_35F834) } + .patch_ISGCrouchStab 0x360690 + _LD_OFF : { *(.patch_ISGCrouchStab) } + .patch_ForceTrailEffectUpdate 0x362108 + _LD_OFF : { *(.patch_ForceTrailEffectUpdate) } /*EffectBlure_AddVertex*/ + .patch_ExtendObjectGetSlot 0x363CB4 + _LD_OFF : { *(.patch_ExtendObjectGetSlot) } + .patch_StalchildDespawn_366338 0x366338 + _LD_OFF : { *(.patch_StalchildDespawn_366338) } + .patch_GetObjectEntry_36A96C 0x36A96C + _LD_OFF : { *(.patch_GetObjectEntry_36A96C) } /* Used for: freestanding item models */ + .patch_IgnoreMaskReaction 0x36BBC4 + _LD_OFF : { *(.patch_IgnoreMaskReaction) } + .patch_SetBGMEvent 0x36EC40 + _LD_OFF : { *(.patch_SetBGMEvent) } + .patch_DemoEffectMedallionDraw 0x37214C + _LD_OFF : { *(.patch_DemoEffectMedallionDraw) } + .patch_IncomingGetItemID 0x3725AC + _LD_OFF : { *(.patch_IncomingGetItemID) } + .patch_Model_EnableMeshGroupByIndex 0x372670 + _LD_OFF : { *(.patch_Model_EnableMeshGroupByIndex) } + .patch_MaskSalesmanCheckNoMaskOne 0x372B64 + _LD_OFF : { *(.patch_MaskSalesmanCheckNoMaskOne) } + .patch_MaskSalesmanCheckNoMaskTwo 0x372B70 + _LD_OFF : { *(.patch_MaskSalesmanCheckNoMaskTwo) } + .patch_GetObjectEntry_372F7C 0x372F7C + _LD_OFF : { *(.patch_GetObjectEntry_372F7C) } + .patch_OverrideObjectIsLoaded 0x373074 + _LD_OFF : { *(.patch_OverrideObjectIsLoaded) } + .patch_ConvertBombDropTwo 0x3747A4 + _LD_OFF : { *(.patch_ConvertBombDropTwo) } + .patch_SetSFX 0x37547C + _LD_OFF : { *(.patch_SetSFX) } + .patch_CollisionCheck_SetAC_Once 0x376174 + _LD_OFF : { *(.patch_CollisionCheck_SetAC_Once) } + .patch_CollisionCheck_SetAT_Once 0x3761FC + _LD_OFF : { *(.patch_CollisionCheck_SetAT_Once) } + .patch_CollisionCheck_SetOC_Once 0x3762B0 + _LD_OFF : { *(.patch_CollisionCheck_SetOC_Once) } + .patch_GKSetDurability 0x376BDC + _LD_OFF : { *(.patch_GKSetDurability) } + .patch_GiantsKnifeWithoutKokiriSword 0x376BEC + _LD_OFF : { *(.patch_GiantsKnifeWithoutKokiriSword) } + .patch_GiveItemMasterSword 0x376C18 + _LD_OFF : { *(.patch_GiveItemMasterSword) } + .patch_NoLensOfTruthNaviText 0x37798C + _LD_OFF : { *(.patch_NoLensOfTruthNaviText) } + .patch_AltHeadersCommand 0x379020 + _LD_OFF : { *(.patch_AltHeadersCommand) } + .patch_FrogRewardPurple 0x3898F0 + _LD_OFF : { *(.patch_FrogRewardPurple) } + .patch_FrogReward 0x38992C + _LD_OFF : { *(.patch_FrogReward) } + .patch_ChildShootingGallery 0x38AB70 + _LD_OFF : { *(.patch_ChildShootingGallery) } + .patch_AdultShootingGallery 0x38ABA0 + _LD_OFF : { *(.patch_AdultShootingGallery) } + .patch_SariasSongHintsOne 0x390620 + _LD_OFF : { *(.patch_SariasSongHintsOne) } + .patch_SariasSongHintsTwo 0x39073C + _LD_OFF : { *(.patch_SariasSongHintsTwo) } + .patch_PeahatLarvaGroundCheck 0x391740 + _LD_OFF : { *(.patch_PeahatLarvaGroundCheck) } + .patch_OcarinaMinigameEndAfterWin 0x39DF38 + _LD_OFF : { *(.patch_OcarinaMinigameEndAfterWin) } + .patch_LullabyLocation 0x3A0A7C + _LD_OFF : { *(.patch_LullabyLocation) } + .patch_OverrideDrawItemThree 0x3A0EA8 + _LD_OFF : { *(.patch_OverrideDrawItemThree) } + .patch_AfterInvalidatingRoomObjects 0x3A7698 + _LD_OFF : { *(.patch_AfterInvalidatingRoomObjects) } + .patch_AfterObjectListCommand 0x3A7708 + _LD_OFF : { *(.patch_AfterObjectListCommand) } + .patch_KokiriCheckOpenForest 0x3ACCFC + _LD_OFF : { *(.patch_KokiriCheckOpenForest) } + .patch_TokenNoItemGive2 0x3AD270 + _LD_OFF : { *(.patch_TokenNoItemGive2) } + .patch_GetToken2 0x3AD2F0 + _LD_OFF : { *(.patch_GetToken2) } + .patch_TokenNoItemGive1 0x3ADD68 + _LD_OFF : { *(.patch_TokenNoItemGive1) } + .patch_GetToken1 0x3ADDE4 + _LD_OFF : { *(.patch_GetToken1) } + .patch_TalonGetCastleTextbox 0x3AE6E8 + _LD_OFF : { *(.patch_TalonGetCastleTextbox) } + .patch_GerudoArcheryOne 0x3AFA34 + _LD_OFF : { *(.patch_GerudoArcheryOne) } + .patch_ShabomAfterDamagePlayer 0x3B5060 + _LD_OFF : { *(.patch_ShabomAfterDamagePlayer) } + .patch_BabyDodongoWallCheck 0x3B833C + _LD_OFF : { *(.patch_BabyDodongoWallCheck) } + .patch_RandomGsLoc_CustomTokenSpawnOffset 0x3B94C4 + _LD_OFF : { *(.patch_RandomGsLoc_CustomTokenSpawnOffset) } + .patch_RandomGsLoc_BlockSpawn_Crate 0x3BCA68 + _LD_OFF : { *(.patch_RandomGsLoc_BlockSpawn_Crate) } + .patch_MovableBlockCooldownTimer 0x3BD46C + _LD_OFF : { *(.patch_MovableBlockCooldownTimer) } + .patch_MovableBlockSpeed 0x3BD508 + _LD_OFF : { *(.patch_MovableBlockSpeed) } + .patch_MilkCrateCooldownTimer 0x3BD85C + _LD_OFF : { *(.patch_MilkCrateCooldownTimer) } + .patch_MilkCrateSpeed 0x3BD88C + _LD_OFF : { *(.patch_MilkCrateSpeed) } + .patch_RandomGsLoc_BlockSpawn_Soil 0x3BF690 + _LD_OFF : { *(.patch_RandomGsLoc_BlockSpawn_Soil) } + .patch_ForestTempleBasementPuzzleDelay 0x3BFA8C + _LD_OFF : { *(.patch_ForestTempleBasementPuzzleDelay) } + .patch_GerudoArcheryTwo 0x3C2D80 + _LD_OFF : { *(.patch_GerudoArcheryTwo) } + .patch_DampeCheckCanDig1 0x3C3354 + _LD_OFF : { *(.patch_DampeCheckCanDig1) } + .patch_DampeRollHigh 0x3C3418 + _LD_OFF : { *(.patch_DampeRollHigh) } + .patch_DampeCheckRewardFlag 0x3C3598 + _LD_OFF : { *(.patch_DampeCheckRewardFlag) } + .patch_DampeCheckCanDig2 0x3C35D0 + _LD_OFF : { *(.patch_DampeCheckCanDig2) } + .patch_SongOfTimeLocation 0x3C375C + _LD_OFF : { *(.patch_SongOfTimeLocation) } + .patch_EponasSongLocation 0x3C6194 + _LD_OFF : { *(.patch_EponasSongLocation) } + .patch_MalonNextAction 0x3C6210 + _LD_OFF : { *(.patch_MalonNextAction) } + .patch_BombPurchaseableCheck 0x3CE800 + _LD_OFF : { *(.patch_BombPurchaseableCheck) } + .patch_ScrubStickUpgradeTwo 0x3CE990 + _LD_OFF : { *(.patch_ScrubStickUpgradeTwo) } + .patch_ScrubNutUpgradeTwo 0x3CE9DC + _LD_OFF : { *(.patch_ScrubNutUpgradeTwo) } + .patch_GrannySetRewardFlag 0x3D0E34 + _LD_OFF : { *(.patch_GrannySetRewardFlag) } + .patch_GrannyItemOverrideTwo 0x3D0E60 + _LD_OFF : { *(.patch_GrannyItemOverrideTwo) } + .patch_MidoCheckDekuTreeClearFour 0x3D2C18 + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearFour) } + .patch_LeeverAfterDie 0x3D4E10 + _LD_OFF : { *(.patch_LeeverAfterDie) } + .patch_LeeverAfterSink 0x3D6188 + _LD_OFF : { *(.patch_LeeverAfterSink) } + .patch_LeeverSandCheck_Small 0x3DE2A0 + _LD_OFF : { *(.patch_LeeverSandCheck_Small) } + .patch_ShadowShip_Speed 0x3DFB30 + _LD_OFF : { *(.patch_ShadowShip_Speed) } + .patch_FireBlockSpeed 0x3E0BB4 + _LD_OFF : { *(.patch_FireBlockSpeed) } + .patch_FreeScarecrow 0x3E55A8 + _LD_OFF : { *(.patch_FreeScarecrow) } + .patch_MasterSwordAlwaysDrop 0x3E5E98 + _LD_OFF : { *(.patch_MasterSwordAlwaysDrop) } + .patch_PickUpMasterSword 0x3E5EC8 + _LD_OFF : { *(.patch_PickUpMasterSword) } + .patch_SkipMasterSwordFanfare 0x3E5F60 + _LD_OFF : { *(.patch_SkipMasterSwordFanfare) } + .patch_ShadowShip_CSTimer 0x3E6C50 + _LD_OFF : { *(.patch_ShadowShip_CSTimer) } + .patch_FlyingPotDontChangeCategory 0x3E7008 + _LD_OFF : { *(.patch_FlyingPotDontChangeCategory) } + .patch_FairyReward 0x3E7598 + _LD_OFF : { *(.patch_FairyReward) } + .patch_RainbowBridge 0x3E7CAC + _LD_OFF : { *(.patch_RainbowBridge) } + .patch_RemoveWaterfallCS 0x3E7F64 + _LD_OFF : { *(.patch_RemoveWaterfallCS) } + .patch_DekuTheaterSkullMask 0x3EAF38 + _LD_OFF : { *(.patch_DekuTheaterSkullMask) } + .patch_CowItemOverride 0x3EE378 + _LD_OFF : { *(.patch_CowItemOverride) } + .patch_CowBottleCheck 0x3F065C + _LD_OFF : { *(.patch_CowBottleCheck) } + .patch_CarpetSalesmanCheckFlagOne 0x3F0A18 + _LD_OFF : { *(.patch_CarpetSalesmanCheckFlagOne) } + .patch_CarpetSalesmanCheckFlagTwo 0x3F0A64 + _LD_OFF : { *(.patch_CarpetSalesmanCheckFlagTwo) } + .patch_LabScientistIgnoreEyedropsInInventory 0x3F0B44 + _LD_OFF : { *(.patch_LabScientistIgnoreEyedropsInInventory) } + .patch_FastChestsTwo 0x3F1048 + _LD_OFF : { *(.patch_FastChestsTwo) } + .patch_HandleDoorDestroyCustomModels 0x3F1B88 + _LD_OFF : { *(.patch_HandleDoorDestroyCustomModels) } + .patch_OverrideGrottoActorEntrance 0x3F2254 + _LD_OFF : { *(.patch_OverrideGrottoActorEntrance) } + .patch_FireArrowRequirement 0x3F23AC + _LD_OFF : { *(.patch_FireArrowRequirement) } + .patch_FireArrowCheckChestFlagOne 0x3F23FC + _LD_OFF : { *(.patch_FireArrowCheckChestFlagOne) } + .patch_FireArrowCheckChestFlagTwo 0x3F2448 + _LD_OFF : { *(.patch_FireArrowCheckChestFlagTwo) } + .patch_LinkReflection 0x3F2F0C + _LD_OFF : { *(.patch_LinkReflection) } + .patch_SlidingDoorDestroyCustomModels 0x3F4A70 + _LD_OFF : { *(.patch_SlidingDoorDestroyCustomModels) } + .patch_ChildBlueWarpOverride 0x3F5774 + _LD_OFF : { *(.patch_ChildBlueWarpOverride) } + .patch_CarpetSalesmanSetFlag 0x3F9550 + _LD_OFF : { *(.patch_CarpetSalesmanSetFlag) } + .patch_PreSwapBuffers 0x3FD384 + _LD_OFF : { *(.patch_PreSwapBuffers) } + .patch_AwakeCallback 0x3FD43C + _LD_OFF : { *(.patch_AwakeCallback) } + .patch_SleepQueryCallback 0x3FD6C4 + _LD_OFF : { *(.patch_SleepQueryCallback) } + + /* 0x419E18 - 0x41A143 : Language related function, don't place anything in this range */ + /* 0x41A144 */ _LD_OFF = DEFINED(_EUR_) ? 0x24 : _LD_OFF; + + .patch_OcarinaNoteButtonsPress 0x41AAAC + _LD_OFF : { *(.patch_OcarinaNoteButtonsPress) } + .patch_CurseTrapDizzyStick 0x41AB24 + _LD_OFF : { *(.patch_CurseTrapDizzyStick) } + .patch_CurseTrapDizzyButtons 0x41ABDC + _LD_OFF : { *(.patch_CurseTrapDizzyButtons) } + .patch_PermadeathSkipMenu 0x41C980 + _LD_OFF : { *(.patch_PermadeathSkipMenu) } + .patch_SaveMenuIgnoreOpen 0x42EC00 + _LD_OFF : { *(.patch_SaveMenuIgnoreOpen) } + .patch_ItemsMenuDraw 0x434C08 + _LD_OFF : { *(.patch_ItemsMenuDraw) } + .patch_PlayInit 0x4352F4 + _LD_OFF : { *(.patch_PlayInit) } + + /* 0x436690 */ _LD_OFF = DEFINED(_EUR_) ? 0x20 : _LD_OFF; + + .patch_GearMenuEmptySlot 0x438C00 + _LD_OFF : { *(.patch_GearMenuEmptySlot) } + .patch_DrawHeartIcon 0x444368 + _LD_OFF : { *(.patch_DrawHeartIcon) } + .patch_BeforeLoadGame 0x447380 + _LD_OFF : { *(.patch_BeforeLoadGame) } + .patch_DontSetMotionSetting 0x447410 + _LD_OFF : { *(.patch_DontSetMotionSetting) } + .patch_OverrideFogDuringGameplayInit 0x4485B4 + _LD_OFF : { *(.patch_OverrideFogDuringGameplayInit) } + .patch_CheckForWeirdEggHatchGameplayInit 0x448A64 + _LD_OFF : { *(.patch_CheckForWeirdEggHatchGameplayInit) } + .patch_CheckForPocketCuccoHatchGameplayInit 0x448A80 + _LD_OFF : { *(.patch_CheckForPocketCuccoHatchGameplayInit) } + .patch_InitSceneMirrorWorld 0x4490DC + _LD_OFF : { *(.patch_InitSceneMirrorWorld) } + .patch_InitSceneEntranceOverride 0x449190 + _LD_OFF : { *(.patch_InitSceneEntranceOverride) } + .patch_InitSceneClearExtendedObjects 0x449218 + _LD_OFF : { *(.patch_InitSceneClearExtendedObjects) } + .patch_SaveFile_Init 0x449A04 + _LD_OFF : { *(.patch_SaveFile_Init) } + .patch_SavewarpSetRespawnFlag 0x449E40 + _LD_OFF : { *(.patch_SavewarpSetRespawnFlag) } + .patch_Multiplayer_OnLoadFile 0x449EFC + _LD_OFF : { *(.patch_Multiplayer_OnLoadFile) } + .patch_AfterLoadGame 0x449F00 + _LD_OFF : { *(.patch_AfterLoadGame) } + .patch_GetCustomMessageEntryTwo 0x44D564 + _LD_OFF : { *(.patch_GetCustomMessageEntryTwo) } + .patch_GetCustomMessageTextTwo 0x44D5A4 + _LD_OFF : { *(.patch_GetCustomMessageTextTwo) } + .patch_GameplayDestroy 0x44E294 + _LD_OFF : { *(.patch_GameplayDestroy) } + .patch_ExtendedObjectClear 0x44E758 + _LD_OFF : { *(.patch_ExtendedObjectClear) } + .patch_Multiplayer_UpdatePrevActorFlags 0x44E878 + _LD_OFF : { *(.patch_Multiplayer_UpdatePrevActorFlags) } + .patch_PlayEntranceCutscene 0x44F068 + _LD_OFF : { *(.patch_PlayEntranceCutscene) } + .patch_RequiemLocation 0x44F104 + _LD_OFF : { *(.patch_RequiemLocation) } + .patch_NocturneLocation 0x44F12C + _LD_OFF : { *(.patch_NocturneLocation) } + .patch_SariasGift 0x44F188 + _LD_OFF : { *(.patch_SariasGift) } + .patch_LACSConditionOne 0x44F1D4 + _LD_OFF : { *(.patch_LACSConditionOne) } + .patch_LACSConditionTwo 0x44F20C + _LD_OFF : { *(.patch_LACSConditionTwo) } + .patch_BossChallenge_Enter 0x44F634 + _LD_OFF : { *(.patch_BossChallenge_Enter) } + .patch_SetSavewarpEntrance 0x44FBE4 + _LD_OFF : { *(.patch_SetSavewarpEntrance) } + .patch_LullabyCheckFlag 0x44FD54 + _LD_OFF : { *(.patch_LullabyCheckFlag) } + .patch_LoadFileSwordless 0x44FD98 + _LD_OFF : { *(.patch_LoadFileSwordless) } + .patch_OpenSaveDontSpoilTradeItems 0x44FDF8 + _LD_OFF : { *(.patch_OpenSaveDontSpoilTradeItems) } + .patch_OnActorSetup_SceneChange 0x452250 + _LD_OFF : { *(.patch_OnActorSetup_SceneChange) } + .patch_AfterActorSetup_SceneChange 0x4522B8 + _LD_OFF : { *(.patch_AfterActorSetup_SceneChange) } + .patch_before_GlobalContext_Update 0x452390 + _LD_OFF : { *(.patch_before_GlobalContext_Update) } + .patch_after_GlobalContext_Update 0x452434 + _LD_OFF : { *(.patch_after_GlobalContext_Update) } + .patch_FixItemsMenuSlotDuplication 0x456B90 + _LD_OFF : { *(.patch_FixItemsMenuSlotDuplication) } + .patch_GameOverDontSpoilTradeItems 0x458BE0 + _LD_OFF : { *(.patch_GameOverDontSpoilTradeItems) } + .patch_DeathHandleBButton 0x458CA8 + _LD_OFF : { *(.patch_DeathHandleBButton) } + .patch_PermadeathForceQuit 0x458E20 + _LD_OFF : { *(.patch_PermadeathForceQuit) } + .patch_SetGameOverEntrance 0x458E3C + _LD_OFF : { *(.patch_SetGameOverEntrance) } + .patch_SetGameOverRespawnFlag 0x458EF0 + _LD_OFF : { *(.patch_SetGameOverRespawnFlag) } + .patch_InterfaceDrawDontSpoilTradeItems 0x45A17C + _LD_OFF : { *(.patch_InterfaceDrawDontSpoilTradeItems) } + .patch_TimerExpiration 0x45A948 + _LD_OFF : { *(.patch_TimerExpiration) } + .patch_Timer2TickSound 0x45A9B4 + _LD_OFF : { *(.patch_Timer2TickSound) } + .patch_SunsSongEndCloseTextbox 0x45B514 + _LD_OFF : { *(.patch_SunsSongEndCloseTextbox) } + .patch_SetSunsSongRespawnFlag 0x45B660 + _LD_OFF : { *(.patch_SetSunsSongRespawnFlag) } + .patch_BossChallenge_ExitMenu 0x45CCA4 + _LD_OFF : { *(.patch_BossChallenge_ExitMenu) } + .patch_StoreChildBButtonEquip 0x45F20C + _LD_OFF : { *(.patch_StoreChildBButtonEquip) } + .patch_BecomeAdult 0x45F230 + _LD_OFF : { *(.patch_BecomeAdult) } + .patch_AlwaysRestoreChildEquips 0x45F3B0 + _LD_OFF : { *(.patch_AlwaysRestoreChildEquips) } + .patch_ChildDontEquipSwordSlotByDefault 0x45F49C + _LD_OFF : { *(.patch_ChildDontEquipSwordSlotByDefault) } + .patch_OnActorSetup_RoomChange 0x4613C4 + _LD_OFF : { *(.patch_OnActorSetup_RoomChange) } + .patch_AfterActorSetup_RoomChange 0x461434 + _LD_OFF : { *(.patch_AfterActorSetup_RoomChange) } + .patch_FixActorKillLoop 0x4615E0 + _LD_OFF : { *(.patch_FixActorKillLoop) } + .patch_ActorUpdate 0x461790 + _LD_OFF : { *(.patch_ActorUpdate) } + .patch_TitleCardUpdate 0x4618B8 + _LD_OFF : { *(.patch_TitleCardUpdate) } + .patch_ItemsMenuNumSprites 0x46B758 + _LD_OFF : { *(.patch_ItemsMenuNumSprites) } + .patch_CheckForWeirdEggHatchKankyo 0x470D00 + _LD_OFF : { *(.patch_CheckForWeirdEggHatchKankyo) } + .patch_CheckForPocketCuccoHatchKankyo 0x470D1C + _LD_OFF : { *(.patch_CheckForPocketCuccoHatchKankyo) } + .patch_CriticalHealthCheckOne 0x4715B8 + _LD_OFF : { *(.patch_CriticalHealthCheckOne) } + .patch_CriticalHealthCheckTwo 0x4716D4 + _LD_OFF : { *(.patch_CriticalHealthCheckTwo) } + .patch_EnableFW 0x476D1C + _LD_OFF : { *(.patch_EnableFW) } + .patch_OcarinaNoteSound_Npc 0x477C08 + _LD_OFF : { *(.patch_OcarinaNoteSound_Npc) } + .patch_StoreTargetActorType 0x479984 + _LD_OFF : { *(.patch_StoreTargetActorType) } + .patch_TargetReticleColor 0x47B284 + _LD_OFF : { *(.patch_TargetReticleColor) } + .patch_TargetPointerColor 0x47BAE8 + _LD_OFF : { *(.patch_TargetPointerColor) } + .patch_FWKeepWarpPoint 0x47C3C0 + _LD_OFF : { *(.patch_FWKeepWarpPoint) } + .patch_TurboTextAdvance 0x480928 + _LD_OFF : { *(.patch_TurboTextAdvance) } + .patch_SetBGMDayNight 0x483C88 + _LD_OFF : { *(.patch_SetBGMDayNight) } + .patch_Cutscene_CheckObjectLoaded 0x4849D8 + _LD_OFF : { *(.patch_Cutscene_CheckObjectLoaded) } + .patch_TurboTextClose 0x488214 + _LD_OFF : { *(.patch_TurboTextClose) } + .patch_WarpSongEntranceOverride 0x488850 + _LD_OFF : { *(.patch_WarpSongEntranceOverride) } + .patch_SetFWPlayerParams 0x4911B8 + _LD_OFF : { *(.patch_SetFWPlayerParams) } + .patch_SwapFaroresWind 0x49186C + _LD_OFF : { *(.patch_SwapFaroresWind) } + .patch_SwapAgeIgnoreSceneSetup 0x4918B0 + _LD_OFF : { *(.patch_SwapAgeIgnoreSceneSetup) } + .patch_SkipTimeTravelCutsceneTwo 0x4918C8 + _LD_OFF : { *(.patch_SkipTimeTravelCutsceneTwo) } + .patch_DMTOwlEntranceOverride 0x492064 + _LD_OFF : { *(.patch_DMTOwlEntranceOverride) } + .patch_LHOwlEntranceOverride 0x492080 + _LD_OFF : { *(.patch_LHOwlEntranceOverride) } + .patch_PlayerBonk 0x492CD0 + _LD_OFF : { *(.patch_PlayerBonk) } + .patch_FairyUseHealAmount 0x4968B4 + _LD_OFF : { *(.patch_FairyUseHealAmount) } + .patch_SendDroppedBottleContents 0x496A1C + _LD_OFF : { *(.patch_SendDroppedBottleContents) } + .patch_ReturnFW 0x496B88 + _LD_OFF : { *(.patch_ReturnFW) } + .patch_SetSpecialVoidOutRespawnFlag 0x496C70 + _LD_OFF : { *(.patch_SetSpecialVoidOutRespawnFlag) } + .patch_GanonBattleDeathWarp 0x496C98 + _LD_OFF : { *(.patch_GanonBattleDeathWarp) } + .patch_GanonRestoreMSOnDeath 0x496CB4 + _LD_OFF : { *(.patch_GanonRestoreMSOnDeath) } + .patch_CriticalHealthCheckThree 0x49F294 + _LD_OFF : { *(.patch_CriticalHealthCheckThree) } + + /* 0x4A5B00 */ _LD_OFF = DEFINED(_EUR_) ? 0x0 : _LD_OFF; + + .patch_OverrideGiDrawIdPlusOne_Ground 0x4BC610 + _LD_OFF : { *(.patch_OverrideGiDrawIdPlusOne_Ground) } + .patch_OverrideGiDrawIdPlusOne_Water 0x4BD5DC + _LD_OFF : { *(.patch_OverrideGiDrawIdPlusOne_Water) } + .patch_EditDrawGetItemBeforeModelSpawn 0x4C0FD0 + _LD_OFF : { *(.patch_EditDrawGetItemBeforeModelSpawn) } + .patch_HookshotRotation 0x4C2524 + _LD_OFF : { *(.patch_HookshotRotation) } + .patch_EditDrawGetItemAfterMatrixUpdate 0x4C4D14 + _LD_OFF : { *(.patch_EditDrawGetItemAfterMatrixUpdate) } + .patch_EditDrawGetItemAfterModelSpawn 0x4C61A4 + _LD_OFF : { *(.patch_EditDrawGetItemAfterModelSpawn) } + .patch_CrouchStabHitbox 0x4C85D4 + _LD_OFF : { *(.patch_CrouchStabHitbox) } + + /* 0x4C99A7: End of vanilla code in .text section */ + . = 0x4C99A8 + _LD_OFF; . = ALIGN(4); .loader : { *(.loader*) } - .patch_DampeSetCollectibleFlag 0x4D9D50 : { - *(.patch_DampeSetCollectibleFlag) - } - - .patch_BombchuCheapestPriceOne 0x525348 : { - *(.patch_BombchuCheapestPriceOne) - } - - .patch_BombchuCheapestPriceTwo 0x5253D8 : { - *(.patch_BombchuCheapestPriceTwo) - } - - .patch_BombchuCheapestPriceThree 0x525408 : { - *(.patch_BombchuCheapestPriceThree) - } - - .patch_BombchuCheapestPriceFour 0x525498 : { - *(.patch_BombchuCheapestPriceFour) - } - - .patch_OcarinaMinigameRewardsOrder 0x52ED10 : { - *(.patch_OcarinaMinigameRewardsOrder) - } - - .patch_TycoonWalletSize 0x53CC08 : { - *(.patch_TycoonWalletSize) - } - - .patch_TitleLinkObject 0x53CCF0 : { - *(.patch_TitleLinkObject) - } + .patch_DampeSetCollectibleFlag 0x4D9D50 + _LD_OFF : { *(.patch_DampeSetCollectibleFlag) } + .patch_BombchuCheapestPriceOne 0x525348 + _LD_OFF : { *(.patch_BombchuCheapestPriceOne) } + .patch_BombchuCheapestPriceTwo 0x5253D8 + _LD_OFF : { *(.patch_BombchuCheapestPriceTwo) } + .patch_BombchuCheapestPriceThree 0x525408 + _LD_OFF : { *(.patch_BombchuCheapestPriceThree) } + .patch_BombchuCheapestPriceFour 0x525498 + _LD_OFF : { *(.patch_BombchuCheapestPriceFour) } + .patch_OcarinaMinigameRewardsOrder 0x52ED10 + _LD_OFF : { *(.patch_OcarinaMinigameRewardsOrder) } + .patch_TycoonWalletSize 0x53CC08 + _LD_OFF : { *(.patch_TycoonWalletSize) } + .patch_TitleLinkObject 0x53CCF0 + _LD_OFF : { *(.patch_TitleLinkObject) } - . = 0x005C7000; + /* 0x005C6607: End of vanilla .bss section */ + . = 0x005C7000 + _LD_OFF; + _LD_TEXT_START = . ; .text : { __text_start = . ; *(.text*) + __text_end = . ; *(.rodata*) *(.data*) *(.bss*) - *(.init*) - *(.fini*) - *(.eh_frame*) - *(.init_array*) - *(.fini_array*) *(COMMON) rCustomMessages = . ; - __text_end = . ; } + _LD_TEXT_SIZE = __text_end - __text_start; + + /* Section not included in patch. */ + .other_executable : { + *(.init) + *(.fini) + } + + /* + * Section not included in patch. Use high address to force placement + * in separate segment to avoid linker warning. + */ + .other_allocatable 0x01000000 : { + *(.eh_frame) + *(.init_array) + *(.fini_array) + } + + /* 0xFFFFFFFF */ } diff --git a/code/patch.py b/code/patch.py index 57a691ca..fd3fbbde 100644 --- a/code/patch.py +++ b/code/patch.py @@ -54,6 +54,9 @@ def are_existing_symbols_valid(hppFilePath, newSymbolsInfo): ips = b'PATCH' with open(elf, 'rb') as e: for name, vaddr, offset, size in sections: + # Skip useless sections + if not name.startswith('.patch') and not name in ['.text', '.loader']: + continue e.seek(offset, 0) while size > 65535: From 7e67bc015acb0d7784cf77c8b6274137a83561d3 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Mon, 30 Mar 2026 23:22:30 +0200 Subject: [PATCH 5/9] Update handling of patch symbols for the app --- .gitignore | 2 +- Makefile | 24 ++++++++----- code/patch.py | 37 -------------------- generate_patch_symbols.py | 46 ++++++++++++++++++++++++ source/custom_messages.cpp | 19 +++++----- source/patch.cpp | 72 +++++++++----------------------------- source/patch.hpp | 39 ++++++++++----------- 7 files changed, 105 insertions(+), 134 deletions(-) create mode 100644 generate_patch_symbols.py diff --git a/.gitignore b/.gitignore index be03277d..e641bb7f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,5 @@ build/* *.pyc *.ips *.zar -source/patch_symbols*.hpp +source/patch_symbols* .DS_Store diff --git a/Makefile b/Makefile index b47c0879..7e8046eb 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft CFLAGS := -g -Wall -O2 -mword-relocations \ -fomit-frame-pointer -ffunction-sections \ - $(ARCH) + -fdiagnostics-color=always $(ARCH) CFLAGS += $(INCLUDE) -D__3DS__ @@ -62,8 +62,10 @@ LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) LIBS := -lctru -lm -# Debug-specific flags +# Auto-generated CPP file +PATCH_SYMBOLS_FILE := patch_symbols.cpp +# Debug-specific flags debug ?= 0 ifneq ($(debug), 0) CFLAGS += -g -DENABLE_DEBUG @@ -104,6 +106,10 @@ SHLISTFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.shlist))) GFXFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.t3s))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) +ifeq ($(filter $(PATCH_SYMBOLS_FILE),$(CPPFILES)),) + CPPFILES += $(PATCH_SYMBOLS_FILE) +endif + #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- @@ -172,14 +178,13 @@ ifneq ($(ROMFS),) export _3DSXFLAGS += --romfs=$(CURDIR)/$(ROMFS) endif -.PHONY: all clean delete3DSX create_basecode +.PHONY: app create_basecode clean #--------------------------------------------------------------------------------- -all: delete3DSX create_basecode $(BUILD) $(GFXBUILD) $(DEPSDIR) $(ROMFS_T3XFILES) $(T3XHFILES) - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -delete3DSX: +app: create_basecode $(BUILD) $(GFXBUILD) $(DEPSDIR) $(ROMFS_T3XFILES) $(T3XHFILES) @rm -fr $(TARGET).3dsx + @py generate_patch_symbols.py + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile create_basecode: ifeq ($(app_only), 0) @@ -206,7 +211,8 @@ endif clean: @echo clean ... @rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf $(GFXBUILD) \ - $(ROMFS)/basecode.ips $(ROMFS)/basecode_USA.ips $(ROMFS)/basecode_EUR.ips + $(ROMFS)/basecode.ips $(ROMFS)/basecode_USA.ips $(ROMFS)/basecode_EUR.ips \ + source/patch_symbols* $(MAKE) clean -C code #--------------------------------------------------------------------------------- @@ -279,4 +285,4 @@ endef #--------------------------------------------------------------------------------------- endif -#--------------------------------------------------------------------------------------- \ No newline at end of file +#--------------------------------------------------------------------------------------- diff --git a/code/patch.py b/code/patch.py index fd3fbbde..a2e04f03 100644 --- a/code/patch.py +++ b/code/patch.py @@ -3,24 +3,6 @@ import subprocess import sys -# If symbols required by the app haven't changed with the latest build, -# the HPP files won't be rewritten so that the app will build faster -def are_existing_symbols_valid(hppFilePath, newSymbolsInfo): - try: - with open(hppFilePath, 'r') as hppFile: - hppFileLines = hppFile.readlines()[1:] # Skip first line ("#pragma once") - if len(hppFileLines) != len(newSymbolsInfo): - return False # Symbols amount changed - for line, newSym in zip(hppFileLines, newSymbolsInfo): - oldAddressString = line.split()[-1] - oldAddressInt = int(oldAddressString, 16) - newAddressInt = int(newSym[0], 16) - if (oldAddressInt != newAddressInt): - return False # Some symbol changed - except: - return False # The HPP file doesn't exist (or some other problem occurred) - return True - elf = sys.argv[1] region = sys.argv[2] debug = int(sys.argv[3]) @@ -29,25 +11,6 @@ def are_existing_symbols_valid(hppFilePath, newSymbolsInfo): sectionsInfo = [line.split()[1:6] for line in lines if line.split() and line.split()[0].isdigit()] sections = ((sec[0], int(sec[2],16), int(sec[4],16), int(sec[1],16)) for sec in sectionsInfo if int(sec[2],16) != 0) -# Put here the symbols from the patch which are needed by the app -desiredSymbols = ("rItemOverrides", "gSettingsContext", "gSpoilerData", "gSpoilerDataLocs", "rScrubRandomItemPrices", "rDungeonRewardOverrides", "rCustomMessages", -"numCustomMessageEntries", "ptrCustomMessageEntries", "rShopsanityPrices", "rEntranceOverrides", "rBGMOverrides", "rSfxData", "rDungeonInfoData", "rGsLocOverrides", -"rEnemyOverrides") - -nmResult = subprocess.run([os.environ["DEVKITARM"] + r'/bin/arm-none-eabi-nm', elf], stdout=subprocess.PIPE) -nmLines = str(nmResult.stdout).split('\\n') -symbolsInfo = [line.split() for line in nmLines if len(line.split()) >= 3 and line.split()[2].replace("\\r", "") in desiredSymbols] -hppFileName = "patch_symbols_" + region + ".hpp" -hppFilePath = "../source/" + hppFileName -if are_existing_symbols_valid(hppFilePath, symbolsInfo): - print(hppFileName + " unchanged. Run `make clean` to delete it.") -else: - with open(hppFilePath, 'w') as syms: - syms.write("#pragma once\n") - for sym in symbolsInfo: - syms.write("#define "+sym[2].replace("\\r", "").upper()+"_" + region + "_ADDR 0x"+sym[0]+"\n") - print("wrote desired symbols to " + hppFileName) - off = lambda vaddr: struct.pack(">I",vaddr - 0x100000)[1:] sz = lambda size: struct.pack(">H", size) diff --git a/generate_patch_symbols.py b/generate_patch_symbols.py new file mode 100644 index 00000000..a4a075fc --- /dev/null +++ b/generate_patch_symbols.py @@ -0,0 +1,46 @@ +import os, sys, subprocess +from pathlib import Path + +USA_ELF_PATH = 'code/basecode_USA.elf' +EUR_ELF_PATH = 'code/basecode_EUR.elf' +CPP_FILE_PATH = 'source/patch_symbols.cpp' +LD_TEXT_START = '_LD_TEXT_START' + +# Put here the symbols from the patch which are needed by the app +desiredSymbols = ['rItemOverrides', 'gSettingsContext', 'gSpoilerData', 'gSpoilerDataLocs', 'rScrubRandomItemPrices', + 'rDungeonRewardOverrides', 'rCustomMessages', 'numCustomMessageEntries', 'ptrCustomMessageEntries', + 'rShopsanityPrices', 'rEntranceOverrides', 'rBGMOverrides', 'rSfxData', 'rDungeonInfoData', + 'rGsLocOverrides', 'rEnemyOverrides'] + +def getSymbolsTable(elfFilePath): + nmResult = subprocess.run([os.environ['DEVKITARM'] + r'/bin/arm-none-eabi-nm', elfFilePath], text=True, capture_output=True) + nmLines = nmResult.stdout.replace('\r', '').split('\n') + symbolsDict = dict() + for line in nmLines: + words = line.split() + if len(words) != 3: + continue + [addr, type, name] = words + symbolsDict[name] = addr + return symbolsDict + +symTableUSA = getSymbolsTable(USA_ELF_PATH) +symTableEUR = getSymbolsTable(EUR_ELF_PATH) + +if symTableUSA[LD_TEXT_START] != symTableEUR[LD_TEXT_START]: + sys.exit('ERROR: USA and EUR regions should use the same base address for custom code!') + +newContent = '#include "patch.hpp"\n\nconst PatchSymbols gPatchSymbols = {\n' +for name in desiredSymbols: + newContent += f' .{name} = 0x{symTableUSA[name]},\n' +newContent += '};\n' + +cppFile = Path(CPP_FILE_PATH) +oldContent = cppFile.read_text() if cppFile.exists() else '' + +# If the CPP content doesn't change, don't rewrite the file so it won't be recompiled +if newContent != oldContent: + cppFile.write_text(newContent, newline='\n') + print(f'Wrote desired symbols to {CPP_FILE_PATH}') +else: + print(f'Patch symbols unchanged') diff --git a/source/custom_messages.cpp b/source/custom_messages.cpp index 3e038c52..65d29181 100644 --- a/source/custom_messages.cpp +++ b/source/custom_messages.cpp @@ -1,6 +1,5 @@ #include "custom_messages.hpp" -#include "patch_symbols_USA.hpp" -#include "patch_symbols_EUR.hpp" +#include "patch.hpp" #include "debug.hpp" #include "shops.hpp" #include "../code/src/message.h" @@ -160,7 +159,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, NAEnglishText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[ENGLISH_U].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_USA_ADDR; + newEntry.info[ENGLISH_U].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[ENGLISH_U].length = NAEnglishText.size(); messageData << NAEnglishText; @@ -168,7 +167,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, NAFrenchText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[FRENCH_U].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_USA_ADDR; + newEntry.info[FRENCH_U].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[FRENCH_U].length = NAFrenchText.size(); messageData << NAFrenchText; @@ -176,7 +175,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, NASpanishText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[SPANISH_U].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_USA_ADDR; + newEntry.info[SPANISH_U].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[SPANISH_U].length = NASpanishText.size(); messageData << NASpanishText; } else if (Settings::Region == REGION_EUR) { @@ -184,7 +183,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, EUREnglishText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[ENGLISH_E].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_EUR_ADDR; + newEntry.info[ENGLISH_E].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[ENGLISH_E].length = EUREnglishText.size(); messageData << EUREnglishText; @@ -192,7 +191,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, EURFrenchText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[FRENCH_E].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_EUR_ADDR; + newEntry.info[FRENCH_E].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[FRENCH_E].length = EURFrenchText.size(); messageData << EURFrenchText; @@ -200,7 +199,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, EURSpanishText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[SPANISH_E].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_EUR_ADDR; + newEntry.info[SPANISH_E].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[SPANISH_E].length = EURSpanishText.size(); messageData << EURSpanishText; @@ -208,7 +207,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, EURItalianText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[ITALIAN_E].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_EUR_ADDR; + newEntry.info[ITALIAN_E].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[ITALIAN_E].length = EURItalianText.size(); messageData << EURItalianText; @@ -216,7 +215,7 @@ void CreateMessage(u32 textId, u32 unk_04, u32 textBoxType, u32 textBoxPosition, EURGermanText += "\0"s; } messageData.seekg(0, messageData.end); - newEntry.info[GERMAN_E].offset = (char*)((int)messageData.tellg()) + RCUSTOMMESSAGES_EUR_ADDR; + newEntry.info[GERMAN_E].offset = (char*)((int)messageData.tellg()) + gPatchSymbols.rCustomMessages; newEntry.info[GERMAN_E].length = EURGermanText.size(); messageData << EURGermanText; } diff --git a/source/patch.cpp b/source/patch.cpp index 889e8083..ba6e54d4 100644 --- a/source/patch.cpp +++ b/source/patch.cpp @@ -23,40 +23,6 @@ #include "../code/src/custom_models.h" #include "../code/src/enemizer.h" -const PatchSymbols UsaSymbols = { GSETTINGSCONTEXT_USA_ADDR, - GSPOILERDATA_USA_ADDR, - GSPOILERDATALOCS_USA_ADDR, - NUMCUSTOMMESSAGEENTRIES_USA_ADDR, - PTRCUSTOMMESSAGEENTRIES_USA_ADDR, - RBGMOVERRIDES_USA_ADDR, - RCUSTOMMESSAGES_USA_ADDR, - RDUNGEONINFODATA_USA_ADDR, - RDUNGEONREWARDOVERRIDES_USA_ADDR, - RENEMYOVERRIDES_USA_ADDR, - RENTRANCEOVERRIDES_USA_ADDR, - RGSLOCOVERRIDES_USA_ADDR, - RITEMOVERRIDES_USA_ADDR, - RSCRUBRANDOMITEMPRICES_USA_ADDR, - RSFXDATA_USA_ADDR, - RSHOPSANITYPRICES_USA_ADDR }; - -const PatchSymbols EurSymbols = { GSETTINGSCONTEXT_EUR_ADDR, - GSPOILERDATA_EUR_ADDR, - GSPOILERDATALOCS_EUR_ADDR, - NUMCUSTOMMESSAGEENTRIES_EUR_ADDR, - PTRCUSTOMMESSAGEENTRIES_EUR_ADDR, - RBGMOVERRIDES_EUR_ADDR, - RCUSTOMMESSAGES_EUR_ADDR, - RDUNGEONINFODATA_EUR_ADDR, - RDUNGEONREWARDOVERRIDES_EUR_ADDR, - RENEMYOVERRIDES_EUR_ADDR, - RENTRANCEOVERRIDES_EUR_ADDR, - RGSLOCOVERRIDES_EUR_ADDR, - RITEMOVERRIDES_EUR_ADDR, - RSCRUBRANDOMITEMPRICES_EUR_ADDR, - RSFXDATA_EUR_ADDR, - RSHOPSANITYPRICES_EUR_ADDR }; - // For specification on the IPS file format, visit: https://zerosoft.zophar.net/ips.php using FILEPtr = std::unique_ptr; @@ -112,12 +78,6 @@ bool WriteAllPatches() { u32 totalRW = 0; char buf[512]; std::string titleId = Settings::TitleId(); - PatchSymbols patchSymbols; - if (Settings::Region == REGION_EUR) { - patchSymbols = EurSymbols; - } else { // REGION_NA - patchSymbols = UsaSymbols; - } // Open SD archive if (!R_SUCCEEDED(res = FSUSER_OpenArchive(&sdmcArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, "")))) { @@ -189,7 +149,7 @@ bool WriteAllPatches() { | rItemOverrides | --------------------------*/ - u32 patchOffset = V_TO_P(patchSymbols.RITEMOVERRIDES_ADDR); + u32 patchOffset = V_TO_P(gPatchSymbols.rItemOverrides); s32 patchSize = sizeof(ItemOverride) * overrides.size(); ItemOverride ovrPatchData[overrides.size()] = {}; // generate override data @@ -206,7 +166,7 @@ bool WriteAllPatches() { | rEntranceOverrides | --------------------------*/ - patchOffset = V_TO_P(patchSymbols.RENTRANCEOVERRIDES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rEntranceOverrides); patchSize = sizeof(EntranceOverride) * entranceOverrides.size(); EntranceOverride eOvrPatchData[entranceOverrides.size()] = {}; // generate entrance override patch data @@ -223,7 +183,7 @@ bool WriteAllPatches() { | gSettingsContext | --------------------------*/ - patchOffset = V_TO_P(patchSymbols.GSETTINGSCONTEXT_ADDR); + patchOffset = V_TO_P(gPatchSymbols.gSettingsContext); patchSize = sizeof(SettingsContext); // get the settings context SettingsContext ctx = Settings::FillContext(); @@ -235,14 +195,14 @@ bool WriteAllPatches() { | gSpoilerData | --------------------------*/ - patchOffset = V_TO_P(patchSymbols.GSPOILERDATA_ADDR); + patchOffset = V_TO_P(gPatchSymbols.gSpoilerData); patchSize = sizeof(SpoilerData); if (!WritePatch(patchOffset, patchSize, (char*)(GetSpoilerData()), code, bytesWritten, totalRW, buf)) { return false; } patchSize = sizeof(SpoilerDataLocs); for (size_t idx = 0; idx < SPOILER_LOCDATS; idx++) { - patchOffset = V_TO_P(patchSymbols.GSPOILERDATALOCS_ADDR) + (patchSize * idx); + patchOffset = V_TO_P(gPatchSymbols.gSpoilerDataLocs) + (patchSize * idx); if (!WritePatch(patchOffset, patchSize, (char*)(GetSpoilerDataLocs(idx)), code, bytesWritten, totalRW, buf)) { return false; } @@ -266,7 +226,7 @@ bool WriteAllPatches() { } // Write the patch for random scrub prices - patchOffset = V_TO_P(patchSymbols.RSCRUBRANDOMITEMPRICES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rScrubRandomItemPrices); patchSize = sizeof(rScrubRandomItemPrices); if (!WritePatch(patchOffset, patchSize, (char*)(&rScrubRandomItemPrices), code, bytesWritten, totalRW, buf)) { return false; @@ -297,7 +257,7 @@ bool WriteAllPatches() { } // Write shopsanity item prices to the patch - patchOffset = V_TO_P(patchSymbols.RSHOPSANITYPRICES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rShopsanityPrices); patchSize = sizeof(rShopsanityPrices); if (!WritePatch(patchOffset, patchSize, (char*)(&rShopsanityPrices), code, bytesWritten, totalRW, buf)) { return false; @@ -309,7 +269,7 @@ bool WriteAllPatches() { ---------------------------------*/ // Write rDungeonRewardOverrides to the patch if (Settings::ShuffleRewards.Is(REWARDSHUFFLE_END_OF_DUNGEON)) { - patchOffset = V_TO_P(patchSymbols.RDUNGEONREWARDOVERRIDES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rDungeonRewardOverrides); patchSize = sizeof(Settings::rDungeonRewardOverrides); if (!WritePatch(patchOffset, patchSize, (char*)(&Settings::rDungeonRewardOverrides), code, bytesWritten, totalRW, buf)) { @@ -325,7 +285,7 @@ bool WriteAllPatches() { std::pair messageEntriesInfo = CustomMessages::RawMessageEntryData(); // Write message data to patch - u32 messageDataOffset = V_TO_P(patchSymbols.RCUSTOMMESSAGES_ADDR); + u32 messageDataOffset = V_TO_P(gPatchSymbols.rCustomMessages); s32 messageDataSize = messageDataInfo.second; if (!WritePatch(messageDataOffset, messageDataSize, (char*)messageDataInfo.first, code, bytesWritten, totalRW, buf)) { @@ -341,7 +301,7 @@ bool WriteAllPatches() { } // Write ptrCustomMessageEntries to patch - patchOffset = V_TO_P(patchSymbols.PTRCUSTOMMESSAGEENTRIES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.ptrCustomMessageEntries); patchSize = 4; u32 ptrCustomMessageEntriesData = P_TO_V(messageEntriesOffset); if (!WritePatch(patchOffset, patchSize, (char*)(&ptrCustomMessageEntriesData), code, bytesWritten, totalRW, buf)) { @@ -349,7 +309,7 @@ bool WriteAllPatches() { } // Write numCustomMessageEntries to code - patchOffset = V_TO_P(patchSymbols.NUMCUSTOMMESSAGEENTRIES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.numCustomMessageEntries); patchSize = 4; u32 numCustomMessageEntriesData = CustomMessages::NumMessages(); if (!WritePatch(patchOffset, patchSize, (char*)(&numCustomMessageEntriesData), code, bytesWritten, totalRW, buf)) { @@ -387,7 +347,7 @@ bool WriteAllPatches() { // Only write patch if index variant of music shuffle is used if (!Music::archiveFound) { - patchOffset = V_TO_P(patchSymbols.RBGMOVERRIDES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rBGMOverrides); patchSize = sizeof(Music::seqOverridesMusic); if (!WritePatch(patchOffset, patchSize, (char*)Music::seqOverridesMusic.data(), code, bytesWritten, totalRW, buf)) { @@ -399,7 +359,7 @@ bool WriteAllPatches() { | rSfxData | ---------------------------------*/ - patchOffset = V_TO_P(patchSymbols.RSFXDATA_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rSfxData); patchSize = sizeof(SFXData); if (!WritePatch(patchOffset, patchSize, (char*)(&SFX::GetSFXData()), code, bytesWritten, totalRW, buf)) { return false; @@ -409,7 +369,7 @@ bool WriteAllPatches() { | rDungeonInfoData | ---------------------------------*/ - patchOffset = V_TO_P(patchSymbols.RDUNGEONINFODATA_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rDungeonInfoData); patchSize = sizeof(dungeonInfoData); if (!WritePatch(patchOffset, patchSize, (char*)(&dungeonInfoData), code, bytesWritten, totalRW, buf)) { return false; @@ -624,7 +584,7 @@ bool WriteAllPatches() { | Gold Skulltula Locations | ---------------------------------*/ - patchOffset = V_TO_P(patchSymbols.RGSLOCOVERRIDES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rGsLocOverrides); patchSize = sizeof(GsLocOverride) * Gs_GetOverrideData()->size(); if (!WritePatch(patchOffset, patchSize, (char*)Gs_GetOverrideData()->data(), code, bytesWritten, totalRW, buf)) { @@ -654,7 +614,7 @@ bool WriteAllPatches() { std::vector enemyOverrides; Enemizer::FillPatchOverrides(enemyOverrides); - patchOffset = V_TO_P(patchSymbols.RENEMYOVERRIDES_ADDR); + patchOffset = V_TO_P(gPatchSymbols.rEnemyOverrides); patchSize = sizeof(EnemyOverride) * enemyOverrides.size(); if (!WritePatch(patchOffset, patchSize, (char*)enemyOverrides.data(), code, bytesWritten, totalRW, buf)) { diff --git a/source/patch.hpp b/source/patch.hpp index ccb1ed57..177544d7 100644 --- a/source/patch.hpp +++ b/source/patch.hpp @@ -3,8 +3,6 @@ #include <3ds.h> #include "playthrough.hpp" #include "settings.hpp" -#include "patch_symbols_USA.hpp" -#include "patch_symbols_EUR.hpp" #include "../code/src/settings.h" #include "../code/src/item_override.h" #include "../code/src/spoiler_data.h" @@ -15,26 +13,25 @@ #define PATCH_CITRA 1 #define PATCH_SIZE_MAX 65535 -typedef struct { - u32 GSETTINGSCONTEXT_ADDR; - u32 GSPOILERDATA_ADDR; - u32 GSPOILERDATALOCS_ADDR; - u32 NUMCUSTOMMESSAGEENTRIES_ADDR; - u32 PTRCUSTOMMESSAGEENTRIES_ADDR; - u32 RBGMOVERRIDES_ADDR; - u32 RCUSTOMMESSAGES_ADDR; - u32 RDUNGEONINFODATA_ADDR; - u32 RDUNGEONREWARDOVERRIDES_ADDR; - u32 RENEMYOVERRIDES_ADDR; - u32 RENTRANCEOVERRIDES_ADDR; - u32 RGSLOCOVERRIDES_ADDR; - u32 RITEMOVERRIDES_ADDR; - u32 RSCRUBRANDOMITEMPRICES_ADDR; - u32 RSFXDATA_ADDR; - u32 RSHOPSANITYPRICES_ADDR; +typedef struct PatchSymbols { + u32 rItemOverrides; + u32 gSettingsContext; + u32 gSpoilerData; + u32 gSpoilerDataLocs; + u32 rScrubRandomItemPrices; + u32 rDungeonRewardOverrides; + u32 rCustomMessages; + u32 numCustomMessageEntries; + u32 ptrCustomMessageEntries; + u32 rShopsanityPrices; + u32 rEntranceOverrides; + u32 rBGMOverrides; + u32 rSfxData; + u32 rDungeonInfoData; + u32 rGsLocOverrides; + u32 rEnemyOverrides; } PatchSymbols; -extern const PatchSymbols EurSymbols; -extern const PatchSymbols UsaSymbols; +extern const PatchSymbols gPatchSymbols; bool WriteAllPatches(); From 2adf4ecb466c044d926be48f766df8e933529302 Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Mon, 30 Mar 2026 23:22:36 +0200 Subject: [PATCH 6/9] Move all game addresses to linker script --- code/Makefile | 72 ++--- code/include/z3D/actors/z_en_dns.h | 4 +- code/include/z3D/actors/z_en_item00.h | 6 +- code/include/z3D/actors/z_en_test.h | 20 ++ code/include/z3D/z3D.h | 272 ++++++----------- code/include/z3D/z3Dactor.h | 39 +-- code/include/z3D/z3Dactor_id.h | 1 + code/include/z3D/z3Dbgcheck.h | 18 +- code/include/z3D/z3Dcollision_check.h | 23 +- code/include/z3D/z3Deffect.h | 13 +- code/include/z3D/z3Dmath.h | 30 +- code/oot.ld | 403 ++++++++++++++++++++++++- code/patch.py | 9 +- code/src/actor.c | 31 +- code/src/actors/anju.c | 4 +- code/src/actors/anju.h | 4 +- code/src/actors/anubis.c | 2 +- code/src/actors/bean_plant.c | 45 +-- code/src/actors/bean_plant.h | 14 +- code/src/actors/boulder_red.c | 30 +- code/src/actors/boulder_red.h | 4 +- code/src/actors/bubble.c | 6 +- code/src/actors/business_scrubs.c | 40 ++- code/src/actors/business_scrubs.h | 2 +- code/src/actors/carpenter.c | 24 +- code/src/actors/carpenter.h | 12 +- code/src/actors/checkable_spot.c | 7 +- code/src/actors/checkable_spot.h | 7 +- code/src/actors/chest.c | 5 +- code/src/actors/chest_minigame.c | 19 +- code/src/actors/collapsing_castle.c | 2 +- code/src/actors/collapsing_platform.c | 34 ++- code/src/actors/collapsing_platform.h | 12 +- code/src/actors/cow.c | 5 +- code/src/actors/dampe.c | 2 +- code/src/actors/dark_link.c | 4 +- code/src/actors/dead_hand_hand.c | 2 +- code/src/actors/deku_scrubs.c | 12 +- code/src/actors/deku_scrubs.h | 8 +- code/src/actors/deku_tree_mouth.c | 2 +- code/src/actors/demo_effect.c | 8 +- code/src/actors/demo_kankyo.c | 2 +- code/src/actors/dodongos.c | 10 +- code/src/actors/dodongos.h | 4 +- code/src/actors/door.c | 131 ++++---- code/src/actors/door.h | 48 ++- code/src/actors/drawbridge.c | 2 +- code/src/actors/en_ex_item.c | 5 +- code/src/actors/enemy_spawner.c | 4 +- code/src/actors/flare_dancer.c | 8 +- code/src/actors/flying_traps.c | 8 +- code/src/actors/flying_traps.h | 8 +- code/src/actors/ganondorf.c | 2 +- code/src/actors/ganondorf_organ.c | 2 +- code/src/actors/gerudos.c | 12 +- code/src/actors/gohma.h | 5 +- code/src/actors/gorons.c | 2 +- code/src/actors/gorons.h | 4 +- code/src/actors/gossip_stone.c | 2 +- code/src/actors/graveyard_objects.c | 14 +- code/src/actors/graveyard_objects.h | 10 +- code/src/actors/grog.c | 2 +- code/src/actors/grog.h | 4 +- code/src/actors/gtg_gate.c | 5 +- code/src/actors/guay.c | 4 +- code/src/actors/heart_container.c | 11 +- code/src/actors/hookshot.c | 6 +- code/src/actors/iron_knuckle.c | 4 +- code/src/actors/item00.c | 13 +- code/src/actors/item_etcetera.c | 11 +- code/src/actors/jabu.c | 2 +- code/src/actors/king_zora.c | 2 +- code/src/actors/lake_hylia_objects.c | 5 +- code/src/actors/leever.c | 4 +- code/src/actors/liftable_rock.c | 17 +- code/src/actors/liftable_rock.h | 10 +- code/src/actors/link_puppet.c | 59 ++-- code/src/actors/link_puppet.h | 5 - code/src/actors/lizalfos.c | 2 +- code/src/actors/malon.c | 2 +- code/src/actors/moblin.c | 8 +- code/src/actors/nabooru.c | 2 +- code/src/actors/obj_mure3.c | 2 +- code/src/actors/obj_switch.c | 2 +- code/src/actors/ocarina.c | 8 +- code/src/actors/owl.c | 5 +- code/src/actors/peahat.c | 6 +- code/src/actors/player.c | 27 +- code/src/actors/poe.c | 8 +- code/src/actors/pushblock.c | 4 +- code/src/actors/red_ice.c | 2 +- code/src/actors/rupee_trap.c | 2 +- code/src/actors/shabom.h | 12 +- code/src/actors/shadow_ship.c | 11 +- code/src/actors/shooting_gallery_man.c | 5 +- code/src/actors/shops.c | 6 +- code/src/actors/shops.h | 2 +- code/src/actors/skull_kid.c | 2 +- code/src/actors/skulltula.c | 35 ++- code/src/actors/skulltula.h | 10 +- code/src/actors/skulltula_people.c | 2 +- code/src/actors/stalchild.c | 2 +- code/src/actors/stalfos.c | 2 +- code/src/actors/stinger.c | 4 +- code/src/actors/title_screen.c | 2 +- code/src/actors/token.c | 19 +- code/src/actors/twinrova.c | 15 +- code/src/actors/web.c | 44 +-- code/src/actors/web.h | 14 +- code/src/actors/well_stone.c | 2 +- code/src/actors/well_water.c | 2 +- code/src/actors/windmill_man.c | 2 +- code/src/arrow.c | 10 +- code/src/asm/hooks.s | 133 ++------ code/src/asm/patches.s | 46 +-- code/src/boss_challenge.c | 2 - code/src/camera.c | 2 +- code/src/entrance.c | 12 +- code/src/fairy.c | 6 +- code/src/fishing.h | 6 +- code/src/fog.c | 2 +- code/src/hints.c | 7 +- code/src/icetrap.c | 22 +- code/src/item_effect.c | 3 +- code/src/ld_symbols.h | 19 ++ code/src/loader.c | 2 +- code/src/menus.c | 34 +-- code/src/message.c | 7 +- code/src/message.h | 11 +- code/src/models.c | 17 +- code/src/models.h | 13 +- code/src/multiplayer.c | 4 +- code/src/newcodeinfo.h | 12 - code/src/objects.h | 30 +- code/src/ocarina_notes.c | 2 +- code/src/ocarina_notes.h | 10 +- code/src/oot_malloc.h | 7 +- code/src/permadeath.c | 3 +- code/src/savefile.c | 3 +- code/src/songs_visual_effects.c | 14 +- code/src/spin_attack.c | 2 +- 141 files changed, 1283 insertions(+), 1135 deletions(-) create mode 100644 code/include/z3D/actors/z_en_test.h create mode 100644 code/src/ld_symbols.h delete mode 100644 code/src/newcodeinfo.h diff --git a/code/Makefile b/code/Makefile index 184c1990..67dfdfc0 100644 --- a/code/Makefile +++ b/code/Makefile @@ -27,7 +27,7 @@ include $(DEVKITARM)/3ds_rules # - icon.png # - /default_icon.png #--------------------------------------------------------------------------------- -TARGET := $(notdir $(CURDIR)) +# TARGET Defined below BUILD := build SOURCES := $(sort $(dir $(wildcard src/*/ src/))) DATA := data @@ -38,51 +38,43 @@ INCLUDES += assets #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -USA := USA -EUR := EUR -JP := JP -REGION := USA - -VERFLAGS := -D USA=$(USA) -D EUR=$(EUR) -D JP=$(JP) -D REGION=$(REGION) ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=softfp -mtp=soft -mfpu=vfpv2 CFLAGS := -g -Wall -mword-relocations -D DEBUG \ -fomit-frame-pointer -ffunction-sections \ - $(ARCH) + -fdiagnostics-color=always $(ARCH) -CFLAGS += $(INCLUDE) -DARM11 -D_3DS $(VERFLAGS) +CFLAGS += $(INCLUDE) -DARM11 -D_3DS CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 LINK_SCRIPT := oot.ld -LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) -T $(TOPDIR)/$(LINK_SCRIPT) $(VERFLAGS) -lgcc +LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) -T $(TOPDIR)/$(LINK_SCRIPT) -lgcc -ifeq ($(USA), $(REGION)) - ASFLAGS += -D _USA_=1 -D _EUR_=0 -D _JP_=0 - CFLAGS += -g -DVersion_USA - BUILD := build_usa - TARGET := code_usa -else -ifeq ($(EUR), $(REGION)) - LDFLAGS += -Wl,--defsym,_EUR_=1 - ASFLAGS += -D _USA_=0 -D _EUR_=1 -D _JP_=0 - CFLAGS += -g -DVersion_EUR - BUILD := build_eur - TARGET := code_eur -ifeq ($(JP), $(REGION)) - ASFLAGS += -D _USA_=0 -D _EUR_=0 -D _JP_=1 - CFLAGS += -g -DVersion_JP - BUILD := build_jp - TARGET := code_jp -endif -endif +ASFLAGS += -g $(ARCH) + +LIBS := -lgcc + + +# Region selection +REGION ?= USA + +VALID_REGIONS := USA EUR + +ifeq ($(filter $(REGION),$(VALID_REGIONS)),) + $(error "Invalid region: $(REGION)") endif -ASFLAGS += -g $(ARCH) $(VERFLAGS) +UNSELECTED_REGIONS := $(subst $(REGION),,$(VALID_REGIONS)) + +# Define region for the Linker Script +LDFLAGS += -Wl,--defsym,_LD_$(REGION)=1 $(foreach region,$(UNSELECTED_REGIONS),-Wl,--defsym,_LD_$(region)=0) + +# Define target filename with region name +TARGET := basecode_$(REGION) -LIBS := -lgcc # Debug-specific flags debug ?= 0 @@ -158,21 +150,21 @@ else endif -.PHONY: $(BUILD) clean all +.PHONY: base_patch clean #--------------------------------------------------------------------------------- -all: $(BUILD) - -$(BUILD): - @[ -d $@ ] || mkdir -p $@ +base_patch: + @[ -d $(BUILD) ] || mkdir -p $(BUILD) @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - @python3 --version &> /dev/null && _python_="python3" || _python_="python"; \ - eval $$_python_ patch.py $(OUTPUT).elf $(REGION) $(debug); + @py patch.py $(OUTPUT).elf $(debug); + @mv basecode.ips $(TARGET).ips + @printf "Created $(TARGET).ips\n\n" #--------------------------------------------------------------------------------- clean: - @echo clean ... - @rm -fr build build_eur build_usa *.elf ../source/patch_symbols* + @printf "Cleaning..." + @rm -fr build* *.elf + @printf " Done\n" #--------------------------------------------------------------------------------- diff --git a/code/include/z3D/actors/z_en_dns.h b/code/include/z3D/actors/z_en_dns.h index f6c881d0..069f5863 100644 --- a/code/include/z3D/actors/z_en_dns.h +++ b/code/include/z3D/actors/z_en_dns.h @@ -5,6 +5,8 @@ struct EnDns; +typedef void (*EnDnsActionFunc)(struct EnDns* this, GlobalContext* globalCtx); + typedef u32 (*EnDnsPurchaseableCheck)(struct EnDns*); typedef void (*EnDnsSetRupeesAndFlags)(struct EnDns*); @@ -18,7 +20,7 @@ typedef struct { typedef struct EnDns { /* 0x000 */ Actor actor; - /* 0x1A4 */ void* action_fn; + /* 0x1A4 */ EnDnsActionFunc action_fn; /* 0x1A8 */ char collider[0x58]; /* 0x200 */ s16 dust_timer; /* 0x202 */ char unk_202; diff --git a/code/include/z3D/actors/z_en_item00.h b/code/include/z3D/actors/z_en_item00.h index d8362bda..a2b2fb03 100644 --- a/code/include/z3D/actors/z_en_item00.h +++ b/code/include/z3D/actors/z_en_item00.h @@ -3,6 +3,10 @@ #include "z3D/z3D.h" +struct EnItem00; + +typedef void (*EnItem00ActionFunc)(struct EnItem00* this, GlobalContext* globalCtx); + typedef enum Item00Type { /* 0x00 */ ITEM00_RUPEE_GREEN, /* 0x01 */ ITEM00_RUPEE_BLUE, @@ -41,7 +45,7 @@ typedef struct EnItem00Extension { typedef struct EnItem00 { /* 0x000 */ Actor actor; - /* 0x1A4 */ void* actionFunc; + /* 0x1A4 */ EnItem00ActionFunc actionFunc; /* 0x1A8 */ u16 collectibleFlag; /* 0x1AA */ char unk_1AA[0x4]; /* 0x1AE */ u16 unk_1AE; diff --git a/code/include/z3D/actors/z_en_test.h b/code/include/z3D/actors/z_en_test.h new file mode 100644 index 00000000..15fc869a --- /dev/null +++ b/code/include/z3D/actors/z_en_test.h @@ -0,0 +1,20 @@ +#ifndef _EN_TEST_H_ +#define _EN_TEST_H_ + +#include "z3D/z3D.h" + +struct EnTest; + +typedef void (*EnTestActionFunc)(struct EnTest*, GlobalContext*); + +typedef struct EnTest { + Actor base; + char unk_1A4[60]; + SkelAnime anime; + char unk_264[6636]; + EnTestActionFunc action_fn; +} EnTest; + +void EnTest_Wait(EnTest* this, GlobalContext* globalCtx); + +#endif //_EN_TEST_H_ diff --git a/code/include/z3D/z3D.h b/code/include/z3D/z3D.h index dd938bb6..ff2e5867 100644 --- a/code/include/z3D/z3D.h +++ b/code/include/z3D/z3D.h @@ -13,16 +13,7 @@ #include "z3Deffect.h" #include "z3Dcolor.h" -// #include "hid.h" - -#ifdef Version_EUR - #define GAME_ADDR(addr) \ - ((addr >= 0x41A144 && addr <= 0x43668B) ? (addr + 0x24) \ - : (addr >= 0x436690 && addr <= 0x4A5ADF) ? (addr + 0x20) \ - : addr) -#else - #define GAME_ADDR(addr) (addr) -#endif +#include "../../include/hid.h" #define TRUE 1 #define FALSE 0 @@ -664,24 +655,27 @@ typedef struct MainClass { extern GlobalContext* gGlobalContext; extern const u32 ItemSlots[]; extern const char DungeonNames[][25]; -#define gSaveContext (*(SaveContext*)GAME_ADDR(0x587958)) -#define gStaticContext (*(StaticContext*)0x08080010) -#define gObjectTable ((ObjectFile*)GAME_ADDR(0x53CCF4)) -#define gEntranceTable ((EntranceInfo*)GAME_ADDR(0x543BB8)) -#define gItemUsabilityTable ((u8*)GAME_ADDR(0x506C58)) -#define gGearUsabilityTable ((u32*)GAME_ADDR(0x4D47C8)) -#define gDungeonSceneTable ((Scene*)GAME_ADDR(0x4DC400)) -#define gMQDungeonSceneTable ((Scene*)GAME_ADDR(0x4DCBA8)) -#define gSceneTable ((Scene*)GAME_ADDR(0x545484)) -#define gRandInt (*(u32*)GAME_ADDR(0x50C0C4)) -#define gRandFloat (*(f32*)GAME_ADDR(0x50C0C8)) -#define gDrawItemTable ((DrawItemTableEntry*)GAME_ADDR(0x4D88C8)) -#define gRestrictionFlags ((RestrictionFlags*)GAME_ADDR(0x539DC4)) -#define PLAYER ((Player*)gGlobalContext->actorCtx.actorList[ACTORTYPE_PLAYER].first) -#define gMainClass ((MainClass*)GAME_ADDR(0x5BE5B8)) -#define gIsBottomScreenDimmed (*(s32*)GAME_ADDR(0x5043EC)) -#define sPrevMainBgmSeqId (*(s32*)GAME_ADDR(0x54ACB8)) +extern SaveContext gSaveContext; +extern StaticContext gStaticContext; +extern ObjectFile gObjectTable[]; +extern EntranceInfo gEntranceTable[]; +extern u8 gItemUsabilityTable[]; +extern u32 gGearUsabilityTable[]; +extern Scene gDungeonSceneTable[]; +extern Scene gMQDungeonSceneTable[]; +extern Scene gSceneTable[]; +extern u32 gRandInt; +extern f32 gRandFloat; +extern DrawItemTableEntry gDrawItemTable[]; +extern RestrictionFlags gRestrictionFlags[]; +extern MainClass gMainClass; +extern s32 gIsBottomScreenDimmed; +extern s32 sPrevMainBgmSeqId; +extern f32 gSfxDefaultFreqAndVolScale; +extern s8 gSfxDefaultReverb; + +#define PLAYER ((Player*)gGlobalContext->actorCtx.actorList[ACTORTYPE_PLAYER].first) #define GearSlot(X) (X - ITEM_SWORD_KOKIRI) typedef enum { @@ -714,169 +708,71 @@ typedef enum { #define SCENE_LINK_HOUSE 52 -/* TODO: figure out what to do with this stuff */ -#define real_hid_addr 0x10002000 -#define real_hid (*(hid_mem_t*)real_hid_addr) - -#define Z3D_TOP_SCREEN_LEFT_1 0x14313890 -#define Z3D_TOP_SCREEN_LEFT_2 0x14359DA0 -#define Z3D_TOP_SCREEN_RIGHT_1 0x14410AD0 -#define Z3D_TOP_SCREEN_RIGHT_2 0x14456FE0 -#define Z3D_BOTTOM_SCREEN_1 0x143A02B0 -#define Z3D_BOTTOM_SCREEN_2 0x143D86C0 - -typedef void (*Item_Give_proc)(GlobalContext* globalCtx, u8 item); -#define Item_Give ((Item_Give_proc)GAME_ADDR(0x376A78)) - -typedef void (*DisplayTextbox_proc)(GlobalContext* globalCtx, u16 textId, Actor* actor); -#define DisplayTextbox ((DisplayTextbox_proc)GAME_ADDR(0x367C7C)) - -typedef u32 (*EventCheck_proc)(u32 flag); -#define EventCheck ((EventCheck_proc)GAME_ADDR(0x350CF4)) - -typedef void (*EventSet_proc)(u32 flag); -#define EventSet ((EventSet_proc)GAME_ADDR(0x34CBF8)) - -typedef void (*Rupees_ChangeBy_proc)(s16 rupeeChange); -#define Rupees_ChangeBy ((Rupees_ChangeBy_proc)GAME_ADDR(0x376A60)) - -typedef void (*LinkDamage_proc)(GlobalContext* globalCtx, Player* player, s32 arg2, f32 arg3, f32 arg4, s16 arg5, - s32 arg6); -#define LinkDamage ((LinkDamage_proc)GAME_ADDR(0x35D304)) - -typedef u32 (*Inventory_HasEmptyBottle_proc)(void); -#define Inventory_HasEmptyBottle ((Inventory_HasEmptyBottle_proc)GAME_ADDR(0x377A04)) - -typedef void (*PlaySound_proc)(u32); +extern hid_mem_t real_hid; +extern u8 Z3D_TOP_SCREEN_LEFT_1[]; +extern u8 Z3D_TOP_SCREEN_LEFT_2[]; +extern u8 Z3D_TOP_SCREEN_RIGHT_1[]; +extern u8 Z3D_TOP_SCREEN_RIGHT_2[]; +extern u8 Z3D_BOTTOM_SCREEN_1[]; +extern u8 Z3D_BOTTOM_SCREEN_2[]; + +void Item_Give(GlobalContext* globalCtx, u8 item); +void DisplayTextbox(GlobalContext* globalCtx, u16 textId, Actor* actor); +u32 EventCheck(u32 flag); +void EventSet(u32 flag); +void Rupees_ChangeBy(s16 rupeeChange); +void LinkDamage(GlobalContext* globalCtx, Player* player, s32 arg2, f32 arg3, f32 arg4, s16 arg5, s32 arg6); +u32 Inventory_HasEmptyBottle(void); // This function plays sound effects and music tracks, overlaid on top of the current BGM -#define PlaySound ((PlaySound_proc)GAME_ADDR(0x35C528)) - -typedef u32 (*Audio_GetActiveSeqId_proc)(u8 seqPlayerIndex); -#define Audio_GetActiveSeqId ((Audio_GetActiveSeqId_proc)GAME_ADDR(0x366684)) - -typedef void (*Audio_RestoreBGM_proc)(void); +void PlaySound(u32); +u32 Audio_GetActiveSeqId(u8 seqPlayerIndex); // Restores the original sequence to the main BGM player after a mini-boss battle or a minigame. -#define Audio_RestoreBGM ((Audio_RestoreBGM_proc)GAME_ADDR(0x34EC14)) - -// Unknown function. Passing these arguments stops the BGM. -#define Audio_StopBGM() (((void (*)(u32, u32))0x3655D0)(0, 0)) - -typedef Actor* (*Actor_Spawn_proc)(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, float posX, - float posY, float posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params, - s32 initImmediately) __attribute__((pcs("aapcs-vfp"))); -#define Actor_Spawn ((Actor_Spawn_proc)GAME_ADDR(0x3738D0)) - -typedef Actor* (*Actor_Find_proc)(ActorContext* actorCtx, s16 actorId, u8 actorType); -#define Actor_Find ((Actor_Find_proc)GAME_ADDR(0x372D64)) - -typedef void (*Actor_GetScreenPos_proc)(GlobalContext* globalCtx, Actor* actor, s16* outX, s16* outY); -#define Actor_GetScreenPos ((Actor_GetScreenPos_proc)GAME_ADDR(0x363A20)) - -typedef void (*Actor_KillAllWithMissingObject_proc)(GlobalContext* globalCtx, ActorContext* actorCtx); -#define Actor_KillAllWithMissingObject ((Actor_KillAllWithMissingObject_proc)GAME_ADDR(0x379C3C)) - -typedef void (*FireDamage_proc)(Actor* player, GlobalContext* globalCtx, int flamesColor); -#define FireDamage ((FireDamage_proc)GAME_ADDR(0x35D8D8)) - -typedef void (*Flags_SetEnv_proc)(GlobalContext* globalCtx, s16 flag); -#define Flags_SetEnv ((Flags_SetEnv_proc)GAME_ADDR(0x366704)) - -typedef void (*GiveItem_proc)(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) +void Audio_RestoreBGM(void); +// Unknown params. Passing (0, 0) stops the BGM. +void Audio_SetBGM(u32, u32); +#define Audio_StopBGM() Audio_SetBGM(0, 0) +Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, float posX, float posY, float posZ, + s16 rotX, s16 rotY, s16 rotZ, s16 params, s32 initImmediately) __attribute__((pcs("aapcs-vfp"))); +Actor* Actor_Find(ActorContext* actorCtx, s16 actorId, u8 actorType); +void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* outX, s16* outY); +void Actor_KillAllWithMissingObject(GlobalContext* globalCtx, ActorContext* actorCtx); +void FireDamage(Actor* player, GlobalContext* globalCtx, int flamesColor); +void Flags_SetEnv(GlobalContext* globalCtx, s16 flag); +void GiveItem(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) __attribute__((pcs("aapcs-vfp"))); -#define GiveItem ((GiveItem_proc)GAME_ADDR(0x3724DC)) - -typedef void (*Message_CloseTextbox_proc)(GlobalContext* globalCtx); -#define Message_CloseTextbox ((Message_CloseTextbox_proc)GAME_ADDR(0x3725E0)) - -typedef void (*SetupItemInWater_proc)(Player* player, GlobalContext* globalCtx); -#define SetupItemInWater ((SetupItemInWater_proc)GAME_ADDR(0x354894)) - -typedef void (*Health_ChangeBy_proc)(GlobalContext* arg1, u32 arg2); -#define Health_ChangeBy ((Health_ChangeBy_proc)GAME_ADDR(0x352DBC)) - -typedef void (*PlaySFX_proc)(u32 sfxId, Vec3f* pos, u32 token, f32* freqScale, f32* a4, s8* reverbAdd); -#define PlaySFX ((PlaySFX_proc)GAME_ADDR(0x37547C)) - -typedef void (*Flags_SetSwitch_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_SetSwitch ((Flags_SetSwitch_proc)GAME_ADDR(0x375C10)) - -typedef void (*Flags_UnsetSwitch_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_UnsetSwitch ((Flags_UnsetSwitch_proc)GAME_ADDR(0x36BEAC)) - -typedef u32 (*Flags_GetSwitch_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_GetSwitch ((Flags_GetSwitch_proc)GAME_ADDR(0x36E864)) - -typedef u32 (*Flags_GetCollectible_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_GetCollectible ((Flags_GetCollectible_proc)GAME_ADDR(0x36405C)) - -typedef u32 (*Flags_SetCollectible_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_SetCollectible ((Flags_SetCollectible_proc)GAME_ADDR(0x3329D8)) - -typedef u32 (*Flags_GetClear_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_GetClear ((Flags_GetClear_proc)GAME_ADDR(0x36CF6C)) - -typedef u32 (*Flags_SetClear_proc)(GlobalContext* globalCtx, u32 flag); -#define Flags_SetClear ((Flags_SetClear_proc)GAME_ADDR(0x36EC14)) - -typedef void (*Player_SetEquipmentData_proc)(GlobalContext* globalCtx, Player* player); -#define Player_SetEquipmentData ((Player_SetEquipmentData_proc)GAME_ADDR(0x34913C)) - -typedef s32 (*BossChallenge_IsActive_proc)(void); -#define BossChallenge_IsActive ((BossChallenge_IsActive_proc)GAME_ADDR(0x35B164)) - -typedef s32 (*Audio_PlayActorSfx2_proc)(Actor* actor, s32 sfxID); -#define Audio_PlayActorSfx2 ((Audio_PlayActorSfx2_proc)GAME_ADDR(0x375BCC)) - -typedef s32 (*Model_GetMeshGroupCount_proc)(SkeletonAnimationModel* skelAnimeModel); -#define Model_GetMeshGroupCount ((Model_GetMeshGroupCount_proc)GAME_ADDR(0x2BB71C)) - -typedef s32 (*Model_IsMeshGroupUsed_proc)(SkeletonAnimationModel* skelAnimeModel, s32 param); -#define Model_IsMeshGroupUsed ((Model_IsMeshGroupUsed_proc)GAME_ADDR(0x4C6880)) - -typedef void (*Model_EnableMeshGroupByIndex_proc)(SkeletonAnimationModel* skel, u32 index); -#define Model_EnableMeshGroupByIndex ((Model_EnableMeshGroupByIndex_proc)GAME_ADDR(0x37266C)) - -typedef void (*Model_DisableMeshGroupByIndex_proc)(SkeletonAnimationModel* skel, u32 index); -#define Model_DisableMeshGroupByIndex ((Model_DisableMeshGroupByIndex_proc)GAME_ADDR(0x36932C)) - -typedef s32 (*Player_InBlockingCsMode_proc)(GlobalContext* globalCtx, Player* player); -#define Player_InBlockingCsMode ((Player_InBlockingCsMode_proc)GAME_ADDR(0x35DB20)) - -typedef u32 (*PauseContext_GetState_proc)(void); -#define PauseContext_GetState ((PauseContext_GetState_proc)GAME_ADDR(0x3695F8)) - -typedef s32 (*Camera_CheckWater_proc)(Camera* camera); -#define Camera_CheckWater ((Camera_CheckWater_proc)GAME_ADDR(0x2D06A0)) - -typedef void (*Camera_UpdateInterface_proc)(u32 flags); -#define Camera_UpdateInterface ((Camera_UpdateInterface_proc)GAME_ADDR(0x330D84)) - -typedef f32 (*Camera_BGCheckInfo_proc)(Camera* camera, Vec3f* from, CamColChk* to); -#define Camera_BGCheckInfo ((Camera_BGCheckInfo_proc)GAME_ADDR(0x3553FC)) - -typedef s32 (*Quake_Update_proc)(Camera* camera, ShakeInfo* camShake); -#define Quake_Update ((Quake_Update_proc)GAME_ADDR(0x4787C8)) - -typedef s16 (*Camera_GetCamDataId_proc)(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -#define Camera_GetCamDataId ((Camera_GetCamDataId_proc)GAME_ADDR(0x47BFD8)) - -typedef s32 (*Animation_GetLastFrame_proc)(SkelAnime* anime, s32 animation_index); -#define Animation_GetLastFrame ((Animation_GetLastFrame_proc)GAME_ADDR(0x36AE14)) - -typedef void (*Animation_Change_proc)(SkelAnime* anime, s32 animation_index, f32 play_speed, f32 start_frame, - f32 end_frame, f32 morph_frames, s32 mode) __attribute__((pcs("aapcs-vfp"))); -#define Animation_Change ((Animation_Change_proc)GAME_ADDR(0x375C08)) - -typedef void (*EffectSsDeadDb_Spawn_proc)(GlobalContext* globalCtx, Vec3f* position, Vec3f* velocity, - Vec3f* acceleration, s16 scale, s16 scale_step, s16 prim_r, s16 prim_g, - s16 prim_b, s16 prim_a, s16 env_r, s16 env_g, s16 env_b, s16 unused, - s32 frame_duration, s16 play_sound); -#define EffectSsDeadDb_Spawn ((EffectSsDeadDb_Spawn_proc)GAME_ADDR(0x3642F4)) - -typedef void (*SaveGame_proc)(GlobalContext* globalCtx, u8 isSaveFileCreation); -#define SaveGame ((SaveGame_proc)GAME_ADDR(0x2FDAC8)) - -typedef s32 (*Message_GetState_proc)(void); -#define Message_GetState ((Message_GetState_proc)GAME_ADDR(0x3769d8)) +void Message_CloseTextbox(GlobalContext* globalCtx); +void SetupItemInWater(Player* player, GlobalContext* globalCtx); +void Health_ChangeBy(GlobalContext* arg1, u32 arg2); +void PlaySFX(u32 sfxId, Vec3f* pos, u32 token, f32* freqScale, f32* a4, s8* reverbAdd); +void Flags_SetSwitch(GlobalContext* globalCtx, u32 flag); +void Flags_UnsetSwitch(GlobalContext* globalCtx, u32 flag); +u32 Flags_GetSwitch(GlobalContext* globalCtx, u32 flag); +u32 Flags_GetCollectible(GlobalContext* globalCtx, u32 flag); +u32 Flags_SetCollectible(GlobalContext* globalCtx, u32 flag); +u32 Flags_GetClear(GlobalContext* globalCtx, u32 flag); +u32 Flags_SetClear(GlobalContext* globalCtx, u32 flag); +void Player_SetEquipmentData(GlobalContext* globalCtx, Player* player); +s32 BossChallenge_IsActive(void); +s32 Audio_PlayActorSfx2(Actor* actor, s32 sfxID); +s32 Model_GetMeshGroupCount(SkeletonAnimationModel* skelAnimeModel); +s32 Model_IsMeshGroupUsed(SkeletonAnimationModel* skelAnimeModel, s32 param); +void Model_EnableMeshGroupByIndex(SkeletonAnimationModel* skel, u32 index); +void Model_DisableMeshGroupByIndex(SkeletonAnimationModel* skel, u32 index); +s32 Player_InBlockingCsMode(GlobalContext* globalCtx, Player* player); +u32 PauseContext_GetState(void); +s32 Camera_CheckWater(Camera* camera); +void Camera_UpdateInterface(u32 flags); +f32 Camera_BGCheckInfo(Camera* camera, Vec3f* from, CamColChk* to); +s32 Quake_Update(Camera* camera, ShakeInfo* camShake); +s16 Camera_GetCamDataId(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 Animation_GetLastFrame(SkelAnime* anime, s32 animation_index); +void Animation_Change(SkelAnime* anime, s32 animation_index, f32 play_speed, f32 start_frame, f32 end_frame, + f32 morph_frames, s32 mode) __attribute__((pcs("aapcs-vfp"))); +void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* position, Vec3f* velocity, Vec3f* acceleration, s16 scale, + s16 scale_step, s16 prim_r, s16 prim_g, s16 prim_b, s16 prim_a, s16 env_r, s16 env_g, + s16 env_b, s16 unused, s32 frame_duration, s16 play_sound); +void SaveGame(GlobalContext* globalCtx, u8 isSaveFileCreation); +s32 Message_GetState(void); +void SetEventBGM(u32 seqPlayerIndex, u32 seqId); #endif //_Z3D_H_ diff --git a/code/include/z3D/z3Dactor.h b/code/include/z3D/z3Dactor.h index bda3060e..8825cf53 100644 --- a/code/include/z3D/z3Dactor.h +++ b/code/include/z3D/z3Dactor.h @@ -339,7 +339,7 @@ typedef struct Player { } Player; // total size (from init vars): 2A4C _Static_assert(sizeof(Player) == 0x2A4C, "Player size"); -#define sFloorType (*(s32*)GAME_ADDR(0x53A0A4)) +extern s32 sFloorType; typedef enum { /* 0x00 */ ACTORTYPE_SWITCH, @@ -365,33 +365,20 @@ typedef struct ActorHeapNode { struct ActorHeapNode* prev; } ActorHeapNode; -void Actor_Kill(Actor* actor); -#define gActorOverlayTable ((ActorOverlay*)GAME_ADDR(0x50CD84)) - -typedef u32 (*Actor_HasParent_proc)(Actor* actor, struct GlobalContext* globalCtx); -#define Actor_HasParent ((Actor_HasParent_proc)GAME_ADDR(0x371E40)) - -typedef f32 (*Actor_WorldDistXYZToActor_proc)(Actor* a, Actor* b) __attribute__((pcs("aapcs-vfp"))); -#define Actor_WorldDistXYZToActor ((Actor_WorldDistXYZToActor_proc)GAME_ADDR(0x3306C4)) - -typedef void (*ActorShape_Init_proc)(ActorShape* shape, f32 yOffset, void* shadowDrawFunc, f32 shadowScale) - __attribute__((pcs("aapcs-vfp"))); -#define ActorShape_Init ((ActorShape_Init_proc)GAME_ADDR(0x372D4C)) +extern ActorOverlay gActorOverlayTable[]; -typedef void (*Actor_SetFeetPos_proc)(Actor* actor, nn_math_MTX34* mtx, int param_3, int param_4, Vec3f* param_5, - int param_6, Vec3f* param_7); -#define Actor_SetFeetPos ((Actor_SetFeetPos_proc)GAME_ADDR(0x34CBB4)) +void Actor_Kill(Actor* actor); -typedef void (*Actor_UpdateBgCheckInfo_proc)(struct GlobalContext* globalCtx, Actor* actor, f32 wallCheckHeight, - f32 wallCheckRadius, f32 ceilingCheckHeight, s32 flags) +u32 Actor_HasParent(Actor* actor, struct GlobalContext* globalCtx); +f32 Actor_WorldDistXYZToActor(Actor* a, Actor* b) __attribute__((pcs("aapcs-vfp"))); +void ActorShape_Init(ActorShape* shape, f32 yOffset, void* shadowDrawFunc, f32 shadowScale) __attribute__((pcs("aapcs-vfp"))); -#define Actor_UpdateBgCheckInfo ((Actor_UpdateBgCheckInfo_proc)GAME_ADDR(0x376340)) - -typedef s32 (*Player_InCsMode_proc)(struct GlobalContext* globalCtx); -#define Player_InCsMode ((Player_InCsMode_proc)GAME_ADDR(0x36A7A0)) - -typedef Actor* (*Actor_FindNearby_proc)(struct GlobalContext* globalCtx, Actor* ref_actor, s16 actorId, - u8 actor_category, f32 range); -#define Actor_FindNearby ((Actor_FindNearby_proc)GAME_ADDR(0x369334)) +void Actor_SetFeetPos(Actor* actor, nn_math_MTX34* mtx, int param_3, int param_4, Vec3f* param_5, int param_6, + Vec3f* param_7); +void Actor_UpdateBgCheckInfo(struct GlobalContext* globalCtx, Actor* actor, f32 wallCheckHeight, f32 wallCheckRadius, + f32 ceilingCheckHeight, s32 flags) __attribute__((pcs("aapcs-vfp"))); +s32 Player_InCsMode(struct GlobalContext* globalCtx); +Actor* Actor_FindNearby(struct GlobalContext* globalCtx, Actor* ref_actor, s16 actorId, u8 actor_category, f32 range); +void ActorShadow_DrawFeet(Actor* actor, void* lights, struct GlobalContext* globalCtx); #endif diff --git a/code/include/z3D/z3Dactor_id.h b/code/include/z3D/z3Dactor_id.h index 6d5de366..15a4e7df 100644 --- a/code/include/z3D/z3Dactor_id.h +++ b/code/include/z3D/z3Dactor_id.h @@ -29,6 +29,7 @@ enum ActorId { ACTOR_DEKU_BABA = 0x055, ACTOR_MAD_SCRUB = 0x060, ACTOR_BARI = 0x063, + ACTOR_HOOKSHOT = 0x066, ACTOR_BUBBLE = 0x069, ACTOR_FLYING_FLOOR_TILE = 0x06B, ACTOR_BEAMOS = 0x08A, diff --git a/code/include/z3D/z3Dbgcheck.h b/code/include/z3D/z3Dbgcheck.h index 39d5daf5..c63e511c 100644 --- a/code/include/z3D/z3Dbgcheck.h +++ b/code/include/z3D/z3Dbgcheck.h @@ -152,19 +152,13 @@ typedef struct CollisionContext { /* 0x0050 */ DynaCollisionContext dyna; } CollisionContext; // size = 0x15F4 -typedef s32 (*WaterBox_GetSurfaceImpl_proc)(struct GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, - f32* ySurface, void** outWaterBox) __attribute__((pcs("aapcs-vfp"))); // Returns true if point is within the xz boundaries of an active water box, else false -#define WaterBox_GetSurfaceImpl ((WaterBox_GetSurfaceImpl_proc)GAME_ADDR(0x35E8A0)) - -typedef f32 (*BgCheck_RaycastDown1_proc)(CollisionContext* colCtx, CollisionPoly* outGroundPoly, Vec3f* pos) - __attribute__((pcs("aapcs-vfp"))); +s32 WaterBox_GetSurfaceImpl(struct GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + void** outWaterBox) __attribute__((pcs("aapcs-vfp"))); // Returns the yIntersect of the nearest poly found directly below `pos`, or BGCHECK_Y_MIN if no floor detected -#define BgCheck_RaycastDown1 ((BgCheck_RaycastDown1_proc)GAME_ADDR(0x257054)) - -typedef s32 (*BgCheck_EntityLineTest1_proc)(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, - CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, - s32 chkOneFace, s32* bgId); -#define BgCheck_EntityLineTest1 ((BgCheck_EntityLineTest1_proc)GAME_ADDR(0x369F9C)) +f32 BgCheck_RaycastDown1(CollisionContext* colCtx, CollisionPoly* outGroundPoly, Vec3f* pos) + __attribute__((pcs("aapcs-vfp"))); +s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); #endif //_Z3DBGCHECK_H diff --git a/code/include/z3D/z3Dcollision_check.h b/code/include/z3D/z3Dcollision_check.h index 6110d837..95c9f8a1 100644 --- a/code/include/z3D/z3Dcollision_check.h +++ b/code/include/z3D/z3Dcollision_check.h @@ -127,22 +127,11 @@ typedef struct { } ColliderCylinderInit; // size = 0x58 _Static_assert(sizeof(ColliderCylinderInit) == 0x38, "ColliderCylinderInit size"); -typedef void (*Collider_InitCylinder_proc)(struct GlobalContext* globalCtx, ColliderCylinder* collider); -#define Collider_InitCylinder ((Collider_InitCylinder_proc)GAME_ADDR(0x353DD0)) - -typedef void (*Collider_SetCylinder_proc)(struct GlobalContext* globalCtx, ColliderCylinder* collider, - struct Actor* actor, void* cylinderInitData); -#define Collider_SetCylinder ((Collider_SetCylinder_proc)GAME_ADDR(0x353D24)) - -typedef void (*Collider_UpdateCylinder_proc)(struct Actor* actor, ColliderCylinder* collider); -#define Collider_UpdateCylinder ((Collider_UpdateCylinder_proc)GAME_ADDR(0x37632C)) - -typedef void (*CollisionCheck_SetOC_proc)(struct GlobalContext* globalCtx, struct CollisionCheckContext* colChkCtx, - void* collider); -#define CollisionCheck_SetOC ((CollisionCheck_SetOC_proc)GAME_ADDR(0x3762A4)) - -typedef void (*CollisionCheck_SetAC_proc)(struct GlobalContext* globalCtx, struct CollisionCheckContext* colChkCtx, - void* collider); -#define CollisionCheck_SetAC ((CollisionCheck_SetAC_proc)GAME_ADDR(0x376168)) +void Collider_InitCylinder(struct GlobalContext* globalCtx, ColliderCylinder* collider); +void Collider_SetCylinder(struct GlobalContext* globalCtx, ColliderCylinder* collider, struct Actor* actor, + void* cylinderInitData); +void Collider_UpdateCylinder(struct Actor* actor, ColliderCylinder* collider); +void CollisionCheck_SetOC(struct GlobalContext* globalCtx, struct CollisionCheckContext* colChkCtx, void* collider); +void CollisionCheck_SetAC(struct GlobalContext* globalCtx, struct CollisionCheckContext* colChkCtx, void* collider); #endif //_Z3DCOLLISION_CHECK_H_ diff --git a/code/include/z3D/z3Deffect.h b/code/include/z3D/z3Deffect.h index cdf83fb0..5b670657 100644 --- a/code/include/z3D/z3Deffect.h +++ b/code/include/z3D/z3Deffect.h @@ -76,12 +76,10 @@ typedef struct EffectContext { } EffectContext; _Static_assert(sizeof(EffectContext) == 0xD250, "EffectContext size"); -#define gEffectContext (*(EffectContext*)GAME_ADDR(0x58B2E0)) +extern EffectContext gEffectContext; -#define EffectBlure_Update ((void (*)(EffectBlure*))GAME_ADDR(0x227000)) - -typedef void (*Effect_Delete_proc)(struct GlobalContext* globalCtx, s32 index); -#define Effect_Delete ((Effect_Delete_proc)GAME_ADDR(0x34F0F4)) +void EffectBlure_Update(EffectBlure*); +void Effect_Delete(struct GlobalContext* globalCtx, s32 index); /* Effect Soft Sprites */ @@ -151,9 +149,8 @@ typedef struct EffectSsInfo { // ... } EffectSsInfo; -#define gEffectSsInfo (*(EffectSsInfo*)GAME_ADDR(0x598530)) +extern EffectSsInfo gEffectSsInfo; -typedef void (*EffectSs_Delete_proc)(EffectSs* effectSs); -#define EffectSs_Delete ((EffectSs_Delete_proc)GAME_ADDR(0x2D6A50)) +void EffectSs_Delete(EffectSs* effectSs); #endif //_Z3DEFFECT_H_ diff --git a/code/include/z3D/z3Dmath.h b/code/include/z3D/z3Dmath.h index 8fe6553c..b7b0d010 100644 --- a/code/include/z3D/z3Dmath.h +++ b/code/include/z3D/z3Dmath.h @@ -1,28 +1,12 @@ #ifndef _Z3DMATH_H_ #define _Z3DMATH_H_ -typedef f32 (*Math_SinS_proc)(s16 angle) __attribute__((pcs("aapcs-vfp"))); -#define Math_SinS ((Math_SinS_proc)GAME_ADDR(0x2CFCA0)) - -typedef f32 (*Math_CosS_proc)(s16 angle) __attribute__((pcs("aapcs-vfp"))); -#define Math_CosS ((Math_CosS_proc)GAME_ADDR(0x338F60)) - -typedef void (*Matrix_Multiply_proc)(nn_math_MTX34* dst, nn_math_MTX34* lhs, nn_math_MTX44* rhs) - __attribute__((pcs("aapcs-vfp"))); -#define Matrix_Multiply ((Matrix_Multiply_proc)GAME_ADDR(0x36C174)) - -typedef void (*Matrix_UpdatePosition_proc)(nn_math_MTX34* dst, nn_math_MTX34* src, Vec3f* vec) - __attribute__((pcs("aapcs-vfp"))); -#define Matrix_UpdatePosition ((Matrix_UpdatePosition_proc)GAME_ADDR(0x372070)) - -typedef s16 (*Math_SmoothStepToS_proc)(s16* pValue, s16 target, s16 scale, s16 step, s16 minStep); -#define Math_SmoothStepToS ((Math_SmoothStepToS_proc)GAME_ADDR(0x375A18)) - -typedef f32 (*Math_SmoothStepToF_proc)(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep) - __attribute__((pcs("aapcs-vfp"))); -#define Math_SmoothStepToF ((Math_SmoothStepToF_proc)GAME_ADDR(0x36E168)) - -typedef f32 (*Math_Vec3f_DistXZ_proc)(Vec3f* a, Vec3f* b) __attribute__((pcs("aapcs-vfp"))); -#define Math_Vec3f_DistXZ ((Math_Vec3f_DistXZ_proc)GAME_ADDR(0x36D260)) +f32 Math_SinS(s16 angle) __attribute__((pcs("aapcs-vfp"))); +f32 Math_CosS(s16 angle) __attribute__((pcs("aapcs-vfp"))); +void Matrix_Multiply(nn_math_MTX34* dst, nn_math_MTX34* lhs, nn_math_MTX44* rhs) __attribute__((pcs("aapcs-vfp"))); +void Matrix_UpdatePosition(nn_math_MTX34* dst, nn_math_MTX34* src, Vec3f* vec) __attribute__((pcs("aapcs-vfp"))); +s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, s16 step, s16 minStep); +f32 Math_SmoothStepToF(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep) __attribute__((pcs("aapcs-vfp"))); +f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b) __attribute__((pcs("aapcs-vfp"))); #endif diff --git a/code/oot.ld b/code/oot.ld index 961b2679..47fddc04 100644 --- a/code/oot.ld +++ b/code/oot.ld @@ -7,45 +7,73 @@ SECTIONS . = 0x100000 + _LD_OFF; .patch_loader 0x100000 + _LD_OFF : { *(.patch_loader) } + FUN_00100434 = 0x100434 + _LD_OFF; + EnBb_Update = 0x1005EC + _LD_OFF; + EnIk_UpdateEnemy = 0x1008B4 + _LD_OFF; + EnZf_Update = 0x101C48 + _LD_OFF; .patch_GrogSetTradedCojiroFlag 0x104C50 + _LD_OFF : { *(.patch_GrogSetTradedCojiroFlag) } .patch_MidoCheckDekuTreeClearTwo 0x105CD4 + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearTwo) } .patch_ArmosCooldownTimer 0x10B41C + _LD_OFF : { *(.patch_ArmosCooldownTimer) } .patch_ArmosPushSpeed 0x10B5C4 + _LD_OFF : { *(.patch_ArmosPushSpeed) } + EnMb_ClubWaitPlayerNear = 0x10B5D0 + _LD_OFF; .patch_ShortenRainbowBridgeCS 0x10B904 + _LD_OFF : { *(.patch_ShortenRainbowBridgeCS) } .patch_GrannyTextID 0x10DCD0 + _LD_OFF : { *(.patch_GrannyTextID) } + OceffSpot_End = 0x10FBD0 + _LD_OFF; + ObjLift_Shake = 0x110E98 + _LD_OFF; .patch_LabScientistDontStartTimerAndSetFlag 0x112440 + _LD_OFF : { *(.patch_LabScientistDontStartTimerAndSetFlag) } .patch_BombchuPurchaseableCheck 0x112ED0 + _LD_OFF : { *(.patch_BombchuPurchaseableCheck) } + EnDha_Update = 0x113050 + _LD_OFF; .patch_PoeCollectorGetFirstTextbox 0x113844 + _LD_OFF : { *(.patch_PoeCollectorGetFirstTextbox) } + ItemEtcetera_Draw = 0x11707C + _LD_OFF; .patch_ItemEtceteraModelDraw 0x117080 + _LD_OFF : { *(.patch_ItemEtceteraModelDraw) } + EnFd_Reappear = 0x117D98 + _LD_OFF; .patch_FlyingPotCollision 0x11DB34 + _LD_OFF : { *(.patch_FlyingPotCollision) } .patch_DodongoAfterSwallowBomb 0x11E4B8 + _LD_OFF : { *(.patch_DodongoAfterSwallowBomb) } + EnGe1_TalkAfterGame_Archery = 0x12A5C8 + _LD_OFF; .patch_SariasSongItemGive 0x12C84C + _LD_OFF : { *(.patch_SariasSongItemGive) } .patch_SariasSongLocation 0x12C8F8 + _LD_OFF : { *(.patch_SariasSongLocation) } .patch_SkulltulaRewardOne 0x12CC68 + _LD_OFF : { *(.patch_SkulltulaRewardOne) } .patch_SkulltulaRewardTwo 0x12CD38 + _LD_OFF : { *(.patch_SkulltulaRewardTwo) } + DemoGt_Update = 0x12E1C4 + _LD_OFF; + EnTest_Update = 0x12E2D0 + _LD_OFF; .patch_MedigoronCheckFlagOne 0x13024C + _LD_OFF : { *(.patch_MedigoronCheckFlagOne) } .patch_MedigoronGetCustomText 0x130258 + _LD_OFF : { *(.patch_MedigoronGetCustomText) } .patch_MedigoronCheckFlagTwo 0x1302C4 + _LD_OFF : { *(.patch_MedigoronCheckFlagTwo) } .patch_BeanDaddyModifyBeansBought 0x130CEC + _LD_OFF : { *(.patch_BeanDaddyModifyBeansBought) } + EnBubble_Pop = 0x1321A8 + _LD_OFF; .patch_PlayerCheckVoidOut 0x132B64 + _LD_OFF : { *(.patch_PlayerCheckVoidOut) } + EnGo2_SetGetItem = 0x133EBC + _LD_OFF; .patch_BiggoronDontSetBGSFlag 0x133F7C + _LD_OFF : { *(.patch_BiggoronDontSetBGSFlag) } .patch_KingZoraDontStartTimer 0x134D7C + _LD_OFF : { *(.patch_KingZoraDontStartTimer) } + EnMb_ClubAttack = 0x136C68 + _LD_OFF; .patch_GanonFinalBlow 0x13B684 + _LD_OFF : { *(.patch_GanonFinalBlow) } .patch_StalchildDespawn_13DB68 0x13DB68 + _LD_OFF : { *(.patch_StalchildDespawn_13DB68) } .patch_SongOfStormsLocation 0x1427E0 + _LD_OFF : { *(.patch_SongOfStormsLocation) } + ObjBean_StallGrowth = 0x143684 + _LD_OFF; + ObjBean_GrowSprout = 0x1436C4 + _LD_OFF; .patch_JabuSwitchRutoCheck 0x143AC8 + _LD_OFF : { *(.patch_JabuSwitchRutoCheck) } .patch_OwlMagicCheck 0x144B44 + _LD_OFF : { *(.patch_OwlMagicCheck) } + EnGeldB_Update = 0x14A04C + _LD_OFF; + EnGirlA_InitializeItemAction = 0x14D5C8 + _LD_OFF; .patch_MedigoronItemOverrideOne 0x14D95C + _LD_OFF : { *(.patch_MedigoronItemOverrideOne) } .patch_BeanDaddyPurchase 0x14EDA8 + _LD_OFF : { *(.patch_BeanDaddyPurchase) } .patch_BeanDaddyModifyPrice 0x14EE98 + _LD_OFF : { *(.patch_BeanDaddyModifyPrice) } .patch_SkipTwinrovaQuarrelCutsceneOne 0x15273C + _LD_OFF : { *(.patch_SkipTwinrovaQuarrelCutsceneOne) } + EnCrow_Respawn = 0x158648 + _LD_OFF; .patch_FairyPickupHealAmount 0x15CA4C + _LD_OFF : { *(.patch_FairyPickupHealAmount) } .patch_RandomGsLoc_SkipSoilJingle 0x15DBD8 + _LD_OFF : { *(.patch_RandomGsLoc_SkipSoilJingle) } + ObjBean_UnplantedWait = 0x15E154 + _LD_OFF; .patch_GrannyBottleCheck 0x161044 + _LD_OFF : { *(.patch_GrannyBottleCheck) } .patch_GrannyItemOverrideOne 0x161094 + _LD_OFF : { *(.patch_GrannyItemOverrideOne) } + FUN_00161828 = 0x161828 + _LD_OFF; .patch_ScrubStickUpgradeOne 0x161898 + _LD_OFF : { *(.patch_ScrubStickUpgradeOne) } .patch_ScrubNutUpgradeOne 0x1618EC + _LD_OFF : { *(.patch_ScrubNutUpgradeOne) } + EnDns_Talk = 0x161960 + _LD_OFF; + EnBb_Init = 0x162328 + _LD_OFF; + EnBb_Destroy = 0x162C28 + _LD_OFF; + EnGs_Init = 0x16461C + _LD_OFF; .patch_GrogCheckForShouldDespawn 0x16485C + _LD_OFF : { *(.patch_GrogCheckForShouldDespawn) } + EnIk_Init = 0x164B0C + _LD_OFF; .patch_GetObjectEntry_164BC8 0x164BC8 + _LD_OFF : { *(.patch_GetObjectEntry_164BC8) } .patch_CheckFadoCanSpawnInLostWoods 0x1657EC + _LD_OFF : { *(.patch_CheckFadoCanSpawnInLostWoods) } .patch_EnKoInitCheckForest_165834 0x165834 + _LD_OFF : { *(.patch_EnKoInitCheckForest_165834) } @@ -53,18 +81,24 @@ SECTIONS .patch_EnKoInitCheckForest_1658C0 0x1658C0 + _LD_OFF : { *(.patch_EnKoInitCheckForest_1658C0) } .patch_EnKoInitCheckForest_1658F0 0x1658F0 + _LD_OFF : { *(.patch_EnKoInitCheckForest_1658F0) } .patch_KingZoraCheckMovedFlag 0x165A60 + _LD_OFF : { *(.patch_KingZoraCheckMovedFlag) } + EnMb_Init = 0x165BA4 + _LD_OFF; .patch_MidoCheckSpawn 0x166154 + _LD_OFF : { *(.patch_MidoCheckSpawn) } .patch_MidoCheckDekuTreeClearOne 0x16623C + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearOne) } + EnPeehat_Update = 0x167644 + _LD_OFF; .patch_GetObjectEntry_EnRdInit_One 0x167DA4 + _LD_OFF : { *(.patch_GetObjectEntry_EnRdInit_One) } .patch_GetObjectEntry_EnRdInit_Two 0x167E38 + _LD_OFF : { *(.patch_GetObjectEntry_EnRdInit_Two) } .patch_SariasSongCheckFlag 0x1686A0 + _LD_OFF : { *(.patch_SariasSongCheckFlag) } + EnSi_Init = 0x168A90 + _LD_OFF; .patch_GetObjectEntry_EnSiInit 0x168B20 + _LD_OFF : { *(.patch_GetObjectEntry_EnSiInit) } + EnSi_Destroy = 0x168C3C + _LD_OFF; + EnSw_Init = 0x1691C8 + _LD_OFF; .patch_RandomGsLoc_BlockSpawn_Tree 0x16C43C + _LD_OFF : { *(.patch_RandomGsLoc_BlockSpawn_Tree) } .patch_MedigoronSetRewardFlag 0x16C918 + _LD_OFF : { *(.patch_MedigoronSetRewardFlag) } .patch_MedigoronItemOverrideTwo 0x16C9BC + _LD_OFF : { *(.patch_MedigoronItemOverrideTwo) } .patch_MaskSalesmanBorrowMask 0x16D148 + _LD_OFF : { *(.patch_MaskSalesmanBorrowMask) } .patch_KingZoraIgnoreSapphire 0x1736B8 + _LD_OFF : { *(.patch_KingZoraIgnoreSapphire) } .patch_MidoForestDialog 0x173944 + _LD_OFF : { *(.patch_MidoForestDialog) } + EnGoma_SetupHatch = 0x1741C8 + _LD_OFF; .patch_LeeverSandCheck_Big 0x1743D0 + _LD_OFF : { *(.patch_LeeverSandCheck_Big) } .patch_SkipTimeTravelCutsceneOne 0x174DEC + _LD_OFF : { *(.patch_SkipTimeTravelCutsceneOne) } .patch_SkipTwinrovaQuarrelCutsceneTwo 0x176110 + _LD_OFF : { *(.patch_SkipTwinrovaQuarrelCutsceneTwo) } @@ -72,25 +106,39 @@ SECTIONS .patch_CarpenterBossDontNullExchangeItem 0x178BE4 + _LD_OFF : { *(.patch_CarpenterBossDontNullExchangeItem) } .patch_CarpenterBossSetTradedSawFlag 0x178D58 + _LD_OFF : { *(.patch_CarpenterBossSetTradedSawFlag) } .patch_AnjuCheckCuccoAmount 0x179420 + _LD_OFF : { *(.patch_AnjuCheckCuccoAmount) } + EnReeba_SetupSurface = 0x181394 + _LD_OFF; + BgYdanSp_BurnWallWeb = 0x181878 + _LD_OFF; + BgYdanSp_WallWebIdle = 0x181C88 + _LD_OFF; + EnDaiku_WaitFreedom = 0x182FF0 + _LD_OFF; .patch_FastOwlCutscenes 0x188584 + _LD_OFF : { *(.patch_FastOwlCutscenes) } .patch_BombchuShopInfinitePurchases 0x188D3C + _LD_OFF : { *(.patch_BombchuShopInfinitePurchases) } + EnBox_Init = 0x1899EC + _LD_OFF; + EnCow_Init = 0x189FD4 + _LD_OFF; + EnCow_Destroy = 0x18A3E4 + _LD_OFF; .patch_BusinessScrubTable 0x18A634 + _LD_OFF : { *(.patch_BusinessScrubTable) } + EnGe1_Init = 0x18B218 + _LD_OFF; .patch_CheckGerudoToken_18B368 0x18B368 + _LD_OFF : { *(.patch_CheckGerudoToken_18B368) } .patch_CheckGerudoToken_18B3A0 0x18B3A0 + _LD_OFF : { *(.patch_CheckGerudoToken_18B3A0) } .patch_CheckGerudoToken_18B3C0 0x18B3C0 + _LD_OFF : { *(.patch_CheckGerudoToken_18B3C0) } .patch_CheckGerudoToken_18B448 0x18B448 + _LD_OFF : { *(.patch_CheckGerudoToken_18B448) } .patch_CheckGerudoToken_18B6F4 0x18B6F4 + _LD_OFF : { *(.patch_CheckGerudoToken_18B6F4) } .patch_CheckGerudoToken_18B710 0x18B710 + _LD_OFF : { *(.patch_CheckGerudoToken_18B710) } + EnMa1_Init = 0x18C334 + _LD_OFF; .patch_EponasSongCheckFlag 0x18C56C + _LD_OFF : { *(.patch_EponasSongCheckFlag) } + EnMag_Init = 0x18CBB8 + _LD_OFF; .patch_GetObjectEntry_EnXcInit 0x18D7AC + _LD_OFF : { *(.patch_GetObjectEntry_EnXcInit) } .patch_PreludeLocation 0x18D9FC + _LD_OFF : { *(.patch_PreludeLocation) } + EnOwl_Init = 0x18DB28 + _LD_OFF; + EnPoh_Init = 0x18DF00 + _LD_OFF; .patch_SkullKidPoacherSawCheck 0x18ED80 + _LD_OFF : { *(.patch_SkullKidPoacherSawCheck) } .patch_PoeCollectorCheckPoints 0x19091C + _LD_OFF : { *(.patch_PoeCollectorCheckPoints) } .patch_GoronShopPurchaseableCheck 0x19120C + _LD_OFF : { *(.patch_GoronShopPurchaseableCheck) } + PlayerActor_Init = 0x191844 + _LD_OFF; .patch_PlayerEditAndRetrieveCMB 0x191970 + _LD_OFF : { *(.patch_PlayerEditAndRetrieveCMB) } .patch_AdultItemsCMABsAsChild 0x191BB0 + _LD_OFF : { *(.patch_AdultItemsCMABsAsChild) } .patch_SetChildCustomTunic 0x191DB0 + _LD_OFF : { *(.patch_SetChildCustomTunic) } .patch_PlayerGetCustomTunicCMAB 0x191DD4 + _LD_OFF : { *(.patch_PlayerGetCustomTunicCMAB) } + PlayerActor_Destroy = 0x19262C + _LD_OFF; .patch_SkipDaruniaDanceOne 0x19493C + _LD_OFF : { *(.patch_SkipDaruniaDanceOne) } .patch_SkipDaruniaDanceTwo 0x194944 + _LD_OFF : { *(.patch_SkipDaruniaDanceTwo) } .patch_ChildRollingGoron 0x194B18 + _LD_OFF : { *(.patch_ChildRollingGoron) } @@ -105,20 +153,36 @@ SECTIONS .patch_AmyBlockCooldownTimer 0x196ECC + _LD_OFF : { *(.patch_AmyBlockCooldownTimer) } .patch_AmyBlockSpeed 0x196F3C + _LD_OFF : { *(.patch_AmyBlockSpeed) } .patch_DampeChest 0x19A420 + _LD_OFF : { *(.patch_DampeChest) } + BgYdanSp_BurnFloorWeb = 0x19A52C + _LD_OFF; + BgYdanSp_FloorWebIdle = 0x19A8EC + _LD_OFF; .patch_PierreSoftlockFixOne 0x19C734 + _LD_OFF : { *(.patch_PierreSoftlockFixOne) } .patch_EnBlkobj_FindDarkLink 0x1A0BC8 + _LD_OFF : { *(.patch_EnBlkobj_FindDarkLink) } .patch_EnBlkobj_SpawnDarkLink 0x1A137C + _LD_OFF : { *(.patch_EnBlkobj_SpawnDarkLink) } .patch_RutoBlueWarpOverride 0x1A1900 + _LD_OFF : { *(.patch_RutoBlueWarpOverride) } + Boss_Tw_Init = 0x1A7E18 + _LD_OFF; .patch_KotakeDontPlayBattleMusic 0x1A8218 + _LD_OFF : { *(.patch_KotakeDontPlayBattleMusic) } + Boss_Tw_Destroy = 0x1A88E8 + _LD_OFF; + EnFd_Update = 0x1B004C + _LD_OFF; + EnFu_Update = 0x1B1328 + _LD_OFF; + EnGeldB_Draw = 0x1B2B00 + _LD_OFF; .patch_GetObjectEntry_EnGomaInit_One 0x1B3130 + _LD_OFF : { *(.patch_GetObjectEntry_EnGomaInit_One) } .patch_GetObjectEntry_EnGomaInit_Two 0x1B3208 + _LD_OFF : { *(.patch_GetObjectEntry_EnGomaInit_Two) } .patch_GossipStoneAddSariaHint 0x1B3968 + _LD_OFF : { *(.patch_GossipStoneAddSariaHint) } .patch_ReadGossipStoneHints 0x1B3A44 + _LD_OFF : { *(.patch_ReadGossipStoneHints) } + EnIshi_Init = 0x1B5460 + _LD_OFF; .patch_SkipJabuOpeningCutscene 0x1B583C + _LD_OFF : { *(.patch_SkipJabuOpeningCutscene) } + EnKz_Update = 0x1B66F8 + _LD_OFF; .patch_KingZoraSecondTunic 0x1B6A18 + _LD_OFF : { *(.patch_KingZoraSecondTunic) } .patch_KingZoraGiveTunic 0x1B6A64 + _LD_OFF : { *(.patch_KingZoraGiveTunic) } + EnMb_Update = 0x1B6D80 + _LD_OFF; .patch_MidoCheckDekuTreeClearThree 0x1B7414 + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearThree) } + EnNb_Draw = 0x1B7FBC + _LD_OFF; + EnSi_Draw = 0x1BA050 + _LD_OFF; + EnSi_Update = 0x1BA0C8 + _LD_OFF; + EnSw_Update = 0x1BB110 + _LD_OFF; .patch_GetObjectEntry_EnTiteInit 0x1BBC9C + _LD_OFF : { *(.patch_GetObjectEntry_EnTiteInit) } + EnTk_Update = 0x1BC088 + _LD_OFF; + Fishing_Init = 0x1C0AD8 + _LD_OFF; .patch_FishingNewRecord 0x1C3AA4 + _LD_OFF : { *(.patch_FishingNewRecord) } .patch_FishingSizeIgnoreChild 0x1C3DFC + _LD_OFF : { *(.patch_FishingSizeIgnoreChild) } .patch_FishingSizeIgnoreAdult 0x1C3E40 + _LD_OFF : { *(.patch_FishingSizeIgnoreAdult) } @@ -128,75 +192,172 @@ SECTIONS .patch_GerudoBattleMusic 0x1C6FD8 + _LD_OFF : { *(.patch_GerudoBattleMusic) } .patch_EnEncount1_SpawnLeever 0x1CC94C + _LD_OFF : { *(.patch_EnEncount1_SpawnLeever) } .patch_EnEncount1_SetLeeverAimType 0x1CC984 + _LD_OFF : { *(.patch_EnEncount1_SetLeeverAimType) } + EnEiyer_WanderUnderground = 0x1CD1D4 + _LD_OFF; .patch_TruthSpinnerSpeed 0x1CD814 + _LD_OFF : { *(.patch_TruthSpinnerSpeed) } + ActorShadow_DrawFeet = 0x1D04F4 + _LD_OFF; .patch_DemoEffectStoneDraw 0x1D209C + _LD_OFF : { *(.patch_DemoEffectStoneDraw) } + EnBox_Update = 0x1D5B70 + _LD_OFF; .patch_ChestIceSmoke 0x1D5E5C + _LD_OFF : { *(.patch_ChestIceSmoke) } + EnDns_Update = 0x1D67CC + _LD_OFF; + EnGe1_Update = 0x1D742C + _LD_OFF; .patch_CheckGerudoToken_1D7AD4 0x1D7AD4 + _LD_OFF : { *(.patch_CheckGerudoToken_1D7AD4) } + EnGeldB_Init = 0x1D7BD8 + _LD_OFF; + EnGirlA_Init = 0x1D7F20 + _LD_OFF; .patch_BiggoronSetTextId 0x1D8A10 + _LD_OFF : { *(.patch_BiggoronSetTextId) } .patch_BombchuShopAlwaysOpen 0x1DC6B0 + _LD_OFF : { *(.patch_BombchuShopAlwaysOpen) } + EnOwl_Update = 0x1DCB60 + _LD_OFF; + EnPoh_UpdateLiving = 0x1DD974 + _LD_OFF; .patch_LeeverDontChangeCategory 0x1DE010 + _LD_OFF : { *(.patch_LeeverDontChangeCategory) } .patch_LeeverSandCheck_Init 0x1DE078 + _LD_OFF : { *(.patch_LeeverSandCheck_Init) } + EnSkb_Update = 0x1DE320 + _LD_OFF; + EnSkj_Update = 0x1DE890 + _LD_OFF; + EnSsh_Update = 0x1DF0A4 + _LD_OFF; + ObjBean_Init = 0x1E12B0 + _LD_OFF; + PlayerActor_Update = 0x1E1B54 + _LD_OFF; .patch_AdultBlueWarpOverride 0x1E3F50 + _LD_OFF : { *(.patch_AdultBlueWarpOverride) } .patch_DaruniaCheckStrength 0x1E489C + _LD_OFF : { *(.patch_DaruniaCheckStrength) } + BgYdanSp_FloorWebBreaking = 0x1E8438 + _LD_OFF; .patch_CanPlayBombchuBowlingTwo 0x1EA1D4 + _LD_OFF : { *(.patch_CanPlayBombchuBowlingTwo) } + ArmsHook_Init = 0x1EBF84 + _LD_OFF; + Boss_Tw_Draw = 0x1EEDF0 + _LD_OFF; + Boss_Tw_Update = 0x1EF880 + _LD_OFF; .patch_BoomerangTrailEffect 0x1F4220 + _LD_OFF : { *(.patch_BoomerangTrailEffect) } /*EnBoom_Draw*/ + EnCrow_Update = 0x1F4D40 + _LD_OFF; + EnDodojr_Init = 0x1F51E8 + _LD_OFF; + EnDoor_Update = 0x1F53C8 + _LD_OFF; .patch_GohmaEggDeathSignalParent 0x1F5F48 + _LD_OFF : { *(.patch_GohmaEggDeathSignalParent) } + EnIshi_Update = 0x1F69AC + _LD_OFF; + EnItem00_Init = 0x1F69B4 + _LD_OFF; .patch_Item00GiveAutomaticItemDrop 0x1F6E4C + _LD_OFF : { *(.patch_Item00GiveAutomaticItemDrop) } .patch_ItemGiveBombchuDropOne 0x1F6F70 + _LD_OFF : { *(.patch_ItemGiveBombchuDropOne) } + EnItem00_Destroy = 0x1F706C + _LD_OFF; + EnTorch2_Init = 0x1F853C + _LD_OFF; .patch_GetObjectEntry_1F85B0 0x1F85B0 + _LD_OFF : { *(.patch_GetObjectEntry_1F85B0) } + Fishing_DrawFish = 0x1F98B4 + _LD_OFF; + Fishing_UpdateFish = 0x1F9ACC + _LD_OFF; + BgSpot02Objects_Explode = 0x205EDC + _LD_OFF; .patch_BombchuBowlingStaticReward 0x206150 + _LD_OFF : { *(.patch_BombchuBowlingStaticReward) } + FUN_2065E0 = 0x2065E0 + _LD_OFF; .patch_SkipSongReplays_TimeBlocksFix 0x208004 + _LD_OFF : { *(.patch_SkipSongReplays_TimeBlocksFix) } .patch_SkipSongReplays_WarpBlocksFix 0x208068 + _LD_OFF : { *(.patch_SkipSongReplays_WarpBlocksFix) } + EnChanger_Init = 0x20EC50 + _LD_OFF; .patch_ChestMinigame_DontOpenChestsOnInit 0x20EC8C + _LD_OFF : { *(.patch_ChestMinigame_DontOpenChestsOnInit) } .patch_ChestMinigame_KeyChestVisibility 0x20EDB8 + _LD_OFF : { *(.patch_ChestMinigame_KeyChestVisibility) } .patch_ChestMinigame_RewardChestVisibility 0x20EFE0 + _LD_OFF : { *(.patch_ChestMinigame_RewardChestVisibility) } + EnDaiku_Update = 0x20F1A8 + _LD_OFF; + EnEiyer_Update = 0x20F700 + _LD_OFF; + EnExItem_Init = 0x20FC50 + _LD_OFF; + EnExItem_Destroy = 0x20FDE0 + _LD_OFF; + EnGirlA_Draw = 0x210188 + _LD_OFF; .patch_ShopItemDontSetAnimSpeedOne 0x2101BC + _LD_OFF : { *(.patch_ShopItemDontSetAnimSpeedOne) } .patch_ShopItemDontSetAnimSpeedTwo 0x2101CC + _LD_OFF : { *(.patch_ShopItemDontSetAnimSpeedTwo) } .patch_CourtyardCheckForVisitedZeldaOne 0x210C4C + _LD_OFF : { *(.patch_CourtyardCheckForVisitedZeldaOne) } .patch_CourtyardCheckForVisitedZeldaTwo 0x210C78 + _LD_OFF : { *(.patch_CourtyardCheckForVisitedZeldaTwo) } .patch_BugsRecatchable 0x212090 + _LD_OFF : { *(.patch_BugsRecatchable) } .patch_WaterSpoutMasterQuestCheck 0x212BDC + _LD_OFF : { *(.patch_WaterSpoutMasterQuestCheck) } + ObjBean_Update = 0x214BEC + _LD_OFF; .patch_DekuSproutCheckForest 0x2153A4 + _LD_OFF : { *(.patch_DekuSproutCheckForest) } .patch_DungeonCheckJabuMQBox 0x21590C + _LD_OFF : { *(.patch_DungeonCheckJabuMQBox) } .patch_JabuBoxCheckRuto 0x215934 + _LD_OFF : { *(.patch_JabuBoxCheckRuto) } + ObjLift_Update = 0x2159DC + _LD_OFF; + ObjSwitch_Init = 0x215A14 + _LD_OFF; .patch_GetObjectEntry_ObjSwitchInit 0x215A60 + _LD_OFF : { *(.patch_GetObjectEntry_ObjSwitchInit) } .patch_EnEncount1_SpawnStalchildWolfos 0x21C020 + _LD_OFF : { *(.patch_EnEncount1_SpawnStalchildWolfos) } .patch_DekuTheaterMaskOfTruth 0x21CA30 + _LD_OFF : { *(.patch_DekuTheaterMaskOfTruth) } .patch_BombchuBowlingPrizeOrder 0x21CAD4 + _LD_OFF : { *(.patch_BombchuBowlingPrizeOrder) } + EnDntNomal_SetupTargetUnburrow = 0x21CCFC + _LD_OFF; + EnDntNomal_SetupTargetWalk = 0x21CED4 + _LD_OFF; .patch_NoHealFromBombchuBowlingPrize 0x21D170 + _LD_OFF : { *(.patch_NoHealFromBombchuBowlingPrize) } .patch_HookshotDrawChain 0x2202A0 + _LD_OFF : { *(.patch_HookshotDrawChain) } + DemoEffect_Init = 0x22345C + _LD_OFF; + DemoEffect_Destroy = 0x2245B8 + _LD_OFF; + EffectBlure_Update = 0x227000 + _LD_OFF; + EnBubble_Draw = 0x228CB4 + _LD_OFF; + EnBubble_Update = 0x228F24 + _LD_OFF; .patch_GetObjectEntry_EnDekunutsInit 0x2293AC + _LD_OFF : { *(.patch_GetObjectEntry_EnDekunutsInit) } + EnEncount1_Init = 0x229994 + _LD_OFF; + EnHintnuts_Init = 0x22AB2C + _LD_OFF; .patch_GetObjectEntry_EnHintnutsInit 0x22AB70 + _LD_OFF : { *(.patch_GetObjectEntry_EnHintnutsInit) } + EnItem00_Draw = 0x22B6C0 + _LD_OFF; + EnItem00_Update = 0x22B71C + _LD_OFF; .patch_Item00GiveCollectedItemDrop 0x22B974 + _LD_OFF : { *(.patch_Item00GiveCollectedItemDrop) } .patch_patch_ItemGiveBombchuDropTwo 0x22BAE4 + _LD_OFF : { *(.patch_ItemGiveBombchuDropTwo) } .patch_GetObjectEntry_EnNutsballInit 0x22DEC4 + _LD_OFF : { *(.patch_GetObjectEntry_EnNutsballInit) } + EnShopnuts_Init = 0x22ED2C + _LD_OFF; .patch_BusinessScrubCheckFlags 0x22EE64 + _LD_OFF : { *(.patch_BusinessScrubCheckFlags) } + EnTorch2_Update = 0x22F0C8 + _LD_OFF; .patch_DarkLinkPlayerRecoil 0x22F838 + _LD_OFF : { *(.patch_DarkLinkPlayerRecoil) } + ObjMure3_Update = 0x2318AC + _LD_OFF; .patch_GanonCSEquipMS 0x2359A4 + _LD_OFF : { *(.patch_GanonCSEquipMS) } + FUN_2389EC = 0x2389EC + _LD_OFF; + EnDntNomal_SetupTargetGivePrize = 0x2394CC + _LD_OFF; + BgTreemouth_Init = 0x2412B4 + _LD_OFF; + BgYdanSp_Update = 0x241EF8 + _LD_OFF; + BossGanon_Update = 0x242A94 + _LD_OFF; + DoorShutter_Init = 0x2453E0 + _LD_OFF; + EnAnubice_Update = 0x246E58 + _LD_OFF; .patch_AnubisFlameCircleCheck 0x246F64 + _LD_OFF : { *(.patch_AnubisFlameCircleCheck) } .patch_RainbowChuTrailOne 0x247FC0 + _LD_OFF : { *(.patch_RainbowChuTrailOne) } /*Bombchus use 2 EffectBlure instances*/ .patch_RainbowChuTrailTwo 0x2480A4 + _LD_OFF : { *(.patch_RainbowChuTrailTwo) } /*Bombchus use 2 EffectBlure instances*/ .patch_EnExItemModelDraw 0x249C94 + _LD_OFF : { *(.patch_EnExItemModelDraw) } + EnMThunder_Init = 0x24C910 + _LD_OFF; + EnPoh_Update = 0x24D368 + _LD_OFF; .patch_RedeadCanFreezePlayer 0x24DC2C + _LD_OFF : { *(.patch_RedeadCanFreezePlayer) } .patch_SwordTrailDurationGrezzoFix 0x2507D0 + _LD_OFF : { *(.patch_SwordTrailDurationGrezzoFix) } /*duration is set to 6 due to framerate increase. NOP to allow custom duration*/ .patch_MultiplyPlayerSpeed 0x251D34 + _LD_OFF : { *(.patch_MultiplyPlayerSpeed) } .patch_GameOverStart 0x252424 + _LD_OFF : { *(.patch_GameOverStart) } + ItemBHeart_Init = 0x25375C + _LD_OFF; + ItemBHeart_Destroy = 0x2537D4 + _LD_OFF; + ItemOcarina_Init = 0x253818 + _LD_OFF; + ItemOcarina_Destroy = 0x253A1C + _LD_OFF; + OceffSpot_Update = 0x255BDC + _LD_OFF; + OceffWipe_Update = 0x256158 + _LD_OFF; + BgCheck_RaycastDown1 = 0x257054 + _LD_OFF; .patch_SkipDaruniaDanceThree 0x257F00 + _LD_OFF : { *(.patch_SkipDaruniaDanceThree) } .patch_LostWoodsTargetTimer 0x2592B8 + _LD_OFF : { *(.patch_LostWoodsTargetTimer) } .patch_LostWoodsShootingGame 0x259E4C + _LD_OFF : { *(.patch_LostWoodsShootingGame) } .patch_CanPlayBombchuBowlingOne 0x25A744 + _LD_OFF : { *(.patch_CanPlayBombchuBowlingOne) } + EnDaiku_InitEscape = 0x25A8E4 + _LD_OFF; .patch_GanonDrawMasterSword 0x26207C + _LD_OFF : { *(.patch_GanonDrawMasterSword) } + DemoEffect_Update = 0x262C58 + _LD_OFF; + DemoKankyo_Update = 0x262EA4 + _LD_OFF; + DoorGerudo_Update = 0x263118 + _LD_OFF; .patch_NaviNotifications 0x267E04 + _LD_OFF : { *(.patch_NaviNotifications) } + EnEncount1_Update = 0x2682D0 + _LD_OFF; + EnExRuppy_Update = 0x2689B8 + _LD_OFF; .patch_CheckGerudoToken_269884 0x269884 + _LD_OFF : { *(.patch_CheckGerudoToken_269884) } + EnNutsball_Update = 0x26BD8C + _LD_OFF; .patch_MinuetLocation 0x26C388 + _LD_OFF : { *(.patch_MinuetLocation) } .patch_BoleroLocation 0x26C448 + _LD_OFF : { *(.patch_BoleroLocation) } + EnTakaraMan_Init = 0x26DEB8 + _LD_OFF; + EnYukabyun_Update = 0x26E628 + _LD_OFF; .patch_FlyingTileCollision 0x26E730 + _LD_OFF : { *(.patch_FlyingTileCollision) } .patch_DeadHandHandCanGrabPlayer 0x26EB58 + _LD_OFF : { *(.patch_DeadHandHandCanGrabPlayer) } + ObjHamishi_Update = 0x26FD24 + _LD_OFF; .patch_RedBoulderExplode 0x26FE7C + _LD_OFF : { *(.patch_RedBoulderExplode) } + OceffStorm_Update = 0x27112C + _LD_OFF; + OceffWipe2_Update = 0x2714B8 + _LD_OFF; + OceffWipe3_Update = 0x27181C + _LD_OFF; + OceffWipe4_Update = 0x271C10 + _LD_OFF; .patch_MaskSalesmanGiveMaskOfTruth 0x271D48 + _LD_OFF : { *(.patch_MaskSalesmanGiveMaskOfTruth) } + ItemEtcetera_Init = 0x273F28 + _LD_OFF; + ItemEtcetera_Destroy = 0x2740BC + _LD_OFF; .patch_SongOfTimeJingle 0x274B1C + _LD_OFF : { *(.patch_SongOfTimeJingle) } .patch_DoorOfTimeCheck 0x274B68 + _LD_OFF : { *(.patch_DoorOfTimeCheck) } + EnDaiku_EscapeRotate = 0x2754E4 + _LD_OFF; + BgBdanSwitch_Init = 0x276508 + _LD_OFF; + BgSpot12Saku_Init = 0x27AD6C + _LD_OFF; + BossDodongo_Update = 0x27BE30 + _LD_OFF; .patch_ImpaInCourtyardCheckForVisitedZelda 0x27DEF8 + _LD_OFF : { *(.patch_ImpaInCourtyardCheckForVisitedZelda) } + DoorShutter_Update = 0x27E6E0 + _LD_OFF; + EnDntNomal_Update = 0x280510 + _LD_OFF; + EnGanonOrgan_Init = 0x280E0C + _LD_OFF; + EnPoh_UpdateDead = 0x282E88 + _LD_OFF; + EnSyatekiMan_Init = 0x283F94 + _LD_OFF; + ItemBHeart_Draw = 0x285BEC + _LD_OFF; + ItemBHeart_Update = 0x285C18 + _LD_OFF; + ItemOcarina_Draw = 0x285D48 + _LD_OFF; + ObjOshihiki_Update = 0x286520 + _LD_OFF; .patch_GanonGiveMSMidFight 0x288030 + _LD_OFF : { *(.patch_GanonGiveMSMidFight) } .patch_AnjuGiveCojiro 0x2884F4 + _LD_OFF : { *(.patch_AnjuGiveCojiro) } .patch_SunsSongLocation 0x2888C8 + _LD_OFF : { *(.patch_SunsSongLocation) } @@ -204,11 +365,21 @@ SECTIONS .patch_PierreSoftlockFixThree 0x2889D4 + _LD_OFF : { *(.patch_PierreSoftlockFixThree) } .patch_KakarikoGateCheck 0x28A678 + _LD_OFF : { *(.patch_KakarikoGateCheck) } .patch_BombchuBowlingAlwaysFirstPrize 0x291924 + _LD_OFF : { *(.patch_BombchuBowlingAlwaysFirstPrize) } + ItemEtcetera_Update = 0x298D88 + _LD_OFF; .patch_LostWoodsShootingGameTwo 0x2990E8 + _LD_OFF : { *(.patch_LostWoodsShootingGameTwo) } + BgSpot12Saku_Update = 0x29E030 + _LD_OFF; .patch_Sheik_GetTextID 0x2A4B44 + _LD_OFF : { *(.patch_Sheik_GetTextID) } + EnSyatekiMan_Update = 0x2A60BC + _LD_OFF; + BgSpot01Idomizu_Init = 0x2AC704 + _LD_OFF; + BgSpot01Idosoko_Init = 0x2AC7C8 + _LD_OFF; + BgSpot06Objects_Destroy = 0x2AD1E4 + _LD_OFF; + BgSpot15Rrbox_Update = 0x2AD484 + _LD_OFF; + EnItem00_Collected = 0x2B175C + _LD_OFF; .patch_SerenadeCheckChestFlag 0x2B2544 + _LD_OFF : { *(.patch_SerenadeCheckChestFlag) } .patch_SerenadeLocation 0x2B2574 + _LD_OFF : { *(.patch_SerenadeLocation) } + EnPeehat_StateAttackRecoil = 0x2B2CC0 + _LD_OFF; .patch_RainbowSwordTrail 0x2B9AD0 + _LD_OFF : { *(.patch_RainbowSwordTrail) } + Model_GetMeshGroupCount = 0x2BB71C + _LD_OFF; .patch_OverrideTextID 0x2BC1C4 + _LD_OFF : { *(.patch_OverrideTextID) } .patch_OverrideItemID 0x2BC1D0 + _LD_OFF : { *(.patch_OverrideItemID) } .patch_NoSilverGauntletsCutsceneWarp 0x2BC2A0 + _LD_OFF : { *(.patch_NoSilverGauntletsCutsceneWarp) } @@ -218,107 +389,225 @@ SECTIONS .patch_NoHealFromHealthUpgrades 0x2CD07C + _LD_OFF : { *(.patch_NoHealFromHealthUpgrades) } .patch_GetCustomMessageEntryOne 0x2CD3A4 + _LD_OFF : { *(.patch_GetCustomMessageEntryOne) } .patch_GetCustomMessageTextOne 0x2CD3EC + _LD_OFF : { *(.patch_GetCustomMessageTextOne) } + Math_SinS = 0x2CFCA0 + _LD_OFF; + Camera_CheckWater = 0x2D06A0 + _LD_OFF; .patch_ActorDraw 0x2D6310 + _LD_OFF : { *(.patch_ActorDraw) } .patch_OcarinaNoteSound_Player 0x2D6A04 + _LD_OFF : { *(.patch_OcarinaNoteSound_Player) } + EffectSs_Delete = 0x2D6A50 + _LD_OFF; .patch_CamUpdate 0x2D84C8 + _LD_OFF : { *(.patch_CamUpdate) } .patch_CamRoll 0x2D88E4 + _LD_OFF : { *(.patch_CamRoll) } + Message_GetText = 0x2DF4B0 + _LD_OFF; + Message_GetEntry = 0x2DF4C4 + _LD_OFF; .patch_CheckForTextControlCode 0x2E0490 + _LD_OFF : { *(.patch_CheckForTextControlCode) } .patch_HandleTextControlCode 0x2E057C + _LD_OFF : { *(.patch_HandleTextControlCode) } + Object_UpdateEntries = 0x2E4EA0 + _LD_OFF; .patch_SceneInitAfterCopyScenes 0x2EAFDC + _LD_OFF : { *(.patch_SceneInitAfterCopyScenes) } .patch_ChildCanOpenBowSubMenu 0x2EB2D8 + _LD_OFF : { *(.patch_ChildCanOpenBowSubMenu) } + MenuSpritesManager_OffsetSpriteAt = 0x2EB3D8 + _LD_OFF; .patch_FileSelect_CopyFile 0x2EDA04 + _LD_OFF : { *(.patch_FileSelect_CopyFile) } .patch_CorrectCompassChests 0x2F161C + _LD_OFF : { *(.patch_CorrectCompassChests) } .patch_CorrectCompassChestsTwo 0x2F1770 + _LD_OFF : { *(.patch_CorrectCompassChestsTwo) } + ZAR_Destroy = 0x2F70C4 + _LD_OFF; .patch_OverrideDrawItemOne 0x2F7498 + _LD_OFF : { *(.patch_OverrideDrawItemOne) } + MenuSpritesManager_SetSpriteAt = 0x2F8D40 + _LD_OFF; + MenuSpritesManager_RegisterItemSprite = 0x2F8D74 + _LD_OFF; .patch_OcarinaNoteButtonsDraw 0x2F9430 + _LD_OFF : { *(.patch_OcarinaNoteButtonsDraw) } .patch_SaveGame 0x2FBFA8 + _LD_OFF : { *(.patch_SaveGame) } + SaveGame = 0x2FDAC8 + _LD_OFF; .patch_SaveFileSwordless 0x2FDCE4 + _LD_OFF : { *(.patch_SaveFileSwordless) } + Message_UnkControlCodeHandler = 0x306318 + _LD_OFF; .patch_Gfx_Update 0x310254 + _LD_OFF : { *(.patch_Gfx_Update) } .patch_OverrideDrawItemTwo 0x3148A8 + _LD_OFF : { *(.patch_OverrideDrawItemTwo) } .patch_OoBBombchuOne 0x315120 + _LD_OFF : { *(.patch_OoBBombchuOne) } .patch_OoBBombchuTwo 0x31513C + _LD_OFF : { *(.patch_OoBBombchuTwo) } .patch_OoBBombchuThree 0x315150 + _LD_OFF : { *(.patch_OoBBombchuThree) } + Inventory_ReplaceItem = 0x316CEC + _LD_OFF; .patch_CollisionATvsAC 0x3191B0 + _LD_OFF : { *(.patch_CollisionATvsAC) } + ElfMessage_GetSariaText = 0x31C698 + _LD_OFF; .patch_ISGPutaway 0x32B4AC + _LD_OFF : { *(.patch_ISGPutaway) } + Object_Spawn = 0x32E21C + _LD_OFF; + Actor_WorldDistXYZToActor = 0x3306C4 + _LD_OFF; + Camera_UpdateInterface = 0x330D84 + _LD_OFF; .patch_SetBGMEntrance 0x331048 + _LD_OFF : { *(.patch_SetBGMEntrance) } + Flags_SetCollectible = 0x3329D8 + _LD_OFF; + NockArrow = 0x33603C + _LD_OFF; .patch_NockArrow 0x33615C + _LD_OFF : { *(.patch_NockArrow) } .patch_DecreaseArrowCount 0x3362C4 + _LD_OFF : { *(.patch_DecreaseArrowCount) } .patch_SceneExitOverride 0x3366EC + _LD_OFF : { *(.patch_SceneExitOverride) } .patch_SceneExitDynamicOverride 0x33676C + _LD_OFF : { *(.patch_SceneExitDynamicOverride) } .patch_EnteredLocation 0x338DB8 + _LD_OFF : { *(.patch_EnteredLocation) } .patch_LostWoodsBridgeMusic 0x338DD8 + _LD_OFF : { *(.patch_LostWoodsBridgeMusic) } + Math_CosS = 0x338F60 + _LD_OFF; .patch_GetObjectEntry_339DFC 0x339DFC + _LD_OFF : { *(.patch_GetObjectEntry_339DFC) } .patch_GetObjectEntry_33A950 0x33A950 + _LD_OFF : { *(.patch_GetObjectEntry_33A950) } .patch_GetObjectEntry_33AB24 0x33AB24 + _LD_OFF : { *(.patch_GetObjectEntry_33AB24) } /* Used for: chest ice trap smoke effect */ + Inventory_ChangeUpgrade = 0x33C730 + _LD_OFF; .patch_BiggoronDayCheck 0x33DCC0 + _LD_OFF : { *(.patch_BiggoronDayCheck) } .patch_FWandWarpSongTimerDepletion 0x33DE84 + _LD_OFF : { *(.patch_FWandWarpSongTimerDepletion) } + SkelAnime_InitLink = 0x3413EC + _LD_OFF; .patch_RandomGsLoc_CustomTangibilityCheck 0x3415B0 + _LD_OFF : { *(.patch_RandomGsLoc_CustomTangibilityCheck) } .patch_MasterQuestGoldSkulltulaCheck 0x3415C8 + _LD_OFF : { *(.patch_MasterQuestGoldSkulltulaCheck) } .patch_TurboTextSignalNPC 0x3469F4 + _LD_OFF : { *(.patch_TurboTextSignalNPC) } + Magic_Reset = 0x34708C + _LD_OFF; + Player_SetEquipmentData = 0x34913C + _LD_OFF; .patch_FairyReviveHealAmount 0x34AF48 + _LD_OFF : { *(.patch_FairyReviveHealAmount) } + Actor_SetFeetPos = 0x34CBB4 + _LD_OFF; + EventSet = 0x34CBF8 + _LD_OFF; .patch_FishingIgnoreTempBTwo 0x34CFCC + _LD_OFF : { *(.patch_FishingIgnoreTempBTwo) } .patch_FWLoadSet 0x34D9E8 + _LD_OFF : { *(.patch_FWLoadSet) } + Audio_RestoreBGM = 0x34EC14 + _LD_OFF; + Effect_Delete = 0x34F0F4 + _LD_OFF; .patch_GetObjectEntry_34F270 0x34F270 + _LD_OFF : { *(.patch_GetObjectEntry_34F270) } + SystemArena_Free = 0x34FC6C + _LD_OFF; .patch_GetObjectEntry_34FE68 0x34FE68 + _LD_OFF : { *(.patch_GetObjectEntry_34FE68) } + SystemArena_Malloc = 0x35010C + _LD_OFF; + SkelAnime_Free2 = 0x350BE0 + _LD_OFF; + EventCheck = 0x350CF4 + _LD_OFF; .patch_FWGetSet 0x3519CC + _LD_OFF : { *(.patch_FWGetSet) } + Health_ChangeBy = 0x352DBC + _LD_OFF; .patch_ApplyDamageMultiplier 0x352DC0 + _LD_OFF : { *(.patch_ApplyDamageMultiplier) } .patch_GetObjectEntry_352F28 0x352F28 + _LD_OFF : { *(.patch_GetObjectEntry_352F28) } /* Used for: Flare Dancer */ .patch_GetObjectEntry_353CE4 0x353CE4 + _LD_OFF : { *(.patch_GetObjectEntry_353CE4) } + Collider_SetCylinder = 0x353D24 + _LD_OFF; + Collider_InitCylinder = 0x353DD0 + _LD_OFF; + SetupItemInWater = 0x354894 + _LD_OFF; .patch_FastChests 0x354CD4 + _LD_OFF : { *(.patch_FastChests) } .patch_AboutToPickUpActor 0x354DD8 + _LD_OFF : { *(.patch_AboutToPickUpActor) } .patch_MasterSwordTimerCheck 0x354DFC + _LD_OFF : { *(.patch_MasterSwordTimerCheck) } + Camera_BGCheckInfo = 0x3553FC + _LD_OFF; .patch_LikeLikeNeverEatTunic 0x355C2C + _LD_OFF : { *(.patch_LikeLikeNeverEatTunic) } + DeleteModel_At = 0x357248 + _LD_OFF; + ZAR_GetCMBByIndex = 0x358EF8 + _LD_OFF; + BossChallenge_IsActive = 0x35B164 + _LD_OFF; .patch_PlaySound 0x35C528 + _LD_OFF : { *(.patch_PlaySound) } + PlaySound = 0x35C528 + _LD_OFF; + LinkDamage = 0x35D304 + _LD_OFF; + FireDamage = 0x35D8D8 + _LD_OFF; + Player_InBlockingCsMode = 0x35DB20 + _LD_OFF; + SkelAnime_DrawOpa = 0x35E240 + _LD_OFF; .patch_ConvertBombDropOne 0x35E46C + _LD_OFF : { *(.patch_ConvertBombDropOne) } + WaterBox_GetSurfaceImpl = 0x35E8A0 + _LD_OFF; .patch_SkullwalltulaAttack_35F328 0x35F328 + _LD_OFF : { *(.patch_SkullwalltulaAttack_35F328) } .patch_SkullwalltulaTargetRotation 0x35F828 + _LD_OFF : { *(.patch_SkullwalltulaTargetRotation) } .patch_SkullwalltulaAttack_35F834 0x35F834 + _LD_OFF : { *(.patch_SkullwalltulaAttack_35F834) } + LinkAnimation_PlayOnce = 0x3604F0 + _LD_OFF; .patch_ISGCrouchStab 0x360690 + _LD_OFF : { *(.patch_ISGCrouchStab) } .patch_ForceTrailEffectUpdate 0x362108 + _LD_OFF : { *(.patch_ForceTrailEffectUpdate) } /*EffectBlure_AddVertex*/ + Actor_GetScreenPos = 0x363A20 + _LD_OFF; + Object_GetSlot = 0x363C10 + _LD_OFF; .patch_ExtendObjectGetSlot 0x363CB4 + _LD_OFF : { *(.patch_ExtendObjectGetSlot) } + Flags_GetCollectible = 0x36405C + _LD_OFF; + EffectSsDeadDb_Spawn = 0x3642F4 + _LD_OFF; + Audio_SetBGM = 0x3655D0 + _LD_OFF; .patch_StalchildDespawn_366338 0x366338 + _LD_OFF : { *(.patch_StalchildDespawn_366338) } + Audio_GetActiveSeqId = 0x366684 + _LD_OFF; + Flags_SetEnv = 0x366704 + _LD_OFF; + Actor_SetModelMatrix = 0x3679D0 + _LD_OFF; + DisplayTextbox = 0x367C7C + _LD_OFF; + SkeletonAnimationModel_SetMesh = 0x369178 + _LD_OFF; + Model_DisableMeshGroupByIndex = 0x36932C + _LD_OFF; + Actor_FindNearby = 0x369334 + _LD_OFF; + PauseContext_GetState = 0x3695F8 + _LD_OFF; + BgCheck_EntityLineTest1 = 0x369F9C + _LD_OFF; + Player_InCsMode = 0x36A7A0 + _LD_OFF; + SkeletonAnimationModel_Spawn = 0x36A924 + _LD_OFF; .patch_GetObjectEntry_36A96C 0x36A96C + _LD_OFF : { *(.patch_GetObjectEntry_36A96C) } /* Used for: freestanding item models */ + Animation_GetLastFrame = 0x36AE14 + _LD_OFF; .patch_IgnoreMaskReaction 0x36BBC4 + _LD_OFF : { *(.patch_IgnoreMaskReaction) } + Flags_UnsetSwitch = 0x36BEAC + _LD_OFF; + Matrix_Multiply = 0x36C174 + _LD_OFF; + Flags_GetClear = 0x36CF6C + _LD_OFF; + Math_Vec3f_DistXZ = 0x36D260 + _LD_OFF; + Math_SmoothStepToF = 0x36E168 + _LD_OFF; + Flags_GetSwitch = 0x36E864 + _LD_OFF; + Flags_SetClear = 0x36EC14 + _LD_OFF; .patch_SetBGMEvent 0x36EC40 + _LD_OFF : { *(.patch_SetBGMEvent) } + SetEventBGM = 0x36EC40 + _LD_OFF; + Player_GetMask = 0x36EF98 + _LD_OFF; + SetNextEntrance = 0x3716F0 + _LD_OFF; + Actor_HasParent = 0x371E40 + _LD_OFF; + Matrix_UpdatePosition = 0x372070 + _LD_OFF; .patch_DemoEffectMedallionDraw 0x37214C + _LD_OFF : { *(.patch_DemoEffectMedallionDraw) } + SkeletonAnimationModel_Draw = 0x372170 + _LD_OFF; + SkeletonAnimationModel_MatrixCopy = 0x3721E0 + _LD_OFF; + GiveItem = 0x3724DC + _LD_OFF; .patch_IncomingGetItemID 0x3725AC + _LD_OFF : { *(.patch_IncomingGetItemID) } + Message_CloseTextbox = 0x3725E0 + _LD_OFF; + Model_EnableMeshGroupByIndex = 0x37266C + _LD_OFF; .patch_Model_EnableMeshGroupByIndex 0x372670 + _LD_OFF : { *(.patch_Model_EnableMeshGroupByIndex) } .patch_MaskSalesmanCheckNoMaskOne 0x372B64 + _LD_OFF : { *(.patch_MaskSalesmanCheckNoMaskOne) } .patch_MaskSalesmanCheckNoMaskTwo 0x372B70 + _LD_OFF : { *(.patch_MaskSalesmanCheckNoMaskTwo) } + ActorShape_Init = 0x372D4C + _LD_OFF; + Actor_Find = 0x372D64 + _LD_OFF; + TexAnim_Spawn = 0x372D94 + _LD_OFF; + ZAR_GetCMABByIndex = 0x372F0C + _LD_OFF; + SkeletonAnimationModel_SpawnAt = 0x372F38 + _LD_OFF; .patch_GetObjectEntry_372F7C 0x372F7C + _LD_OFF : { *(.patch_GetObjectEntry_372F7C) } .patch_OverrideObjectIsLoaded 0x373074 + _LD_OFF : { *(.patch_OverrideObjectIsLoaded) } + EnWonderTalk_Update = 0x3731F4 + _LD_OFF; + Actor_Spawn = 0x3738D0 + _LD_OFF; .patch_ConvertBombDropTwo 0x3747A4 + _LD_OFF : { *(.patch_ConvertBombDropTwo) } .patch_SetSFX 0x37547C + _LD_OFF : { *(.patch_SetSFX) } + PlaySFX = 0x37547C + _LD_OFF; + Math_SmoothStepToS = 0x375A18 + _LD_OFF; + FUN_00375B70 = 0x375B70 + _LD_OFF; + Audio_PlayActorSfx2 = 0x375BCC + _LD_OFF; + Animation_Change = 0x375C08 + _LD_OFF; + Flags_SetSwitch = 0x375C10 + _LD_OFF; + CollisionCheck_SetAC = 0x376168 + _LD_OFF; .patch_CollisionCheck_SetAC_Once 0x376174 + _LD_OFF : { *(.patch_CollisionCheck_SetAC_Once) } .patch_CollisionCheck_SetAT_Once 0x3761FC + _LD_OFF : { *(.patch_CollisionCheck_SetAT_Once) } + CollisionCheck_SetOC = 0x3762A4 + _LD_OFF; .patch_CollisionCheck_SetOC_Once 0x3762B0 + _LD_OFF : { *(.patch_CollisionCheck_SetOC_Once) } + Collider_UpdateCylinder = 0x37632C + _LD_OFF; + Actor_UpdateBgCheckInfo = 0x376340 + _LD_OFF; + EnDns_ChangeAnim = 0x37693C + _LD_OFF; + Message_GetState = 0x3769D8 + _LD_OFF; + Rupees_ChangeBy = 0x376A60 + _LD_OFF; + Item_Give = 0x376A78 + _LD_OFF; .patch_GKSetDurability 0x376BDC + _LD_OFF : { *(.patch_GKSetDurability) } .patch_GiantsKnifeWithoutKokiriSword 0x376BEC + _LD_OFF : { *(.patch_GiantsKnifeWithoutKokiriSword) } .patch_GiveItemMasterSword 0x376C18 + _LD_OFF : { *(.patch_GiveItemMasterSword) } .patch_NoLensOfTruthNaviText 0x37798C + _LD_OFF : { *(.patch_NoLensOfTruthNaviText) } + Inventory_HasEmptyBottle = 0x377A04 + _LD_OFF; .patch_AltHeadersCommand 0x379020 + _LD_OFF : { *(.patch_AltHeadersCommand) } + EnWonderTalk2_Update = 0x3794EC + _LD_OFF; + Actor_KillAllWithMissingObject = 0x379C3C + _LD_OFF; + BgSpot02Objects_Update = 0x3831AC + _LD_OFF; + BgSpot06Objects_Update = 0x3833F8 + _LD_OFF; .patch_FrogRewardPurple 0x3898F0 + _LD_OFF : { *(.patch_FrogRewardPurple) } .patch_FrogReward 0x38992C + _LD_OFF : { *(.patch_FrogReward) } .patch_ChildShootingGallery 0x38AB70 + _LD_OFF : { *(.patch_ChildShootingGallery) } .patch_AdultShootingGallery 0x38ABA0 + _LD_OFF : { *(.patch_AdultShootingGallery) } + BgSpot00Hanebasi_Update = 0x38B390 + _LD_OFF; .patch_SariasSongHintsOne 0x390620 + _LD_OFF : { *(.patch_SariasSongHintsOne) } .patch_SariasSongHintsTwo 0x39073C + _LD_OFF : { *(.patch_SariasSongHintsTwo) } + EnPeehat_Larva_StateSeekPlayer = 0x391588 + _LD_OFF; .patch_PeahatLarvaGroundCheck 0x391740 + _LD_OFF : { *(.patch_PeahatLarvaGroundCheck) } + EnTest_Wait = 0x39D8CC + _LD_OFF; .patch_OcarinaMinigameEndAfterWin 0x39DF38 + _LD_OFF : { *(.patch_OcarinaMinigameEndAfterWin) } .patch_LullabyLocation 0x3A0A7C + _LD_OFF : { *(.patch_LullabyLocation) } .patch_OverrideDrawItemThree 0x3A0EA8 + _LD_OFF : { *(.patch_OverrideDrawItemThree) } .patch_AfterInvalidatingRoomObjects 0x3A7698 + _LD_OFF : { *(.patch_AfterInvalidatingRoomObjects) } .patch_AfterObjectListCommand 0x3A7708 + _LD_OFF : { *(.patch_AfterObjectListCommand) } + EnFdFire_Disappear = 0x3ABFB8 + _LD_OFF; .patch_KokiriCheckOpenForest 0x3ACCFC + _LD_OFF : { *(.patch_KokiriCheckOpenForest) } + EnFd_JumpToGround = 0x3ACD84 + _LD_OFF; .patch_TokenNoItemGive2 0x3AD270 + _LD_OFF : { *(.patch_TokenNoItemGive2) } .patch_GetToken2 0x3AD2F0 + _LD_OFF : { *(.patch_GetToken2) } .patch_TokenNoItemGive1 0x3ADD68 + _LD_OFF : { *(.patch_TokenNoItemGive1) } .patch_GetToken1 0x3ADDE4 + _LD_OFF : { *(.patch_GetToken1) } .patch_TalonGetCastleTextbox 0x3AE6E8 + _LD_OFF : { *(.patch_TalonGetCastleTextbox) } .patch_GerudoArcheryOne 0x3AFA34 + _LD_OFF : { *(.patch_GerudoArcheryOne) } + EnHs_ActionAfterTradeCojiro = 0x3B02C0 + _LD_OFF; .patch_ShabomAfterDamagePlayer 0x3B5060 + _LD_OFF : { *(.patch_ShabomAfterDamagePlayer) } + EnBubble_Disappear = 0x3B5190 + _LD_OFF; + EnDodojr_DropItem = 0x3B7C64 + _LD_OFF; .patch_BabyDodongoWallCheck 0x3B833C + _LD_OFF : { *(.patch_BabyDodongoWallCheck) } + EnSw_GoldSkulltulaDeath = 0x3B91BC + _LD_OFF; .patch_RandomGsLoc_CustomTokenSpawnOffset 0x3B94C4 + _LD_OFF : { *(.patch_RandomGsLoc_CustomTokenSpawnOffset) } + EnYukabyun_Levitate = 0x3B9E3C + _LD_OFF; + ObjLift_Fall = 0x3BB7BC + _LD_OFF; .patch_RandomGsLoc_BlockSpawn_Crate 0x3BCA68 + _LD_OFF : { *(.patch_RandomGsLoc_BlockSpawn_Crate) } .patch_MovableBlockCooldownTimer 0x3BD46C + _LD_OFF : { *(.patch_MovableBlockCooldownTimer) } .patch_MovableBlockSpeed 0x3BD508 + _LD_OFF : { *(.patch_MovableBlockSpeed) } @@ -326,70 +615,94 @@ SECTIONS .patch_MilkCrateSpeed 0x3BD88C + _LD_OFF : { *(.patch_MilkCrateSpeed) } .patch_RandomGsLoc_BlockSpawn_Soil 0x3BF690 + _LD_OFF : { *(.patch_RandomGsLoc_BlockSpawn_Soil) } .patch_ForestTempleBasementPuzzleDelay 0x3BFA8C + _LD_OFF : { *(.patch_ForestTempleBasementPuzzleDelay) } + ObjLift_Wait = 0x3C05B0 + _LD_OFF; + EnSw_SetupGoingHome = 0x3C2A50 + _LD_OFF; .patch_GerudoArcheryTwo 0x3C2D80 + _LD_OFF : { *(.patch_GerudoArcheryTwo) } .patch_DampeCheckCanDig1 0x3C3354 + _LD_OFF : { *(.patch_DampeCheckCanDig1) } .patch_DampeRollHigh 0x3C3418 + _LD_OFF : { *(.patch_DampeRollHigh) } .patch_DampeCheckRewardFlag 0x3C3598 + _LD_OFF : { *(.patch_DampeCheckRewardFlag) } .patch_DampeCheckCanDig2 0x3C35D0 + _LD_OFF : { *(.patch_DampeCheckCanDig2) } .patch_SongOfTimeLocation 0x3C375C + _LD_OFF : { *(.patch_SongOfTimeLocation) } + EnDns_SetupBurrow = 0x3C3C04 + _LD_OFF; .patch_EponasSongLocation 0x3C6194 + _LD_OFF : { *(.patch_EponasSongLocation) } .patch_MalonNextAction 0x3C6210 + _LD_OFF : { *(.patch_MalonNextAction) } + EnIshi_LiftedUp = 0x3CBAC4 + _LD_OFF; + EnSw_WalltulaIdle = 0x3CDAAC + _LD_OFF; .patch_BombPurchaseableCheck 0x3CE800 + _LD_OFF : { *(.patch_BombPurchaseableCheck) } + FUN_003CE92C = 0x3CE92C + _LD_OFF; .patch_ScrubStickUpgradeTwo 0x3CE990 + _LD_OFF : { *(.patch_ScrubStickUpgradeTwo) } .patch_ScrubNutUpgradeTwo 0x3CE9DC + _LD_OFF : { *(.patch_ScrubNutUpgradeTwo) } + EnDns_Burrow = 0x3CEA64 + _LD_OFF; + EnSi_DestroyAfterText = 0x3D0544 + _LD_OFF; + EnDodojr_JumpAttackBounce = 0x3D069C + _LD_OFF; .patch_GrannySetRewardFlag 0x3D0E34 + _LD_OFF : { *(.patch_GrannySetRewardFlag) } .patch_GrannyItemOverrideTwo 0x3D0E60 + _LD_OFF : { *(.patch_GrannyItemOverrideTwo) } .patch_MidoCheckDekuTreeClearFour 0x3D2C18 + _LD_OFF : { *(.patch_MidoCheckDekuTreeClearFour) } + EnReeba_Die = 0x3D4CB0 + _LD_OFF; .patch_LeeverAfterDie 0x3D4E10 + _LD_OFF : { *(.patch_LeeverAfterDie) } .patch_LeeverAfterSink 0x3D6188 + _LD_OFF : { *(.patch_LeeverAfterSink) } + BossDodongo_DeathCutscene = 0x3DA7AC + _LD_OFF; .patch_LeeverSandCheck_Small 0x3DE2A0 + _LD_OFF : { *(.patch_LeeverSandCheck_Small) } .patch_ShadowShip_Speed 0x3DFB30 + _LD_OFF : { *(.patch_ShadowShip_Speed) } .patch_FireBlockSpeed 0x3E0BB4 + _LD_OFF : { *(.patch_FireBlockSpeed) } + EnDodongo_Idle = 0x3E4FE8 + _LD_OFF; .patch_FreeScarecrow 0x3E55A8 + _LD_OFF : { *(.patch_FreeScarecrow) } .patch_MasterSwordAlwaysDrop 0x3E5E98 + _LD_OFF : { *(.patch_MasterSwordAlwaysDrop) } .patch_PickUpMasterSword 0x3E5EC8 + _LD_OFF : { *(.patch_PickUpMasterSword) } .patch_SkipMasterSwordFanfare 0x3E5F60 + _LD_OFF : { *(.patch_SkipMasterSwordFanfare) } + EnYukabyun_Wait = 0x3E6880 + _LD_OFF; .patch_ShadowShip_CSTimer 0x3E6C50 + _LD_OFF : { *(.patch_ShadowShip_CSTimer) } + EnTuboTrap_WaitForProximity = 0x3E6F88 + _LD_OFF; .patch_FlyingPotDontChangeCategory 0x3E7008 + _LD_OFF : { *(.patch_FlyingPotDontChangeCategory) } .patch_FairyReward 0x3E7598 + _LD_OFF : { *(.patch_FairyReward) } .patch_RainbowBridge 0x3E7CAC + _LD_OFF : { *(.patch_RainbowBridge) } .patch_RemoveWaterfallCS 0x3E7F64 + _LD_OFF : { *(.patch_RemoveWaterfallCS) } .patch_DekuTheaterSkullMask 0x3EAF38 + _LD_OFF : { *(.patch_DekuTheaterSkullMask) } + EnDoor_Open = 0x3EC04C + _LD_OFF; .patch_CowItemOverride 0x3EE378 + _LD_OFF : { *(.patch_CowItemOverride) } + DoorGerudo_Unlocking = 0x3EEE38 + _LD_OFF; + DoorShutter_SlidingDoor_Open = 0x3EEE7C + _LD_OFF; .patch_CowBottleCheck 0x3F065C + _LD_OFF : { *(.patch_CowBottleCheck) } .patch_CarpetSalesmanCheckFlagOne 0x3F0A18 + _LD_OFF : { *(.patch_CarpetSalesmanCheckFlagOne) } .patch_CarpetSalesmanCheckFlagTwo 0x3F0A64 + _LD_OFF : { *(.patch_CarpetSalesmanCheckFlagTwo) } .patch_LabScientistIgnoreEyedropsInInventory 0x3F0B44 + _LD_OFF : { *(.patch_LabScientistIgnoreEyedropsInInventory) } .patch_FastChestsTwo 0x3F1048 + _LD_OFF : { *(.patch_FastChestsTwo) } + EnDoor_Idle = 0x3F1B28 + _LD_OFF; .patch_HandleDoorDestroyCustomModels 0x3F1B88 + _LD_OFF : { *(.patch_HandleDoorDestroyCustomModels) } .patch_OverrideGrottoActorEntrance 0x3F2254 + _LD_OFF : { *(.patch_OverrideGrottoActorEntrance) } .patch_FireArrowRequirement 0x3F23AC + _LD_OFF : { *(.patch_FireArrowRequirement) } .patch_FireArrowCheckChestFlagOne 0x3F23FC + _LD_OFF : { *(.patch_FireArrowCheckChestFlagOne) } .patch_FireArrowCheckChestFlagTwo 0x3F2448 + _LD_OFF : { *(.patch_FireArrowCheckChestFlagTwo) } .patch_LinkReflection 0x3F2F0C + _LD_OFF : { *(.patch_LinkReflection) } + DoorGerudo_Idle = 0x3F3FA0 + _LD_OFF; + DoorShutter_SlidingDoor_Idle = 0x3F4A3C + _LD_OFF; .patch_SlidingDoorDestroyCustomModels 0x3F4A70 + _LD_OFF : { *(.patch_SlidingDoorDestroyCustomModels) } .patch_ChildBlueWarpOverride 0x3F5774 + _LD_OFF : { *(.patch_ChildBlueWarpOverride) } + BgIceShelter_Melt = 0x3F5F00 + _LD_OFF; .patch_CarpetSalesmanSetFlag 0x3F9550 + _LD_OFF : { *(.patch_CarpetSalesmanSetFlag) } .patch_PreSwapBuffers 0x3FD384 + _LD_OFF : { *(.patch_PreSwapBuffers) } .patch_AwakeCallback 0x3FD43C + _LD_OFF : { *(.patch_AwakeCallback) } .patch_SleepQueryCallback 0x3FD6C4 + _LD_OFF : { *(.patch_SleepQueryCallback) } + Message_SetInstantText = 0x40B608 + _LD_OFF; /* 0x419E18 - 0x41A143 : Language related function, don't place anything in this range */ - /* 0x41A144 */ _LD_OFF = DEFINED(_EUR_) ? 0x24 : _LD_OFF; + /* 0x41A144 */ _LD_OFF = _LD_EUR ? 0x24 : _LD_OFF; .patch_OcarinaNoteButtonsPress 0x41AAAC + _LD_OFF : { *(.patch_OcarinaNoteButtonsPress) } .patch_CurseTrapDizzyStick 0x41AB24 + _LD_OFF : { *(.patch_CurseTrapDizzyStick) } - .patch_CurseTrapDizzyButtons 0x41ABDC + _LD_OFF : { *(.patch_CurseTrapDizzyButtons) } + .patch_CurseTrapDizzyButtons 0x41ABD0 + _LD_OFF : { *(.patch_CurseTrapDizzyButtons) } .patch_PermadeathSkipMenu 0x41C980 + _LD_OFF : { *(.patch_PermadeathSkipMenu) } .patch_SaveMenuIgnoreOpen 0x42EC00 + _LD_OFF : { *(.patch_SaveMenuIgnoreOpen) } .patch_ItemsMenuDraw 0x434C08 + _LD_OFF : { *(.patch_ItemsMenuDraw) } .patch_PlayInit 0x4352F4 + _LD_OFF : { *(.patch_PlayInit) } - /* 0x436690 */ _LD_OFF = DEFINED(_EUR_) ? 0x20 : _LD_OFF; + /* 0x436690 */ _LD_OFF = _LD_EUR ? 0x20 : _LD_OFF; .patch_GearMenuEmptySlot 0x438C00 + _LD_OFF : { *(.patch_GearMenuEmptySlot) } .patch_DrawHeartIcon 0x444368 + _LD_OFF : { *(.patch_DrawHeartIcon) } + SaveFile_Delete = 0x446FC4 + _LD_OFF; .patch_BeforeLoadGame 0x447380 + _LD_OFF : { *(.patch_BeforeLoadGame) } + ret_BeforeLoadGame = 0x447384 + _LD_OFF; .patch_DontSetMotionSetting 0x447410 + _LD_OFF : { *(.patch_DontSetMotionSetting) } .patch_OverrideFogDuringGameplayInit 0x4485B4 + _LD_OFF : { *(.patch_OverrideFogDuringGameplayInit) } .patch_CheckForWeirdEggHatchGameplayInit 0x448A64 + _LD_OFF : { *(.patch_CheckForWeirdEggHatchGameplayInit) } @@ -406,38 +719,51 @@ SECTIONS .patch_GameplayDestroy 0x44E294 + _LD_OFF : { *(.patch_GameplayDestroy) } .patch_ExtendedObjectClear 0x44E758 + _LD_OFF : { *(.patch_ExtendedObjectClear) } .patch_Multiplayer_UpdatePrevActorFlags 0x44E878 + _LD_OFF : { *(.patch_Multiplayer_UpdatePrevActorFlags) } - .patch_PlayEntranceCutscene 0x44F068 + _LD_OFF : { *(.patch_PlayEntranceCutscene) } + .patch_PlayEntranceCutscene 0x44F030 + _LD_OFF : { *(.patch_PlayEntranceCutscene) } .patch_RequiemLocation 0x44F104 + _LD_OFF : { *(.patch_RequiemLocation) } .patch_NocturneLocation 0x44F12C + _LD_OFF : { *(.patch_NocturneLocation) } + ret_NocturneLocation = 0x44F180 + _LD_OFF; .patch_SariasGift 0x44F188 + _LD_OFF : { *(.patch_SariasGift) } .patch_LACSConditionOne 0x44F1D4 + _LD_OFF : { *(.patch_LACSConditionOne) } .patch_LACSConditionTwo 0x44F20C + _LD_OFF : { *(.patch_LACSConditionTwo) } .patch_BossChallenge_Enter 0x44F634 + _LD_OFF : { *(.patch_BossChallenge_Enter) } .patch_SetSavewarpEntrance 0x44FBE4 + _LD_OFF : { *(.patch_SetSavewarpEntrance) } + ret_SetSavewarpEntrance = 0x44FCE0 + _LD_OFF; .patch_LullabyCheckFlag 0x44FD54 + _LD_OFF : { *(.patch_LullabyCheckFlag) } .patch_LoadFileSwordless 0x44FD98 + _LD_OFF : { *(.patch_LoadFileSwordless) } .patch_OpenSaveDontSpoilTradeItems 0x44FDF8 + _LD_OFF : { *(.patch_OpenSaveDontSpoilTradeItems) } + ret_OpenSaveDontSpoilTradeItems = 0x44FEB8 + _LD_OFF; .patch_OnActorSetup_SceneChange 0x452250 + _LD_OFF : { *(.patch_OnActorSetup_SceneChange) } + ret_OnActorSetup_SceneChange = 0x4522A4 + _LD_OFF; .patch_AfterActorSetup_SceneChange 0x4522B8 + _LD_OFF : { *(.patch_AfterActorSetup_SceneChange) } .patch_before_GlobalContext_Update 0x452390 + _LD_OFF : { *(.patch_before_GlobalContext_Update) } .patch_after_GlobalContext_Update 0x452434 + _LD_OFF : { *(.patch_after_GlobalContext_Update) } .patch_FixItemsMenuSlotDuplication 0x456B90 + _LD_OFF : { *(.patch_FixItemsMenuSlotDuplication) } + ret_FixItemsMenuSlotDuplication = 0x456B94 + _LD_OFF; .patch_GameOverDontSpoilTradeItems 0x458BE0 + _LD_OFF : { *(.patch_GameOverDontSpoilTradeItems) } + ret_GameOverDontSpoilTradeItems = 0x458CA0 + _LD_OFF; .patch_DeathHandleBButton 0x458CA8 + _LD_OFF : { *(.patch_DeathHandleBButton) } .patch_PermadeathForceQuit 0x458E20 + _LD_OFF : { *(.patch_PermadeathForceQuit) } .patch_SetGameOverEntrance 0x458E3C + _LD_OFF : { *(.patch_SetGameOverEntrance) } + ret_SetGameOverEntrance = 0x458EC8 + _LD_OFF; .patch_SetGameOverRespawnFlag 0x458EF0 + _LD_OFF : { *(.patch_SetGameOverRespawnFlag) } + ret_PermadeathForceQuit = 0x458FF4 + _LD_OFF; .patch_InterfaceDrawDontSpoilTradeItems 0x45A17C + _LD_OFF : { *(.patch_InterfaceDrawDontSpoilTradeItems) } + ret_InterfaceDrawDontSpoilTradeItems = 0x45A210 + _LD_OFF; .patch_TimerExpiration 0x45A948 + _LD_OFF : { *(.patch_TimerExpiration) } .patch_Timer2TickSound 0x45A9B4 + _LD_OFF : { *(.patch_Timer2TickSound) } .patch_SunsSongEndCloseTextbox 0x45B514 + _LD_OFF : { *(.patch_SunsSongEndCloseTextbox) } + ret_SunsSongEndCloseTextbox = 0x45B518 + _LD_OFF; .patch_SetSunsSongRespawnFlag 0x45B660 + _LD_OFF : { *(.patch_SetSunsSongRespawnFlag) } .patch_BossChallenge_ExitMenu 0x45CCA4 + _LD_OFF : { *(.patch_BossChallenge_ExitMenu) } .patch_StoreChildBButtonEquip 0x45F20C + _LD_OFF : { *(.patch_StoreChildBButtonEquip) } + ret_StoreChildBButtonEquip = 0x45F210 + _LD_OFF; .patch_BecomeAdult 0x45F230 + _LD_OFF : { *(.patch_BecomeAdult) } .patch_AlwaysRestoreChildEquips 0x45F3B0 + _LD_OFF : { *(.patch_AlwaysRestoreChildEquips) } .patch_ChildDontEquipSwordSlotByDefault 0x45F49C + _LD_OFF : { *(.patch_ChildDontEquipSwordSlotByDefault) } + Object_Clear = 0x45FDA0 + _LD_OFF; .patch_OnActorSetup_RoomChange 0x4613C4 + _LD_OFF : { *(.patch_OnActorSetup_RoomChange) } + ret_OnActorSetup_RoomChange = 0x461424 + _LD_OFF; .patch_AfterActorSetup_RoomChange 0x461434 + _LD_OFF : { *(.patch_AfterActorSetup_RoomChange) } .patch_FixActorKillLoop 0x4615E0 + _LD_OFF : { *(.patch_FixActorKillLoop) } .patch_ActorUpdate 0x461790 + _LD_OFF : { *(.patch_ActorUpdate) } @@ -449,12 +775,18 @@ SECTIONS .patch_CriticalHealthCheckTwo 0x4716D4 + _LD_OFF : { *(.patch_CriticalHealthCheckTwo) } .patch_EnableFW 0x476D1C + _LD_OFF : { *(.patch_EnableFW) } .patch_OcarinaNoteSound_Npc 0x477C08 + _LD_OFF : { *(.patch_OcarinaNoteSound_Npc) } + Quake_Update = 0x4787C8 + _LD_OFF; + TitleCard_Update = 0x47953C + _LD_OFF; .patch_StoreTargetActorType 0x479984 + _LD_OFF : { *(.patch_StoreTargetActorType) } .patch_TargetReticleColor 0x47B284 + _LD_OFF : { *(.patch_TargetReticleColor) } + ret_TargetReticleColor = 0x47B2E8 + _LD_OFF; .patch_TargetPointerColor 0x47BAE8 + _LD_OFF : { *(.patch_TargetPointerColor) } + ret_TargetPointerColor = 0x47BB30 + _LD_OFF; + Camera_GetCamDataId = 0x47BFD8 + _LD_OFF; .patch_FWKeepWarpPoint 0x47C3C0 + _LD_OFF : { *(.patch_FWKeepWarpPoint) } .patch_TurboTextAdvance 0x480928 + _LD_OFF : { *(.patch_TurboTextAdvance) } .patch_SetBGMDayNight 0x483C88 + _LD_OFF : { *(.patch_SetBGMDayNight) } + ret_SetBGMDayNight = 0x483C8C + _LD_OFF; .patch_Cutscene_CheckObjectLoaded 0x4849D8 + _LD_OFF : { *(.patch_Cutscene_CheckObjectLoaded) } .patch_TurboTextClose 0x488214 + _LD_OFF : { *(.patch_TurboTextClose) } .patch_WarpSongEntranceOverride 0x488850 + _LD_OFF : { *(.patch_WarpSongEntranceOverride) } @@ -473,14 +805,19 @@ SECTIONS .patch_GanonRestoreMSOnDeath 0x496CB4 + _LD_OFF : { *(.patch_GanonRestoreMSOnDeath) } .patch_CriticalHealthCheckThree 0x49F294 + _LD_OFF : { *(.patch_CriticalHealthCheckThree) } - /* 0x4A5B00 */ _LD_OFF = DEFINED(_EUR_) ? 0x0 : _LD_OFF; + /* 0x4A5B00 */ _LD_OFF = _LD_EUR ? 0x0 : _LD_OFF; + FUN_4BA378 = 0x4BA378 + _LD_OFF; .patch_OverrideGiDrawIdPlusOne_Ground 0x4BC610 + _LD_OFF : { *(.patch_OverrideGiDrawIdPlusOne_Ground) } .patch_OverrideGiDrawIdPlusOne_Water 0x4BD5DC + _LD_OFF : { *(.patch_OverrideGiDrawIdPlusOne_Water) } + PlayerActor_Draw = 0x4BF618 + _LD_OFF; + Message_CheckForControlCodes = 0x4C08C0 + _LD_OFF; .patch_EditDrawGetItemBeforeModelSpawn 0x4C0FD0 + _LD_OFF : { *(.patch_EditDrawGetItemBeforeModelSpawn) } .patch_HookshotRotation 0x4C2524 + _LD_OFF : { *(.patch_HookshotRotation) } + HookshotRotation = 0x4C257C + _LD_OFF; .patch_EditDrawGetItemAfterMatrixUpdate 0x4C4D14 + _LD_OFF : { *(.patch_EditDrawGetItemAfterMatrixUpdate) } .patch_EditDrawGetItemAfterModelSpawn 0x4C61A4 + _LD_OFF : { *(.patch_EditDrawGetItemAfterModelSpawn) } + Model_IsMeshGroupUsed = 0x4C6880 + _LD_OFF; .patch_CrouchStabHitbox 0x4C85D4 + _LD_OFF : { *(.patch_CrouchStabHitbox) } /* 0x4C99A7: End of vanilla code in .text section */ @@ -490,14 +827,61 @@ SECTIONS *(.loader*) } + gGearUsabilityTable = 0x4D47C8 + _LD_OFF; + gOcarinaMenuSongLengths = 0x4D53C8 + _LD_OFF; + gOcarinaMenuSongNoteSequences = 0x4D541C + _LD_OFF; + gDrawItemTable = 0x4D88C8 + _LD_OFF; .patch_DampeSetCollectibleFlag 0x4D9D50 + _LD_OFF : { *(.patch_DampeSetCollectibleFlag) } + gDungeonSceneTable = 0x4DC400 + _LD_OFF; + gMQDungeonSceneTable = 0x4DCBA8 + _LD_OFF; + GyroDrawHUDIcon = 0x4FC648 + _LD_OFF; + gIsBottomScreenDimmed = 0x5043EC + _LD_OFF; + gGearMenuSpritesManager = 0x50447C + _LD_OFF; + gGearMenuSelectedSlot = 0x50448C + _LD_OFF; + gItemsMenuSpritesManager = 0x506734 + _LD_OFF; + gBowMenuSpritesManager = 0x506738 + _LD_OFF; + gItemsMenuGlowSpritesManager = 0x50673C + _LD_OFF; + gMenuSpritesManager_506740 = 0x506740 + _LD_OFF; + gItemsMenuSelectedSlot = 0x506748 + _LD_OFF; + gItemUsabilityTable = 0x506C58 + _LD_OFF; + gDungeonMapMenuSpritesManager = 0x506CD0 + _LD_OFF; + OcarinaUIStruct = 0x5093EC + _LD_OFF; + gRandInt = 0x50C0C4 + _LD_OFF; + gRandFloat = 0x50C0C8 + _LD_OFF; + NaviColorsArray = 0x50C998 + _LD_OFF; + gActorOverlayTable = 0x50CD84 + _LD_OFF; + EnChanger_LoserGetItemIds = 0x521774 + _LD_OFF; + VanillaScrubTable = 0x522384 + _LD_OFF; + EnGirlA_ShopItemEntries = 0x524F50 + _LD_OFF; .patch_BombchuCheapestPriceOne 0x525348 + _LD_OFF : { *(.patch_BombchuCheapestPriceOne) } .patch_BombchuCheapestPriceTwo 0x5253D8 + _LD_OFF : { *(.patch_BombchuCheapestPriceTwo) } .patch_BombchuCheapestPriceThree 0x525408 + _LD_OFF : { *(.patch_BombchuCheapestPriceThree) } .patch_BombchuCheapestPriceFour 0x525498 + _LD_OFF : { *(.patch_BombchuCheapestPriceFour) } .patch_OcarinaMinigameRewardsOrder 0x52ED10 + _LD_OFF : { *(.patch_OcarinaMinigameRewardsOrder) } + z3D_Fog_State = 0x531EB4 + _LD_OFF; + TimerFrameCounter = 0x539D8A + _LD_OFF; + gRestrictionFlags = 0x539DC4 + _LD_OFF; + sFloorType = 0x53A0A4 + _LD_OFF; + dynamicExitList = 0x53C094 + _LD_OFF; + PlayerDListGroup_EmptySheathAdult = 0x53C4D8 + _LD_OFF; + PlayerDListGroup_EmptySheathChildWithHylianShield = 0x53C4DC + _LD_OFF; + Vec3f_PlayerFeet_unk = 0x53CACC + _LD_OFF; .patch_TycoonWalletSize 0x53CC08 + _LD_OFF : { *(.patch_TycoonWalletSize) } .patch_TitleLinkObject 0x53CCF0 + _LD_OFF : { *(.patch_TitleLinkObject) } + gObjectTable = 0x53CCF4 + _LD_OFF; + gEntranceTable = 0x543BB8 + _LD_OFF; + gSceneTable = 0x545484 + _LD_OFF; + gSfxDefaultFreqAndVolScale = 0x54AC20 + _LD_OFF; + gSfxDefaultReverb = 0x54AC24 + _LD_OFF; + sPrevMainBgmSeqId = 0x54ACB8 + _LD_OFF; + gOcarinaSongNotes = 0x54B5F2 + _LD_OFF; + gOcarinaSongButtons = 0x54C222 + _LD_OFF; + ControlStick_X = 0x5655C0 + _LD_OFF; + ControlStick_Y = 0x5655C4 + _LD_OFF; + gSaveContext = 0x587958 + _LD_OFF; + gEffectContext = 0x58B2E0 + _LD_OFF; + gEffectSsInfo = 0x598530 + _LD_OFF; + gMainClass = 0x5BE5B8 + _LD_OFF; /* 0x005C6607: End of vanilla .bss section */ . = 0x005C7000 + _LD_OFF; @@ -530,5 +914,14 @@ SECTIONS *(.fini_array) } + gStaticContext = 0x8080010 + _LD_OFF; + real_hid = 0x10002000 + _LD_OFF; + Z3D_TOP_SCREEN_LEFT_1 = 0x14313890 + _LD_OFF; + Z3D_TOP_SCREEN_LEFT_2 = 0x14359DA0 + _LD_OFF; + Z3D_BOTTOM_SCREEN_1 = 0x143A02B0 + _LD_OFF; + Z3D_BOTTOM_SCREEN_2 = 0x143D86C0 + _LD_OFF; + Z3D_TOP_SCREEN_RIGHT_1 = 0x14410AD0 + _LD_OFF; + Z3D_TOP_SCREEN_RIGHT_2 = 0x14456FE0 + _LD_OFF; + /* 0xFFFFFFFF */ } diff --git a/code/patch.py b/code/patch.py index a2e04f03..78760013 100644 --- a/code/patch.py +++ b/code/patch.py @@ -4,8 +4,7 @@ import sys elf = sys.argv[1] -region = sys.argv[2] -debug = int(sys.argv[3]) +debug = int(sys.argv[2]) result = subprocess.run([os.environ["DEVKITARM"] + r'/bin/arm-none-eabi-objdump', '--section-headers', elf], stdout=subprocess.PIPE) lines = str(result.stdout).split('\\n') sectionsInfo = [line.split()[1:6] for line in lines if line.split() and line.split()[0].isdigit()] @@ -33,7 +32,7 @@ offset += 65535 size -= 65535 - patch = e.read(size) + patch = e.read(size) if len(patch) != 0: if (debug): print('{:0X}'.format(vaddr), '{:0X}'.format(vaddr + size), name) @@ -42,7 +41,5 @@ ips += patch ips += b'EOF' -basecodeFile = "basecode_" + region + ".ips" -with open(basecodeFile, 'wb') as patchFile: +with open('basecode.ips', 'wb') as patchFile: patchFile.write(ips) - print("created " + basecodeFile + "\n") diff --git a/code/src/actor.c b/code/src/actor.c index 51492d66..eba991ec 100644 --- a/code/src/actor.c +++ b/code/src/actor.c @@ -85,8 +85,7 @@ #include "ganondorf.h" #include "obj_mure3.h" -typedef void (*TitleCard_Update_proc)(GlobalContext* globalCtx, TitleCardContext* titleCtx); -#define TitleCard_Update ((TitleCard_Update_proc)GAME_ADDR(0x47953C)) +void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx); void Actor_Init() { // Some actors have the wrong ID saved in their "initInfo". @@ -111,7 +110,7 @@ void Actor_Init() { gActorOverlayTable[0x4].initInfo->init = ShopsanityItem_Init; gActorOverlayTable[0x4].initInfo->instanceSize = sizeof(ShopsanityItem); - gActorOverlayTable[0x9].initInfo->update = (ActorFunc)EnDoor_rUpdate; + gActorOverlayTable[0x9].initInfo->update = EnDoor_rUpdate; gActorOverlayTable[0xA].initInfo->init = EnBox_rInit; gActorOverlayTable[0xA].initInfo->update = EnBox_rUpdate; @@ -119,7 +118,7 @@ void Actor_Init() { gActorOverlayTable[0xD].initInfo->init = EnPoh_rInit; gActorOverlayTable[0xD].initInfo->update = EnPoh_rUpdate; - gActorOverlayTable[0xF].initInfo->update = (ActorFunc)BgYdanSp_rUpdate; + gActorOverlayTable[0xF].initInfo->update = BgYdanSp_rUpdate; gActorOverlayTable[0x15].initInfo->init = EnItem00_rInit; gActorOverlayTable[0x15].initInfo->destroy = EnItem00_rDestroy; @@ -134,7 +133,7 @@ void Actor_Init() { gActorOverlayTable[0x27].initInfo->update = BossDodongo_rUpdate; gActorOverlayTable[0x2E].initInfo->init = DoorShutter_rInit; - gActorOverlayTable[0x2E].initInfo->update = (ActorFunc)DoorShutter_rUpdate; + gActorOverlayTable[0x2E].initInfo->update = DoorShutter_rUpdate; gActorOverlayTable[0x2F].initInfo->init = EnDodojr_rInit; @@ -238,16 +237,16 @@ void Actor_Init() { gActorOverlayTable[0x11D].initInfo->type = ACTORTYPE_ENEMY; // Flying Pot - gActorOverlayTable[0x126].initInfo->init = (ActorFunc)ObjBean_rInit; - gActorOverlayTable[0x126].initInfo->update = (ActorFunc)ObjBean_rUpdate; + gActorOverlayTable[0x126].initInfo->init = ObjBean_rInit; + gActorOverlayTable[0x126].initInfo->update = ObjBean_rUpdate; gActorOverlayTable[0x12A].initInfo->init = ObjSwitch_rInit; - gActorOverlayTable[0x12C].initInfo->update = (ActorFunc)ObjLift_rUpdate; + gActorOverlayTable[0x12C].initInfo->update = ObjLift_rUpdate; gActorOverlayTable[0x131].initInfo->update = EnExRuppy_rUpdate; - gActorOverlayTable[0x133].initInfo->update = (ActorFunc)EnDaiku_rUpdate; + gActorOverlayTable[0x133].initInfo->update = EnDaiku_rUpdate; gActorOverlayTable[0x138].initInfo->init = EnGe1_rInit; gActorOverlayTable[0x138].initInfo->update = EnGe1_rUpdate; @@ -260,7 +259,7 @@ void Actor_Init() { gActorOverlayTable[0x14D].initInfo->update = EnOwl_rUpdate; gActorOverlayTable[0x14E].initInfo->init = EnIshi_rInit; - gActorOverlayTable[0x14E].initInfo->update = (ActorFunc)EnIshi_rUpdate; + gActorOverlayTable[0x14E].initInfo->update = EnIshi_rUpdate; gActorOverlayTable[0x153].initInfo->update = EnFu_rUpdate; @@ -273,7 +272,7 @@ void Actor_Init() { gActorOverlayTable[0x168].initInfo->init = EnExItem_rInit; gActorOverlayTable[0x168].initInfo->destroy = EnExItem_rDestroy; - gActorOverlayTable[0x172].initInfo->update = (ActorFunc)DoorGerudo_rUpdate; + gActorOverlayTable[0x172].initInfo->update = DoorGerudo_rUpdate; gActorOverlayTable[0x174].initInfo->update = DemoGt_rUpdate; @@ -323,7 +322,7 @@ void Actor_Init() { gActorOverlayTable[0x1C6].initInfo->init = EnCow_rInit; gActorOverlayTable[0x1C6].initInfo->destroy = EnCow_rDestroy; - gActorOverlayTable[0x1D2].initInfo->update = (ActorFunc)ObjHamishi_rUpdate; + gActorOverlayTable[0x1D2].initInfo->update = ObjHamishi_rUpdate; // Define custom object IDs to be by default the same as the base objects they're based on const struct { @@ -550,16 +549,16 @@ void Actor_rDraw(Actor* actor, GlobalContext* globalCtx) { 0x00, 0xFF, 1, 8, 0); } - s32 origSaModelsCount1 = gMainClass->sub180.saModelsCount1; - s32 origSaModelsCount2 = gMainClass->sub180.saModelsCount2; + s32 origSaModelsCount1 = gMainClass.sub180.saModelsCount1; + s32 origSaModelsCount2 = gMainClass.sub180.saModelsCount2; actor->draw(actor, globalCtx); if (shouldDrawSoulless && (gSettingsContext.soullessEnemiesLook != SOULLESSLOOK_FLASHING || rGameplayFrames % 2 == 0)) { // make enemy invisible - gMainClass->sub180.saModelsCount1 = origSaModelsCount1; // 3D models - gMainClass->sub180.saModelsCount2 = origSaModelsCount2; // 2D billboards + gMainClass.sub180.saModelsCount1 = origSaModelsCount1; // 3D models + gMainClass.sub180.saModelsCount2 = origSaModelsCount2; // 2D billboards } } diff --git a/code/src/actors/anju.c b/code/src/actors/anju.c index f60ca462..b8b31600 100644 --- a/code/src/actors/anju.c +++ b/code/src/actors/anju.c @@ -3,6 +3,8 @@ #include "anju.h" +void FUN_2389EC(EnNiwLady* self, GlobalContext* globalCtx); + u32 EnNiwLady_CheckCuccoAmount(u32 cuccosInPen) { return cuccosInPen - gSettingsContext.numRequiredCuccos + 7; } @@ -10,7 +12,7 @@ u32 EnNiwLady_CheckCuccoAmount(u32 cuccosInPen) { void EnNiwLady_rGiveCojiro(EnNiwLady* self, GlobalContext* globalCtx) { if (Actor_HasParent(&self->actor, globalCtx)) { gSaveContext.itemGetInf[2] |= 0x4000; - self->actionFunc = (EnNiwLady_ActionFunc)GAME_ADDR(0x2389EC); + self->actionFunc = FUN_2389EC; } else { GiveItem(&self->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f); } diff --git a/code/src/actors/anju.h b/code/src/actors/anju.h index 69797dc2..d4265b19 100644 --- a/code/src/actors/anju.h +++ b/code/src/actors/anju.h @@ -5,12 +5,12 @@ struct EnNiwLady; -typedef void (*EnNiwLady_ActionFunc)(struct EnNiwLady* self, GlobalContext* globalCtx); +typedef void (*EnNiwLadyActionFunc)(struct EnNiwLady* this, GlobalContext* globalCtx); typedef struct EnNiwLady { /* 0x0000 */ Actor actor; /* 0x01A4 */ char unk_1A4[0x69C]; - /* 0x0840 */ EnNiwLady_ActionFunc actionFunc; + /* 0x0840 */ EnNiwLadyActionFunc actionFunc; /* 0x0844 */ char unk_844[0x030]; /* 0x0874 */ s32 getItemId; /* 0x0878 */ char unk_878[0x250]; diff --git a/code/src/actors/anubis.c b/code/src/actors/anubis.c index 57d7e8ea..66dac526 100644 --- a/code/src/actors/anubis.c +++ b/code/src/actors/anubis.c @@ -2,7 +2,7 @@ #include "anubis.h" #include "enemy_souls.h" -#define EnAnubice_Update ((ActorFunc)GAME_ADDR(0x246E58)) +void EnAnubice_Update(Actor* thisx, GlobalContext* globalCtx); void EnAnubice_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnAnubice* this = (EnAnubice*)thisx; diff --git a/code/src/actors/bean_plant.c b/code/src/actors/bean_plant.c index 461f6684..669ec94e 100644 --- a/code/src/actors/bean_plant.c +++ b/code/src/actors/bean_plant.c @@ -1,40 +1,41 @@ #include "bean_plant.h" #include "multiplayer.h" -#define ObjBean_Init ((ActorFunc)GAME_ADDR(0x1E12B0)) +void ObjBean_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjBean_Update(Actor* thisx, GlobalContext* globalCtx); -#define ObjBean_Update ((ActorFunc)GAME_ADDR(0x214BEC)) - -#define ObjBean_UnplantedWait (void*)GAME_ADDR(0x15E154) -#define ObjBean_StallGrowth (void*)GAME_ADDR(0x143684) -#define ObjBean_GrowSprout (void*)GAME_ADDR(0x1436C4) +void ObjBean_UnplantedWait(ObjBean* this, GlobalContext* globalCtx); +void ObjBean_StallGrowth(ObjBean* this, GlobalContext* globalCtx); +void ObjBean_GrowSprout(ObjBean* this, GlobalContext* globalCtx); PosRot lastBeanPlant_Home; s16 lastBeanPlant_Params; -void ObjBean_rInit(ObjBean* thisx, GlobalContext* globalCtx) { - lastBeanPlant_Home = thisx->base.home; - lastBeanPlant_Params = thisx->base.params; - ObjBean_Init((Actor*)thisx, globalCtx); +void ObjBean_rInit(Actor* thisx, GlobalContext* globalCtx) { + lastBeanPlant_Home = thisx->home; + lastBeanPlant_Params = thisx->params; + ObjBean_Init(thisx, globalCtx); } -void ObjBean_rUpdate(ObjBean* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; +void ObjBean_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + ObjBean* this = (ObjBean*)thisx; + + ObjBeanActionFunc prev_action_fn = this->action_fn; - ObjBean_Update((Actor*)thisx, globalCtx); + ObjBean_Update(thisx, globalCtx); - if (prev_action_fn == ObjBean_UnplantedWait && thisx->action_fn == ObjBean_StallGrowth) { - Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); + if (prev_action_fn == ObjBean_UnplantedWait && this->action_fn == ObjBean_StallGrowth) { + Multiplayer_Send_ActorUpdate(thisx, NULL, 0); } } -void ObjBean_StartGrowth(ObjBean* thisx) { - if (thisx->action_fn != ObjBean_UnplantedWait) { +void ObjBean_StartGrowth(ObjBean* this) { + if (this->action_fn != ObjBean_UnplantedWait) { return; } - thisx->action_fn = ObjBean_GrowSprout; - thisx->unk_bitfield = ((thisx->unk_bitfield & 0xF0) | 3); - thisx->base.scale.x = 0.01; - thisx->base.scale.y = 0.01; - thisx->base.scale.z = 0.01; + this->action_fn = ObjBean_GrowSprout; + this->unk_bitfield = ((this->unk_bitfield & 0xF0) | 3); + this->base.scale.x = 0.01; + this->base.scale.y = 0.01; + this->base.scale.z = 0.01; } diff --git a/code/src/actors/bean_plant.h b/code/src/actors/bean_plant.h index 808a5275..b786b8a2 100644 --- a/code/src/actors/bean_plant.h +++ b/code/src/actors/bean_plant.h @@ -3,10 +3,14 @@ #include "z3D/z3D.h" -typedef struct { +struct ObjBean; + +typedef void (*ObjBeanActionFunc)(struct ObjBean* this, GlobalContext* globalCtx); + +typedef struct ObjBean { Actor base; char dyna[24]; - void* action_fn; + ObjBeanActionFunc action_fn; char collider[88]; char unk_218[16]; s16 timer; @@ -19,8 +23,8 @@ typedef struct { extern PosRot lastBeanPlant_Home; extern s16 lastBeanPlant_Params; -void ObjBean_rInit(ObjBean* thisx, GlobalContext* globalCtx); -void ObjBean_rUpdate(ObjBean* thisx, GlobalContext* globalCtx); -void ObjBean_StartGrowth(ObjBean* thisx); +void ObjBean_rInit(Actor* thisx, GlobalContext* globalCtx); +void ObjBean_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void ObjBean_StartGrowth(ObjBean* this); #endif //_BEAN_PLANT_H_ diff --git a/code/src/actors/boulder_red.c b/code/src/actors/boulder_red.c index e9ceb605..932fb842 100644 --- a/code/src/actors/boulder_red.c +++ b/code/src/actors/boulder_red.c @@ -1,27 +1,29 @@ #include "boulder_red.h" #include "multiplayer.h" -#define ObjHamishi_Update ((ActorFunc)GAME_ADDR(0x26FD24)) +void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx); -void ObjHamishi_rUpdate(ObjHamishi* thisx, GlobalContext* globalCtx) { - s16 prevHitCount = thisx->hit_count; +void ObjHamishi_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + ObjHamishi* this = (ObjHamishi*)thisx; - ObjHamishi_Update((Actor*)thisx, globalCtx); + s16 prevHitCount = this->hit_count; - if (thisx->hit_count != prevHitCount) { - Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); + ObjHamishi_Update(thisx, globalCtx); + + if (this->hit_count != prevHitCount) { + Multiplayer_Send_ActorUpdate(thisx, NULL, 0); } } -void ObjHamishi_Hit(ObjHamishi* thisx) { - thisx->hit_count++; - if (thisx->hit_count < 2) { - thisx->shake_frames = 15; - thisx->shake_position_size = 2.0; - thisx->shake_rotation_size = 400.0; +void ObjHamishi_Hit(ObjHamishi* this) { + this->hit_count++; + if (this->hit_count < 2) { + this->shake_frames = 15; + this->shake_position_size = 2.0; + this->shake_rotation_size = 400.0; } } -s16 ObjHamishi_HitCount(ObjHamishi* thisx) { - return thisx->hit_count; +s16 ObjHamishi_HitCount(ObjHamishi* this) { + return this->hit_count; } diff --git a/code/src/actors/boulder_red.h b/code/src/actors/boulder_red.h index 9bac808c..cc03a309 100644 --- a/code/src/actors/boulder_red.h +++ b/code/src/actors/boulder_red.h @@ -15,7 +15,7 @@ typedef struct { SkeletonAnimationModel* animation_model; } ObjHamishi; -void ObjHamishi_rUpdate(ObjHamishi* thisx, GlobalContext* globalCtx); -void ObjHamishi_Hit(ObjHamishi* thisx); +void ObjHamishi_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void ObjHamishi_Hit(ObjHamishi* this); #endif //_BOULDER_RED_H_ diff --git a/code/src/actors/bubble.c b/code/src/actors/bubble.c index afd65b1f..316e832d 100644 --- a/code/src/actors/bubble.c +++ b/code/src/actors/bubble.c @@ -2,9 +2,9 @@ #include "enemizer.h" #include "common.h" -#define EnBb_Init ((ActorFunc)GAME_ADDR(0x162328)) -#define EnBb_Update ((ActorFunc)GAME_ADDR(0x1005ec)) -#define EnBb_Destroy ((ActorFunc)GAME_ADDR(0x162C28)) +void EnBb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBb_Destroy(Actor* thisx, GlobalContext* globalCtx); #define Bubble_GetType(actor) ((s16)(thisx->params | 0xFF00)) diff --git a/code/src/actors/business_scrubs.c b/code/src/actors/business_scrubs.c index 807354bf..15954b49 100644 --- a/code/src/actors/business_scrubs.c +++ b/code/src/actors/business_scrubs.c @@ -2,9 +2,8 @@ #include "settings.h" #include "multiplayer.h" -#define EnDns_Update ((ActorFunc)GAME_ADDR(0x1D67CC)) - -#define EnShopnuts_Init ((ActorFunc)GAME_ADDR(0x22ED2C)) +void EnDns_Update(Actor* thisx, GlobalContext* globalCtx); +void EnShopnuts_Init(Actor* thisx, GlobalContext* globalCtx); u32 EnDns_rPurchaseableCheck(EnDns* scrub); void EnDns_rSetRupeesAndFlags(EnDns* scrub); @@ -25,7 +24,7 @@ static const DnsItemEntry Scrub_A = { 40, 1, 0x79, EnDns_rPurchaseableCheck, EnD const DnsItemEntry* rScrubTable[] = { &Scrub_0, &Scrub_1, &Scrub_2, &Scrub_3, &Scrub_4, &Scrub_5, &Scrub_6, &Scrub_7, &Scrub_8, &Scrub_9, &Scrub_A }; -#define VanillaScrubTable ((DnsItemEntry**)GAME_ADDR(0x522384)) +extern DnsItemEntry* VanillaScrubTable[]; s16 rScrubRandomItemPrices[11] = { 0 }; @@ -102,20 +101,19 @@ void EnShopnuts_rInit(Actor* thisx, GlobalContext* globalCtx) { EnShopnuts_Init(&scrub->actor, globalCtx); } -#define EnDns_Talk (void*)GAME_ADDR(0x161960) -#define FUN_00161828 (void*)GAME_ADDR(0x161828) -#define FUN_003CE92C (void*)GAME_ADDR(0x3CE92C) -#define FUN_00100434 (void*)GAME_ADDR(0x100434) -#define EnDns_SetupBurrow (void*)GAME_ADDR(0x3C3C04) -#define EnDns_Burrow (void*)GAME_ADDR(0x3CEA64) +void EnDns_Talk(EnDns* this, GlobalContext* globalCtx); +void FUN_00161828(EnDns* this, GlobalContext* globalCtx); +void FUN_003CE92C(EnDns* this, GlobalContext* globalCtx); +void FUN_00100434(EnDns* this, GlobalContext* globalCtx); +void EnDns_SetupBurrow(EnDns* this, GlobalContext* globalCtx); +void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx); -typedef u32 (*EnDns_ChangeAnim_proc)(EnDns* globalCtx, u8 arg1); -#define EnDns_ChangeAnim ((EnDns_ChangeAnim_proc)GAME_ADDR(0x37693C)) +u32 EnDns_ChangeAnim(EnDns* globalCtx, u8 arg1); void EnDns_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnDns* scrub = (EnDns*)thisx; - void* prev_action_fn = scrub->action_fn; + EnDnsActionFunc prev_action_fn = scrub->action_fn; EnDns_Update(&scrub->actor, globalCtx); @@ -131,14 +129,14 @@ void EnDns_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } } -void EnDns_StartBurrow(EnDns* thisx) { - if (thisx->action_fn == FUN_00161828 || thisx->action_fn == FUN_003CE92C || thisx->action_fn == FUN_00100434 || - thisx->action_fn == EnDns_SetupBurrow || thisx->action_fn == EnDns_Burrow) { +void EnDns_StartBurrow(EnDns* this) { + if (this->action_fn == FUN_00161828 || this->action_fn == FUN_003CE92C || this->action_fn == FUN_00100434 || + this->action_fn == EnDns_SetupBurrow || this->action_fn == EnDns_Burrow) { return; } - thisx->drop_collectible = 0; - thisx->maintain_collider = 0; - thisx->actor.flags &= ~(0x1); - EnDns_ChangeAnim(thisx, 1); - thisx->action_fn = EnDns_SetupBurrow; + this->drop_collectible = 0; + this->maintain_collider = 0; + this->actor.flags &= ~(0x1); + EnDns_ChangeAnim(this, 1); + this->action_fn = EnDns_SetupBurrow; } diff --git a/code/src/actors/business_scrubs.h b/code/src/actors/business_scrubs.h index a7943030..e8bb5588 100644 --- a/code/src/actors/business_scrubs.h +++ b/code/src/actors/business_scrubs.h @@ -6,7 +6,7 @@ #include "z3D/actors/z_en_shopnuts.h" void EnDns_rUpdate(Actor* thisx, GlobalContext* globalCtx); -void EnDns_StartBurrow(EnDns* thisx); +void EnDns_StartBurrow(EnDns* this); void EnShopnuts_rInit(Actor* thisx, GlobalContext* globalCtx); diff --git a/code/src/actors/carpenter.c b/code/src/actors/carpenter.c index d70be950..86e8ffd6 100644 --- a/code/src/actors/carpenter.c +++ b/code/src/actors/carpenter.c @@ -5,27 +5,29 @@ void EnToryo_SetTradedSawFlag(void) { gSaveContext.itemGetInf[3] |= 0x4; } -#define EnDaiku_Update ((ActorFunc)GAME_ADDR(0x20F1A8)) +void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnDaiku_WaitFreedom (void*)GAME_ADDR(0x182FF0) -#define EnDaiku_InitEscape (void*)GAME_ADDR(0x25A8E4) -#define EnDaiku_EscapeRotate (void*)GAME_ADDR(0x2754E4) +void EnDaiku_WaitFreedom(EnDaiku* this, GlobalContext* globalCtx); +void EnDaiku_InitEscape(EnDaiku* this, GlobalContext* globalCtx); +void EnDaiku_EscapeRotate(EnDaiku* this, GlobalContext* globalCtx); -void EnDaiku_rUpdate(EnDaiku* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; +void EnDaiku_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + EnDaiku* this = (EnDaiku*)thisx; - EnDaiku_Update((Actor*)thisx, globalCtx); + EnDaikuActionFunc prev_action_fn = this->action_fn; - if (prev_action_fn == EnDaiku_WaitFreedom && thisx->action_fn == EnDaiku_InitEscape) { + EnDaiku_Update(thisx, globalCtx); + + if (prev_action_fn == EnDaiku_WaitFreedom && this->action_fn == EnDaiku_InitEscape) { Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); } } -void EnDaiku_StartEscape(EnDaiku* thisx) { - if (thisx->action_fn != EnDaiku_WaitFreedom) { +void EnDaiku_StartEscape(EnDaiku* this) { + if (this->action_fn != EnDaiku_WaitFreedom) { return; } - Actor_Kill((Actor*)thisx); + Actor_Kill(&this->base); // TODO: Start escape instead // thisx->action_fn = EnDaiku_EscapeRotate; } diff --git a/code/src/actors/carpenter.h b/code/src/actors/carpenter.h index 218da35a..1a06c796 100644 --- a/code/src/actors/carpenter.h +++ b/code/src/actors/carpenter.h @@ -3,14 +3,18 @@ #include "z3D/z3D.h" -typedef struct { +struct EnDaiku; + +typedef void (*EnDaikuActionFunc)(struct EnDaiku* this, GlobalContext* globalCtx); + +typedef struct EnDaiku { Actor base; SkelAnime anime; char unk_228[2080]; - void* action_fn; + EnDaikuActionFunc action_fn; } EnDaiku; -void EnDaiku_rUpdate(EnDaiku* thisx, GlobalContext* globalCtx); -void EnDaiku_StartEscape(EnDaiku* thisx); +void EnDaiku_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void EnDaiku_StartEscape(EnDaiku* this); #endif //_CARPENTER_H_ diff --git a/code/src/actors/checkable_spot.c b/code/src/actors/checkable_spot.c index c542677c..bbdbecda 100644 --- a/code/src/actors/checkable_spot.c +++ b/code/src/actors/checkable_spot.c @@ -3,13 +3,14 @@ #include "savefile.h" #include "settings.h" -#define EnWonderTalk_Update ((ActorFunc)GAME_ADDR(0x3731F4)) +void EnWonderTalk_Update(Actor* thisx, GlobalContext* globalCtx); +void EnWonderTalk2_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnWonderTalk2_Update ((ActorFunc)GAME_ADDR(0x3794EC)) +void FUN_2065E0(EnWonderTalk* this, GlobalContext* globalCtx); void EnWonderTalk_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnWonderTalk* this = (EnWonderTalk*)thisx; - if (this->actionFunc == (ActorFunc)GAME_ADDR(0x2065E0) && thisx->params == 0x0FFF) { // reading ToT altar + if (this->actionFunc == FUN_2065E0 && thisx->params == 0x0FFF) { // reading ToT altar gExtSaveData.extInf.totAltarFlags |= (1 << gSaveContext.linkAge); } EnWonderTalk_Update(thisx, globalCtx); diff --git a/code/src/actors/checkable_spot.h b/code/src/actors/checkable_spot.h index 721012ec..c6747575 100644 --- a/code/src/actors/checkable_spot.h +++ b/code/src/actors/checkable_spot.h @@ -3,14 +3,17 @@ #include "z3D/z3D.h" +struct EnWonderTalk; + +typedef void (*EnWonderTalkFunc)(struct EnWonderTalk* this, GlobalContext* globalCtx); + typedef struct EnWonderTalk { /* 0x000 */ Actor actor; - /* 0x1A4 */ ActorFunc actionFunc; + /* 0x1A4 */ EnWonderTalkFunc actionFunc; /* 0x1A8 */ char unk_1A8[0x15]; } EnWonderTalk; // size = 0x1BD void EnWonderTalk_rUpdate(Actor* thisx, GlobalContext* globalCtx); - void EnWonderTalk2_rUpdate(Actor* thisx, GlobalContext* globalCtx); #endif //_CHECKABLE_SPOT_H_ diff --git a/code/src/actors/chest.c b/code/src/actors/chest.c index 0e43d6ba..af3cece8 100644 --- a/code/src/actors/chest.c +++ b/code/src/actors/chest.c @@ -10,9 +10,8 @@ #include "objects.h" #include "custom_models.h" -#define EnBox_Init ((ActorFunc)GAME_ADDR(0x1899EC)) - -#define EnBox_Update ((ActorFunc)GAME_ADDR(0x1D5B70)) +void EnBox_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBox_Update(Actor* thisx, GlobalContext* globalCtx); static Actor* sLastTrapChest = 0; static Actor* sBomb = 0; diff --git a/code/src/actors/chest_minigame.c b/code/src/actors/chest_minigame.c index 23159e25..34a49d6e 100644 --- a/code/src/actors/chest_minigame.c +++ b/code/src/actors/chest_minigame.c @@ -2,11 +2,10 @@ #include "settings.h" #include "chest_minigame.h" -#define EnTakaraMan_Init ((ActorFunc)GAME_ADDR(0x26DEB8)) +void EnTakaraMan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnChanger_Init(Actor* thisx, GlobalContext* globalCtx); -#define EnChanger_Init ((ActorFunc)GAME_ADDR(0x20EC50)) - -#define sLoserGetItemIds ((s32*)GAME_ADDR(0x521774)) +extern s32 EnChanger_LoserGetItemIds[]; void EnTakaraMan_rInit(Actor* thisx, GlobalContext* globalCtx) { if (gSettingsContext.shuffleChestMinigame) { @@ -18,12 +17,12 @@ void EnTakaraMan_rInit(Actor* thisx, GlobalContext* globalCtx) { void EnChanger_rInit(Actor* thisx, GlobalContext* globalCtx) { if (gSettingsContext.shuffleChestMinigame) { // Set loser chests to be Ice Traps - sLoserGetItemIds[0] = 0; - sLoserGetItemIds[1] = 0x7C; - sLoserGetItemIds[2] = 0x7C; - sLoserGetItemIds[3] = 0x7C; - sLoserGetItemIds[4] = 0x7C; - sLoserGetItemIds[5] = 0x7C; + EnChanger_LoserGetItemIds[0] = 0; + EnChanger_LoserGetItemIds[1] = 0x7C; + EnChanger_LoserGetItemIds[2] = 0x7C; + EnChanger_LoserGetItemIds[3] = 0x7C; + EnChanger_LoserGetItemIds[4] = 0x7C; + EnChanger_LoserGetItemIds[5] = 0x7C; } EnChanger_Init(thisx, globalCtx); diff --git a/code/src/actors/collapsing_castle.c b/code/src/actors/collapsing_castle.c index 6be07d68..d518f43c 100644 --- a/code/src/actors/collapsing_castle.c +++ b/code/src/actors/collapsing_castle.c @@ -1,7 +1,7 @@ #include "z3D/z3D.h" #include "collapsing_castle.h" -#define DemoGt_Update ((ActorFunc)GAME_ADDR(0x12E1C4)) +void DemoGt_Update(Actor* thisx, GlobalContext* globalCtx); void DemoGt_rUpdate(Actor* thisx, GlobalContext* globalCtx) { DemoGt_Update(thisx, globalCtx); diff --git a/code/src/actors/collapsing_platform.c b/code/src/actors/collapsing_platform.c index e196cb74..bcc76219 100644 --- a/code/src/actors/collapsing_platform.c +++ b/code/src/actors/collapsing_platform.c @@ -1,32 +1,34 @@ #include "collapsing_platform.h" #include "multiplayer.h" -#define ObjLift_Update ((ActorFunc)GAME_ADDR(0x2159DC)) +void ObjLift_Update(Actor* thisx, GlobalContext* globalCtx); -#define ObjLift_Wait (void*)GAME_ADDR(0x3C05B0) -#define ObjLift_Shake (void*)GAME_ADDR(0x110E98) -#define ObjLift_Fall (void*)GAME_ADDR(0x3BB7BC) +void ObjLift_Wait(ObjLift* this, GlobalContext* globalCtx); +void ObjLift_Shake(ObjLift* this, GlobalContext* globalCtx); +void ObjLift_Fall(ObjLift* this, GlobalContext* globalCtx); -void ObjLift_rUpdate(ObjLift* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; +void ObjLift_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + ObjLift* this = (ObjLift*)thisx; - ObjLift_Update((Actor*)thisx, globalCtx); + ObjLiftActionFunc prev_action_fn = this->action_fn; - if (prev_action_fn != thisx->action_fn && prev_action_fn == ObjLift_Wait) { - Multiplayer_Send_ActorUpdate((Actor*)thisx, &thisx->action_fn, sizeof(void*)); + ObjLift_Update(thisx, globalCtx); + + if (prev_action_fn != this->action_fn && prev_action_fn == ObjLift_Wait) { + Multiplayer_Send_ActorUpdate(thisx, &this->action_fn, sizeof(void*)); } } -void ObjLift_SetActionFn(ObjLift* thisx, void* new_action_fn) { - if (thisx->action_fn != ObjLift_Wait) { +void ObjLift_SetActionFn(ObjLift* this, ObjLiftActionFunc new_action_fn) { + if (this->action_fn != ObjLift_Wait) { return; } if (new_action_fn == ObjLift_Shake) { - thisx->timer = 30; + this->timer = 30; } else if (new_action_fn == ObjLift_Fall) { - thisx->base.world.pos = thisx->base.home.pos; - thisx->base.world.rot = thisx->base.home.rot; - thisx->base.shape.rot = thisx->base.world.rot; + this->base.world.pos = this->base.home.pos; + this->base.world.rot = this->base.home.rot; + this->base.shape.rot = this->base.world.rot; } - thisx->action_fn = new_action_fn; + this->action_fn = new_action_fn; } diff --git a/code/src/actors/collapsing_platform.h b/code/src/actors/collapsing_platform.h index 139027c4..86553eb3 100644 --- a/code/src/actors/collapsing_platform.h +++ b/code/src/actors/collapsing_platform.h @@ -3,16 +3,20 @@ #include "z3D/z3D.h" -typedef struct { +struct ObjLift; + +typedef void (*ObjLiftActionFunc)(struct ObjLift* this, GlobalContext* globalCtx); + +typedef struct ObjLift { Actor base; char dyna[24]; - void* action_fn; + ObjLiftActionFunc action_fn; SkeletonAnimationModel* animation_model; char unk_1C4[6]; u16 timer; } ObjLift; -void ObjLift_rUpdate(ObjLift* thisx, GlobalContext* globalCtx); -void ObjLift_SetActionFn(ObjLift* thisx, void* new_action_fn); +void ObjLift_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void ObjLift_SetActionFn(ObjLift* this, ObjLiftActionFunc new_action_fn); #endif //_COLLAPSING_PLATFORM_H_ diff --git a/code/src/actors/cow.c b/code/src/actors/cow.c index 232995ba..d31a7d00 100644 --- a/code/src/actors/cow.c +++ b/code/src/actors/cow.c @@ -3,9 +3,8 @@ #include "entrance.h" #include "cow.h" -#define EnCow_Init ((ActorFunc)GAME_ADDR(0x189FD4)) - -#define EnCow_Destroy ((ActorFunc)GAME_ADDR(0x18A3E4)) +void EnCow_Init(Actor* thisx, GlobalContext* globalCtx); +void EnCow_Destroy(Actor* thisx, GlobalContext* globalCtx); static s32 sNumCows = 0; diff --git a/code/src/actors/dampe.c b/code/src/actors/dampe.c index 10722692..0e4d4ed8 100644 --- a/code/src/actors/dampe.c +++ b/code/src/actors/dampe.c @@ -1,6 +1,6 @@ #include "dampe.h" -#define EnTk_Update ((ActorFunc)GAME_ADDR(0x1BC088)) +void EnTk_Update(Actor* thisx, GlobalContext* globalCtx); void EnTk_rUpdate(Actor* thisx, GlobalContext* globalCtx) { // Custom collectible flag for the heart piece diff --git a/code/src/actors/dark_link.c b/code/src/actors/dark_link.c index e8c60d42..cea78a9c 100644 --- a/code/src/actors/dark_link.c +++ b/code/src/actors/dark_link.c @@ -3,8 +3,8 @@ #include "enemizer.h" #include "common.h" -#define EnTorch2_Init ((ActorFunc)GAME_ADDR(0x1F853C)) -#define EnTorch2_Update ((ActorFunc)GAME_ADDR(0x22F0C8)) +void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx); u8 sPlayerWeaponClanked = FALSE; diff --git a/code/src/actors/dead_hand_hand.c b/code/src/actors/dead_hand_hand.c index 055e74ea..8bd348ad 100644 --- a/code/src/actors/dead_hand_hand.c +++ b/code/src/actors/dead_hand_hand.c @@ -1,7 +1,7 @@ #include "dead_hand_hand.h" #include "settings.h" -#define EnDha_Update ((ActorFunc)GAME_ADDR(0x113050)) +void EnDha_Update(Actor* thisx, GlobalContext* globalCtx); void EnDha_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnDha_Update(thisx, globalCtx); diff --git a/code/src/actors/deku_scrubs.c b/code/src/actors/deku_scrubs.c index 32dc05fc..89f24eb8 100644 --- a/code/src/actors/deku_scrubs.c +++ b/code/src/actors/deku_scrubs.c @@ -1,15 +1,15 @@ #include "deku_scrubs.h" #include "settings.h" -#define EnDntNomal_Update ((ActorFunc)GAME_ADDR(0x280510)) +void EnDntNomal_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnDntNomal_SetupTargetWalk ((ActorFunc)GAME_ADDR(0x21CED4)) -#define EnDntNomal_SetupTargetGivePrize ((ActorFunc)GAME_ADDR(0x2394CC)) -#define EnDntNomal_SetupTargetUnburrow ((ActorFunc)GAME_ADDR(0x21CCFC)) +void EnDntNomal_SetupTargetWalk(EnDntNomal* this, GlobalContext* globalCtx); +void EnDntNomal_SetupTargetGivePrize(EnDntNomal* this, GlobalContext* globalCtx); +void EnDntNomal_SetupTargetUnburrow(EnDntNomal* this, GlobalContext* globalCtx); -#define EnHintnuts_Init ((ActorFunc)GAME_ADDR(0x22AB2C)) +void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx); -#define EnNutsball_Update ((ActorFunc)GAME_ADDR(0x26BD8C)) +void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx); #define NUTSBALL_TYPE_DEKUNUTS 0 #define NUTSBALL_TYPE_HINTNUTS 1 diff --git a/code/src/actors/deku_scrubs.h b/code/src/actors/deku_scrubs.h index ddecc844..9ff7fd8a 100644 --- a/code/src/actors/deku_scrubs.h +++ b/code/src/actors/deku_scrubs.h @@ -3,9 +3,13 @@ #include "z3D/z3D.h" -typedef struct { +struct EnDntNomal; + +typedef void (*EnDntNomalActionFunc)(struct EnDntNomal* this, GlobalContext* globalCtx); + +typedef struct EnDntNomal { /* 0x000 */ Actor base; - /* 0x1A4 */ ActorFunc actionFunc; + /* 0x1A4 */ EnDntNomalActionFunc actionFunc; /* 0x1A8 */ char unk_1A8[0x40]; /* 0x1E8 */ s16 timer1; /* 0x1EA */ s16 timer2; diff --git a/code/src/actors/deku_tree_mouth.c b/code/src/actors/deku_tree_mouth.c index d36d6a53..70208888 100644 --- a/code/src/actors/deku_tree_mouth.c +++ b/code/src/actors/deku_tree_mouth.c @@ -2,7 +2,7 @@ #include "settings.h" #include "z3D/z3D.h" -#define BgTreemouth_Init ((ActorFunc)GAME_ADDR(0x2412B4)) +void BgTreemouth_Init(Actor* thisx, GlobalContext* globalCtx); void BgTreemouth_rInit(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/demo_effect.c b/code/src/actors/demo_effect.c index 51e0d7c3..a4e2ad74 100644 --- a/code/src/actors/demo_effect.c +++ b/code/src/actors/demo_effect.c @@ -2,11 +2,9 @@ #include "z3D/actors/z_demo_effect.h" #include "models.h" -#define DemoEffect_Init ((ActorFunc)GAME_ADDR(0x22345C)) - -#define DemoEffect_Destroy ((ActorFunc)GAME_ADDR(0x2245B8)) - -#define DemoEffect_Update ((ActorFunc)GAME_ADDR(0x262C58)) +void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoEffect_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoEffect_Update(Actor* thisx, GlobalContext* globalCtx); #define THIS ((DemoEffect*)thisx) diff --git a/code/src/actors/demo_kankyo.c b/code/src/actors/demo_kankyo.c index 80c34963..82b1fc44 100644 --- a/code/src/actors/demo_kankyo.c +++ b/code/src/actors/demo_kankyo.c @@ -4,7 +4,7 @@ #include "entrance.h" #include "grotto.h" -#define DemoKankyo_Update ((ActorFunc)GAME_ADDR(0x262EA4)) +void DemoKankyo_Update(Actor* thisx, GlobalContext* globalCtx); #define CsTimer (globalCtx->csCtx.frames) diff --git a/code/src/actors/dodongos.c b/code/src/actors/dodongos.c index bd4003f1..8c688698 100644 --- a/code/src/actors/dodongos.c +++ b/code/src/actors/dodongos.c @@ -3,13 +3,13 @@ #include "enemy_souls.h" #include "settings.h" -#define EnDodongo_Idle ((EnDodongoActionFunc)GAME_ADDR(0x3E4FE8)) +void EnDodongo_Idle(EnDodongo* this, GlobalContext* globalCtx); -#define EnDodojr_Init ((ActorFunc)GAME_ADDR(0x1F51E8)) -#define EnDodojr_JumpAttackBounce ((EnDodojrActionFunc)GAME_ADDR(0x3D069C)) +void EnDodojr_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDodojr_JumpAttackBounce(EnDodojr* this, GlobalContext* globalCtx); -#define BossDodongo_Update ((ActorFunc)GAME_ADDR(0x27BE30)) -#define BossDodongo_DeathCutscene ((BossDodongoActionFunc)GAME_ADDR(0x3DA7AC)) +void BossDodongo_Update(Actor* thisx, GlobalContext* globalCtx); +void BossDodongo_DeathCutscene(BossDodongo* this, GlobalContext* globalCtx); static s16 BossDodongo_PrevNumWallCollisions = 0; diff --git a/code/src/actors/dodongos.h b/code/src/actors/dodongos.h index c63ff568..7be1b532 100644 --- a/code/src/actors/dodongos.h +++ b/code/src/actors/dodongos.h @@ -11,8 +11,6 @@ typedef void (*EnDodongoActionFunc)(struct EnDodongo*, GlobalContext*); typedef void (*EnDodojrActionFunc)(struct EnDodojr*, GlobalContext*); typedef void (*BossDodongoActionFunc)(struct BossDodongo*, GlobalContext*); -#define EnDodojr_DropItem ((EnDodojrActionFunc)GAME_ADDR(0x3B7C64)) - typedef struct EnDodongo { /* 0x0000 */ Actor base; /* 0x01A4 */ SkelAnime skelAnime; @@ -50,6 +48,8 @@ _Static_assert(sizeof(BossDodongo) == 0x206C, "BossDodongo size"); void EnDodojr_rInit(Actor* thisx, GlobalContext* globalCtx); +void EnDodojr_DropItem(EnDodojr* this, GlobalContext* globalCtx); + void BossDodongo_rUpdate(Actor* thisx, GlobalContext* globalCtx); #endif //_DODONGOS_H_ diff --git a/code/src/actors/door.c b/code/src/actors/door.c index 3f892f3f..d1b8581d 100644 --- a/code/src/actors/door.c +++ b/code/src/actors/door.c @@ -16,45 +16,51 @@ void Door_CheckToDeleteCustomModels(Actor* door) { } } -// EnDoor +/*------------------------------ +| EN_DOOR | +------------------------------*/ -#define EnDoor_Update ((ActorFunc)GAME_ADDR(0x1F53C8)) +void EnDoor_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnDoor_Idle (void*)GAME_ADDR(0x3F1B28) -#define EnDoor_Open (void*)GAME_ADDR(0x3EC04C) -void EnDoor_Unlocking(EnDoor* thisx, GlobalContext* globalCtx); +void EnDoor_Idle(EnDoor* this, GlobalContext* globalCtx); +void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx); +void EnDoor_Unlocking(EnDoor* this, GlobalContext* globalCtx); -void EnDoor_rUpdate(EnDoor* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; +void EnDoor_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + EnDoor* this = (EnDoor*)thisx; - EnDoor_Update((Actor*)thisx, globalCtx); + EnDoorActionFunc prev_action_fn = this->action_fn; - if (thisx->lock_timer != 0 && prev_action_fn == EnDoor_Idle && thisx->action_fn == EnDoor_Open) { - Multiplayer_Send_UnlockedDoor(thisx->base.params & 0x3F); - Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); + EnDoor_Update(thisx, globalCtx); + + if (this->lock_timer != 0 && prev_action_fn == EnDoor_Idle && this->action_fn == EnDoor_Open) { + Multiplayer_Send_UnlockedDoor(this->base.params & 0x3F); + Multiplayer_Send_ActorUpdate(thisx, NULL, 0); } } -void EnDoor_Unlock(EnDoor* thisx) { - if (thisx->action_fn != EnDoor_Idle) { +void EnDoor_Unlock(EnDoor* this) { + if (this->action_fn != EnDoor_Idle) { return; } - thisx->action_fn = &EnDoor_Unlocking; - PlaySFX(0x10001D3, &thisx->base.world.pos, 4, (f32*)GAME_ADDR(0x54AC20), (f32*)GAME_ADDR(0x54AC20), - (s8*)GAME_ADDR(0x54AC24)); // NA_SE_EV_CHAIN_KEY_UNLOCK + this->action_fn = &EnDoor_Unlocking; + PlaySFX(0x10001D3, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); // NA_SE_EV_CHAIN_KEY_UNLOCK } -void EnDoor_Unlocking(EnDoor* thisx, GlobalContext* globalCtx) { - if (thisx->lock_timer > 0) { - thisx->lock_timer--; +void EnDoor_Unlocking(EnDoor* this, GlobalContext* globalCtx) { + if (this->lock_timer > 0) { + this->lock_timer--; return; } - thisx->action_fn = EnDoor_Idle; + this->action_fn = EnDoor_Idle; } -// DoorShutter +/*------------------------------ +| DOOR_SHUTTER | +------------------------------*/ -#define DoorShutter_Init ((ActorFunc)GAME_ADDR(0x2453E0)) +void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx); void DoorShutter_rInit(Actor* thisx, GlobalContext* globalCtx) { // In Treasure Chest Shop when its chests are shuffled, @@ -71,74 +77,79 @@ void DoorShutter_rInit(Actor* thisx, GlobalContext* globalCtx) { DoorShutter_Init(thisx, globalCtx); } -#define DoorShutter_Update_addr -#define DoorShutter_Update ((ActorFunc)GAME_ADDR(0x27E6E0)) +void DoorShutter_Update(Actor* thisx, GlobalContext* globalCtx); + +void DoorShutter_SlidingDoor_Idle(DoorShutter* this, GlobalContext* globalCtx); +void DoorShutter_SlidingDoor_Open(DoorShutter* this, GlobalContext* globalCtx); +void DoorShutter_Unlocking(DoorShutter* this, GlobalContext* globalCtx); -#define DoorShutter_SlidingDoor_Idle (void*)GAME_ADDR(0x3F4A3C) -#define DoorShutter_SlidingDoor_Open (void*)GAME_ADDR(0x3EEE7C) -void DoorShutter_Unlocking(DoorShutter* thisx, GlobalContext* globalCtx); +void DoorShutter_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + DoorShutter* this = (DoorShutter*)thisx; -void DoorShutter_rUpdate(DoorShutter* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; + DoorShutterActionFunc prev_action_fn = this->action_fn; - DoorShutter_Update((Actor*)thisx, globalCtx); + DoorShutter_Update(thisx, globalCtx); // Don't sync chest minigame doors when the setting is off if (globalCtx->sceneNum == 16 && gSettingsContext.shuffleChestMinigame == SHUFFLECHESTMINIGAME_OFF) { return; } - if (thisx->lock_timer != 0 && prev_action_fn == DoorShutter_SlidingDoor_Idle && - thisx->action_fn == DoorShutter_SlidingDoor_Open) { - if (thisx->door_type_maybe != 5) { - Multiplayer_Send_UnlockedDoor(thisx->base.params & 0x3F); + if (this->lock_timer != 0 && prev_action_fn == DoorShutter_SlidingDoor_Idle && + this->action_fn == DoorShutter_SlidingDoor_Open) { + if (this->door_type_maybe != 5) { + Multiplayer_Send_UnlockedDoor(thisx->params & 0x3F); } - Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); + Multiplayer_Send_ActorUpdate(thisx, NULL, 0); } } -void DoorShutter_Unlock(DoorShutter* thisx) { - if (thisx->action_fn != DoorShutter_SlidingDoor_Idle) { +void DoorShutter_Unlock(DoorShutter* this) { + if (this->action_fn != DoorShutter_SlidingDoor_Idle) { return; } - thisx->action_fn = &DoorShutter_Unlocking; + this->action_fn = &DoorShutter_Unlocking; // NA_SE_EV_CHAIN_KEY_UNLOCK : NA_SE_EV_CHAIN_KEY_UNLOCK_B - u32 sfx_id = thisx->door_type_maybe != 5 ? 0x10001D3 : 0x1000200; - PlaySFX(sfx_id, &thisx->base.world.pos, 4, (f32*)GAME_ADDR(0x54AC20), (f32*)GAME_ADDR(0x54AC20), - (s8*)GAME_ADDR(0x54AC24)); + u32 sfx_id = this->door_type_maybe != 5 ? 0x10001D3 : 0x1000200; + PlaySFX(sfx_id, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } -void DoorShutter_Unlocking(DoorShutter* thisx, GlobalContext* globalCtx) { - if (thisx->lock_timer > 0) { - thisx->lock_timer--; +void DoorShutter_Unlocking(DoorShutter* this, GlobalContext* globalCtx) { + if (this->lock_timer > 0) { + this->lock_timer--; return; } - thisx->action_fn = DoorShutter_SlidingDoor_Idle; + this->action_fn = DoorShutter_SlidingDoor_Idle; } -// DoorGerudo +/*------------------------------ +| DOOR_GERUDO | +------------------------------*/ + +void DoorGerudo_Update(Actor* thisx, GlobalContext* globalCtx); -#define DoorGerudo_Update ((ActorFunc)GAME_ADDR(0x263118)) +void DoorGerudo_Idle(DoorGerudo* this, GlobalContext* globalCtx); +void DoorGerudo_Unlocking(DoorGerudo* this, GlobalContext* globalCtx); -#define DoorGerudo_Idle (void*)GAME_ADDR(0x3F3FA0) -#define DoorGerudo_Unlocking (void*)GAME_ADDR(0x3EEE38) +void DoorGerudo_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + DoorGerudo* this = (DoorGerudo*)thisx; -void DoorGerudo_rUpdate(DoorGerudo* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; + DoorGerudoActionFunc prev_action_fn = this->action_fn; - DoorGerudo_Update((Actor*)thisx, globalCtx); + DoorGerudo_Update(thisx, globalCtx); - if (thisx->lock_timer != 0 && prev_action_fn == DoorGerudo_Idle && thisx->action_fn == DoorGerudo_Unlocking) { - Multiplayer_Send_UnlockedDoor(thisx->base.params & 0x3F); - Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); + if (this->lock_timer != 0 && prev_action_fn == DoorGerudo_Idle && this->action_fn == DoorGerudo_Unlocking) { + Multiplayer_Send_UnlockedDoor(thisx->params & 0x3F); + Multiplayer_Send_ActorUpdate(thisx, NULL, 0); } } -void DoorGerudo_Unlock(DoorGerudo* thisx) { - if (thisx->action_fn != DoorGerudo_Idle || thisx->lock_timer == 0) { +void DoorGerudo_Unlock(DoorGerudo* this) { + if (this->action_fn != DoorGerudo_Idle || this->lock_timer == 0) { return; } - thisx->action_fn = DoorGerudo_Unlocking; - PlaySFX(0x10001D3, &thisx->base.world.pos, 4, (f32*)GAME_ADDR(0x54AC20), (f32*)GAME_ADDR(0x54AC20), - (s8*)GAME_ADDR(0x54AC24)); // NA_SE_EV_CHAIN_KEY_UNLOCK + this->action_fn = DoorGerudo_Unlocking; + PlaySFX(0x10001D3, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); // NA_SE_EV_CHAIN_KEY_UNLOCK } diff --git a/code/src/actors/door.h b/code/src/actors/door.h index 657ab410..3a4d3ca6 100644 --- a/code/src/actors/door.h +++ b/code/src/actors/door.h @@ -3,18 +3,34 @@ #include "z3D/z3D.h" -typedef struct { +/*------------------------------ +| EN_DOOR | +------------------------------*/ + +struct EnDoor; + +typedef void (*EnDoorActionFunc)(struct EnDoor* this, GlobalContext* globalCtx); + +typedef struct EnDoor { Actor base; SkelAnime anime; char unk_228[444]; - void* action_fn; + EnDoorActionFunc action_fn; s16 lock_timer; } EnDoor; -void EnDoor_rUpdate(EnDoor* thisx, GlobalContext* globalCtx); -void EnDoor_Unlock(EnDoor* thisx); +void EnDoor_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void EnDoor_Unlock(EnDoor* this); + +/*------------------------------ +| DOOR_SHUTTER | +------------------------------*/ + +struct DoorShutter; -typedef struct { +typedef void (*DoorShutterActionFunc)(struct DoorShutter* this, GlobalContext* globalCtx); + +typedef struct DoorShutter { Actor base; char dyna[24]; char unk_1BC[6]; @@ -22,23 +38,31 @@ typedef struct { char unk_1C3[3]; s8 lock_timer; char unk_1C7[9]; - void* action_fn; + DoorShutterActionFunc action_fn; } DoorShutter; void DoorShutter_rInit(Actor* thisx, GlobalContext* globalCtx); -void DoorShutter_rUpdate(DoorShutter* thisx, GlobalContext* globalCtx); -void DoorShutter_Unlock(DoorShutter* thisx); +void DoorShutter_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void DoorShutter_Unlock(DoorShutter* this); + +/*------------------------------ +| DOOR_GERUDO | +------------------------------*/ + +struct DoorGerudo; + +typedef void (*DoorGerudoActionFunc)(struct DoorGerudo* this, GlobalContext* globalCtx); -typedef struct { +typedef struct DoorGerudo { Actor base; char dyna[24]; char unk_1BC[2]; s8 lock_timer; char unk_1BF[1]; - void* action_fn; + DoorGerudoActionFunc action_fn; } DoorGerudo; -void DoorGerudo_rUpdate(DoorGerudo* thisx, GlobalContext* globalCtx); -void DoorGerudo_Unlock(DoorGerudo* thisx); +void DoorGerudo_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void DoorGerudo_Unlock(DoorGerudo* this); #endif //_DOOR_H_ diff --git a/code/src/actors/drawbridge.c b/code/src/actors/drawbridge.c index 2361b483..40d52c60 100644 --- a/code/src/actors/drawbridge.c +++ b/code/src/actors/drawbridge.c @@ -1,7 +1,7 @@ #include "z3D/z3D.h" #include "drawbridge.h" -#define BgSpot00Hanebasi_Update ((ActorFunc)GAME_ADDR(0x38B390)) +void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx); void BgSpot00Hanebasi_rUpdate(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/en_ex_item.c b/code/src/actors/en_ex_item.c index c18f8df8..53fbb191 100644 --- a/code/src/actors/en_ex_item.c +++ b/code/src/actors/en_ex_item.c @@ -2,9 +2,8 @@ #include "z3D/actors/z_en_ex_item.h" #include "models.h" -#define EnExItem_Init ((ActorFunc)GAME_ADDR(0x20FC50)) - -#define EnExItem_Destroy ((ActorFunc)GAME_ADDR(0x20FDE0)) +void EnExItem_Init(Actor* thisx, GlobalContext* globalCtx); +void EnExItem_Destroy(Actor* thisx, GlobalContext* globalCtx); #define THIS ((EnExItem*)thisx) diff --git a/code/src/actors/enemy_spawner.c b/code/src/actors/enemy_spawner.c index 943dbecd..70e4aa18 100644 --- a/code/src/actors/enemy_spawner.c +++ b/code/src/actors/enemy_spawner.c @@ -6,8 +6,8 @@ #include "gohma.h" #include "dodongos.h" -#define EnEncount1_Init ((ActorFunc)GAME_ADDR(0x229994)) -#define EnEncount1_Update ((ActorFunc)GAME_ADDR(0x2682D0)) +void EnEncount1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnEncount1_Update(Actor* thisx, GlobalContext* globalCtx); void EnemySpawner_OverrideSpawnedActor(EnEncount1* this, s16* actorId, s16* params) { if (gSettingsContext.enemizer == OFF || this->rSpawnedActorId == 0) { diff --git a/code/src/actors/flare_dancer.c b/code/src/actors/flare_dancer.c index b6d85ada..c38ca566 100644 --- a/code/src/actors/flare_dancer.c +++ b/code/src/actors/flare_dancer.c @@ -2,12 +2,12 @@ #include "settings.h" #include "bgm.h" -#define EnFd_Update ((ActorFunc)GAME_ADDR(0x1B004C)) +void EnFd_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnFd_Reappear ((EnFdActionFunc)GAME_ADDR(0x117D98)) -#define EnFd_JumpToGround ((EnFdActionFunc)GAME_ADDR(0x3ACD84)) +void EnFd_Reappear(EnFd* this, GlobalContext* globalCtx); +void EnFd_JumpToGround(EnFd* this, GlobalContext* globalCtx); -#define EnFdFire_Disappear ((EnFdFireActionFunc)GAME_ADDR(0x3ABFB8)) +void EnFdFire_Disappear(EnFdFire* this, GlobalContext* globalCtx); void EnFd_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnFd* this = (EnFd*)thisx; diff --git a/code/src/actors/flying_traps.c b/code/src/actors/flying_traps.c index 6e1012a4..cc6d1e59 100644 --- a/code/src/actors/flying_traps.c +++ b/code/src/actors/flying_traps.c @@ -4,11 +4,11 @@ #include "settings.h" #include "common.h" -#define EnYukabyun_Update ((ActorFunc)GAME_ADDR(0x26E628)) +void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnYukabyun_Levitate ((EnYukabyun_ActionFunc)GAME_ADDR(0x3B9E3C)) -#define EnYukabyun_Wait ((EnYukabyun_ActionFunc)GAME_ADDR(0x3E6880)) -#define EnTuboTrap_WaitForProximity ((EnTuboTrap_ActionFunc)GAME_ADDR(0x3E6F88)) +void EnYukabyun_Levitate(EnYukabyun* this, GlobalContext* globalCtx); +void EnYukabyun_Wait(EnYukabyun* this, GlobalContext* globalCtx); +void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx); s32 FlyingTraps_Tile_OnImpact(EnYukabyun* this) { if (!EnemySouls_CheckSoulForActor(&this->base)) { diff --git a/code/src/actors/flying_traps.h b/code/src/actors/flying_traps.h index 26f13213..d270e125 100644 --- a/code/src/actors/flying_traps.h +++ b/code/src/actors/flying_traps.h @@ -6,12 +6,12 @@ struct EnYukabyun; struct EnTuboTrap; -typedef void (*EnYukabyun_ActionFunc)(struct EnYukabyun* self, GlobalContext* globalCtx); -typedef void (*EnTuboTrap_ActionFunc)(struct EnTuboTrap* self, GlobalContext* globalCtx); +typedef void (*EnYukabyunActionFunc)(struct EnYukabyun* this, GlobalContext* globalCtx); +typedef void (*EnTuboTrapActionFunc)(struct EnTuboTrap* this, GlobalContext* globalCtx); typedef struct EnYukabyun { /* 0x0000 */ Actor base; - /* 0x01A4 */ EnYukabyun_ActionFunc actionFunc; + /* 0x01A4 */ EnYukabyunActionFunc actionFunc; /* 0x01A8 */ s16 waitCounter; /* 0x01AA */ char unk_1AA[0x2]; /* 0x01AC */ ColliderCylinder* collider; @@ -20,7 +20,7 @@ typedef struct EnYukabyun { typedef struct EnTuboTrap { /* 0x0000 */ Actor base; - /* 0x01A4 */ EnTuboTrap_ActionFunc actionFunc; + /* 0x01A4 */ EnTuboTrapActionFunc actionFunc; /* 0x01A8 */ f32 targetY; /* 0x01AC */ Vec3f originPos; /* 0x01B8 */ ColliderCylinder* collider; diff --git a/code/src/actors/ganondorf.c b/code/src/actors/ganondorf.c index 02a3e765..461b0b8e 100644 --- a/code/src/actors/ganondorf.c +++ b/code/src/actors/ganondorf.c @@ -1,7 +1,7 @@ #include "z3D/z3D.h" #include "ganondorf.h" -#define BossGanon_Update ((ActorFunc)GAME_ADDR(0x242A94)) +void BossGanon_Update(Actor* thisx, GlobalContext* globalCtx); void BossGanon_rUpdate(Actor* thisx, GlobalContext* globalCtx) { s16 prevHealthAccumulator = gSaveContext.healthAccumulator; diff --git a/code/src/actors/ganondorf_organ.c b/code/src/actors/ganondorf_organ.c index d507d5b5..e72ac7f4 100644 --- a/code/src/actors/ganondorf_organ.c +++ b/code/src/actors/ganondorf_organ.c @@ -1,6 +1,6 @@ #include "z3D/z3D.h" -#define EnGanonOrgan_Init ((ActorFunc)GAME_ADDR(0x280E0C)) +void EnGanonOrgan_Init(Actor* thisx, GlobalContext* globalCtx); void EnGanonOrgan_rInit(Actor* organ, GlobalContext* globalCtx) { gSaveContext.eventChkInf[12] &= ~0x80; diff --git a/code/src/actors/gerudos.c b/code/src/actors/gerudos.c index ac22bcd0..24f31f21 100644 --- a/code/src/actors/gerudos.c +++ b/code/src/actors/gerudos.c @@ -3,14 +3,14 @@ #include "gerudos.h" -#define EnGe1_Init ((ActorFunc)GAME_ADDR(0x18B218)) -#define EnGe1_Update ((ActorFunc)GAME_ADDR(0x1D742C)) +void EnGe1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGe1_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnGe1_TalkAfterGame_Archery ((ActorFunc)GAME_ADDR(0x12A5C8)) +void EnGe1_TalkAfterGame_Archery(Actor* thisx, GlobalContext* globalCtx); -#define EnGeldB_Init ((ActorFunc)GAME_ADDR(0x1D7BD8)) -#define EnGeldB_Update ((ActorFunc)GAME_ADDR(0x14A04C)) -#define EnGeldB_Draw ((ActorFunc)GAME_ADDR(0x1B2B00)) +void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx); void EnGe1_rInit(Actor* thisx, GlobalContext* globalCtx) { EnGe1* self = (EnGe1*)thisx; diff --git a/code/src/actors/gohma.h b/code/src/actors/gohma.h index 0585f44c..2d930e88 100644 --- a/code/src/actors/gohma.h +++ b/code/src/actors/gohma.h @@ -4,9 +4,8 @@ #include "z3D/z3D.h" struct EnGoma; -typedef void (*EnGomaActionFunc)(struct EnGoma*, GlobalContext*); -#define EnGoma_SetupHatch ((EnGomaActionFunc)GAME_ADDR(0x1741C8)) +typedef void (*EnGomaActionFunc)(struct EnGoma*, GlobalContext*); typedef struct EnGoma { /* 0x0000 */ Actor base; @@ -16,4 +15,6 @@ typedef struct EnGoma { } EnGoma; _Static_assert(sizeof(EnGoma) == 0x81C, "EnGoma size"); +void EnGoma_SetupHatch(EnGoma* this, GlobalContext* globalCtx); + #endif //_GOHMA_H_ diff --git a/code/src/actors/gorons.c b/code/src/actors/gorons.c index 01a47641..e247c4f3 100644 --- a/code/src/actors/gorons.c +++ b/code/src/actors/gorons.c @@ -4,7 +4,7 @@ #include "gorons.h" -#define EnGo2_SetGetItem ((EnGo2_ActionFunc)GAME_ADDR(0x133EBC)) +void EnGo2_SetGetItem(EnGo2* this, GlobalContext* globalCtx); void EnGo2_rBiggoronSetTextId(EnGo2* self) { Player* player = PLAYER; diff --git a/code/src/actors/gorons.h b/code/src/actors/gorons.h index 4739fb76..30511b4b 100644 --- a/code/src/actors/gorons.h +++ b/code/src/actors/gorons.h @@ -5,7 +5,7 @@ struct EnGo2; -typedef void (*EnGo2_ActionFunc)(struct EnGo2* self, GlobalContext* globalCtx); +typedef void (*EnGo2ActionFunc)(struct EnGo2* this, GlobalContext* globalCtx); #define BIGGORON_TRADED_CLAIM_CHECK (1 << 0) #define BIGGORON_TRADED_EYEDROPS (1 << 1) @@ -14,7 +14,7 @@ typedef void (*EnGo2_ActionFunc)(struct EnGo2* self, GlobalContext* globalCtx); typedef struct EnGo2 { /* 0x0000 */ Actor actor; /* 0x01A4 */ char unk_1A4[0xA18]; - /* 0x0BBC */ EnGo2_ActionFunc actionFunc; + /* 0x0BBC */ EnGo2ActionFunc actionFunc; /* 0x0BC0 */ char unk_BC0[0x338]; /* 0x0EF8 */ s32 getItemId; /* 0x0EFC */ char unk_EFC[0xC]; diff --git a/code/src/actors/gossip_stone.c b/code/src/actors/gossip_stone.c index dc766eae..62a7174c 100644 --- a/code/src/actors/gossip_stone.c +++ b/code/src/actors/gossip_stone.c @@ -1,7 +1,7 @@ #include "gossip_stone.h" #include "z3D/z3D.h" -#define EnGs_Init ((ActorFunc)GAME_ADDR(0x16461C)) +void EnGs_Init(Actor* thisx, GlobalContext* globalCtx); void EnGs_rInit(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/graveyard_objects.c b/code/src/actors/graveyard_objects.c index 07d25b04..3c78c2cc 100644 --- a/code/src/actors/graveyard_objects.c +++ b/code/src/actors/graveyard_objects.c @@ -3,9 +3,9 @@ #define CsTimer (gGlobalContext->csCtx.frames) -#define BgSpot02Objects_Update ((ActorFunc)GAME_ADDR(0x3831AC)) +void BgSpot02Objects_Update(Actor* thisx, GlobalContext* globalCtx); -#define BgSpot02Objects_Explode (void*)GAME_ADDR(0x205EDC) +void BgSpot02Objects_Explode(BgSpot02Objects* this, GlobalContext* globalCtx); void BgSpot02Objects_rUpdate(Actor* thisx, GlobalContext* globalCtx) { BgSpot02Objects_Update(thisx, globalCtx); @@ -20,9 +20,9 @@ void BgSpot02Objects_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } } -void BgSpot02Objects_ExplodeGrave(BgSpot02Objects* thisx) { - PlaySFX(0x1000219, &thisx->base.world.pos, 4, (f32*)GAME_ADDR(0x54AC20), (f32*)GAME_ADDR(0x54AC20), - (s8*)GAME_ADDR(0x54AC24)); // NA_SE_EV_GRAVE_EXPLOSION - thisx->timer = 38; - thisx->action_fn = BgSpot02Objects_Explode; +void BgSpot02Objects_ExplodeGrave(BgSpot02Objects* this) { + PlaySFX(0x1000219, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); // NA_SE_EV_GRAVE_EXPLOSION + this->timer = 38; + this->action_fn = BgSpot02Objects_Explode; } diff --git a/code/src/actors/graveyard_objects.h b/code/src/actors/graveyard_objects.h index de30c33f..22a5b4a1 100644 --- a/code/src/actors/graveyard_objects.h +++ b/code/src/actors/graveyard_objects.h @@ -3,14 +3,18 @@ #include "z3D/z3D.h" -typedef struct { +struct BgSpot02Objects; + +typedef void (*BgSpot02ObjectsActionFunc)(struct BgSpot02Objects* this, GlobalContext* globalCtx); + +typedef struct BgSpot02Objects { Actor base; char dyna[24]; - void* action_fn; + BgSpot02ObjectsActionFunc action_fn; s16 timer; } BgSpot02Objects; void BgSpot02Objects_rUpdate(Actor* thisx, GlobalContext* globalCtx); -void BgSpot02Objects_ExplodeGrave(BgSpot02Objects* thisx); +void BgSpot02Objects_ExplodeGrave(BgSpot02Objects* this); #endif //_GRAVEYARD_OBJECTS_H_ diff --git a/code/src/actors/grog.c b/code/src/actors/grog.c index 05d0ba38..37033dbd 100644 --- a/code/src/actors/grog.c +++ b/code/src/actors/grog.c @@ -3,7 +3,7 @@ #include "grog.h" -#define EnHs_ActionAfterTradeCojiro ((EnHs_ActionFunc)GAME_ADDR(0x3B02C0)) +void EnHs_ActionAfterTradeCojiro(EnHs* this, GlobalContext* globalCtx); void EnHs_CheckForShouldDespawn(EnHs* self) { if ((gSettingsContext.shuffleAdultTradeQuest == SHUFFLEADULTTRADEQUEST_ON) && diff --git a/code/src/actors/grog.h b/code/src/actors/grog.h index c775b6a9..5725f9f2 100644 --- a/code/src/actors/grog.h +++ b/code/src/actors/grog.h @@ -5,14 +5,14 @@ struct EnHs; -typedef void (*EnHs_ActionFunc)(struct EnHs* self, GlobalContext* globalCtx); +typedef void (*EnHsActionFunc)(struct EnHs* this, GlobalContext* globalCtx); typedef struct EnHs { /* 0x0000 */ Actor actor; /* 0x01A4 */ char unk_1A4[0x560]; /* 0x0704 */ u16 unk_704; /* 0x0706 */ char unk_706[0x2]; - /* 0x0708 */ EnHs_ActionFunc actionFunc; + /* 0x0708 */ EnHsActionFunc actionFunc; /* 0x070C */ char unk_70C[0x8]; } EnHs; // size = 0x714 diff --git a/code/src/actors/gtg_gate.c b/code/src/actors/gtg_gate.c index 488a6392..d16e8c83 100644 --- a/code/src/actors/gtg_gate.c +++ b/code/src/actors/gtg_gate.c @@ -1,9 +1,8 @@ #include "gtg_gate.h" #include "settings.h" -#define BgSpot12Saku_Update ((ActorFunc)GAME_ADDR(0x29E030)) - -#define BgSpot12Saku_Init ((ActorFunc)GAME_ADDR(0x27AD6C)) +void BgSpot12Saku_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Saku_Init(Actor* thisx, GlobalContext* globalCtx); void BgSpot12Saku_rUpdate(Actor* thisx, GlobalContext* globalCtx) { // If ER is on, when the guard opens the GtG gate its permanent flag will be set. diff --git a/code/src/actors/guay.c b/code/src/actors/guay.c index 01c889d7..c36a3a70 100644 --- a/code/src/actors/guay.c +++ b/code/src/actors/guay.c @@ -1,9 +1,9 @@ #include "guay.h" #include "settings.h" -#define EnCrow_Update ((ActorFunc)GAME_ADDR(0x1F4D40)) +void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnCrow_Respawn ((EnCrowActionFunc)GAME_ADDR(0x158648)) +void EnCrow_Respawn(EnCrow* this, GlobalContext* globalCtx); #define sDefaultColliderRadius 20 diff --git a/code/src/actors/heart_container.c b/code/src/actors/heart_container.c index e2df3047..b6adb9e7 100644 --- a/code/src/actors/heart_container.c +++ b/code/src/actors/heart_container.c @@ -2,13 +2,10 @@ #include "z3D/actors/z_item_b_heart.h" #include "models.h" -#define ItemBHeart_Init ((ActorFunc)GAME_ADDR(0x25375C)) - -#define ItemBHeart_Destroy ((ActorFunc)GAME_ADDR(0x2537D4)) - -#define ItemBHeart_Update ((ActorFunc)GAME_ADDR(0x285C18)) - -#define ItemBHeart_Draw ((ActorFunc)GAME_ADDR(0x285BEC)) +void ItemBHeart_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemBHeart_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx); +void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx); #define THIS ((ItemBHeart*)thisx) diff --git a/code/src/actors/hookshot.c b/code/src/actors/hookshot.c index b7378c20..d647f5eb 100644 --- a/code/src/actors/hookshot.c +++ b/code/src/actors/hookshot.c @@ -2,9 +2,9 @@ #include "hookshot.h" #include "settings.h" -#define ArmsHook_Init ((ActorFunc)GAME_ADDR(0x1EBF84)) +void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx); -#define HookshotRotation (f32*)GAME_ADDR(0x4C257C) +extern f32 HookshotRotation; void ArmsHook_rInit(Actor* thisx, GlobalContext* globalCtx) { ArmsHook_Init(thisx, globalCtx); @@ -16,5 +16,5 @@ void ArmsHook_rInit(Actor* thisx, GlobalContext* globalCtx) { } f32 Hookshot_GetZRotation(void) { - return gSaveContext.linkAge == AGE_ADULT ? *HookshotRotation : -1.4; // TODO find position and lower that + return gSaveContext.linkAge == AGE_ADULT ? HookshotRotation : -1.4; // TODO find position and lower that } diff --git a/code/src/actors/iron_knuckle.c b/code/src/actors/iron_knuckle.c index e93cc28d..b6029445 100644 --- a/code/src/actors/iron_knuckle.c +++ b/code/src/actors/iron_knuckle.c @@ -1,8 +1,8 @@ #include "iron_knuckle.h" #include "settings.h" -#define EnIk_Init ((ActorFunc)GAME_ADDR(0x164B0C)) -#define EnIk_UpdateEnemy ((ActorFunc)GAME_ADDR(0x1008B4)) +void EnIk_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIk_UpdateEnemy(Actor* thisx, GlobalContext* globalCtx); void EnIk_Update_Randomized(Actor* thisx, GlobalContext* globalCtx) { EnIk_UpdateEnemy(thisx, globalCtx); diff --git a/code/src/actors/item00.c b/code/src/actors/item00.c index b3502b8e..56015cd8 100644 --- a/code/src/actors/item00.c +++ b/code/src/actors/item00.c @@ -6,17 +6,14 @@ #include "common.h" #include "savefile.h" -#define EnItem00_Init ((ActorFunc)GAME_ADDR(0x1F69B4)) - -#define EnItem00_Destroy ((ActorFunc)GAME_ADDR(0x1F706C)) - -#define EnItem00_Update ((ActorFunc)GAME_ADDR(0x22B71C)) - -#define EnItem00_Draw ((ActorFunc)GAME_ADDR(0x22B6C0)) +void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx); +void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx); +void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx); #define THIS ((EnItem00*)thisx) -#define EnItem00_Collected ((void*)GAME_ADDR(0x2B175C)) +void EnItem00_Collected(EnItem00* this, GlobalContext* globalCtx); void EnItem00_rInit(Actor* thisx, GlobalContext* globalCtx) { EnItem00* item = THIS; diff --git a/code/src/actors/item_etcetera.c b/code/src/actors/item_etcetera.c index d628016a..4dd676cb 100644 --- a/code/src/actors/item_etcetera.c +++ b/code/src/actors/item_etcetera.c @@ -3,13 +3,10 @@ #include "models.h" #include "settings.h" -#define ItemEtcetera_Init ((ActorFunc)GAME_ADDR(0x273F28)) - -#define ItemEtcetera_Destroy ((ActorFunc)GAME_ADDR(0x2740BC)) - -#define ItemEtcetera_Update ((ActorFunc)GAME_ADDR(0x298D88)) - -#define ItemEtcetera_Draw ((ActorFunc)GAME_ADDR(0x11707C)) +void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemEtcetera_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemEtcetera_Update(Actor* thisx, GlobalContext* globalCtx); +void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx); #define THIS ((ItemEtcetera*)thisx) diff --git a/code/src/actors/jabu.c b/code/src/actors/jabu.c index 317b8e1b..b5275b93 100644 --- a/code/src/actors/jabu.c +++ b/code/src/actors/jabu.c @@ -3,7 +3,7 @@ #include "entrance.h" #include "grotto.h" -#define BgBdanSwitch_Init ((ActorFunc)GAME_ADDR(0x276508)) +void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx); void Jabu_SkipOpeningCutscene(void) { gGlobalContext->nextEntranceIndex = Entrance_OverrideNextIndex(0x0028); diff --git a/code/src/actors/king_zora.c b/code/src/actors/king_zora.c index d0c1d2bb..634a9827 100644 --- a/code/src/actors/king_zora.c +++ b/code/src/actors/king_zora.c @@ -3,7 +3,7 @@ #include "king_zora.h" #include "common.h" -#define EnKz_Update ((ActorFunc)GAME_ADDR(0x1B66F8)) +void EnKz_Update(Actor* thisx, GlobalContext* globalCtx); u32 EnKz_CheckMovedFlag(void) { if ((gSaveContext.eventChkInf[3] & 0x8) || diff --git a/code/src/actors/lake_hylia_objects.c b/code/src/actors/lake_hylia_objects.c index a618c3cf..17081d1a 100644 --- a/code/src/actors/lake_hylia_objects.c +++ b/code/src/actors/lake_hylia_objects.c @@ -2,9 +2,8 @@ #include "lake_hylia_objects.h" #include "objects.h" -#define BgSpot06Objects_Update ((ActorFunc)GAME_ADDR(0x3833F8)) - -#define BgSpot06Objects_Destroy ((ActorFunc)GAME_ADDR(0x2AD1E4)) +void BgSpot06Objects_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot06Objects_Destroy(Actor* thisx, GlobalContext* globalCtx); static u8 actionCounter = 0; // used to perform some actions on subsequent frames static s8 waterMovement = 0; // to be used when implementing moving water plane diff --git a/code/src/actors/leever.c b/code/src/actors/leever.c index 24f6ba74..a20335e2 100644 --- a/code/src/actors/leever.c +++ b/code/src/actors/leever.c @@ -1,8 +1,8 @@ #include "leever.h" #include "settings.h" -#define EnReeba_SetupSurface ((EnReebaActionFunc)GAME_ADDR(0x181394)) -#define EnReeba_Die ((EnReebaActionFunc)GAME_ADDR(0x3D4CB0)) +void EnReeba_SetupSurface(EnReeba* this, GlobalContext* globalCtx); +void EnReeba_Die(EnReeba* this, GlobalContext* globalCtx); s32 Leever_ShouldSurviveOutsideSand(Actor* actor) { return Enemizer_IsEnemyRandomized(ENEMY_LEEVER) && diff --git a/code/src/actors/liftable_rock.c b/code/src/actors/liftable_rock.c index 70d6aa03..f4644279 100644 --- a/code/src/actors/liftable_rock.c +++ b/code/src/actors/liftable_rock.c @@ -2,11 +2,10 @@ #include "settings.h" #include "multiplayer.h" -#define EnIshi_Init ((ActorFunc)GAME_ADDR(0x1B5460)) +void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIshi_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnIshi_Update ((ActorFunc)GAME_ADDR(0x1F69AC)) - -#define EnIshi_LiftedUp (void*)GAME_ADDR(0x3CBAC4) +void EnIshi_LiftedUp(EnIshi* this, GlobalContext* globalCtx); void EnIshi_rInit(Actor* thisx, GlobalContext* globalCtx) { @@ -21,13 +20,15 @@ void EnIshi_rInit(Actor* thisx, GlobalContext* globalCtx) { } } -void EnIshi_rUpdate(EnIshi* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; +void EnIshi_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + EnIshi* this = (EnIshi*)thisx; + + EnIshiActionFunc prev_action_fn = this->action_fn; EnIshi_Update((Actor*)thisx, globalCtx); - s16 type = thisx->base.params & 0x1; - if (type == LARGE_ROCK && prev_action_fn != thisx->action_fn && thisx->action_fn == EnIshi_LiftedUp) { + s16 type = thisx->params & 0x1; + if (type == LARGE_ROCK && prev_action_fn != this->action_fn && this->action_fn == EnIshi_LiftedUp) { Multiplayer_Send_ActorUpdate((Actor*)thisx, NULL, 0); } } diff --git a/code/src/actors/liftable_rock.h b/code/src/actors/liftable_rock.h index 6f78a51b..c9277be9 100644 --- a/code/src/actors/liftable_rock.h +++ b/code/src/actors/liftable_rock.h @@ -6,14 +6,18 @@ #include "../include/z3D/z3D.h" -typedef struct { +struct EnIshi; + +typedef void (*EnIshiActionFunc)(struct EnIshi* this, GlobalContext* globalCtx); + +typedef struct EnIshi { Actor base; - void* action_fn; + EnIshiActionFunc action_fn; char collider[88]; SkeletonAnimationModel* animation_model; } EnIshi; void EnIshi_rInit(Actor* thisx, GlobalContext* globalCtx); -void EnIshi_rUpdate(EnIshi* thisx, GlobalContext* globalCtx); +void EnIshi_rUpdate(Actor* thisx, GlobalContext* globalCtx); #endif //_LIFTABLE_ROCK_H_ diff --git a/code/src/actors/link_puppet.c b/code/src/actors/link_puppet.c index ef8824a9..7a4a5d5b 100644 --- a/code/src/actors/link_puppet.c +++ b/code/src/actors/link_puppet.c @@ -10,17 +10,22 @@ // Draw at most three extra Links. More can cause graphical issues that persist until game restart. #define MAX_PUPPETS_AT_ONCE 3 +void EnLinkPuppet_Init(Actor* thisx, GlobalContext* globalCtx); +void EnLinkPuppet_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnLinkPuppet_Update(Actor* thisx, GlobalContext* globalCtx); +void EnLinkPuppet_Draw(Actor* thisx, GlobalContext* globalCtx); + ActorInit EnLinkPuppet_InitVars = { - 0x1, // ID - ACTORTYPE_NPC, // Type - 0xFF, // Room - 0x2000410, // Flags - 21, // Object ID (20: Adult, 21: Child) - sizeof(EnLinkPuppet), // - (ActorFunc)EnLinkPuppet_Init, // - (ActorFunc)EnLinkPuppet_Destroy, // - (ActorFunc)EnLinkPuppet_Update, // - (ActorFunc)EnLinkPuppet_Draw, // + 0x1, // ID + ACTORTYPE_NPC, // Type + 0xFF, // Room + 0x2000410, // Flags + 21, // Object ID (20: Adult, 21: Child) + sizeof(EnLinkPuppet), + EnLinkPuppet_Init, + EnLinkPuppet_Destroy, + EnLinkPuppet_Update, + EnLinkPuppet_Draw, }; static ColliderCylinderInit EnLinkPupper_ColliderCylinderInit = { @@ -43,15 +48,15 @@ static ColliderCylinderInit EnLinkPupper_ColliderCylinderInit = { { 12.0f, 50.0f, 0.0f, { 0.0f, 0.0f, 0.0f } }, }; -typedef void (*SkelAnime_InitLink_proc)(SkelAnime* skelAnime, ZARInfo* zarInfo, GlobalContext* globalCtx, void* cmbMan, - void* param_5, u32 animation, s32 limbBufCount, void* jointTable, - void* morphTable); -#define SkelAnime_InitLink ((SkelAnime_InitLink_proc)GAME_ADDR(0x3413EC)) +void SkelAnime_InitLink(SkelAnime* skelAnime, ZARInfo* zarInfo, GlobalContext* globalCtx, void* cmbMan, void* param_5, + u32 animation, s32 limbBufCount, void* jointTable, void* morphTable); // When posing the model by copying the joint table, the model for some reason gets raised about 12 units. static const f32 childOffsetY = 12.5f; -void EnLinkPuppet_Init(EnLinkPuppet* this, GlobalContext* globalCtx) { +void EnLinkPuppet_Init(Actor* thisx, GlobalContext* globalCtx) { + EnLinkPuppet* this = (EnLinkPuppet*)thisx; + this->base.room = -1; SkelAnime_InitLink(&this->skelAnime, PLAYER->zarInfo, globalCtx, PLAYER->cmbMan, this->base.unk_178, 0, 9, @@ -85,17 +90,20 @@ void EnLinkPuppet_Init(EnLinkPuppet* this, GlobalContext* globalCtx) { // Shadow f32 feetShadowScale = (this->ghostPtr->ghostData.age == 0) ? 90.0f : 60.0f; - ActorShape_Init(&this->base.shape, 0.0f, (void*)GAME_ADDR(0x1D04F4), feetShadowScale); + ActorShape_Init(&this->base.shape, 0.0f, ActorShadow_DrawFeet, feetShadowScale); } -typedef void (*SkelAnime_Free2_proc)(SkelAnime* anime); -#define SkelAnime_Free2 ((SkelAnime_Free2_proc)GAME_ADDR(0x350BE0)) +void SkelAnime_Free2(SkelAnime* anime); + +void EnLinkPuppet_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnLinkPuppet* this = (EnLinkPuppet*)thisx; -void EnLinkPuppet_Destroy(EnLinkPuppet* this, GlobalContext* globalCtx) { SkelAnime_Free2(&this->skelAnime); } -void EnLinkPuppet_Update(EnLinkPuppet* this, GlobalContext* globalCtx) { +void EnLinkPuppet_Update(Actor* thisx, GlobalContext* globalCtx) { + EnLinkPuppet* this = (EnLinkPuppet*)thisx; + if (!this->ghostPtr->inUse || !this->ghostPtr->isInGame || this->ghostPtr->ghostData.currentScene != gGlobalContext->sceneNum) { Actor_Kill(&this->base); @@ -141,19 +149,20 @@ void EnLinkPuppet_Update(EnLinkPuppet* this, GlobalContext* globalCtx) { } } -#define Vec3f_PlayerFeet_unk ((Vec3f*)GAME_ADDR(0x53CACC)) void EnLinkPuppet_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, nn_math_MTX34* mtx, EnLinkPuppet* this) { + extern Vec3f Vec3f_PlayerFeet_unk[]; if (limbIndex != 0x15) { Actor_SetFeetPos((Actor*)this, mtx, limbIndex, 5, &Vec3f_PlayerFeet_unk[gSaveContext.linkAge], 8, &Vec3f_PlayerFeet_unk[gSaveContext.linkAge]); } } -typedef void (*SkelAnime_DrawOpa_proc)(SkelAnime* skelAnime, nn_math_MTX34* modelMtx, void* overrideLimbDraw, - void* postLimbDraw, Actor* param_5, u32 param_6); -#define SkelAnime_DrawOpa ((SkelAnime_DrawOpa_proc)GAME_ADDR(0x35E240)) +void SkelAnime_DrawOpa(SkelAnime* skelAnime, nn_math_MTX34* modelMtx, void* overrideLimbDraw, void* postLimbDraw, + Actor* param_5, u32 param_6); + +void EnLinkPuppet_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnLinkPuppet* this = (EnLinkPuppet*)thisx; -void EnLinkPuppet_Draw(EnLinkPuppet* this, GlobalContext* globalCtx) { // Check how many Link puppets already exist before this one. u8 linkPuppetCount = 0; Actor* firstActor = gGlobalContext->actorCtx.actorList[EnLinkPuppet_InitVars.type].first; diff --git a/code/src/actors/link_puppet.h b/code/src/actors/link_puppet.h index 141a8329..18830a71 100644 --- a/code/src/actors/link_puppet.h +++ b/code/src/actors/link_puppet.h @@ -13,9 +13,4 @@ typedef struct { extern ActorInit EnLinkPuppet_InitVars; -void EnLinkPuppet_Init(EnLinkPuppet* this, GlobalContext* globalCtx); -void EnLinkPuppet_Destroy(EnLinkPuppet* this, GlobalContext* globalCtx); -void EnLinkPuppet_Update(EnLinkPuppet* this, GlobalContext* globalCtx); -void EnLinkPuppet_Draw(EnLinkPuppet* this, GlobalContext* globalCtx); - #endif //_LINK_PUPPET_H_ diff --git a/code/src/actors/lizalfos.c b/code/src/actors/lizalfos.c index f0aa11bb..a89c73ae 100644 --- a/code/src/actors/lizalfos.c +++ b/code/src/actors/lizalfos.c @@ -1,7 +1,7 @@ #include "lizalfos.h" #include "settings.h" -#define EnZf_Update ((ActorFunc)GAME_ADDR(0x101C48)) +void EnZf_Update(Actor* thisx, GlobalContext* globalCtx); void EnZf_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnZf* this = (EnZf*)thisx; diff --git a/code/src/actors/malon.c b/code/src/actors/malon.c index 393f01ee..e826ddc1 100644 --- a/code/src/actors/malon.c +++ b/code/src/actors/malon.c @@ -1,6 +1,6 @@ #include "malon.h" -#define EnMa1_Init ((ActorFunc)GAME_ADDR(0x18C334)) +void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx); void EnMa1_rInit(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.eventChkInf[0x1] & 0x0010) { // If Talon has fled the castle... diff --git a/code/src/actors/moblin.c b/code/src/actors/moblin.c index 1f0c4755..a3534b39 100644 --- a/code/src/actors/moblin.c +++ b/code/src/actors/moblin.c @@ -3,11 +3,11 @@ #include "settings.h" #include "common.h" -#define EnMb_Init ((ActorFunc)GAME_ADDR(0x165BA4)) -#define EnMb_Update ((ActorFunc)GAME_ADDR(0x1B6D80)) +void EnMb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMb_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnMb_ClubWaitPlayerNear ((EnMbActionFunc)GAME_ADDR(0x10B5D0)) -#define EnMb_ClubAttack ((EnMbActionFunc)GAME_ADDR(0x136C68)) +void EnMb_ClubWaitPlayerNear(EnMb* this, GlobalContext* globalCtx); +void EnMb_ClubAttack(EnMb* this, GlobalContext* globalCtx); void EnMb_rInit(Actor* thisx, GlobalContext* globalCtx) { EnMb_Init(thisx, globalCtx); diff --git a/code/src/actors/nabooru.c b/code/src/actors/nabooru.c index 0185457c..16112bf6 100644 --- a/code/src/actors/nabooru.c +++ b/code/src/actors/nabooru.c @@ -1,7 +1,7 @@ #include "z3D/z3D.h" #include "nabooru.h" -#define EnNb_Draw ((ActorFunc)GAME_ADDR(0x1B7FBC)) +void EnNb_Draw(Actor* thisx, GlobalContext* globalCtx); void EnNb_rDraw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/obj_mure3.c b/code/src/actors/obj_mure3.c index 698155fa..cf50c1d3 100644 --- a/code/src/actors/obj_mure3.c +++ b/code/src/actors/obj_mure3.c @@ -3,7 +3,7 @@ u8 gIsObjMure3Updating = 0; // global variable for rupee circle rupee replacement. u8 gExtraCollectibleFlag = 0x40; // global variable for rupee circle rupee replacement. -#define ObjMure3_Update ((ActorFunc)GAME_ADDR(0x002318ac)) +void ObjMure3_Update(Actor* thisx, GlobalContext* globalCtx); void ObjMure3_rUpdate(Actor* thisx, GlobalContext* globalCtx) { gExtraCollectibleFlag = 0x40; diff --git a/code/src/actors/obj_switch.c b/code/src/actors/obj_switch.c index 4ee1c8a4..4ed4f993 100644 --- a/code/src/actors/obj_switch.c +++ b/code/src/actors/obj_switch.c @@ -2,7 +2,7 @@ #include "obj_switch.h" #include "settings.h" -#define ObjSwitch_Init ((ActorFunc)GAME_ADDR(0x215A14)) +void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx); void ObjSwitch_rInit(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/ocarina.c b/code/src/actors/ocarina.c index 92290246..b8831fde 100644 --- a/code/src/actors/ocarina.c +++ b/code/src/actors/ocarina.c @@ -2,11 +2,9 @@ #include "z3D/actors/z_item_ocarina.h" #include "models.h" -#define ItemOcarina_Init ((ActorFunc)GAME_ADDR(0x253818)) - -#define ItemOcarina_Destroy ((ActorFunc)GAME_ADDR(0x253A1C)) - -#define ItemOcarina_Draw ((ActorFunc)GAME_ADDR(0x285D48)) +void ItemOcarina_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemOcarina_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx); #define THIS ((ItemOcarina*)thisx) diff --git a/code/src/actors/owl.c b/code/src/actors/owl.c index 2ac1c9cc..3f87fdac 100644 --- a/code/src/actors/owl.c +++ b/code/src/actors/owl.c @@ -1,9 +1,8 @@ #include "z3D/z3D.h" #include "settings.h" -#define EnOwl_Init ((ActorFunc)GAME_ADDR(0x18DB28)) - -#define EnOwl_Update ((ActorFunc)GAME_ADDR(0x1DCB60)) +void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx); static u8 shortcutActivated = 0xFF; diff --git a/code/src/actors/peahat.c b/code/src/actors/peahat.c index 26c534e5..d19173dd 100644 --- a/code/src/actors/peahat.c +++ b/code/src/actors/peahat.c @@ -2,10 +2,10 @@ #include "settings.h" #include "enemy_souls.h" -#define EnPeehat_Update ((ActorFunc)GAME_ADDR(0x167644)) +void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnPeehat_StateAttackRecoil ((EnPeehatActionFunc)GAME_ADDR(0x2B2CC0)) -#define EnPeehat_Larva_StateSeekPlayer ((EnPeehatActionFunc)GAME_ADDR(0x391588)) +void EnPeehat_StateAttackRecoil(EnPeehat* this, GlobalContext* globalCtx); +void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, GlobalContext* globalCtx); #define STATE_SEEK_PLAYER 14 diff --git a/code/src/actors/player.c b/code/src/actors/player.c index 584ec673..3fdeffe6 100644 --- a/code/src/actors/player.c +++ b/code/src/actors/player.c @@ -14,18 +14,13 @@ #include "gloom.h" #include "savefile.h" -#define PlayerActor_Init ((ActorFunc)GAME_ADDR(0x191844)) +void PlayerActor_Init(Actor* thisx, GlobalContext* globalCtx); +void PlayerActor_Update(Actor* thisx, GlobalContext* globalCtx); +void PlayerActor_Destroy(Actor* thisx, GlobalContext* globalCtx); +void PlayerActor_Draw(Actor* thisx, GlobalContext* globalCtx); -#define PlayerActor_Update ((ActorFunc)GAME_ADDR(0x1E1B54)) - -#define PlayerActor_Destroy ((ActorFunc)GAME_ADDR(0x19262C)) - -#define PlayerActor_Draw ((ActorFunc)GAME_ADDR(0x4BF618)) - -#define Hookshot_ActorInit ((ActorInit*)GAME_ADDR(0x5108E8)) - -#define PlayerDListGroup_EmptySheathAdult ((void*)GAME_ADDR(0x53C4D8)) -#define PlayerDListGroup_EmptySheathChildWithHylianShield ((void*)GAME_ADDR(0x53C4DC)) +extern struct Unknown PlayerDListGroup_EmptySheathAdult; +extern struct Unknown PlayerDListGroup_EmptySheathChildWithHylianShield; #define OBJECT_LINK_OPENING 0x19F @@ -91,7 +86,7 @@ void PlayerActor_rInit(Actor* thisx, GlobalContext* globalCtx) { PLAYER->currentMask = storedMask; } if (gSettingsContext.hookshotAsChild) { - Hookshot_ActorInit->objectId = (gSaveContext.linkAge == 1 ? 0x1 : 0x14); + gActorOverlayTable[ACTOR_HOOKSHOT].initInfo->objectId = (gSaveContext.linkAge == 1 ? 0x1 : 0x14); } sPrevHealth = gSaveContext.health; @@ -158,9 +153,9 @@ void PlayerActor_rDraw(Actor* thisx, GlobalContext* globalCtx) { // For child, do this only with certain shields, because the game already handles the other cases. if (!(gSaveContext.equips.equipment & 0x000F)) { if (gSaveContext.linkAge == AGE_ADULT) { - PLAYER->sheathDLists = PlayerDListGroup_EmptySheathAdult; + PLAYER->sheathDLists = &PlayerDListGroup_EmptySheathAdult; } else if ((gSaveContext.equips.equipment & 0x00F0) >= 0x0020) { // Hylian or Mirror shield - PLAYER->sheathDLists = PlayerDListGroup_EmptySheathChildWithHylianShield; + PLAYER->sheathDLists = &PlayerDListGroup_EmptySheathChildWithHylianShield; } } @@ -170,10 +165,10 @@ void PlayerActor_rDraw(Actor* thisx, GlobalContext* globalCtx) { } f32 Player_GetSpeedMultiplier(void) { + void FUN_4BA378(Player * player, GlobalContext * globalCtx); f32 speedMultiplier = 1; - if (gSettingsContext.fastBunnyHood && PLAYER->currentMask == 4 && - PLAYER->stateFuncPtr == (void*)GAME_ADDR(0x4BA378)) { + if (gSettingsContext.fastBunnyHood && PLAYER->currentMask == 4 && PLAYER->stateFuncPtr == FUN_4BA378) { speedMultiplier *= 1.5; } diff --git a/code/src/actors/poe.c b/code/src/actors/poe.c index 5ee334b2..bd10a1f8 100644 --- a/code/src/actors/poe.c +++ b/code/src/actors/poe.c @@ -1,10 +1,10 @@ #include "poe.h" #include "settings.h" -#define EnPoh_Init ((ActorFunc)GAME_ADDR(0x18DF00)) -#define EnPoh_Update ((ActorFunc)GAME_ADDR(0x24D368)) -#define EnPoh_UpdateLiving ((ActorFunc)GAME_ADDR(0x1DD974)) -#define EnPoh_UpdateDead ((ActorFunc)GAME_ADDR(0x282E88)) +void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx); +void EnPoh_UpdateDead(Actor* thisx, GlobalContext* globalCtx); /** * Composer Brothers set some flags when they spawn and when the player talks to them. diff --git a/code/src/actors/pushblock.c b/code/src/actors/pushblock.c index 7d17383c..6738a763 100644 --- a/code/src/actors/pushblock.c +++ b/code/src/actors/pushblock.c @@ -1,7 +1,7 @@ #include "pushblock.h" #include "multiplayer.h" -#define ObjOshihiki_Update ((ActorFunc)GAME_ADDR(0x286520)) +void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx); void ObjOshihiki_rUpdate(Actor* thisx, GlobalContext* globalCtx) { Vec3f prevPos = thisx->world.pos; @@ -14,7 +14,7 @@ void ObjOshihiki_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } } -#define BgSpot15Rrbox_Update ((ActorFunc)GAME_ADDR(0x2AD484)) +void BgSpot15Rrbox_Update(Actor* thisx, GlobalContext* globalCtx); void BgSpot15Rrbox_rUpdate(Actor* thisx, GlobalContext* globalCtx) { Vec3f prevPos = thisx->world.pos; diff --git a/code/src/actors/red_ice.c b/code/src/actors/red_ice.c index 9a8ef7d6..ca85ed31 100644 --- a/code/src/actors/red_ice.c +++ b/code/src/actors/red_ice.c @@ -6,7 +6,7 @@ #define ACTOR_EN_ARROW 0x16 #define ARROW_ICE 4 -#define BgIceShelter_Melt ((BgIceShelterActionFunc)GAME_ADDR(0x3F5F00)) +void BgIceShelter_Melt(BgIceShelter* this, GlobalContext* globalCtx); #define NA_SE_EV_ICE_MELT 0x10001F9 void RedIce_CheckIceArrow(Collider* at, Collider* ac) { diff --git a/code/src/actors/rupee_trap.c b/code/src/actors/rupee_trap.c index d07c8d33..61d2d62f 100644 --- a/code/src/actors/rupee_trap.c +++ b/code/src/actors/rupee_trap.c @@ -1,7 +1,7 @@ #include "z3D/z3D.h" #include "settings.h" -#define EnExRuppy_Update ((ActorFunc)GAME_ADDR(0x2689B8)) +void EnExRuppy_Update(Actor* thisx, GlobalContext* globalCtx); void EnExRuppy_rUpdate(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == 0x2 && thisx->xzDistToPlayer < 30.0f) { diff --git a/code/src/actors/shabom.h b/code/src/actors/shabom.h index ba424a6a..ef73d811 100644 --- a/code/src/actors/shabom.h +++ b/code/src/actors/shabom.h @@ -4,12 +4,8 @@ #include "z3D/z3D.h" struct EnBubble; -typedef void (*EnBubbleActionFunc)(struct EnBubble*, GlobalContext*); -#define EnBubble_Update ((ActorFunc)GAME_ADDR(0x228F24)) -#define EnBubble_Draw ((ActorFunc)GAME_ADDR(0x228CB4)) -#define EnBubble_Disappear ((EnBubbleActionFunc)GAME_ADDR(0x3B5190)) -#define EnBubble_Pop ((EnBubbleActionFunc)GAME_ADDR(0x1321A8)) +typedef void (*EnBubbleActionFunc)(struct EnBubble*, GlobalContext*); typedef struct EnBubble { /* 0x0000 */ Actor base; @@ -18,4 +14,10 @@ typedef struct EnBubble { /* 0x01C0 */ char unk_01C0[0x120]; } EnBubble; +void EnBubble_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBubble_Draw(Actor* thisx, GlobalContext* globalCtx); + +void EnBubble_Disappear(EnBubble* this, GlobalContext* globalCtx); +void EnBubble_Pop(EnBubble* this, GlobalContext* globalCtx); + #endif //_SHABOM_H_ diff --git a/code/src/actors/shadow_ship.c b/code/src/actors/shadow_ship.c index 189d0764..ad6f092d 100644 --- a/code/src/actors/shadow_ship.c +++ b/code/src/actors/shadow_ship.c @@ -2,16 +2,7 @@ #include "common.h" #include "settings.h" #include "enemizer.h" - -typedef struct { - Actor base; - char unk_1A4[60]; - SkelAnime anime; - char unk_264[6636]; - ActorFunc action_fn; -} EnTest; - -#define EnTest_Wait ((ActorFunc)GAME_ADDR(0x39D8CC)) +#include "z3D/actors/z_en_test.h" u8 ShadowShip_HasActiveStalfos(void) { if (gEnemizerLocationFlags.shadowShipStalfos) { diff --git a/code/src/actors/shooting_gallery_man.c b/code/src/actors/shooting_gallery_man.c index 4fcbede3..c7a73a7e 100644 --- a/code/src/actors/shooting_gallery_man.c +++ b/code/src/actors/shooting_gallery_man.c @@ -2,9 +2,8 @@ #include "entrance.h" #include "settings.h" -#define EnSyatekiMan_Init ((ActorFunc)GAME_ADDR(0x283F94)) - -#define EnSyatekiMan_Update ((ActorFunc)GAME_ADDR(0x2A60BC)) +void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiMan_Update(Actor* thisx, GlobalContext* globalCtx); void EnSyatekiMan_rInit(Actor* thisx, GlobalContext* globalCtx) { // If child is in the adult shooting gallery or adult in the child shooting gallery, then despawn the shooting diff --git a/code/src/actors/shops.c b/code/src/actors/shops.c index e5b239a6..084b197e 100644 --- a/code/src/actors/shops.c +++ b/code/src/actors/shops.c @@ -32,10 +32,10 @@ s32 Shop_CheckCanBuyBombchus(void) { s32 numShopItemsLoaded = 0; // Used to determine params. Reset this to 0 in ossan_destroy or smth -#define EnGirlA_Init ((ActorFunc)GAME_ADDR(0x1D7F20)) -#define EnGirlA_Draw ((ActorFunc)GAME_ADDR(0x210188)) +void EnGirlA_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGirlA_Draw(Actor* thisx, GlobalContext* globalCtx); -#define EnGirlA_InitializeItemAction ((EnGirlAActionFunc)GAME_ADDR(0x14D5C8)) +void EnGirlA_InitializeItemAction(EnGirlA* this, GlobalContext* globalCtx); void ShopsanityItem_Draw(Actor* itemx, GlobalContext* globalCtx); diff --git a/code/src/actors/shops.h b/code/src/actors/shops.h index 957f14c4..ca766256 100644 --- a/code/src/actors/shops.h +++ b/code/src/actors/shops.h @@ -140,7 +140,7 @@ typedef struct { /* 0x24 */ Vec3f modelPositionOffsets; } ShopItemEntry; // size 0x30 -#define EnGirlA_ShopItemEntries ((ShopItemEntry*)GAME_ADDR(0x524F50)) +extern ShopItemEntry EnGirlA_ShopItemEntries[]; void ShopsanityItem_Init(Actor* itemx, GlobalContext* globalCtx); void ShopsanityItem_SellOut(Actor* itemx, u16 index); // Used for multiplayer diff --git a/code/src/actors/skull_kid.c b/code/src/actors/skull_kid.c index 34d6378b..9223daf4 100644 --- a/code/src/actors/skull_kid.c +++ b/code/src/actors/skull_kid.c @@ -3,7 +3,7 @@ #include "enemy_souls.h" #include "enemizer.h" -#define EnSkj_Update ((ActorFunc)GAME_ADDR(0x1DE890)) +void EnSkj_Update(Actor* thisx, GlobalContext* globalCtx); void EnSkj_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnSkj* this = (EnSkj*)thisx; diff --git a/code/src/actors/skulltula.c b/code/src/actors/skulltula.c index 7cc56b8e..883b87a0 100644 --- a/code/src/actors/skulltula.c +++ b/code/src/actors/skulltula.c @@ -4,12 +4,12 @@ #include "common.h" #include "objects.h" -#define EnSw_Init ((ActorFunc)GAME_ADDR(0x1691C8)) -#define EnSw_Update ((ActorFunc)GAME_ADDR(0x1BB110)) +void EnSw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSw_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnSw_GoldSkulltulaDeath (void*)GAME_ADDR(0x3B91BC) -#define EnSw_WalltulaIdle ((void*)GAME_ADDR(0x3CDAAC)) -#define EnSw_SetupGoingHome ((void*)GAME_ADDR(0x3C2A50)) +void EnSw_GoldSkulltulaDeath(EnSw* this, GlobalContext* globalCtx); +void EnSw_WalltulaIdle(EnSw* this, GlobalContext* globalCtx); +void EnSw_SetupGoingHome(EnSw* this, GlobalContext* globalCtx); #define Skullwalltula_IsCloseToPlayer(walltula) \ (walltula->base.xzDistToPlayer < 250.0 && ABS(walltula->base.yDistToPlayer) < 50.0) @@ -211,7 +211,7 @@ void EnSw_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } } - void* prev_action_fn = this->action_fn; + EnSwActionFunc prev_action_fn = this->action_fn; // Fix rotation for the GS in the top room in Fire Temple MQ, which for some reason spawns upside down // if the MQ flag is not set and you enter the room from the door. @@ -235,22 +235,21 @@ void EnSw_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } } -typedef void (*FUN_00375B70_proc)(GlobalContext* globalCtx, Actor* actor); -#define FUN_00375B70 ((FUN_00375B70_proc)GAME_ADDR(0x375B70)) +void FUN_00375B70(GlobalContext* globalCtx, Actor* actor); -void EnSw_Kill(EnSw* thisx, GlobalContext* globalCtx) { - if (thisx->action_fn == EnSw_GoldSkulltulaDeath || (thisx->base.params & 0x4000 && !gSaveContext.nightFlag)) { +void EnSw_Kill(EnSw* this, GlobalContext* globalCtx) { + if (this->action_fn == EnSw_GoldSkulltulaDeath || (this->base.params & 0x4000 && !gSaveContext.nightFlag)) { return; } // TODO: Fix spin speed - thisx->unk_word2 = 24; - FUN_00375B70(globalCtx, &thisx->base); // Not needed? - thisx->base.colChkInfo.health = 0; - // thisx->anime.play_speed = 8.0; // Doesn't seem to matter - thisx->unk_float1 = 16.0; - thisx->deathTimer_maybe = 15; - thisx->unk_word1 = 1; - thisx->action_fn = EnSw_GoldSkulltulaDeath; + this->unk_word2 = 24; + FUN_00375B70(globalCtx, &this->base); // Not needed? + this->base.colChkInfo.health = 0; + // this->anime.play_speed = 8.0; // Doesn't seem to matter + this->unk_float1 = 16.0; + this->deathTimer_maybe = 15; + this->unk_word1 = 1; + this->action_fn = EnSw_GoldSkulltulaDeath; } // Return -1 to use vanilla check diff --git a/code/src/actors/skulltula.h b/code/src/actors/skulltula.h index 79806d27..0fb2f3a2 100644 --- a/code/src/actors/skulltula.h +++ b/code/src/actors/skulltula.h @@ -12,11 +12,15 @@ #define GS_ARRAY_INDEX(params) ((params & 0x1F00) >> 8) #define GS_BIT_FLAG(params) (params & 0xFF) -typedef struct { +struct EnSw; + +typedef void (*EnSwActionFunc)(struct EnSw*, GlobalContext* globalCtx); + +typedef struct EnSw { /* 0x000 */ Actor base; /* 0x1A4 */ SkelAnime anime; /* 0x228 */ char unk_228[0x478]; - /* 0x6A0 */ void* action_fn; + /* 0x6A0 */ EnSwActionFunc action_fn; /* 0x6A4 */ char collider[0x20]; /* 0x6C4 */ char jnt_sph_element[0x50]; /* 0x714 */ char unk_714[0x2E]; @@ -44,7 +48,7 @@ _Static_assert(sizeof(EnSw) == 0x830, "EnSw size"); void EnSw_rInit(Actor* thisx, GlobalContext* globalCtx); void EnSw_rUpdate(Actor* thisx, GlobalContext* globalCtx); -void EnSw_Kill(EnSw* thisx, GlobalContext* globalCtx); +void EnSw_Kill(EnSw*, GlobalContext* globalCtx); typedef enum { GS_PPT_ACTORENTRY, diff --git a/code/src/actors/skulltula_people.c b/code/src/actors/skulltula_people.c index a5f2af15..782dd0ec 100644 --- a/code/src/actors/skulltula_people.c +++ b/code/src/actors/skulltula_people.c @@ -1,6 +1,6 @@ #include "settings.h" -#define EnSsh_Update ((ActorFunc)GAME_ADDR(0x1DF0A4)) +void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx); void EnSsh_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnSsh_Update(thisx, globalCtx); diff --git a/code/src/actors/stalchild.c b/code/src/actors/stalchild.c index 04b0e9de..0116b710 100644 --- a/code/src/actors/stalchild.c +++ b/code/src/actors/stalchild.c @@ -2,7 +2,7 @@ #include "settings.h" #include "enemy_souls.h" -#define EnSkb_Update ((ActorFunc)GAME_ADDR(0x1DE320)) +void EnSkb_Update(Actor* thisx, GlobalContext* globalCtx); s32 Stalchild_CanDespawn(Actor* stalchild) { return !Enemizer_IsEnemyRandomized(ENEMY_STALCHILD) || diff --git a/code/src/actors/stalfos.c b/code/src/actors/stalfos.c index 6634fd8a..26ee4072 100644 --- a/code/src/actors/stalfos.c +++ b/code/src/actors/stalfos.c @@ -1,7 +1,7 @@ #include "stalfos.h" #include "settings.h" -#define EnTest_Update ((ActorFunc)GAME_ADDR(0x12E2D0)) +void EnTest_Update(Actor* thisx, GlobalContext* globalCtx); void EnTest_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnTest_Update(thisx, globalCtx); diff --git a/code/src/actors/stinger.c b/code/src/actors/stinger.c index 5ce17500..f2977297 100644 --- a/code/src/actors/stinger.c +++ b/code/src/actors/stinger.c @@ -2,9 +2,9 @@ #include "settings.h" #include "common.h" -#define EnEiyer_Update ((ActorFunc)GAME_ADDR(0x20F700)) +void EnEiyer_Update(Actor* thisx, GlobalContext* globalCtx); -#define EnEiyer_WanderUnderground ((EnEiyerActionFunc)GAME_ADDR(0x1CD1D4)) +void EnEiyer_WanderUnderground(EnEiyer* this, GlobalContext* globalCtx); void EnEiyer_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnEiyer* this = (EnEiyer*)thisx; diff --git a/code/src/actors/title_screen.c b/code/src/actors/title_screen.c index 695cf619..7e1db51b 100644 --- a/code/src/actors/title_screen.c +++ b/code/src/actors/title_screen.c @@ -3,7 +3,7 @@ #include "objects.h" #include "title_screen.h" -#define EnMag_Init ((ActorFunc)GAME_ADDR(0x18CBB8)) +void EnMag_Init(Actor* thisx, GlobalContext* globalCtx); u8 missingRomfsAlert = 0; s16 romfsAlertFrames = 0; diff --git a/code/src/actors/token.c b/code/src/actors/token.c index 619ba2ee..e862a9a9 100644 --- a/code/src/actors/token.c +++ b/code/src/actors/token.c @@ -2,18 +2,15 @@ #include "z3D/actors/z_en_si.h" #include "models.h" -#define EnSi_Init ((ActorFunc)GAME_ADDR(0x168A90)) +void EnSi_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSi_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx); -#define EnSi_Destroy ((ActorFunc)GAME_ADDR(0x168C3C)) - -#define EnSi_Update ((ActorFunc)GAME_ADDR(0x1BA0C8)) - -#define EnSi_Draw ((ActorFunc)GAME_ADDR(0x1BA050)) +void EnSi_DestroyAfterText(EnSi* this, GlobalContext* globalCtx); #define THIS ((EnSi*)thisx) -#define EnSi_DestroyAfterText (void*)GAME_ADDR(0x3D0544) - void EnSi_rInit(Actor* thisx, GlobalContext* globalCtx) { EnSi* token = THIS; @@ -41,13 +38,11 @@ void EnSi_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnSi_Update(&token->actor, globalCtx); } -typedef u32 (*EnSi_Draw_GetData_proc)(void); - void EnSi_rDraw(Actor* thisx, GlobalContext* globalCtx) { EnSi* token = THIS; - if (token->actionFunc != (EnSiActionFunc)GAME_ADDR(0x3D0544)) { - token->unk_20C[3] = ((EnSi_Draw_GetData_proc)GAME_ADDR(0x3695F8))() ? 0.0f : 2.0f; + if (token->actionFunc != EnSi_DestroyAfterText) { + token->unk_20C[3] = PauseContext_GetState() ? 0.0f : 2.0f; if (!Model_DrawByActor(&token->actor)) { EnSi_Draw(&token->actor, globalCtx); } diff --git a/code/src/actors/twinrova.c b/code/src/actors/twinrova.c index 2dfb95cb..aa6f53ab 100644 --- a/code/src/actors/twinrova.c +++ b/code/src/actors/twinrova.c @@ -1,15 +1,10 @@ #include "z3D/z3D.h" #include "twinrova.h" -#define Boss_Tw_Init ((ActorFunc)GAME_ADDR(0x1A7E18)) - -#define Boss_Tw_Update ((ActorFunc)GAME_ADDR(0x1EF880)) - -#define Boss_Tw_Draw ((ActorFunc)GAME_ADDR(0x1EEDF0)) - -#define Boss_Tw_Destroy ((ActorFunc)GAME_ADDR(0x1A88E8)) - -#define PlayActorMusic ((void (*)(u8 unk, u32 music))GAME_ADDR(0x36EC40)) +void Boss_Tw_Init(Actor* thisx, GlobalContext* globalCtx); +void Boss_Tw_Update(Actor* thisx, GlobalContext* globalCtx); +void Boss_Tw_Draw(Actor* thisx, GlobalContext* globalCtx); +void Boss_Tw_Destroy(Actor* thisx, GlobalContext* globalCtx); #define BOSS_BATTLE_BGM 0x1000589 @@ -32,7 +27,7 @@ void Boss_Tw_rUpdate(Actor* thisx, GlobalContext* globalCtx) { if (!fightStarted && pos.x > -100 && pos.x < 100 && pos.y > 200 && pos.z > -100 && pos.z < 100) { fightStarted = 1; - PlayActorMusic(0, BOSS_BATTLE_BGM); + SetEventBGM(0, BOSS_BATTLE_BGM); } if (fightStarted) { diff --git a/code/src/actors/web.c b/code/src/actors/web.c index 31081a86..78f1da92 100644 --- a/code/src/actors/web.c +++ b/code/src/actors/web.c @@ -1,39 +1,41 @@ #include "web.h" #include "multiplayer.h" -#define BgYdanSp_Update ((ActorFunc)GAME_ADDR(0x241EF8)) +void BgYdanSp_Update(Actor* thisx, GlobalContext* globalCtx); -#define BgYdanSp_FloorWebIdle (void*)GAME_ADDR(0x19A8EC) -#define BgYdanSp_WallWebIdle (void*)GAME_ADDR(0x181C88) -#define BgYdanSp_BurnFloorWeb (void*)GAME_ADDR(0x19A52C) -#define BgYdanSp_BurnWallWeb (void*)GAME_ADDR(0x181878) -#define BgYdanSp_FloorWebBreaking (void*)GAME_ADDR(0x1E8438) +void BgYdanSp_FloorWebIdle(BgYdanSp* this, GlobalContext* globalCtx); +void BgYdanSp_WallWebIdle(BgYdanSp* this, GlobalContext* globalCtx); +void BgYdanSp_BurnFloorWeb(BgYdanSp* this, GlobalContext* globalCtx); +void BgYdanSp_BurnWallWeb(BgYdanSp* this, GlobalContext* globalCtx); +void BgYdanSp_FloorWebBreaking(BgYdanSp* this, GlobalContext* globalCtx); -void BgYdanSp_rUpdate(BgYdanSp* thisx, GlobalContext* globalCtx) { - void* prev_action_fn = thisx->action_fn; +void BgYdanSp_rUpdate(Actor* thisx, GlobalContext* globalCtx) { + BgYdanSp* this = (BgYdanSp*)thisx; + + BgYdanSpActionFunc prev_action_fn = this->action_fn; // home.pos gets changed when the action_fn updates, so the previous has to be used. - Vec3f prevHomePos = thisx->base.home.pos; + Vec3f prevHomePos = this->base.home.pos; - BgYdanSp_Update((Actor*)thisx, globalCtx); + BgYdanSp_Update(thisx, globalCtx); - if (prev_action_fn != thisx->action_fn && + if (prev_action_fn != this->action_fn && (prev_action_fn == BgYdanSp_FloorWebIdle || prev_action_fn == BgYdanSp_WallWebIdle)) { - BgYdanSp_SendData sendData = { prevHomePos, thisx->action_fn }; - Multiplayer_Send_ActorUpdate((Actor*)thisx, &sendData, sizeof(BgYdanSp_SendData)); + BgYdanSp_SendData sendData = { prevHomePos, this->action_fn }; + Multiplayer_Send_ActorUpdate(thisx, &sendData, sizeof(BgYdanSp_SendData)); } } -void BgYdanSp_SetActionFn(BgYdanSp* thisx, void* new_action_fn) { - if (thisx->action_fn != BgYdanSp_FloorWebIdle && thisx->action_fn != BgYdanSp_WallWebIdle) { +void BgYdanSp_SetActionFn(BgYdanSp* this, BgYdanSpActionFunc new_action_fn) { + if (this->action_fn != BgYdanSp_FloorWebIdle && this->action_fn != BgYdanSp_WallWebIdle) { return; } if (new_action_fn == BgYdanSp_BurnFloorWeb || new_action_fn == BgYdanSp_BurnWallWeb) { - thisx->timer = 45; + this->timer = 45; } else if (new_action_fn == BgYdanSp_FloorWebBreaking) { - thisx->some_float = 200.0; - thisx->base.room = 0xFF; - thisx->base.flags |= 0x10; - thisx->timer = 60; + this->some_float = 200.0; + this->base.room = 0xFF; + this->base.flags |= 0x10; + this->timer = 60; } - thisx->action_fn = new_action_fn; + this->action_fn = new_action_fn; } diff --git a/code/src/actors/web.h b/code/src/actors/web.h index 7caaf9b6..8ad0e230 100644 --- a/code/src/actors/web.h +++ b/code/src/actors/web.h @@ -3,10 +3,14 @@ #include "z3D/z3D.h" -typedef struct { +struct BgYdanSp; + +typedef void (*BgYdanSpActionFunc)(struct BgYdanSp* this, GlobalContext* globalCtx); + +typedef struct BgYdanSp { Actor base; char dyna[24]; - void* action_fn; + BgYdanSpActionFunc action_fn; char unk_1C0[36]; f32 some_float; char unk_1E8[222]; @@ -15,10 +19,10 @@ typedef struct { typedef struct { Vec3f homePos; - void* action_fn; + BgYdanSpActionFunc action_fn; } BgYdanSp_SendData; -void BgYdanSp_rUpdate(BgYdanSp* thisx, GlobalContext* globalCtx); -void BgYdanSp_SetActionFn(BgYdanSp* thisx, void* new_action_fn); +void BgYdanSp_rUpdate(Actor* thisx, GlobalContext* globalCtx); +void BgYdanSp_SetActionFn(BgYdanSp* this, BgYdanSpActionFunc new_action_fn); #endif //_WEB_H_ diff --git a/code/src/actors/well_stone.c b/code/src/actors/well_stone.c index 5c4e22e2..220008a0 100644 --- a/code/src/actors/well_stone.c +++ b/code/src/actors/well_stone.c @@ -4,7 +4,7 @@ // This actor is the stone blocking bottom of the well as adult Link. This is // different from the stone blocking child Link from getting into the well // early during the day before the well water has been drained. -#define BgSpot01Idosoko_Init ((ActorFunc)GAME_ADDR(0x2AC7C8)) +void BgSpot01Idosoko_Init(Actor* thisx, GlobalContext* globalCtx); void BgSpot01Idosoko_rInit(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/well_water.c b/code/src/actors/well_water.c index 21709a59..00b8cfb2 100644 --- a/code/src/actors/well_water.c +++ b/code/src/actors/well_water.c @@ -2,7 +2,7 @@ #include "settings.h" // This actor is the water that blocks getting into Bottom of the Well as child -#define BgSpot01Idomizu_Init ((ActorFunc)GAME_ADDR(0x2AC704)) +void BgSpot01Idomizu_Init(Actor* thisx, GlobalContext* globalCtx); void BgSpot01Idomizu_rInit(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/actors/windmill_man.c b/code/src/actors/windmill_man.c index fa3ef241..438a9f66 100644 --- a/code/src/actors/windmill_man.c +++ b/code/src/actors/windmill_man.c @@ -3,7 +3,7 @@ #define CsTimer (gGlobalContext->csCtx.frames) -#define EnFu_Update ((ActorFunc)GAME_ADDR(0x1B1328)) +void EnFu_Update(Actor* thisx, GlobalContext* globalCtx); void EnFu_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnFu_Update(thisx, globalCtx); diff --git a/code/src/arrow.c b/code/src/arrow.c index 6f1b4773..b6c5dda9 100644 --- a/code/src/arrow.c +++ b/code/src/arrow.c @@ -3,12 +3,10 @@ #include "input.h" #include "settings.h" -typedef s32 (*NockArrowFunc)(Player* player, GlobalContext* globalCtx); -#define NockArrow ((NockArrowFunc)GAME_ADDR(0x33603C)) -typedef void (*PlayAnimFunc)(void* p1, void* p2, s32 anim); // I'm not quite sure what these params are -#define LinkAnimation_PlayOnce ((PlayAnimFunc)GAME_ADDR(0x3604F0)) -typedef void (*MagicResetFunc)(GlobalContext* globalCtx); -#define Magic_Reset ((MagicResetFunc)GAME_ADDR(0x34708C)) +s32 NockArrow(Player* player, GlobalContext* globalCtx); +// I'm not quite sure what these params are +void LinkAnimation_PlayOnce(void* p1, void* p2, s32 anim); +void Magic_Reset(GlobalContext* globalCtx); static const u8 arrowsSlots[] = { SLOT_BOW, SLOT_ARROW_FIRE, SLOT_ARROW_ICE, SLOT_ARROW_LIGHT }; static const u8 arrowsItems[] = { ITEM_BOW, ITEM_ARROW_FIRE, ITEM_ARROW_ICE, ITEM_ARROW_LIGHT }; diff --git a/code/src/asm/hooks.s b/code/src/asm/hooks.s index 8d9810f8..9a094640 100644 --- a/code/src/asm/hooks.s +++ b/code/src/asm/hooks.s @@ -300,11 +300,7 @@ HOOK StoreChildBButtonEquip push {r0-r12, lr} bl SaveFile_SaveChildBButton pop {r0-r12, lr} -.if _EUR_==1 - b 0x45F230 -.else - b 0x45F210 -.endif + b ret_StoreChildBButtonEquip HOOK LullabyCheckFlag push {r0-r12, lr} @@ -607,11 +603,7 @@ HOOK SunsSongEndCloseTextbox push {r0-r12, lr} bl Settings_SunsSongEndCloseTextbox pop {r0-r12, lr} -.if _EUR_==1 - b 0x45B538 -.else - b 0x45B518 -.endif + b ret_SunsSongEndCloseTextbox HOOK SetSpecialVoidOutRespawnFlag push {r0-r12, lr} @@ -802,11 +794,7 @@ HOOK SetBGMDayNight bl SetBGM pop {r1-r12, lr} push {r4-r6, lr} -.if _EUR_==1 - b 0x483CAC -.else - b 0x483C8C -.endif + b ret_SetBGMDayNight HOOK SetBGMEvent push {r0, r2-r12, lr} @@ -922,11 +910,7 @@ HOOK BeforeLoadGame push {r0-r12, lr} bl SaveFile_BeforeLoadGame pop {r0-r12, lr} -.if _EUR_==1 - b 0x4473A4 -.else - b 0x447384 -.endif + b ret_BeforeLoadGame HOOK AfterLoadGame push {r0-r12, lr} @@ -958,11 +942,7 @@ HOOK SaveMenuIgnoreOpen bl SaveMenu_IgnoreOpen cmp r0,#0x1 pop {r0-r12, lr} -.if _EUR_==1 - beq 0x42F294 -.else - beq 0x42F270 -.endif + addeq lr,lr,0xC bx lr HOOK GameOverStart @@ -987,12 +967,8 @@ HOOK PermadeathForceQuit bl Permadeath_GetOption cmp r0,#0x0 pop {r0-r12, lr} -.if _EUR_==1 - bne 0x459014 -.else - bne 0x458FF4 -.endif - bxeq lr + bne ret_PermadeathForceQuit + bx lr HOOK OverrideFogDuringGameplayInit push {r0-r12, lr} @@ -1009,30 +985,18 @@ HOOK FixItemsMenuSlotDuplication mov r4,#0xFF mov lr,#0xFF add r10,r10,#0x1 -.if _EUR_==1 - b 0x456BB4 -.else - b 0x456B94 -.endif + b ret_FixItemsMenuSlotDuplication HOOK PlayEntranceCutscene -.if _EUR_==1 - bgt 0x44F0C4 -.else - bgt 0x44F0A4 -.endif push {r0-r12, lr} - ldrb r0,[r5,#0x3] + @ r0=flag bl EntranceCutscene_ShouldPlay + eor r0,r0,#0x1 @ flip condition cmp r0,#0x0 pop {r0-r12, lr} -.if _EUR_==1 - beq 0x44F0C4 - b 0x44F08C -.else - beq 0x44F0A4 - b 0x44F06C -.endif + addne lr,lr,#0xC @ skip cutscene + bxne lr + b EventCheck @ original instruction HOOK SkipJabuOpeningCutscene ldrh r0,[r0,#0x0] @@ -1226,11 +1190,7 @@ HOOK Multiplayer_OnLoadFile push {r0-r12, lr} bl Multiplayer_OnFileLoad pop {r0-r12, lr} -.if _EUR_==1 - b 0x449F20 -.else - b 0x449F00 -.endif + bx lr HOOK SendDroppedBottleContents add r0,r0,#0x8C @@ -1356,25 +1316,16 @@ HOOK CurseTrapDizzyStick b 0x2FF258 HOOK CurseTrapDizzyButtons - push {r0,r3-r12,lr} - # R1 and R2 contain button status fields - # Apply the curse effect to both - push {r2} - cpy r0,r1 + add r4,r5,#0x4 + push {r0-r12,lr} + @ [R4+0] and [R4+4] contain button status fields + @ Apply the curse effect to both + add r0,r4,#0x0 bl IceTrap_RandomizeButtons - pop {r2} - push {r0} - cpy r0,r2 + add r0,r4,#0x4 bl IceTrap_RandomizeButtons - cpy r2,r0 - pop {r1} - pop {r0,r3-r12,lr} - stmia r0,{r1,r2,r3,r5,r6,r7,r8,r9,r10,r11,r12,lr} -.if _EUR_==1 - b 0x41AC04 -.else - b 0x41ABE0 -.endif + pop {r0-r12,lr} + bx lr HOOK CrouchStabHitbox push {r0-r12,lr} @@ -1560,12 +1511,8 @@ HOOK TargetReticleColor bl Fairy_SetTargetReticleColor cmp r0,#0x0 pop {r0-r12,lr} - bxeq lr @ no custom Navi colors, return to original code -.if _EUR_==1 @ colors applied, skip original code - b 0x47B308 -.else - b 0x47B2E8 -.endif + bxeq lr @ no custom Navi colors, return to original code + b ret_TargetReticleColor @ colors applied, skip original code HOOK TargetPointerColor ldr r0,[r6,#0x120] @@ -1575,12 +1522,8 @@ HOOK TargetPointerColor bl Fairy_SetTargetPointerColor cmp r0,#0x0 pop {r0-r12,lr} - bxeq lr @ no custom Navi colors, return to original code -.if _EUR_==1 @ colors applied, skip original code - b 0x47BB50 -.else - b 0x47BB30 -.endif + bxeq lr @ no custom Navi colors, return to original code + b ret_TargetPointerColor @ colors applied, skip original code HOOK ShadowShip_Speed add r0,r4,#0x6C @@ -1685,22 +1628,14 @@ HOOK OnActorSetup_SceneChange bxne lr # Iterate actor entry pointer and skip add r5,#0x10 -.if _EUR_==1 - b 0x4522C4 -.else - b 0x4522A4 -.endif + b ret_OnActorSetup_SceneChange HOOK AfterActorSetup_SceneChange strb r0,[r7,#0xC03] push {r0-r12, lr} bl ActorSetup_Extra pop {r0-r12, lr} -.if _EUR_==1 - b 0x4522DC -.else - b 0x4522BC -.endif + bx lr HOOK OnActorSetup_RoomChange cpy r4,r6 @@ -1714,22 +1649,14 @@ HOOK OnActorSetup_RoomChange bxne lr # Iterate actor entry pointer and skip add r6,#0x10 -.if _EUR_==1 - b 0x461444 -.else - b 0x461424 -.endif + b ret_OnActorSetup_RoomChange HOOK AfterActorSetup_RoomChange strb r10,[r8,#0xC03] push {r0-r12, lr} bl ActorSetup_Extra pop {r0-r12, lr} -.if _EUR_==1 - b 0x461458 -.else - b 0x461438 -.endif + bx lr HOOK RandomGsLoc_CustomTangibilityCheck sub sp,sp,#0x18 diff --git a/code/src/asm/patches.s b/code/src/asm/patches.s index 50afd081..13044eba 100644 --- a/code/src/asm/patches.s +++ b/code/src/asm/patches.s @@ -261,11 +261,7 @@ PATCH RequiemLocation PATCH NocturneLocation bl Cutscene_OverrideNocturne -.if _EUR_==1 - b 0x44F1A0 -.else - b 0x44F180 -.endif + b ret_NocturneLocation PATCH FreeScarecrow bl hook_ScarecrowCheckToBeActivated @@ -791,19 +787,11 @@ PATCH FWGetSet PATCH SetSavewarpEntrance bl hook_SetSavewarpEntrance -.if _EUR_==1 - b 0x44FD00 -.else - b 0x44FCE0 -.endif + b ret_SetSavewarpEntrance PATCH SetGameOverEntrance bl hook_SetGameOverEntrance -.if _EUR_==1 - b 0x458EE8 -.else - b 0x458EC8 -.endif + b ret_SetGameOverEntrance PATCH SetGameOverRespawnFlag bl hook_SetGameOverRespawnFlag @@ -1002,25 +990,13 @@ PATCH SkipMasterSwordFanfare bl hook_SkipMasterSwordFanfare PATCH GameOverDontSpoilTradeItems -.if _EUR_==1 - b 0x458CC0 -.else - b 0x458CA0 -.endif + b ret_GameOverDontSpoilTradeItems PATCH InterfaceDrawDontSpoilTradeItems -.if _EUR_==1 - b 0x45A230 -.else - b 0x45A210 -.endif + b ret_InterfaceDrawDontSpoilTradeItems PATCH OpenSaveDontSpoilTradeItems -.if _EUR_==1 - b 0x44FED8 -.else - b 0x44FEB8 -.endif + b ret_OpenSaveDontSpoilTradeItems PATCH EnteredLocation bl hook_EnteredLocation @@ -1071,7 +1047,7 @@ PATCH FixItemsMenuSlotDuplication b hook_FixItemsMenuSlotDuplication PATCH PlayEntranceCutscene - b hook_PlayEntranceCutscene + bl hook_PlayEntranceCutscene PATCH SkipJabuOpeningCutscene bl hook_SkipJabuOpeningCutscene @@ -1153,7 +1129,7 @@ PATCH Multiplayer_UpdatePrevActorFlags bl hook_Multiplayer_UpdatePrevActorFlags PATCH Multiplayer_OnLoadFile - b hook_Multiplayer_OnLoadFile + bl hook_Multiplayer_OnLoadFile PATCH SendDroppedBottleContents bl hook_SendDroppedBottleContents @@ -1216,7 +1192,7 @@ PATCH CurseTrapDizzyStick bl hook_CurseTrapDizzyStick PATCH CurseTrapDizzyButtons - b hook_CurseTrapDizzyButtons + bl hook_CurseTrapDizzyButtons PATCH CrouchStabHitbox bl hook_CrouchStabHitbox @@ -1394,13 +1370,13 @@ PATCH OnActorSetup_SceneChange bl hook_OnActorSetup_SceneChange PATCH AfterActorSetup_SceneChange - b hook_AfterActorSetup_SceneChange + bl hook_AfterActorSetup_SceneChange PATCH OnActorSetup_RoomChange bl hook_OnActorSetup_RoomChange PATCH AfterActorSetup_RoomChange - b hook_AfterActorSetup_RoomChange + bl hook_AfterActorSetup_RoomChange PATCH RandomGsLoc_CustomTangibilityCheck b hook_RandomGsLoc_CustomTangibilityCheck diff --git a/code/src/boss_challenge.c b/code/src/boss_challenge.c index 09e84481..3c8d4a61 100644 --- a/code/src/boss_challenge.c +++ b/code/src/boss_challenge.c @@ -2,8 +2,6 @@ #include "multiplayer.h" #define STONES_MEDALLIONS_BITMASK 0x001C003F -#define bossChallengeData ((void*)GAME_ADDR(0x5C3F58)) -#define bossVictories ((u32*)(bossChallengeData + 0x1C)) static u32 ownedStonesMedallions = 0; static u8 enteredBCmenu = 0; diff --git a/code/src/camera.c b/code/src/camera.c index 3e7880b4..0397aedd 100644 --- a/code/src/camera.c +++ b/code/src/camera.c @@ -5,7 +5,7 @@ #include "savefile.h" #include "settings.h" -#define GyroDrawHUDIcon (*(u8*)GAME_ADDR(0x4FC648)) +extern u8 GyroDrawHUDIcon; s16 pitch = 0, yaw = 0; f32 dist = 0; diff --git a/code/src/entrance.c b/code/src/entrance.c index 591bdb72..a52685c7 100644 --- a/code/src/entrance.c +++ b/code/src/entrance.c @@ -8,14 +8,10 @@ #include "common.h" #include "grotto.h" -typedef void (*SetNextEntrance_proc)(struct GlobalContext* globalCtx, s16 entranceIndex, u32 sceneLoadFlag, - u32 transition); -#define SetNextEntrance_addr -#define SetNextEntrance ((SetNextEntrance_proc)GAME_ADDR(0x3716F0)) - -#define dynamicExitList \ - ((s16*)GAME_ADDR(0x53C094)) // = { 0x045B, 0x0482, 0x0340, 0x044B, 0x02A2, 0x0201, 0x03B8, 0x04EE, 0x03C0, 0x0463, - // 0x01CD, 0x0394, 0x0340, 0x057C } +void SetNextEntrance(struct GlobalContext* globalCtx, s16 entranceIndex, u32 sceneLoadFlag, u32 transition); + +extern s16 dynamicExitList[]; // = { 0x045B, 0x0482, 0x0340, 0x044B, 0x02A2, 0x0201, 0x03B8, 0x04EE, 0x03C0, 0x0463, + // 0x01CD, 0x0394, 0x0340, 0x057C } // Warp Song indices array : 0x53C33C = { 0x0600, 0x04F6, 0x0604, 0x01F1, 0x0568, 0x05F4 } diff --git a/code/src/fairy.c b/code/src/fairy.c index b71f24f2..ca2c199c 100644 --- a/code/src/fairy.c +++ b/code/src/fairy.c @@ -5,7 +5,7 @@ #include "common.h" #include "colors.h" -#define NAVI_COLORS_ARRAY ((Color_RGBA8*)GAME_ADDR(0x50C998)) +extern Color_RGBA8 NaviColorsArray[]; #define NAVI_CYCLE_FRAMES_OUTER 18 #define NAVI_CYCLE_FRAMES_INNER 21 @@ -101,7 +101,7 @@ s32 Fairy_SetTargetPointerColor(TargetContext* targetCtx, Actor* targetActor) { } void** cmabManager = ZAR_GetCMABByIndex(targetCtx->zarInfo, 37); // mark_model_white.cmab as base for all colors - Fairy_ApplyColorToTargetCMAB(*cmabManager, NAVI_COLORS_ARRAY[targetActor->type * 2]); // get inner color + Fairy_ApplyColorToTargetCMAB(*cmabManager, NaviColorsArray[targetActor->type * 2]); // get inner color staticRainbowPointerCMAB = Fairy_IsNaviInnerRainbowForActorType(targetActor->type) ? *cmabManager : 0; TexAnim_Spawn(targetCtx->visibleTargetIndicators.pointer->unk_0C, cmabManager); @@ -117,7 +117,7 @@ s32 Fairy_SetTargetReticleColor(TargetContext* targetCtx) { } void** cmabManager = ZAR_GetCMABByIndex(targetCtx->zarInfo, 41); // target_model_white.cmab as base for all colors - Fairy_ApplyColorToTargetCMAB(*cmabManager, NAVI_COLORS_ARRAY[targetCtx->reticleActorType * 2]); // get inner color + Fairy_ApplyColorToTargetCMAB(*cmabManager, NaviColorsArray[targetCtx->reticleActorType * 2]); // get inner color staticRainbowReticleCMAB = Fairy_IsNaviInnerRainbowForActorType(targetCtx->reticleActorType) ? *cmabManager : 0; for (s32 i = 0; i < 4; i++) { diff --git a/code/src/fishing.h b/code/src/fishing.h index cf4867c3..336f5024 100644 --- a/code/src/fishing.h +++ b/code/src/fishing.h @@ -3,9 +3,9 @@ #include "z3D/z3D.h" -#define Fishing_Init ((ActorFunc)GAME_ADDR(0x1C0AD8)) -#define Fishing_UpdateFish ((ActorFunc)GAME_ADDR(0x1F9ACC)) -#define Fishing_DrawFish ((ActorFunc)GAME_ADDR(0x1F98B4)) +void Fishing_Init(Actor* thisx, GlobalContext* globalCtx); +void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx); +void Fishing_DrawFish(Actor* thisx, GlobalContext* globalCtx); #define EN_FISH_AQUARIUM 200 // param for record fish in tank. diff --git a/code/src/fog.c b/code/src/fog.c index f330379f..9a5fa6d2 100644 --- a/code/src/fog.c +++ b/code/src/fog.c @@ -3,7 +3,7 @@ #include "z3D/z3D.h" -#define z3D_Fog_State (*(u8*)GAME_ADDR(0x531EB4)) +extern u8 z3D_Fog_State; // Override glitchy fog state when going through Market Entrance -> Hyrule Field // exit during entrance randomizer diff --git a/code/src/hints.c b/code/src/hints.c index 63b87986..b935b6a9 100644 --- a/code/src/hints.c +++ b/code/src/hints.c @@ -6,11 +6,8 @@ #define SCENE_YDAN_BOSS 17 -typedef u8 (*Player_GetMask_proc)(GlobalContext* globalCtx); -#define Player_GetMask ((Player_GetMask_proc)GAME_ADDR(0x36EF98)) - -typedef u16 (*ElfMessage_GetSariaText_proc)(GlobalContext* globalCtx); -#define ElfMessage_GetSariaText ((ElfMessage_GetSariaText_proc)GAME_ADDR(0x31C698)) +u8 Player_GetMask(GlobalContext* globalCtx); +u16 ElfMessage_GetSariaText(GlobalContext* globalCtx); u16 sSariasSongHintTextIds[MAX_SARIAS_SONG_HINTS] = { 0x0A00 }; s32 sNumSariasSongHints = 1; diff --git a/code/src/icetrap.c b/code/src/icetrap.c index 7e4dd21b..e2ff81dd 100644 --- a/code/src/icetrap.c +++ b/code/src/icetrap.c @@ -7,9 +7,9 @@ #include "player.h" #include "item_override.h" -#define TimerFrameCounter *(s16*)GAME_ADDR(0x539D8A) // Used to decrease the timer every 30 frames -#define ControlStick_X *(float*)GAME_ADDR(0x5655C0) -#define ControlStick_Y *(float*)GAME_ADDR(0x5655C4) +extern s16 TimerFrameCounter; // Used to decrease the timer every 30 frames +extern float ControlStick_X; +extern float ControlStick_Y; static u8 pendingFreezes = 0; static u8 cooldown = 0; @@ -323,12 +323,12 @@ void IceTrap_ReverseStick(void) { } } -btn_t IceTrap_RandomizeButtons(btn_t in) { +void IceTrap_RandomizeButtons(btn_t* btns) { if (IceTrap_ActiveCurse != ICETRAP_CURSE_DIZZY) { - return in; + return; } - uint32_t arr[4] = { in.a, in.b, in.r, in.l }; + uint32_t arr[4] = { btns->a, btns->b, btns->r, btns->l }; for (u32 i = 3; i > 0; i--) { u32 j = dizzyCurseSeed % i; u32 temp = arr[j]; @@ -336,12 +336,10 @@ btn_t IceTrap_RandomizeButtons(btn_t in) { arr[i] = temp; } - btn_t out = in; - out.a = arr[0]; - out.b = arr[1]; - out.r = arr[2]; - out.l = arr[3]; - return out; + btns->a = arr[0]; + btns->b = arr[1]; + btns->r = arr[2]; + btns->l = arr[3]; } u16 IceTrap_CamRoll(u16 roll) { diff --git a/code/src/item_effect.c b/code/src/item_effect.c index 9acd1af2..040b2a8b 100644 --- a/code/src/item_effect.c +++ b/code/src/item_effect.c @@ -160,8 +160,7 @@ void ItemEffect_TriforcePiece(SaveContext* saveCtx, s16 arg1, s16 arg2) { // With the No Ammo Drops option on, when the player gets an ammo upgrade, // the ammo count increases by 10 instead of being set to the maximum -typedef void (*Inventory_ChangeUpgrade_proc)(u32 upgrade, u32 value); -#define Inventory_ChangeUpgrade ((Inventory_ChangeUpgrade_proc)GAME_ADDR(0x33C730)) +void Inventory_ChangeUpgrade(u32 upgrade, u32 value); void ItemEffect_GiveUpgrade(SaveContext* saveCtx, s16 arg1, s16 arg2) { Inventory_ChangeUpgrade(arg2, arg1); diff --git a/code/src/ld_symbols.h b/code/src/ld_symbols.h new file mode 100644 index 00000000..557baccd --- /dev/null +++ b/code/src/ld_symbols.h @@ -0,0 +1,19 @@ +#ifndef _LD_SYMBOLS_H_ +#define _LD_SYMBOLS_H_ + +#include "3ds/types.h" + +/* + * Code size can only be known at link time, so the linker will need a way to + * calculate it and insert the value in the compiled code. + * This variable is fake and will not be allocated. Its symbol is defined in the + * linker script as the total size of the code sections, so that the C code can + * use that value through the variable's address. + */ +extern char _LD_TEXT_SIZE; +#define NEWCODE_SIZE ((u32)&_LD_TEXT_SIZE) + +extern char _LD_TEXT_START; +#define NEWCODE_OFFSET ((u32)&_LD_TEXT_START) + +#endif //_LD_SYMBOLS_H_ diff --git a/code/src/loader.c b/code/src/loader.c index d2142ac3..fe379bc5 100644 --- a/code/src/loader.c +++ b/code/src/loader.c @@ -3,7 +3,7 @@ * for the program Magikoopa. */ -#include "newcodeinfo.h" +#include "ld_symbols.h" #include "3ds/types.h" #include "3ds/svc.h" diff --git a/code/src/menus.c b/code/src/menus.c index 3d4db629..09c16a03 100644 --- a/code/src/menus.c +++ b/code/src/menus.c @@ -6,26 +6,20 @@ #include "dungeon_rewards.h" #include "item_override.h" -#define gItemsMenuSpritesManager (*(MenuSpriteManager**)GAME_ADDR(0x506734)) -#define gBowMenuSpritesManager (*(MenuSpriteManager**)GAME_ADDR(0x506738)) -#define gItemsMenuGlowSpritesManager (*(MenuSpriteManager**)GAME_ADDR(0x50673C)) -#define gMenuSpritesManager_506740 (*(MenuSpriteManager**)GAME_ADDR(0x506740)) -#define gDungeonMapMenuSpritesManager (*(MenuSpriteManager**)GAME_ADDR(0x506CD0)) -#define gGearMenuSpritesManager (*(MenuSpriteManager**)GAME_ADDR(0x50447C)) - -#define gItemsMenuSelectedSlot (*(s32*)GAME_ADDR(0x506748)) -#define gGearMenuSelectedSlot (*(s32*)GAME_ADDR(0x50448C)) - -typedef void (*MenuSpritesManager_RegisterItemSprite_proc)(MenuSpriteManager* menuMan, s32 spriteId, s32 itemId); -#define MenuSpritesManager_RegisterItemSprite ((MenuSpritesManager_RegisterItemSprite_proc)GAME_ADDR(0x2F8D74)) - -typedef void (*MenuSpritesManager_SetSpriteAt_proc)(MenuSpriteManager* menuMan, s32 spriteId, s32 x, s32 y, s32 width, - s32 height); -#define MenuSpritesManager_SetSpriteAt ((MenuSpritesManager_SetSpriteAt_proc)GAME_ADDR(0x2F8D40)) - -typedef void (*MenuSpritesManager_OffsetSpriteAt_proc)(MenuSpriteManager* menuMan, s32 spriteId, s32 x, s32 y, - s32 width, s32 height, s32 xOffset, s32 yOffset); -#define MenuSpritesManager_OffsetSpriteAt ((MenuSpritesManager_OffsetSpriteAt_proc)GAME_ADDR(0x2EB3D8)) +extern MenuSpriteManager* gItemsMenuSpritesManager; +extern MenuSpriteManager* gBowMenuSpritesManager; +extern MenuSpriteManager* gItemsMenuGlowSpritesManager; +extern MenuSpriteManager* gMenuSpritesManager_506740; +extern MenuSpriteManager* gDungeonMapMenuSpritesManager; +extern MenuSpriteManager* gGearMenuSpritesManager; + +extern s32 gItemsMenuSelectedSlot; +extern s32 gGearMenuSelectedSlot; + +void MenuSpritesManager_RegisterItemSprite(MenuSpriteManager* menuMan, s32 spriteId, s32 itemId); +void MenuSpritesManager_SetSpriteAt(MenuSpriteManager* menuMan, s32 spriteId, s32 x, s32 y, s32 width, s32 height); +void MenuSpritesManager_OffsetSpriteAt(MenuSpriteManager* menuMan, s32 spriteId, s32 x, s32 y, s32 width, s32 height, + s32 xOffset, s32 yOffset); void ItemsMenu_Draw(void) { s32 selectedItemSlot; diff --git a/code/src/message.c b/code/src/message.c index 387090b7..5230520d 100644 --- a/code/src/message.c +++ b/code/src/message.c @@ -19,11 +19,8 @@ u32 gFinalPlaytimeSeconds; volatile const u32 numCustomMessageEntries; volatile const MessageEntry* ptrCustomMessageEntries; -typedef const MessageEntry* (*Message_GetEntry_proc)(void* param_1, u32 textId); -#define Message_GetEntry ((Message_GetEntry_proc)GAME_ADDR(0x2DF4C4)) - -typedef const char* (*Message_GetText_proc)(void* param_1, u32 offset); -#define Message_GetText ((Message_GetText_proc)GAME_ADDR(0x2DF4B0)) +const MessageEntry* Message_GetEntry(void* param_1, u32 textId); +const char* Message_GetText(void* param_1, u32 offset); const MessageEntry* Message_GetCustomEntry(void* param_1, u32 textId) { s32 start; diff --git a/code/src/message.h b/code/src/message.h index 1f0f7c8b..11915836 100644 --- a/code/src/message.h +++ b/code/src/message.h @@ -111,13 +111,8 @@ typedef struct UnkTextControlData { // ... size unknown } UnkTextControlData; -typedef void (*Message_UnkControlCodeHandler_proc)(void* textObj, UnkTextControlData** data); -#define Message_UnkControlCodeHandler ((Message_UnkControlCodeHandler_proc)GAME_ADDR(0x306318)) - -typedef char* (*Message_CheckForControlCodes_proc)(void* data, char* nextChars); -#define Message_CheckForControlCodes ((Message_CheckForControlCodes_proc)GAME_ADDR(0x4C08C0)) - -typedef void (*Message_SetInstantText_proc)(void* textObj); -#define Message_SetInstantText ((Message_SetInstantText_proc)GAME_ADDR(0x40B608)) +void Message_UnkControlCodeHandler(void* textObj, UnkTextControlData** data); +char* Message_CheckForControlCodes(void* data, char* nextChars); +void Message_SetInstantText(void* textObj); #endif //_MESSAGE_H_ diff --git a/code/src/models.c b/code/src/models.c index 3841c353..f91cbc7f 100644 --- a/code/src/models.c +++ b/code/src/models.c @@ -8,18 +8,11 @@ #include "common.h" #include -typedef void (*SkeletonAnimationModel_MatrixCopy_proc)(SkeletonAnimationModel* glModel, nn_math_MTX34* mtx); -#define SkeletonAnimationModel_MatrixCopy ((SkeletonAnimationModel_MatrixCopy_proc)GAME_ADDR(0x3721E0)) - -typedef void (*SkeletonAnimationModel_Draw_proc)(SkeletonAnimationModel* glModel, s32 param_2); -#define SkeletonAnimationModel_Draw ((SkeletonAnimationModel_Draw_proc)GAME_ADDR(0x372170)) - -typedef void (*SkeletonAnimationModel_SpawnAt_proc)(Actor* actor, GlobalContext* globalCtx, - SkeletonAnimationModel** glModel, s32 objModelIdx); -#define SkeletonAnimationModel_SpawnAt ((SkeletonAnimationModel_SpawnAt_proc)GAME_ADDR(0x372F38)) - -typedef void (*Actor_SetModelMatrix_proc)(f32 x, f32 y, f32 z, nn_math_MTX34* mtx, ActorShape* shape); -#define Actor_SetModelMatrix ((Actor_SetModelMatrix_proc)GAME_ADDR(0x3679D0)) +void SkeletonAnimationModel_MatrixCopy(SkeletonAnimationModel* glModel, nn_math_MTX34* mtx); +void SkeletonAnimationModel_Draw(SkeletonAnimationModel* glModel, s32 param_2); +void SkeletonAnimationModel_SpawnAt(Actor* actor, GlobalContext* globalCtx, SkeletonAnimationModel** glModel, + s32 objModelIdx); +void Actor_SetModelMatrix(f32 x, f32 y, f32 z, nn_math_MTX34* mtx, ActorShape* shape); #define LOADEDMODELS_MAX 20 Model ModelContext[LOADEDMODELS_MAX] = { 0 }; diff --git a/code/src/models.h b/code/src/models.h index 89a0083a..1844c920 100644 --- a/code/src/models.h +++ b/code/src/models.h @@ -23,14 +23,9 @@ void Model_DestroyAll(void); s32 Model_DrawByActor(Actor* actor); void Model_SetAnim(SkeletonAnimationModel* model, s16 objectId, u32 objectAnimIdx); -typedef SkeletonAnimationModel* (*SkeletonAnimationModel_Spawn_proc)(Actor* actor, GlobalContext* globalCtx, s16 objId, - s32 objModelIdX); -#define SkeletonAnimationModel_Spawn ((SkeletonAnimationModel_Spawn_proc)GAME_ADDR(0x36A924)) - -typedef void (*SkeletonAnimationModel_SetMesh_proc)(SkeletonAnimationModel* glModel, s32 mesh); -#define SkeletonAnimationModel_SetMesh ((SkeletonAnimationModel_SetMesh_proc)GAME_ADDR(0x369178)) - -typedef void (*DeleteModel_At_proc)(SkeletonAnimationModel** model); -#define DeleteModel_At ((DeleteModel_At_proc)GAME_ADDR(0x357248)) +SkeletonAnimationModel* SkeletonAnimationModel_Spawn(Actor* actor, GlobalContext* globalCtx, s16 objId, + s32 objModelIdX); +void SkeletonAnimationModel_SetMesh(SkeletonAnimationModel* glModel, s32 mesh); +void DeleteModel_At(SkeletonAnimationModel** model); #endif //_MODELS_H_ diff --git a/code/src/multiplayer.c b/code/src/multiplayer.c index 4e21f8a5..f12e8ed7 100644 --- a/code/src/multiplayer.c +++ b/code/src/multiplayer.c @@ -1000,8 +1000,8 @@ void Multiplayer_Receive_LinkSFX(u16 senderID) { } mp_duplicateSendProtection = true; - PlaySFX(mBuffer[1], &ghostDataPtr->position, 4, (f32*)GAME_ADDR(0x54AC20), (f32*)GAME_ADDR(0x54AC20), - (s8*)GAME_ADDR(0x54AC24)); + PlaySFX(mBuffer[1], &ghostDataPtr->position, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } // Shared Progress diff --git a/code/src/newcodeinfo.h b/code/src/newcodeinfo.h deleted file mode 100644 index aae5a25d..00000000 --- a/code/src/newcodeinfo.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * This file will (eventually) be automatically generated, following - * the method used by RicBent in the program Magikoopa - */ - -#ifndef _NEWCODEINFO_H_ -#define _NEWCODEINFO_H_ - -#define NEWCODE_OFFSET 0x005C7000 // TODO: this -#define NEWCODE_SIZE 0x00050000 // TODO: this. even now, this is too big. - -#endif //_NEWCODEINFO_H_ \ No newline at end of file diff --git a/code/src/objects.h b/code/src/objects.h index cf784c14..f0c8b61f 100644 --- a/code/src/objects.h +++ b/code/src/objects.h @@ -34,28 +34,14 @@ typedef enum ObjectId { OBJECT_ID_MAX = 0x01A1, } ObjectId; -typedef s32 (*Object_proc)(ObjectContext* objectCtx, s16 objectId); - -#define Object_Spawn ((Object_proc)GAME_ADDR(0x32E21C)) - -#define Object_GetSlot ((Object_proc)GAME_ADDR(0x363C10)) - -typedef void (*Object_UpdateEntries_proc)(ObjectContext* objectCtx); -#define Object_UpdateEntries ((Object_UpdateEntries_proc)GAME_ADDR(0x2E4EA0)) - -typedef void (*Object_Clear_proc)(GlobalContext* globalCtx, ObjectContext* objectCtx); -#define Object_Clear ((Object_Clear_proc)GAME_ADDR(0x45FDA0)) - -typedef void* (*ZAR_Get_proc)(ZARInfo* zarInfo, u32 index); -#define ZAR_GetCMBByIndex ((ZAR_Get_proc)GAME_ADDR(0x358EF8)) - -#define ZAR_GetCMABByIndex ((ZAR_Get_proc)GAME_ADDR(0x372F0C)) - -typedef void (*ZAR_Destroy_proc)(ZARInfo*); -#define ZAR_Destroy ((ZAR_Destroy_proc)GAME_ADDR(0x2F70C4)) - -typedef void (*TexAnim_Spawn_proc)(void*, void*); -#define TexAnim_Spawn ((TexAnim_Spawn_proc)GAME_ADDR(0x372D94)) +s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); +s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId); +void Object_UpdateEntries(ObjectContext* objectCtx); +void Object_Clear(GlobalContext* globalCtx, ObjectContext* objectCtx); +void* ZAR_GetCMBByIndex(ZARInfo* zarInfo, u32 index); +void* ZAR_GetCMABByIndex(ZARInfo* zarInfo, u32 index); +void ZAR_Destroy(ZARInfo* zarInfo); +void TexAnim_Spawn(void*, void*); // Get an object entry given the slot. ObjectEntry* Object_GetEntry(s16 slot); diff --git a/code/src/ocarina_notes.c b/code/src/ocarina_notes.c index a236687e..d59628ec 100644 --- a/code/src/ocarina_notes.c +++ b/code/src/ocarina_notes.c @@ -30,7 +30,7 @@ void OcarinaNotes_Init(void) { OcarinaSongButtonSequence songBtns = gOcarinaSongButtons[songId]; // set playback data - OcarinaNote* songNotes = sOcarinaSongNotes[songId]; + OcarinaNote* songNotes = gOcarinaSongNotes[songId]; u32 noteIndex = 0; for (u32 btnIndex = 0; btnIndex < songBtns.length; btnIndex++) { // set menu song override data diff --git a/code/src/ocarina_notes.h b/code/src/ocarina_notes.h index 9a6c8602..c47d2e92 100644 --- a/code/src/ocarina_notes.h +++ b/code/src/ocarina_notes.h @@ -101,15 +101,15 @@ typedef struct { /* 0x7 */ u8 bFlat4Flag; } OcarinaNote; // size = 0x8 -#define OcarinaUIStruct (*((void**)GAME_ADDR(0x5093EC))) +extern void* OcarinaUIStruct; // sequence of notes to check when a song has been played -#define gOcarinaSongButtons ((OcarinaSongButtonSequence*)GAME_ADDR(0x54C222)) +extern OcarinaSongButtonSequence gOcarinaSongButtons[]; // sequence of note data used for the playbacks (2D array of 20 notes for each song) -#define sOcarinaSongNotes ((OcarinaNote(*)[20])GAME_ADDR(0x54B5F2)) +extern OcarinaNote gOcarinaSongNotes[][20]; // sequence of notes to display on the ocarina song list menu (array of pointers to arrays) -#define gOcarinaMenuSongNoteSequences ((u32**)GAME_ADDR(0x4D541C)) -#define gOcarinaMenuSongLengths ((u32*)GAME_ADDR(0x4D53C8)) +extern u32* gOcarinaMenuSongNoteSequences[]; +extern u32 gOcarinaMenuSongLengths[]; void OcarinaNotes_Init(void); s32 OcarinaNotes_IsButtonOwned(OcarinaNoteButton button); diff --git a/code/src/oot_malloc.h b/code/src/oot_malloc.h index e7dd462c..c2d3f8a4 100644 --- a/code/src/oot_malloc.h +++ b/code/src/oot_malloc.h @@ -4,10 +4,7 @@ #include "3ds/types.h" #include "z3D/z3D.h" -typedef void* (*SystemArena_Malloc_proc)(u32 size); -#define SystemArena_Malloc ((SystemArena_Malloc_proc)GAME_ADDR(0x35010C)) - -typedef void (*SystemArena_Free_proc)(void* ptr); -#define SystemArena_Free ((SystemArena_Free_proc)GAME_ADDR(0x34FC6C)) +void* SystemArena_Malloc(u32 size); +void SystemArena_Free(void* ptr); #endif //_OOT_MALLOC_H_ diff --git a/code/src/permadeath.c b/code/src/permadeath.c index 29e90d5a..8c2d5db4 100644 --- a/code/src/permadeath.c +++ b/code/src/permadeath.c @@ -9,8 +9,7 @@ u8 Permadeath_GetOption(void) { (gSettingsContext.gloomMode != GLOOMMODE_DEATH || gSaveContext.healthCapacity == 0); } -typedef void (*SaveFile_Delete_proc)(u8 fileNum); -#define SaveFile_Delete ((SaveFile_Delete_proc)GAME_ADDR(0x446FC4)) +void SaveFile_Delete(u8 fileNum); void Permadeath_DeleteSave(void) { if (!Permadeath_GetOption()) { diff --git a/code/src/savefile.c b/code/src/savefile.c index 0b5c06d5..8cd115bd 100644 --- a/code/src/savefile.c +++ b/code/src/savefile.c @@ -638,8 +638,7 @@ void SaveFile_BorrowMask(s16 SI_ItemId) { gSaveContext.sceneFlags[0x60].unk |= (itemId - ITEM_MASK_KEATON) << 0x13; } -typedef s32 (*Inventory_ReplaceItem_proc)(GlobalContext* globalCtx, u16 oldItem, u16 newItem); -#define Inventory_ReplaceItem ((Inventory_ReplaceItem_proc)GAME_ADDR(0x316CEC)) +s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem); u32 SaveFile_CheckForWeirdEggHatch(void) { // Force the egg into the child trade slot so that it can hatch diff --git a/code/src/songs_visual_effects.c b/code/src/songs_visual_effects.c index 8ab31bb5..a0933684 100644 --- a/code/src/songs_visual_effects.c +++ b/code/src/songs_visual_effects.c @@ -4,19 +4,19 @@ #include "icetrap.h" #include "savefile.h" -#define OceffWipe_Update ((ActorFunc)GAME_ADDR(0x256158)) +void OceffWipe_Update(Actor* thisx, GlobalContext* globalCtx); -#define OceffWipe2_Update ((ActorFunc)GAME_ADDR(0x2714B8)) +void OceffWipe2_Update(Actor* thisx, GlobalContext* globalCtx); -#define OceffWipe3_Update ((ActorFunc)GAME_ADDR(0x27181C)) +void OceffWipe3_Update(Actor* thisx, GlobalContext* globalCtx); -#define OceffWipe4_Update ((ActorFunc)GAME_ADDR(0x271C10)) +void OceffWipe4_Update(Actor* thisx, GlobalContext* globalCtx); -#define OceffSpot_Update ((ActorFunc)GAME_ADDR(0x255BDC)) +void OceffSpot_Update(Actor* thisx, GlobalContext* globalCtx); -#define OceffSpot_End ((ActorFunc)GAME_ADDR(0x10FBD0)) +void OceffSpot_End(Actor* thisx, GlobalContext* globalCtx); -#define OceffStorm_Update ((ActorFunc)GAME_ADDR(0x27112C)) +void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx); // Zelda's Lullaby, Song of Time void OceffWipe_rUpdate(Actor* thisx, GlobalContext* globalCtx) { diff --git a/code/src/spin_attack.c b/code/src/spin_attack.c index 05fcce54..74cb8328 100644 --- a/code/src/spin_attack.c +++ b/code/src/spin_attack.c @@ -1,7 +1,7 @@ #include "spin_attack.h" #include "icetrap.h" -#define EnMThunder_Init ((ActorFunc)GAME_ADDR(0x24C910)) +void EnMThunder_Init(Actor* thisx, GlobalContext* globalCtx); void EnMThunder_rInit(Actor* thisx, GlobalContext* globalCtx) { if (IceTrap_ActiveCurse != ICETRAP_CURSE_SWORD) { From f1887182954f564bdad1d94e980ded7d349e1f7e Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Wed, 1 Apr 2026 20:38:24 +0200 Subject: [PATCH 7/9] Rename some functions --- code/include/z3D/z3D.h | 6 +++--- code/include/z3D/z3Dactor.h | 6 +++++- code/oot.ld | 27 ++++++++++++++------------- code/src/actors/anju.c | 6 +++--- code/src/actors/business_scrubs.c | 16 ++++++++-------- code/src/actors/checkable_spot.c | 4 ++-- code/src/actors/chest.c | 2 +- code/src/actors/door.c | 12 ++++++------ code/src/actors/graveyard_objects.c | 4 ++-- code/src/actors/lake_hylia_objects.c | 4 ++-- code/src/actors/player.c | 5 +++-- code/src/actors/skulltula.c | 6 +++--- code/src/asm/hooks.s | 9 ++++----- code/src/asm/patches.s | 6 +++--- code/src/icetrap.c | 2 +- code/src/models.c | 2 +- code/src/multiplayer.c | 4 ++-- 17 files changed, 63 insertions(+), 58 deletions(-) diff --git a/code/include/z3D/z3D.h b/code/include/z3D/z3D.h index ff2e5867..9edc593d 100644 --- a/code/include/z3D/z3D.h +++ b/code/include/z3D/z3D.h @@ -724,7 +724,7 @@ void Rupees_ChangeBy(s16 rupeeChange); void LinkDamage(GlobalContext* globalCtx, Player* player, s32 arg2, f32 arg3, f32 arg4, s16 arg5, s32 arg6); u32 Inventory_HasEmptyBottle(void); // This function plays sound effects and music tracks, overlaid on top of the current BGM -void PlaySound(u32); +void Audio_PlayFanfare(u32); u32 Audio_GetActiveSeqId(u8 seqPlayerIndex); // Restores the original sequence to the main BGM player after a mini-boss battle or a minigame. void Audio_RestoreBGM(void); @@ -738,12 +738,12 @@ void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* outX, s16* void Actor_KillAllWithMissingObject(GlobalContext* globalCtx, ActorContext* actorCtx); void FireDamage(Actor* player, GlobalContext* globalCtx, int flamesColor); void Flags_SetEnv(GlobalContext* globalCtx, s16 flag); -void GiveItem(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) +void Actor_OfferGetItem(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) __attribute__((pcs("aapcs-vfp"))); void Message_CloseTextbox(GlobalContext* globalCtx); void SetupItemInWater(Player* player, GlobalContext* globalCtx); void Health_ChangeBy(GlobalContext* arg1, u32 arg2); -void PlaySFX(u32 sfxId, Vec3f* pos, u32 token, f32* freqScale, f32* a4, s8* reverbAdd); +void Audio_PlaySfxGeneral(u32 sfxId, Vec3f* pos, u32 token, f32* freqScale, f32* a4, s8* reverbAdd); void Flags_SetSwitch(GlobalContext* globalCtx, u32 flag); void Flags_UnsetSwitch(GlobalContext* globalCtx, u32 flag); u32 Flags_GetSwitch(GlobalContext* globalCtx, u32 flag); diff --git a/code/include/z3D/z3Dactor.h b/code/include/z3D/z3Dactor.h index 8825cf53..b0e882af 100644 --- a/code/include/z3D/z3Dactor.h +++ b/code/include/z3D/z3Dactor.h @@ -255,6 +255,10 @@ typedef struct DynaPolyActor { /* 0x1BA */ s16 unk_1BA; } DynaPolyActor; // size = 0x1BC +struct Player; + +typedef void (*PlayerActionFunc)(struct Player*, struct GlobalContext*); + typedef struct Player { /* 0x0000 */ Actor actor; /* 0x01A4 */ s8 currentTunic; @@ -301,7 +305,7 @@ typedef struct Player { /* 0x1568 */ ColliderQuad shieldQuad; /* 0x15E8 */ Collider unkMeleeWeaponCollider; /* 0x1600 */ char unk_1600[0x108]; - /* 0x1708 */ void* stateFuncPtr; + /* 0x1708 */ PlayerActionFunc actionFunc; /* 0x170C */ char unk_170C[0x0004]; /* 0x1710 */ u32 stateFlags1; /* 0x1714 */ u32 stateFlags2; diff --git a/code/oot.ld b/code/oot.ld index 47fddc04..4b93838b 100644 --- a/code/oot.ld +++ b/code/oot.ld @@ -7,7 +7,8 @@ SECTIONS . = 0x100000 + _LD_OFF; .patch_loader 0x100000 + _LD_OFF : { *(.patch_loader) } - FUN_00100434 = 0x100434 + _LD_OFF; + nninitRegion = 0x100028 + _LD_OFF; + EnDns_SetupBurrow = 0x100434 + _LD_OFF; EnBb_Update = 0x1005EC + _LD_OFF; EnIk_UpdateEnemy = 0x1008B4 + _LD_OFF; EnZf_Update = 0x101C48 + _LD_OFF; @@ -65,7 +66,7 @@ SECTIONS ObjBean_UnplantedWait = 0x15E154 + _LD_OFF; .patch_GrannyBottleCheck 0x161044 + _LD_OFF : { *(.patch_GrannyBottleCheck) } .patch_GrannyItemOverrideOne 0x161094 + _LD_OFF : { *(.patch_GrannyItemOverrideOne) } - FUN_00161828 = 0x161828 + _LD_OFF; + EnDns_SetupSale = 0x161828 + _LD_OFF; .patch_ScrubStickUpgradeOne 0x161898 + _LD_OFF : { *(.patch_ScrubStickUpgradeOne) } .patch_ScrubNutUpgradeOne 0x1618EC + _LD_OFF : { *(.patch_ScrubNutUpgradeOne) } EnDns_Talk = 0x161960 + _LD_OFF; @@ -237,7 +238,7 @@ SECTIONS Fishing_UpdateFish = 0x1F9ACC + _LD_OFF; BgSpot02Objects_Explode = 0x205EDC + _LD_OFF; .patch_BombchuBowlingStaticReward 0x206150 + _LD_OFF : { *(.patch_BombchuBowlingStaticReward) } - FUN_2065E0 = 0x2065E0 + _LD_OFF; + EnWonderTalk_Action_2065E0 = 0x2065E0 + _LD_OFF; .patch_SkipSongReplays_TimeBlocksFix 0x208004 + _LD_OFF : { *(.patch_SkipSongReplays_TimeBlocksFix) } .patch_SkipSongReplays_WarpBlocksFix 0x208068 + _LD_OFF : { *(.patch_SkipSongReplays_WarpBlocksFix) } EnChanger_Init = 0x20EC50 + _LD_OFF; @@ -289,7 +290,7 @@ SECTIONS .patch_DarkLinkPlayerRecoil 0x22F838 + _LD_OFF : { *(.patch_DarkLinkPlayerRecoil) } ObjMure3_Update = 0x2318AC + _LD_OFF; .patch_GanonCSEquipMS 0x2359A4 + _LD_OFF : { *(.patch_GanonCSEquipMS) } - FUN_2389EC = 0x2389EC + _LD_OFF; + EnNiwLady_Action_2389EC = 0x2389EC + _LD_OFF; EnDntNomal_SetupTargetGivePrize = 0x2394CC + _LD_OFF; BgTreemouth_Init = 0x2412B4 + _LD_OFF; BgYdanSp_Update = 0x241EF8 + _LD_OFF; @@ -479,8 +480,8 @@ SECTIONS DeleteModel_At = 0x357248 + _LD_OFF; ZAR_GetCMBByIndex = 0x358EF8 + _LD_OFF; BossChallenge_IsActive = 0x35B164 + _LD_OFF; - .patch_PlaySound 0x35C528 + _LD_OFF : { *(.patch_PlaySound) } - PlaySound = 0x35C528 + _LD_OFF; + .patch_Audio_PlayFanfare 0x35C528 + _LD_OFF : { *(.patch_Audio_PlayFanfare) } + Audio_PlayFanfare = 0x35C528 + _LD_OFF; LinkDamage = 0x35D304 + _LD_OFF; FireDamage = 0x35D8D8 + _LD_OFF; Player_InBlockingCsMode = 0x35DB20 + _LD_OFF; @@ -530,7 +531,7 @@ SECTIONS .patch_DemoEffectMedallionDraw 0x37214C + _LD_OFF : { *(.patch_DemoEffectMedallionDraw) } SkeletonAnimationModel_Draw = 0x372170 + _LD_OFF; SkeletonAnimationModel_MatrixCopy = 0x3721E0 + _LD_OFF; - GiveItem = 0x3724DC + _LD_OFF; + Actor_OfferGetItem = 0x3724DC + _LD_OFF; .patch_IncomingGetItemID 0x3725AC + _LD_OFF : { *(.patch_IncomingGetItemID) } Message_CloseTextbox = 0x3725E0 + _LD_OFF; Model_EnableMeshGroupByIndex = 0x37266C + _LD_OFF; @@ -548,9 +549,9 @@ SECTIONS Actor_Spawn = 0x3738D0 + _LD_OFF; .patch_ConvertBombDropTwo 0x3747A4 + _LD_OFF : { *(.patch_ConvertBombDropTwo) } .patch_SetSFX 0x37547C + _LD_OFF : { *(.patch_SetSFX) } - PlaySFX = 0x37547C + _LD_OFF; + Audio_PlaySfxGeneral = 0x37547C + _LD_OFF; Math_SmoothStepToS = 0x375A18 + _LD_OFF; - FUN_00375B70 = 0x375B70 + _LD_OFF; + Enemy_StartFinishingBlow = 0x375B70 + _LD_OFF; Audio_PlayActorSfx2 = 0x375BCC + _LD_OFF; Animation_Change = 0x375C08 + _LD_OFF; Flags_SetSwitch = 0x375C10 + _LD_OFF; @@ -623,16 +624,16 @@ SECTIONS .patch_DampeCheckRewardFlag 0x3C3598 + _LD_OFF : { *(.patch_DampeCheckRewardFlag) } .patch_DampeCheckCanDig2 0x3C35D0 + _LD_OFF : { *(.patch_DampeCheckCanDig2) } .patch_SongOfTimeLocation 0x3C375C + _LD_OFF : { *(.patch_SongOfTimeLocation) } - EnDns_SetupBurrow = 0x3C3C04 + _LD_OFF; + EnDns_Burrow = 0x3C3C04 + _LD_OFF; .patch_EponasSongLocation 0x3C6194 + _LD_OFF : { *(.patch_EponasSongLocation) } .patch_MalonNextAction 0x3C6210 + _LD_OFF : { *(.patch_MalonNextAction) } EnIshi_LiftedUp = 0x3CBAC4 + _LD_OFF; EnSw_WalltulaIdle = 0x3CDAAC + _LD_OFF; .patch_BombPurchaseableCheck 0x3CE800 + _LD_OFF : { *(.patch_BombPurchaseableCheck) } - FUN_003CE92C = 0x3CE92C + _LD_OFF; + EnDns_Sale = 0x3CE92C + _LD_OFF; .patch_ScrubStickUpgradeTwo 0x3CE990 + _LD_OFF : { *(.patch_ScrubStickUpgradeTwo) } .patch_ScrubNutUpgradeTwo 0x3CE9DC + _LD_OFF : { *(.patch_ScrubNutUpgradeTwo) } - EnDns_Burrow = 0x3CEA64 + _LD_OFF; + EnDns_PostBurrow = 0x3CEA64 + _LD_OFF; EnSi_DestroyAfterText = 0x3D0544 + _LD_OFF; EnDodojr_JumpAttackBounce = 0x3D069C + _LD_OFF; .patch_GrannySetRewardFlag 0x3D0E34 + _LD_OFF : { *(.patch_GrannySetRewardFlag) } @@ -807,7 +808,7 @@ SECTIONS /* 0x4A5B00 */ _LD_OFF = _LD_EUR ? 0x0 : _LD_OFF; - FUN_4BA378 = 0x4BA378 + _LD_OFF; + Player_Action_Running = 0x4BA378 + _LD_OFF; .patch_OverrideGiDrawIdPlusOne_Ground 0x4BC610 + _LD_OFF : { *(.patch_OverrideGiDrawIdPlusOne_Ground) } .patch_OverrideGiDrawIdPlusOne_Water 0x4BD5DC + _LD_OFF : { *(.patch_OverrideGiDrawIdPlusOne_Water) } PlayerActor_Draw = 0x4BF618 + _LD_OFF; diff --git a/code/src/actors/anju.c b/code/src/actors/anju.c index b8b31600..cc1ed54c 100644 --- a/code/src/actors/anju.c +++ b/code/src/actors/anju.c @@ -3,7 +3,7 @@ #include "anju.h" -void FUN_2389EC(EnNiwLady* self, GlobalContext* globalCtx); +void EnNiwLady_Action_2389EC(EnNiwLady* self, GlobalContext* globalCtx); u32 EnNiwLady_CheckCuccoAmount(u32 cuccosInPen) { return cuccosInPen - gSettingsContext.numRequiredCuccos + 7; @@ -12,8 +12,8 @@ u32 EnNiwLady_CheckCuccoAmount(u32 cuccosInPen) { void EnNiwLady_rGiveCojiro(EnNiwLady* self, GlobalContext* globalCtx) { if (Actor_HasParent(&self->actor, globalCtx)) { gSaveContext.itemGetInf[2] |= 0x4000; - self->actionFunc = FUN_2389EC; + self->actionFunc = EnNiwLady_Action_2389EC; } else { - GiveItem(&self->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f); + Actor_OfferGetItem(&self->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f); } } diff --git a/code/src/actors/business_scrubs.c b/code/src/actors/business_scrubs.c index 15954b49..1eba7b53 100644 --- a/code/src/actors/business_scrubs.c +++ b/code/src/actors/business_scrubs.c @@ -102,11 +102,11 @@ void EnShopnuts_rInit(Actor* thisx, GlobalContext* globalCtx) { } void EnDns_Talk(EnDns* this, GlobalContext* globalCtx); -void FUN_00161828(EnDns* this, GlobalContext* globalCtx); -void FUN_003CE92C(EnDns* this, GlobalContext* globalCtx); -void FUN_00100434(EnDns* this, GlobalContext* globalCtx); +void EnDns_SetupSale(EnDns* this, GlobalContext* globalCtx); +void EnDns_Sale(EnDns* this, GlobalContext* globalCtx); void EnDns_SetupBurrow(EnDns* this, GlobalContext* globalCtx); void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx); +void EnDns_PostBurrow(EnDns* this, GlobalContext* globalCtx); u32 EnDns_ChangeAnim(EnDns* globalCtx, u8 arg1); @@ -123,20 +123,20 @@ void EnDns_rUpdate(Actor* thisx, GlobalContext* globalCtx) { return; } - if (prev_action_fn == EnDns_Talk && - (scrub->action_fn == FUN_00161828 || scrub->action_fn == FUN_003CE92C || scrub->action_fn == FUN_00100434)) { + if (prev_action_fn == EnDns_Talk && (scrub->action_fn == EnDns_SetupSale || scrub->action_fn == EnDns_Sale || + scrub->action_fn == EnDns_SetupBurrow)) { Multiplayer_Send_ActorUpdate(thisx, NULL, 0); } } void EnDns_StartBurrow(EnDns* this) { - if (this->action_fn == FUN_00161828 || this->action_fn == FUN_003CE92C || this->action_fn == FUN_00100434 || - this->action_fn == EnDns_SetupBurrow || this->action_fn == EnDns_Burrow) { + if (this->action_fn == EnDns_SetupSale || this->action_fn == EnDns_Sale || this->action_fn == EnDns_SetupBurrow || + this->action_fn == EnDns_Burrow || this->action_fn == EnDns_PostBurrow) { return; } this->drop_collectible = 0; this->maintain_collider = 0; this->actor.flags &= ~(0x1); EnDns_ChangeAnim(this, 1); - this->action_fn = EnDns_SetupBurrow; + this->action_fn = EnDns_Burrow; } diff --git a/code/src/actors/checkable_spot.c b/code/src/actors/checkable_spot.c index bbdbecda..37302c86 100644 --- a/code/src/actors/checkable_spot.c +++ b/code/src/actors/checkable_spot.c @@ -6,11 +6,11 @@ void EnWonderTalk_Update(Actor* thisx, GlobalContext* globalCtx); void EnWonderTalk2_Update(Actor* thisx, GlobalContext* globalCtx); -void FUN_2065E0(EnWonderTalk* this, GlobalContext* globalCtx); +void EnWonderTalk_Action_2065E0(EnWonderTalk* this, GlobalContext* globalCtx); void EnWonderTalk_rUpdate(Actor* thisx, GlobalContext* globalCtx) { EnWonderTalk* this = (EnWonderTalk*)thisx; - if (this->actionFunc == FUN_2065E0 && thisx->params == 0x0FFF) { // reading ToT altar + if (this->actionFunc == EnWonderTalk_Action_2065E0 && thisx->params == 0x0FFF) { // reading ToT altar gExtSaveData.extInf.totAltarFlags |= (1 << gSaveContext.linkAge); } EnWonderTalk_Update(thisx, globalCtx); diff --git a/code/src/actors/chest.c b/code/src/actors/chest.c index af3cece8..ab093528 100644 --- a/code/src/actors/chest.c +++ b/code/src/actors/chest.c @@ -156,7 +156,7 @@ void EnBox_rUpdate(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.doubleDefense) { healthDecrement /= 2; } - PlaySound(0x100035C); // Poe laugh SFX + Audio_PlayFanfare(0x100035C); // Poe laugh SFX sFairy = 0; } diff --git a/code/src/actors/door.c b/code/src/actors/door.c index d1b8581d..4bc89d44 100644 --- a/code/src/actors/door.c +++ b/code/src/actors/door.c @@ -44,8 +44,8 @@ void EnDoor_Unlock(EnDoor* this) { return; } this->action_fn = &EnDoor_Unlocking; - PlaySFX(0x10001D3, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); // NA_SE_EV_CHAIN_KEY_UNLOCK + Audio_PlaySfxGeneral(0x10001D3, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); // NA_SE_EV_CHAIN_KEY_UNLOCK } void EnDoor_Unlocking(EnDoor* this, GlobalContext* globalCtx) { @@ -111,8 +111,8 @@ void DoorShutter_Unlock(DoorShutter* this) { this->action_fn = &DoorShutter_Unlocking; // NA_SE_EV_CHAIN_KEY_UNLOCK : NA_SE_EV_CHAIN_KEY_UNLOCK_B u32 sfx_id = this->door_type_maybe != 5 ? 0x10001D3 : 0x1000200; - PlaySFX(sfx_id, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + Audio_PlaySfxGeneral(sfx_id, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } void DoorShutter_Unlocking(DoorShutter* this, GlobalContext* globalCtx) { @@ -150,6 +150,6 @@ void DoorGerudo_Unlock(DoorGerudo* this) { return; } this->action_fn = DoorGerudo_Unlocking; - PlaySFX(0x10001D3, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); // NA_SE_EV_CHAIN_KEY_UNLOCK + Audio_PlaySfxGeneral(0x10001D3, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); // NA_SE_EV_CHAIN_KEY_UNLOCK } diff --git a/code/src/actors/graveyard_objects.c b/code/src/actors/graveyard_objects.c index 3c78c2cc..da5691e0 100644 --- a/code/src/actors/graveyard_objects.c +++ b/code/src/actors/graveyard_objects.c @@ -21,8 +21,8 @@ void BgSpot02Objects_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } void BgSpot02Objects_ExplodeGrave(BgSpot02Objects* this) { - PlaySFX(0x1000219, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); // NA_SE_EV_GRAVE_EXPLOSION + Audio_PlaySfxGeneral(0x1000219, &this->base.world.pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); // NA_SE_EV_GRAVE_EXPLOSION this->timer = 38; this->action_fn = BgSpot02Objects_Explode; } diff --git a/code/src/actors/lake_hylia_objects.c b/code/src/actors/lake_hylia_objects.c index 17081d1a..4c4bb417 100644 --- a/code/src/actors/lake_hylia_objects.c +++ b/code/src/actors/lake_hylia_objects.c @@ -57,7 +57,7 @@ void BgSpot06Objects_rUpdate(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->actorCtx.flags.tempSwch & (0x40 << 24)) { // switch pressed if (thisx->params == 0x0002 && gSaveContext.eventChkInf[6] & 0x0200) { // if water is raised, lower it waterMovement = -1; - PlaySound(0x100025B); + Audio_PlayFanfare(0x100025B); gSaveContext.eventChkInf[6] &= ~0x0200; // TODO: remove this warp when the water will properly move globalCtx->nextEntranceIndex = 0x0604; @@ -67,7 +67,7 @@ void BgSpot06Objects_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } else { if (thisx->params == 0x0002 && !(gSaveContext.eventChkInf[6] & 0x0200)) { waterMovement = 1; - PlaySound(0x100025B); + Audio_PlayFanfare(0x100025B); gSaveContext.eventChkInf[6] |= 0x0200; // TODO: remove this warp when the water will properly move globalCtx->nextEntranceIndex = 0x0604; diff --git a/code/src/actors/player.c b/code/src/actors/player.c index 3fdeffe6..5cf6864c 100644 --- a/code/src/actors/player.c +++ b/code/src/actors/player.c @@ -19,6 +19,8 @@ void PlayerActor_Update(Actor* thisx, GlobalContext* globalCtx); void PlayerActor_Destroy(Actor* thisx, GlobalContext* globalCtx); void PlayerActor_Draw(Actor* thisx, GlobalContext* globalCtx); +void Player_Action_Running(Player* player, GlobalContext* globalCtx); + extern struct Unknown PlayerDListGroup_EmptySheathAdult; extern struct Unknown PlayerDListGroup_EmptySheathChildWithHylianShield; @@ -165,10 +167,9 @@ void PlayerActor_rDraw(Actor* thisx, GlobalContext* globalCtx) { } f32 Player_GetSpeedMultiplier(void) { - void FUN_4BA378(Player * player, GlobalContext * globalCtx); f32 speedMultiplier = 1; - if (gSettingsContext.fastBunnyHood && PLAYER->currentMask == 4 && PLAYER->stateFuncPtr == FUN_4BA378) { + if (gSettingsContext.fastBunnyHood && PLAYER->currentMask == 4 && PLAYER->actionFunc == Player_Action_Running) { speedMultiplier *= 1.5; } diff --git a/code/src/actors/skulltula.c b/code/src/actors/skulltula.c index 883b87a0..46b642c3 100644 --- a/code/src/actors/skulltula.c +++ b/code/src/actors/skulltula.c @@ -11,6 +11,8 @@ void EnSw_GoldSkulltulaDeath(EnSw* this, GlobalContext* globalCtx); void EnSw_WalltulaIdle(EnSw* this, GlobalContext* globalCtx); void EnSw_SetupGoingHome(EnSw* this, GlobalContext* globalCtx); +void Enemy_StartFinishingBlow(GlobalContext* globalCtx, Actor* actor); + #define Skullwalltula_IsCloseToPlayer(walltula) \ (walltula->base.xzDistToPlayer < 250.0 && ABS(walltula->base.yDistToPlayer) < 50.0) @@ -235,15 +237,13 @@ void EnSw_rUpdate(Actor* thisx, GlobalContext* globalCtx) { } } -void FUN_00375B70(GlobalContext* globalCtx, Actor* actor); - void EnSw_Kill(EnSw* this, GlobalContext* globalCtx) { if (this->action_fn == EnSw_GoldSkulltulaDeath || (this->base.params & 0x4000 && !gSaveContext.nightFlag)) { return; } // TODO: Fix spin speed this->unk_word2 = 24; - FUN_00375B70(globalCtx, &this->base); // Not needed? + Enemy_StartFinishingBlow(globalCtx, &this->base); // Not needed? this->base.colChkInfo.health = 0; // this->anime.play_speed = 8.0; // Doesn't seem to matter this->unk_float1 = 16.0; diff --git a/code/src/asm/hooks.s b/code/src/asm/hooks.s index 9a094640..9529c1ba 100644 --- a/code/src/asm/hooks.s +++ b/code/src/asm/hooks.s @@ -12,8 +12,7 @@ HOOK into_loader push {r0-r12, lr} bl loader_main pop {r0-r12, lr} - bl 0x100028 - b 0x100004 + b nninitRegion .section .text.randomizer_hooks @@ -775,7 +774,7 @@ HOOK GearMenuEmptySlot mov r2,#0x1 b 0x2E9A3C @ print reward hint -HOOK PlaySound +HOOK Audio_PlayFanfare push {r1-r12, lr} bl SetBGM pop {r1-r12, lr} @@ -1106,7 +1105,7 @@ HOOK OwlEntranceOverride bl Entrance_OverrideNextIndex cpy r1, r0 pop {r0, r2-r12, lr} - b 0x3716F0 + b SetNextEntrance HOOK SavewarpSetRespawnFlag push {r0-r12, lr} @@ -1380,7 +1379,7 @@ HOOK GrannyItemOverride bl EnDs_ItemOverride cpy r2,r0 pop {r0,r1,r3-r12,lr} - b 0x3724DC @GiveItem + b Actor_OfferGetItem HOOK GrannySetRewardFlag push {r0-r12,lr} diff --git a/code/src/asm/patches.s b/code/src/asm/patches.s index 13044eba..2721b69e 100644 --- a/code/src/asm/patches.s +++ b/code/src/asm/patches.s @@ -7,7 +7,7 @@ .endm PATCH loader - b hook_into_loader + bl hook_into_loader PATCH before_GlobalContext_Update bl hook_before_GlobalContext_Update @@ -958,8 +958,8 @@ PATCH CheckForPocketCuccoHatchKankyo PATCH SkipSongReplays_WarpBlocksFix b hook_SkipSongReplays_WarpBlocksFix -PATCH PlaySound - b hook_PlaySound +PATCH Audio_PlayFanfare + b hook_Audio_PlayFanfare PATCH SetBGMEntrance b hook_SetBGMEntrance diff --git a/code/src/icetrap.c b/code/src/icetrap.c index e2ff81dd..de24f628 100644 --- a/code/src/icetrap.c +++ b/code/src/icetrap.c @@ -219,7 +219,7 @@ u8 IceTrap_ActivateCurseTrap(u8 curseType) { gSaveContext.timer2Value = 60; TimerFrameCounter = 30; DisplayTextbox(gGlobalContext, CURSETRAP_TEXT_BASE_INDEX + curseType - ICETRAP_CURSE_SHIELD, 0); - PlaySound(0x100035C); // Poe laugh SFX + Audio_PlayFanfare(0x100035C); // Poe laugh SFX IceTrap_ActiveCurse = (s8)curseType; return 1; } diff --git a/code/src/models.c b/code/src/models.c index f91cbc7f..7071b3bb 100644 --- a/code/src/models.c +++ b/code/src/models.c @@ -110,7 +110,7 @@ void Actor_SetModelMatrixWrapper(Actor* actor, nn_math_MTX34* mtx) { "mov r0,r1\n" // mtx "mov r1,r2\n" // shape "push {r0-r12, lr}\n" - "bl 0x3679D0\n" + "bl Actor_SetModelMatrix\n" "pop {r0-r12, lr}\n" "pop {r0-r12, lr}\n"); } diff --git a/code/src/multiplayer.c b/code/src/multiplayer.c index f12e8ed7..81731d05 100644 --- a/code/src/multiplayer.c +++ b/code/src/multiplayer.c @@ -1000,8 +1000,8 @@ void Multiplayer_Receive_LinkSFX(u16 senderID) { } mp_duplicateSendProtection = true; - PlaySFX(mBuffer[1], &ghostDataPtr->position, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + Audio_PlaySfxGeneral(mBuffer[1], &ghostDataPtr->position, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // Shared Progress From f621987c3844bdca0de37b961ba25e354f61af8e Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Wed, 1 Apr 2026 22:03:40 +0200 Subject: [PATCH 8/9] Correctly detect Python command to use --- Makefile | 5 ++++- code/Makefile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7e8046eb..70c57c7d 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITARM)/3ds_rules +# Detect Python command to use +PYTHON := $(shell command -v python3 > /dev/null 2>&1 && echo python3 || echo python) + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -183,7 +186,7 @@ endif #--------------------------------------------------------------------------------- app: create_basecode $(BUILD) $(GFXBUILD) $(DEPSDIR) $(ROMFS_T3XFILES) $(T3XHFILES) @rm -fr $(TARGET).3dsx - @py generate_patch_symbols.py + @$(PYTHON) generate_patch_symbols.py @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile create_basecode: diff --git a/code/Makefile b/code/Makefile index 67dfdfc0..98cf1e36 100644 --- a/code/Makefile +++ b/code/Makefile @@ -9,6 +9,9 @@ endif TOPDIR ?= $(CURDIR) include $(DEVKITARM)/3ds_rules +# Detect Python command to use +PYTHON := $(shell command -v python3 > /dev/null 2>&1 && echo python3 || echo python) + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -156,7 +159,7 @@ endif base_patch: @[ -d $(BUILD) ] || mkdir -p $(BUILD) @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - @py patch.py $(OUTPUT).elf $(debug); + @$(PYTHON) patch.py $(OUTPUT).elf $(debug); @mv basecode.ips $(TARGET).ips @printf "Created $(TARGET).ips\n\n" From ecb23c489084a1e86f541b13982070ab3a1e589e Mon Sep 17 00:00:00 2001 From: HylianFreddy <82058772+HylianFreddy@users.noreply.github.com> Date: Wed, 1 Apr 2026 22:13:51 +0200 Subject: [PATCH 9/9] Fix python script for python 3.7 --- generate_patch_symbols.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_patch_symbols.py b/generate_patch_symbols.py index a4a075fc..60b8b32c 100644 --- a/generate_patch_symbols.py +++ b/generate_patch_symbols.py @@ -40,7 +40,7 @@ def getSymbolsTable(elfFilePath): # If the CPP content doesn't change, don't rewrite the file so it won't be recompiled if newContent != oldContent: - cppFile.write_text(newContent, newline='\n') + cppFile.write_text(newContent) print(f'Wrote desired symbols to {CPP_FILE_PATH}') else: print(f'Patch symbols unchanged')