add disasm ref code for zelda walking in sanctuary

This commit is contained in:
scawful
2022-12-16 17:47:23 -06:00
parent 3c0b091aaf
commit 7720fffb68

View File

@@ -91,10 +91,127 @@ Sprite_Zelda:
JSL UseImplicitRegIndexedLocalJumpTable
dw Zelda_InPrison
dw Zelda_EnteringSanctuary
dw Zelda_AtSanctuary
dw Zelda_InPrison ; On the beach
dw Zelda_EnteringSanctuary ; Approaching Maku Tree
dw Zelda_AtSanctuary ; In the Maku Tree forest area
}
; ==============================================================================
; *$2ED69-$2ED75 JUMP LOCATION
Zelda_EnteringSanctuary:
{
LDA $0D80, X
JSL UseImplicitRegIndexedLocalJumpTable
dw Zelda_WalkTowardsPriest
dw Zelda_RespondToPriest
dw Zelda_BeCarefulOutThere
}
; ==============================================================================
; $2ED76-$2ED7D DATA
pool Zelda_WalkTowardsPriest:
{
.timers
db $26, $1A, $2C, $01
.directions
db $01, $03, $01, $02
}
; ==============================================================================
; *$2ED7E-$2EDC3 JUMP LOCATION
Zelda_WalkTowardsPriest:
{
LDA $0DF0, X : BNE .walking
LDY $0D90, X : CPY.b #$04 : BCC .beta
INC $0D80, X
STZ $0DE0, X
STZ $0EB0, X
STZ $0D50, X
STZ $0D40, X
RTS
.beta
LDA .timers, Y : STA $0DF0, X
LDA .directions, Y : STA $0EB0, X : STA $0DE0, X
INC $0D90, X
TAY
LDA Sprite_Zelda.x_speeds, Y : STA $0D50, X
LDA Sprite_Zelda.y_speeds, Y : STA $0D40, X
.walking
LDA $1A : LSR #3 : AND.b #$01 : STA $0DC0, X
RTS
}
; ==============================================================================
; *$2EDC4-$2EDEB JUMP LOCATION
Zelda_RespondToPriest:
{
; "Yes, it was [Name] who helped me escape from the dungeon! ..."
LDA.b #$1D
LDY.b #$00
JSL Sprite_ShowMessageUnconditional
INC $0D80, X
LDA.b #$02 : STA $7FFE01
LDA.b #$01 : STA $7EF3C8
JSL SavePalaceDeaths
LDA.b #$02 : STA $7EF3C5
PHX
JSL Sprite_LoadGfxProperties.justLightWorld
PLX
RTS
}
; ==============================================================================
; *$2EDEC-$2EE05 JUMP LOCATION
Zelda_BeCarefulOutThere:
{
JSR Sprite2_DirectionToFacePlayer : TYA : EOR.b #$03 : STA $0EB0, X
; "[Name], be careful out there! I know you can save Hyrule!"
LDA.b #$1E
LDY.b #$00
JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .didnt_speak
STA $0DE0, X
STA $0EB0, X
.didnt_speak
RTS
}
; ==============================================================================