Intro Cutscene warp, organize bank07 free space

This commit is contained in:
scawful
2023-05-17 22:36:35 -05:00
parent 2026c0f2e1
commit 2bf1b4dea5
8 changed files with 348 additions and 282 deletions

View File

@@ -14,80 +14,10 @@ incbin gfx/deku_link.bin
; =============================================================================
org $07F8D1
Link_HandleDekuTransformation:
{
LDA $5D : CMP.b #$0A : BEQ .continue
JSR $82DA
.continue
STZ $03F5
STZ $03F6
; Link can move.
CLC
RTS
}
org $07811A
JSR Link_HandleDekuTransformation
; =============================================================================
org $07A64B ; formerly Quake
LinkItem_DekuMask:
{
; Check for R button held
LDA $F2 : CMP #$10 : BNE .return
JSR Link_CheckNewY_ButtonPress : BCC .return
LDA $3A : AND.b #$BF : STA $3A ; clear the Y button state
LDA $6C : BNE .return ; in a doorway
LDA $0FFC : BNE .return ; can't open menu
LDY.b #$04 : LDA.b #$23
JSL AddTransformationCloud
LDA.b #$14 : JSR Player_DoSfx2
LDA $02B2 : CMP #$01 : BEQ .unequip ; is the deku mask on?
JSL Palette_ArmorAndGloves ; set the palette
LDA.l $7EF359 : STA $0AA5 ; Store the current sword
LDA.l $7EF35A : STA $0AAF ; Store the current shield
LDA.b #$00 : STA $7EF359 : STA $7EF35A ; Clear the sword and shield
LDA #$02 : STA $7E03FC ; Set the override to Bow (pea shooter)
LDA #$35 : STA $BC ; put the mask on
LDA #$01 : STA $02B2
BRA .return
.unequip
JSL Palette_ArmorAndGloves
STZ $5D
; Restore the sword and shield
LDA $0AA5 : STA.l $7EF359
LDA $0AAF : STA.l $7EF35A
LDA #$00 : STA $7E03FC ; clear the override
LDA #$10 : STA $BC : STZ $02B2 ; take the mask off
.return
RTS
}
; =============================================================================
org $079CD9
JSL LinkItem_CheckForSwordSwing_Masks
org $07A013
JSL LinkItem_SlingshotPrepare
; =============================================================================
; =============================================================================
org $318000
LinkItem_CheckForSwordSwing_Masks:
@@ -105,6 +35,8 @@ LinkItem_CheckForSwordSwing_Masks:
; =============================================================================
; org $07A013
; JSL LinkItem_SlingshotPrepare
; Hooked @ [$07A013]
; $A200
@@ -121,8 +53,6 @@ LinkItem_SlingshotPrepare:
; $A214
.void
; $A270
.beta
LDA $7F1060
@@ -181,4 +111,75 @@ LinkItem_SlingshotPrepare:
STA $420B ; Start DMA on channel 0
RTL ; Return from subroutine long
}
}
; =============================================================================
org $07A64B ; formerly Quake
LinkItem_DekuMask:
{
; Check for R button held
LDA $F2 : CMP #$10 : BNE .return
JSR Link_CheckNewY_ButtonPress : BCC .return
LDA $3A : AND.b #$BF : STA $3A ; clear the Y button state
LDA $6C : BNE .return ; in a doorway
LDA $0FFC : BNE .return ; can't open menu
LDY.b #$04 : LDA.b #$23
JSL AddTransformationCloud
LDA.b #$14 : JSR Player_DoSfx2
LDA $02B2 : CMP #$01 : BEQ .unequip ; is the deku mask on?
JSL Palette_ArmorAndGloves ; set the palette
LDA.l $7EF359 : STA $0AA5 ; Store the current sword
LDA.l $7EF35A : STA $0AAF ; Store the current shield
LDA.b #$00 : STA $7EF359 : STA $7EF35A ; Clear the sword and shield
LDA #$02 : STA $7E03FC ; Set the override to Bow (pea shooter)
LDA #$35 : STA $BC ; put the mask on
LDA #$01 : STA $02B2
BRA .return
.unequip
JSL Palette_ArmorAndGloves
STZ $5D
; Restore the sword and shield
LDA $0AA5 : STA.l $7EF359
LDA $0AAF : STA.l $7EF35A
LDA #$00 : STA $7E03FC ; clear the override
LDA #$10 : STA $BC : STZ $02B2 ; take the mask off
.return
RTS
}
; =============================================================================
org $07811A
JSR Link_HandleDekuTransformation
; Bank 07 Free Space
; Previous function LinkState_CheckMinishTile
org $07F903
Link_HandleDekuTransformation:
{
LDA $5D : CMP.b #$0A : BEQ .continue
JSR $82DA
.continue
STZ $03F5
STZ $03F6
; Link can move.
CLC
RTS
}
print "==> Link_HandleDekuTransformation ", pc