Skip to content

Commit 839dbea

Browse files
author
djevangelia
committed
Fix double Saria's song by move set flag
1 parent 2900fed commit 839dbea

9 files changed

Lines changed: 42464 additions & 42495 deletions

File tree

ASM/build/asm_symbols.txt

Lines changed: 1426 additions & 1425 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/build/bundle.o

2.41 KB
Binary file not shown.

ASM/build/c_symbols.txt

Lines changed: 723 additions & 722 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/src/cutscenes.asm

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,19 @@ override_saria_song_check:
178178
;==================================================================================================
179179

180180
set_saria_song_flag:
181-
lh v0, 0xa4(t6) ; v0 = scene
182-
li t0, SAVE_CONTEXT
181+
lbu t0,7532(a1) ; play->csCtx.state
182+
bnez t0,@@Return ; If not CS state idle, continue
183+
li t0,0x56 ; SFM scene id
184+
lh t1,164(a1) ; play->sceneId
185+
bnel t0,t1,@@Return ; If not SFM, continue
186+
nop
187+
la t0, SAVE_CONTEXT ; If SFM and CS state idle = finished Saria's song CS
183188
lb t1, 0x0EDF(t0)
184-
ori t1, t1, 0x80
185-
sb t1, 0x0EDF(t0)
189+
ori t1, t1, 0x80 ; 0x80 Saria flag
190+
sb t1, 0x0EDF(t0) ; Save item received flag
191+
@@Return:
186192
jr ra
187-
nop
193+
move a2,a1 ; displaced
188194

189195
;==================================================================================================
190196

ASM/src/hacks.asm

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,14 +1391,6 @@ nop
13911391
.orga 0xD12F78
13921392
li t7, 0
13931393

1394-
;li v1, 5
1395-
.orga 0xE29388
1396-
j override_saria_song_check
1397-
1398-
;lh v0, 0xa4(t6) ; v0 = scene
1399-
.orga 0xE2A044
1400-
jal set_saria_song_flag
1401-
14021394
; li a1, 3
14031395
.orga 0xDB532C
14041396
jal override_song_of_time
@@ -4162,3 +4154,4 @@ DemoEffect_DrawJewel_AfterHook:
41624154
.include "hacks/ovl_en_okarina_tag.asm"
41634155
.include "hacks/sound.asm"
41644156
.include "hacks/z_player.asm"
4157+
.include "hacks/z_en_sa.asm"

ASM/src/hacks/z_en_sa.asm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.headersize (0x80aa8bc0 - 0x00e28a10)
2+
3+
;li v1, 5
4+
.orga 0xE29388 ; in func_80AF5DFC
5+
j override_saria_song_check
6+
7+
; Set flag for player having received Saria's item
8+
; Replaces sw s1,32(sp)
9+
; move a2,a1
10+
.org 0x80aa9f84 ; in func_80AF68E4
11+
jal set_saria_song_flag
12+
sw s1,32(sp)

data/generated/patch_symbols.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)