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,566 changes: 786 additions & 780 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,492 changes: 747 additions & 745 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ASM/ootSymbols.ld
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ func_800982FC = 0x80081740;
Matrix_Push = 0x800aa6ec;
Matrix_Pop = 0x800aa724;
Audio_StopCurrentMusic = 0x800C7684;
Audio_PlaySfxGeneral = 0x800c806c;
sprintf = 0x800CE7b4;
Message_OpenText = 0x800DC838;
Fault_AddHungupAndCrashImpl = 0x800AF564;
z64_ItemIcons = 0x800F8D2C;
gObjectTable = 0x800f8ff8;
gKaleidoMgrCurOvl = 0x800fe4bc;
z64_SfxDefaultPos = 0x80104394;
z64_SfxDefaultFreqAndVolScale = 0x801043A0;
z64_SfxDefaultReverb = 0x801043A8;
Expand Down
1 change: 1 addition & 0 deletions ASM/src/build.asm
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ RANDO_CONTEXT:
.include "player_hookshotcheckspawn.asm"
.include "enbox_callloadobject.asm"
.include "object_checkmaxobjectspace.asm"
.include "kaleido_preventemptyunequipsword.asm"

.align 0x10
.importobj "../build/bundle.o"
Expand Down
10 changes: 2 additions & 8 deletions ASM/src/hacks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1276,21 +1276,14 @@ nop
nop

; Remove "to Equip" text if the cursor is on an empty slot
; See KaleidoScope_PreventEmptyUnequipSword for prevent empty equip
; Replaces:
; lbu v1, 0x0000 (t4)
; addiu at, r0, 0x0009
.orga 0xBB6688 ; In memory: 0x8038E008
jal equipment_menu_prevent_empty_equip
nop

; Prevent empty slots from being equipped
; Replaces:
; addu t8, t4, v0
; lbu v1, 0x0000 (t8)
.orga 0xBB67C4 ; In memory: 0x8038E144
jal equipment_menu_prevent_empty_equip
addu t4, t4, v0

;==================================================================================================
; Item menu
;==================================================================================================
Expand Down Expand Up @@ -4170,3 +4163,4 @@ DemoEffect_DrawJewel_AfterHook:
.include "hacks/z_en_sa.asm"
.include "hacks/en_box.asm"
.include "hacks/z_scene.asm"
.include "hacks/ovl_kaleido_scope.asm"
18 changes: 18 additions & 0 deletions ASM/src/hacks/ovl_kaleido_scope.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.headersize (0x808137c0 - 0x00bb11e0)

; Prevent empty equipment equip + allow unequipping sword
; Replaces: beq v1,at,80818dc8
; nop
; lw t3,4(t1)
; lui a1,0x8010
; addiu a1,a1,17300
; bne v1,t3,80818ebc
; li a2,4
.org 0x80818dac ; KaleidoScope_DrawEquipment
jal KaleidoScope_PreventEmptyUnequipSword
nop
li at,2
beql t7,at,0x80818ee0 ; don't run equip, don't play error sound
nop ; = unequipped sword
beqz t7,0x80818ebc ; don't run equip, play error sound
li a2,4 ; else, run normal equipping
75 changes: 75 additions & 0 deletions ASM/src/kaleido_preventemptyunequipsword.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
KaleidoScope_PreventEmptyUnequipSword: ; t1 savectx t8 age req table s6 pausectx
addiu sp,sp,-24
sw ra,24(sp)
sw v0,28(sp)

jal equipment_menu_slot_filled ; prevent empty slots from being equipped
nop
bnezl v0,@@CheckUse
lbu v1,(t8) ; load age req from usability table
li v1,255 ; prevent equip (set wrong age)
lui a1,0x8010 ; displaced error setup
addiu a1,a1,17300 ; displaced error setup
b @@Return
move t7,zero ; don't equip, run error after

@@CheckUse:
li at,9 ; usable all ages
beq v1,at,@@CheckSwordRow ; displaced age check
lw t3,4(t1) ; link age
beql v1,t3,@@CheckSwordRow ; displaced age check
nop
lui a1,0x8010 ; displaced error setup
addiu a1,a1,17300 ; displaced error setup
b @@Return
move t7,zero ; don't equip, run error after

@@CheckSwordRow: ; check if current row/Y is sword row
bnezl a0,@@Return ; cursorY
li t7,1 ; if not, run regular equip

lui t0,0x8010
lhu t3,-29584(t0) ; gEquipMasks
lhu t6,112(t1) ; equips equipment
and t6,t6,t3 ; equips & gEquipMasks
lh at,552(s6) ; cursorX
bnel at,t6,@@Return ; if cursor sword != equipped sword,
li t7,1 ; equip sword

lhu t4,-29576(t0) ; gEquipNegMasks
lhu t6,112(t1) ; equips equipment
and t4,t6,t4
sh t4,112(t1) ; remove equipped bit for current sword

li t0,1
sh t0,3890(t1) ; set swordless flag
li t0,255 ; item_none
sb t0,104(t1) ; button item b
sb t0,5090(t1) ; button status b

li a0,18440 ; setup play equip sfx
lui a1,0x8010
addiu a1,a1,17300
li a2,4
move a3,s4
lui t4,0x8010
addiu t4,t4,17320
sw t4,20(sp)
jal Audio_PlaySfxGeneral
sw s4,16(sp)

lui t0,hi(gKaleidoMgrCurOvl) ; load player-kaleido overlay manager
lw t0,lo(gKaleidoMgrCurOvl)(t0)
lw t0,0x14(t0) ; load offset
la t9,0x808296f4 ; sEquipTimer
addu t9,t0 ; resulting address with offset
li t3,10
sh t3,(t9) ; 10 frames timer
li t0,7
sh t0,484(s6) ; set pause main state
li t7,2 ; don't run equip + don't run error
@@Return:
lw ra,24(sp)
lw v0,28(sp)
jr ra ; return value in t7
addiu sp,sp,24
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
Loading