object housekeeping

This commit is contained in:
scawful
2025-01-19 13:39:15 -05:00
parent 236e888bdb
commit a0f1ae77a5
4 changed files with 46 additions and 108 deletions

View File

@@ -1,6 +1,6 @@
; ========================================================= ; =========================================================
; Sprite Properties ; Collectible Sprites
; ========================================================= ; (Pineapple, Seashell, Sword/Shield, Rock Sirloin)
!SPRID = $52 !SPRID = $52
!NbrTiles = 03 ; Number of tiles used in a frame !NbrTiles = 03 ; Number of tiles used in a frame
@@ -32,8 +32,6 @@
%Set_Sprite_Properties(Sprite_Collectible_Prep, Sprite_Collectible_Long) %Set_Sprite_Properties(Sprite_Collectible_Prep, Sprite_Collectible_Long)
; =========================================================
Sprite_Collectible_Long: Sprite_Collectible_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
@@ -59,8 +57,6 @@ Sprite_Collectible_Long:
RTL RTL
} }
; =========================================================
Sprite_Collectible_Prep: Sprite_Collectible_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
@@ -80,12 +76,10 @@ Sprite_Collectible_Prep:
RTL RTL
} }
; =========================================================
Sprite_Collectible_Main: Sprite_Collectible_Main:
{ {
LDA.w SprAction, X LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable JSL JumpTableLocal
dw Pineapple dw Pineapple
dw Seashell dw Seashell
@@ -139,8 +133,6 @@ Sprite_Collectible_Main:
} }
; =========================================================
Sprite_Pineapple_Draw: Sprite_Pineapple_Draw:
{ {
JSL Sprite_PrepOamCoord JSL Sprite_PrepOamCoord
@@ -196,9 +188,6 @@ Sprite_Pineapple_Draw:
RTS RTS
; =========================================================
.start_index .start_index
db $00 db $00
.nbr_of_tiles .nbr_of_tiles
@@ -271,7 +260,6 @@ Sprite_SwordShield_Draw:
RTS RTS
.start_index .start_index
db $00 db $00
.nbr_of_tiles .nbr_of_tiles

View File

@@ -32,8 +32,6 @@
%Set_Sprite_Properties(Sprite_DekuLeaf_Prep, Sprite_DekuLeaf_Long) %Set_Sprite_Properties(Sprite_DekuLeaf_Prep, Sprite_DekuLeaf_Long)
; =========================================================
Sprite_DekuLeaf_Long: Sprite_DekuLeaf_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
@@ -50,8 +48,6 @@ Sprite_DekuLeaf_Long:
RTL RTL
} }
; =========================================================
Sprite_DekuLeaf_Prep: Sprite_DekuLeaf_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
@@ -62,12 +58,10 @@ Sprite_DekuLeaf_Prep:
RTL RTL
} }
; =========================================================
Sprite_DekuLeaf_Main: Sprite_DekuLeaf_Main:
{ {
LDA.w SprAction, X LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable JSL JumpTableLocal
dw WaitForPlayer dw WaitForPlayer
dw Whirlpool_Main dw Whirlpool_Main
@@ -99,48 +93,24 @@ Sprite_DekuLeaf_Main:
STZ $0AAB ; Reset underwater flag STZ $0AAB ; Reset underwater flag
STZ $0351 ; Reset ripple flag STZ $0351 ; Reset ripple flag
STZ $037B ; Reset invincibility flag STZ $037B ; Reset invincibility flag
STZ $02B2 STZ $02B2 ; Reset mask flag
LDA.b $10
CMP.b #$0B
BEQ .exit
LDA.b $8A
AND.b #$40
STA.b $7B
BEQ .no_mirror_portal
LDA.b $20
STA.w $1ADF
LDA.b $21
STA.w $1AEF
LDA.b $22
STA.w $1ABF
LDA.b $23
STA.w $1ACF
LDA.b $10 : CMP.b #$0B : BEQ .exit
LDA.b $8A : AND.b #$40 : STA.b $7B : BEQ .no_mirror_portal
LDA.b $20 : STA.w $1ADF
LDA.b $21 : STA.w $1AEF
LDA.b $22 : STA.w $1ABF
LDA.b $23 : STA.w $1ACF
.no_mirror_portal .no_mirror_portal
LDA.b #$23 LDA.b #$23
#SetGameModeLikeMirror: #SetGameModeLikeMirror:
STA.b $11 STA.b $11
STZ.w $03F8 STZ.w $03F8
LDA.b #$01 : STA.w $02DB
LDA.b #$01
STA.w $02DB
STZ.b $B0 STZ.b $B0
STZ.b $27 : STZ.b $28
STZ.b $27 LDA.b #$14 : STA.b $5D
STZ.b $28
LDA.b #$14 ; LINKSTATE 14
STA.b $5D
.not_on .not_on
.exit .exit
@@ -148,8 +118,6 @@ Sprite_DekuLeaf_Main:
} }
} }
; =========================================================
Sprite_DekuLeaf_Draw: Sprite_DekuLeaf_Draw:
{ {
JSL Sprite_PrepOamCoord JSL Sprite_PrepOamCoord
@@ -159,7 +127,6 @@ Sprite_DekuLeaf_Draw:
LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame LDA $0DC0, X : CLC : ADC $0D90, X : TAY;Animation Frame
LDA .start_index, Y : STA $06 LDA .start_index, Y : STA $06
PHX PHX
LDX .nbr_of_tiles, Y ;amount of tiles -1 LDX .nbr_of_tiles, Y ;amount of tiles -1
LDY.b #$00 LDY.b #$00
@@ -207,9 +174,6 @@ Sprite_DekuLeaf_Draw:
RTS RTS
; =========================================================
.start_index .start_index
db $00 db $00
.nbr_of_tiles .nbr_of_tiles
@@ -280,8 +244,6 @@ Sprite_Whirlpool_Draw:
RTS RTS
.start_index .start_index
db $00, $04, $08 db $00, $04, $08
.nbr_of_tiles .nbr_of_tiles

View File

@@ -68,7 +68,7 @@ Sprite_IceBlock_Prep:
Sprite_IceBlock_Main: Sprite_IceBlock_Main:
{ {
LDA.w SprAction, X LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable JSL JumpTableLocal
dw MovementHandler dw MovementHandler
MovementHandler: MovementHandler:
@@ -169,8 +169,7 @@ IceBlock_CheckForGround:
JSL $06E87B ; GetTileType_long JSL $06E87B ; GetTileType_long
PLY PLY
LDA.w $0FA5 LDA.w $0FA5 : CMP.b #$0E : BNE .stop
CMP.b #$0E : BNE .stop
SEC SEC
RTS RTS
.stop .stop

View File

@@ -73,7 +73,7 @@ BlueSpriteIndex = $7E0632
Sprite_Portal_Main: Sprite_Portal_Main:
{ {
LDA.w SprAction, X LDA.w SprAction, X
JSL UseImplicitRegIndexedLocalJumpTable JSL JumpTableLocal
dw StateHandler dw StateHandler
dw BluePortal dw BluePortal
@@ -104,7 +104,6 @@ Sprite_Portal_Main:
LDA.w SprY, X : STA.w BluePortal_X LDA.w SprY, X : STA.w BluePortal_X
LDA.w SprX, X : STA.w BluePortal_Y LDA.w SprX, X : STA.w BluePortal_Y
LDA.b #$02 : STA.w SprSubtype, X LDA.b #$02 : STA.w SprSubtype, X
%GotoAction(1) %GotoAction(1)
RTS RTS
} }
@@ -124,9 +123,7 @@ Sprite_Portal_Main:
JSL $0683EA ; Sprite_SetupHitbox_long JSL $0683EA ; Sprite_SetupHitbox_long
JSL CheckIfHitBoxesOverlap : BCC .NoOverlap JSL CheckIfHitBoxesOverlap : BCC .NoOverlap
CLC CLC
LDA $1B : BEQ .outdoors LDA $1B : BEQ .outdoors
%GotoAction(3) ; BluePortal_WarpDungeon %GotoAction(3) ; BluePortal_WarpDungeon
.NoOverlap .NoOverlap
RTS RTS
@@ -171,10 +168,6 @@ Sprite_Portal_Main:
LDA $7EC18A : STA $0604 LDA $7EC18A : STA $0604
LDA $7EC18C : STA $0608 LDA $7EC18C : STA $0608
LDA $7EC18E : STA $060C LDA $7EC18E : STA $060C
; LDA $7EC190 : STA $0610
; LDA $7EC192 : STA $0612
; LDA $7EC194 : STA $0614
; LDA $7EC196 : STA $0616
PHX PHX
LDA.w OrangeSpriteIndex : TAX LDA.w OrangeSpriteIndex : TAX
@@ -200,10 +193,6 @@ Sprite_Portal_Main:
LDA $7EC18A : STA $0604 ; Small Room South LDA $7EC18A : STA $0604 ; Small Room South
LDA $7EC18C : STA $0608 ; Small Room West LDA $7EC18C : STA $0608 ; Small Room West
LDA $7EC18E : STA $060C ; Small Room South LDA $7EC18E : STA $060C ; Small Room South
; LDA $7EC190 : STA $0610
; LDA $7EC192 : STA $0612
; LDA $7EC194 : STA $0614
; LDA $7EC196 : STA $0616
PHX PHX
LDA.w BlueSpriteIndex : TAX LDA.w BlueSpriteIndex : TAX