Skip to content

Commit 468f0ec

Browse files
committed
Merge "Fix learning Saria's song multiple times" (#2573)
# Conflicts: # ASM/build/asm_symbols.txt # ASM/build/bundle.o # ASM/build/c_symbols.txt # data/generated/patch_symbols.json # data/generated/rom_patch.txt # data/generated/symbols.json
2 parents 760df78 + 839dbea commit 468f0ec

9 files changed

Lines changed: 42137 additions & 42118 deletions

File tree

ASM/build/asm_symbols.txt

Lines changed: 1392 additions & 1391 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)

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Fix a crash that could occur on Wii VC when starting a cutscene while climbing a ladder.
44
* Fix a visual bug where ice traps appear very large if Link is wearing the Bunny Hood or hovering using the Hover Boots.
55
* Fix a vanilla bug where the player can become unable to move when the Hookshot is pulled but fails to load.
6+
* Fix a bug where the item on the `Song from Saria` location could be obtained multiple times by savewarping on the first frame after obtaining it, then returning to the location.
67

78
# 9.1
89

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)