From 935346fb1366b6ca504b776b280b0c2ae8d27d22 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 6 Jul 2024 19:47:35 -0400 Subject: [PATCH] cleanup deku mask, remove unused code --- Masks/deku_mask.asm | 118 +++++++++++++-------------------- Sprites/ZSpriteLib/sprites.asm | 18 +++-- 2 files changed, 59 insertions(+), 77 deletions(-) diff --git a/Masks/deku_mask.asm b/Masks/deku_mask.asm index c665ed4..c256e07 100644 --- a/Masks/deku_mask.asm +++ b/Masks/deku_mask.asm @@ -25,6 +25,8 @@ deku_palette: dw #$6739, #$15C5, #$150E, #$26C9, #$17AA, #$21F4, #$17DF, #$42DB dw #$14A5, #$14BC, #$14B2, #$14A5, #$7FFF, #$7A18, #$178C +print "End of Masks/deku_mask.asm ", pc + ; ========================================================= ; Indicates somaria platform status. @@ -56,56 +58,31 @@ warnpc $07A6BE ; ========================================================= -org $07811A - JSR Link_HandleDekuTransformation +Link_HandleChangeInZVelocity = $078926 +Link_HandleChangeInZVelocity_preset = $078932 -pullpc ; Free space in bank07 - all_sprites.asm -Link_HandleDekuTransformation: -{ - ; Check if using Quake Medallion - LDA $5D : CMP.b #$0A : BEQ .continue - - .continue - JSR $82DA ; Link_HandleBunnyTransformation - - RTS -} - -print "End of Masks/deku_mask.asm ", pc -pushpc - - -org $078926 - Link_HandleChangeInZVelocity: - -org $078932 - Link_HandleChangeInZVelocity_preset: - -org $078028 - PlaySFX_Set2: - -org $07802F - PlaySFX_Set3: +PlaySFX_Set2 = $078028 +PlaySFX_Set3 = $07802F org $07A6BE LinkState_UsingQuake: { -.anim_step - db #$00, #$01, #$02, #$03 - db #$00, #$01, #$02, #$03 - db #$10, #$10, #$00, #$00 ; 16 + .anim_step + db #$00, #$01, #$02, #$03 + db #$00, #$01, #$02, #$03 + db #$10, #$10, #$00, #$00 ; 16 -.anim_timer - db 5, 5, 5, 5 - db 5, 5, 5, 5 - db 5, 5, 5, 19 + .anim_timer + db 5, 5, 5, 5 + db 5, 5, 5, 5 + db 5, 5, 5, 19 JSR $F514 ; CacheCameraPropertiesIfOutdoors STZ.b $27 : STZ.b $28 ; Reset recoil X and Y ; SPIN STEP CHECK - LDA.w $031D : CMP.b #$0A : BNE .not_ascending + LDA.w LinkSpinStep : CMP.b #$0A : BNE .not_ascending LDA.w $0362 : STA.b $29 LDA.w $0363 : STA.w $02C7 LDA.w $0364 : STA.b $24 @@ -116,56 +93,51 @@ LinkState_UsingQuake: JSL LinkHop_FindArbitraryLandingSpot ; Link recoil Z value, hop Z value - LDA.b $29 : STA.w $0362 + LDA.b LinkRecoilZ : STA.w $0362 LDA.w $02C7 : STA.w $0363 ; Z Position of Link LDA.b $24 : STA.w $0364 : BMI .still_ascending - ; End of ASCEND ----------------------------------------- - ; Link recoil Z - LDY.b #$00 : LDA.b $29 : BPL .done_ascending + ; End of ASCEND ------------------------------------- + LDY.b #$00 : LDA.b LinkRecoilZ : BPL .done_ascending + LDY.b #$00 ; Thrust Sword Down OAM Frame Set - LDY.b #$00 ; Thrust Sword Down OAM Frame Set - - .done_ascending - STY.w $031C : BRA .exit - ; ------------------------------------------------------- + .done_ascending + STY.w $031C : BRA .exit + ; --------------------------------------------------- .not_ascending DEC.b $3D : BPL .special .still_ascending - INC.w $031D + INC.w LinkSpinStep + LDX.w LinkSpinStep + CPX.b #$04 : BNE .skip_swish_sfx + PHX : LDA.b #$23 : JSR PlaySFX_Set3 : PLX + .skip_swish_sfx + CPX.b #$0C : BNE .dont_reset_step + LDA.b #$0B : STA.w LinkSpinStep + TAX + .dont_reset_step + LDA.w .anim_timer,X : STA.b $3D + LDA.w .anim_step,X : STA.w $031C + + LDA.w $0324 : BNE .special ; Prevent repeat spellcast check + CPX.b #$0B : BNE .special ; Animation step check - ; $031D - Spin Step - LDX.w $031D : CPX.b #$04 : BNE .skip_swish_sfx - PHX : LDA.b #$23 : JSR PlaySFX_Set3 : PLX - .skip_swish_sfx - CPX.b #$0C : BNE .dont_reset_step - LDA.b #$0B : STA.w $031D + ; ------------------------------------------------- + ; Prevent repeat spellcast set + LDA.b #$01 : STA.w $0324 + LDA.b #$12 : STA LinkZ + LDA.b #$FF : STA FallTimer + LDA.b #$01 : STA $70 + ; ------------------------------------------------- - TAX - - .dont_reset_step - LDA.w .anim_timer,X : STA.b $3D - LDA.w .anim_step,X : STA.w $031C - - LDA.w $0324 : BNE .special ; Prevent repeat spellcast check - CPX.b #$0B : BNE .special ; Animation step check - - ; ----------------------------------------------------- - ; Prevent repeat spellcast set - LDA.b #$01 : STA.w $0324 - LDA.b #$12 : STA $24 - LDA.b #$FF : STA $5C - LDA.b #$01 : STA $70 - ; ----------------------------------------------------- - -.exit + .exit RTS -.special + .special DEC $5C JSL DekuLink_HoverBasedOnInput RTS diff --git a/Sprites/ZSpriteLib/sprites.asm b/Sprites/ZSpriteLib/sprites.asm index 2f981bd..7f02597 100644 --- a/Sprites/ZSpriteLib/sprites.asm +++ b/Sprites/ZSpriteLib/sprites.asm @@ -510,11 +510,19 @@ LinkY = $20 ; Position Y of link LinkYH = $21 ; High position Y of link LinkX = $22 ; Position X of link LinkXH = $23 ; High position X of link +LinkZ = $24 ; Position Z of link ; ----UDLR ; [U Up][D Down][L Left][R Right] ; Direction link is pushing against -LinkPushDir = $26 +LinkPushDir = $26 + +; Link's recoiling speed +; By themselves, these do not do much +; They will be reset every frame Link is not in recoil state +LinkRecoilY = $27 +LinkRecoilX = $28 +LinkRecoilZ = $29 ; Link's subpixel velocity ; when this value overflows, Link's main velocity gains an extra pixel @@ -538,9 +546,6 @@ LinkMoveDir = $67 ; 0: Not moving, 1: Moving cardinal, 2: Moving diagonally LinkMoveInfo = $6A -LinkRecoilY = $27 ; Recoiling speed Y of link -LinkRecoilX = $28 ; Recoiling speed X of link - LinkVisible = $4B ; if set to 0x0C link will be invisible LinkBunnyGfx = $56 ; if set to 1 link will be bunny, otherwise link @@ -552,6 +557,7 @@ LinkSpeedTbl = $5E ; if is set to 0x02 or 0x03 link is falling LinkFalling = $5B +FallTimer = $5C ; LinkState_Default : 0x00 ; LinkState_Pits : 0x01 @@ -643,6 +649,10 @@ LinkAnim = $037A LinkWallCheat = $037F ; If non zero can walk through walls +; Animation step/graphics for spin attack animations; including medallions. +LinkSpinGfx = $031C +LinkSpinStep = $031D + ; ========================================================= Link_ReceiveItem = $0799AD ; Y = item id