Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,540 changes: 772 additions & 768 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
1,446 changes: 724 additions & 722 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ASM/ootSymbols.ld
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Flags_GetCollectible = 0x800206E8;
Flags_SetCollectible = 0x8002071C;
Actor_SetColorFilter = 0x80027090;
CutsceneFlags_Get = 0x8005991C;
Magic_Reset = 0x80072548;
z64_Gfx_SetupDL_42Opa = 0x8007E868;
Audio_StopCurrentMusic = 0x800C7684;
sprintf = 0x800CE7b4;
Expand Down
1 change: 1 addition & 0 deletions ASM/src/build.asm
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ RANDO_CONTEXT:
.include "en_dns.asm"
.include "bg_gate_shutter.asm"
.include "big_poe.asm"
.include "player_trapresetmagic.asm"

.align 0x10
.importobj "../build/bundle.o"
Expand Down
1 change: 1 addition & 0 deletions ASM/src/hacks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4161,3 +4161,4 @@ DemoEffect_DrawJewel_AfterHook:
.include "hacks/ovl_en_ssh.asm"
.include "hacks/ovl_en_okarina_tag.asm"
.include "hacks/sound.asm"
.include "hacks/z_player.asm"
33 changes: 33 additions & 0 deletions ASM/src/hacks/z_player.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.headersize(0x808301c0 - 0xbcdb70)

;================================================================================
; Fixes magic getting locked if frozen/electrified during spell cast, i.e. traps
; Also ensures that Farore's Wind doesn't consume magic before actually working
;================================================================================
; Call magic reset upon getting frozen
; Replaces li a1,255
; li a2,10
.org 0x80835df0 ; in func_80837C0C
jal Player_FrozenElectrifiedMagicReset
li a2,10

; Call magic reset upon getting electrified
; Replaces li a1,255
; li a2,80
.org 0x80835e4c ; in func_80837C0C
jal Player_FrozenElectrifiedMagicReset
li a2,80

; Remove the Farore check for normal consume magic, so that it can be done
; once the respawn data has been set and spell actually worked
; Replaces bgtz t3,8084e770
.org 0x8084e71c ; in Player_Action_CastMagicSpell
b 0x8084e770
;lui v0,0x8012 is a branch target

; Consume magic once respawn point has been set
; Replaces sw t4,3716(v0)
; sw t5,3720(v0)
.org 0x8084e824 ; in Player_Action_CastMagicSpell
jal Player_SetFaroreMagicState
sw t4,3716(v0)
21 changes: 21 additions & 0 deletions ASM/src/player_trapresetmagic.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Player_FrozenElectrifiedMagicReset:
addiu sp,sp,-24
sw ra,16(sp)
li t4,4 ; MAGIC_STATE_METER_FLASH_2 (waiting for consume)
la t5,SAVE_CONTEXT
lh t6,5104(t5) ; gSaveContext.magicState
bnel t4,t6,@@MagicResetReturn ; Reset if flash 2 state
addiu sp,sp,24
jal Magic_Reset ; Call vanilla magic reset
nop
lw ra,16(sp)
addiu sp,sp,24
@@MagicResetReturn: ; If other state, ra is unchanged, don't need to load it
jr ra
li a1,255 ; Displaced

Player_SetFaroreMagicState:
li t4,1 ; MAGIC_STATE_CONSUME_SETUP
sh t4,5104(v0) ; into gSaveContext.magicState
jr ra
sw t5,3720(v0) ; Displaced
2 changes: 1 addition & 1 deletion data/generated/patch_symbols.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading