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
@@ -95,61 +89,35 @@ Sprite_DekuLeaf_Main:
LDA $0AAB : BEQ .not_on LDA $0AAB : BEQ .not_on
STZ $55 ; Reset cape flag STZ $55 ; Reset cape flag
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 LDA.b $10 : CMP.b #$0B : BEQ .exit
CMP.b #$0B LDA.b $8A : AND.b #$40 : STA.b $7B : BEQ .no_mirror_portal
BEQ .exit 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
LDA.b #$23
LDA.b $8A #SetGameModeLikeMirror:
AND.b #$40 STA.b $11
STA.b $7B STZ.w $03F8
LDA.b #$01 : STA.w $02DB
STZ.b $B0
STZ.b $27 : STZ.b $28
LDA.b #$14 : STA.b $5D
BEQ .no_mirror_portal .not_on
.exit
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
LDA.b #$23
#SetGameModeLikeMirror:
STA.b $11
STZ.w $03F8
LDA.b #$01
STA.w $02DB
STZ.b $B0
STZ.b $27
STZ.b $28
LDA.b #$14 ; LINKSTATE 14
STA.b $5D
.not_on
.exit
RTS RTS
} }
} }
; =========================================================
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:
@@ -122,7 +122,7 @@ Sprite_IceBlock_Main:
RTS RTS
.NotInContact: .NotInContact:
LDA.w SprTimerA, X : BNE .delay_timer LDA.w SprTimerA, X : BNE .delay_timer
LDA.b #$0D : STA.w SprTimerB,X LDA.b #$0D : STA.w SprTimerB, X
.delay_timer .delay_timer
RTS RTS
} }
@@ -160,22 +160,21 @@ Sprite_IceBlock_Main:
; Currently unused as it doesnt play well with the hitbox choices ; Currently unused as it doesnt play well with the hitbox choices
IceBlock_CheckForGround: IceBlock_CheckForGround:
{ {
LDA.w SprY,X : CLC : ADC.b #$08 : STA.b $00 LDA.w SprY, X : CLC : ADC.b #$08 : STA.b $00
LDA.w SprYH,X : ADC.b #$00 : STA.b $01 LDA.w SprYH, X : ADC.b #$00 : STA.b $01
LDA.w SprX,X : STA.b $02 LDA.w SprX, X : STA.b $02
LDA.w SprXH,X : ADC.b #$00 : STA.b $03 LDA.w SprXH, X : ADC.b #$00 : STA.b $03
LDA.w $0F20,X LDA.w $0F20, X
PHY PHY
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 STZ.w SprXSpeed, X
STZ.w SprXSpeed,X STZ.w SprYSpeed, X
STZ.w SprYSpeed,X
CLC CLC
RTS RTS
} }
@@ -185,11 +184,11 @@ Sprite_IceBlock_CheckForSwitch:
LDY.b #$03 LDY.b #$03
.next_tile .next_tile
LDA.w SprY,X : CLC : ADC.w .offset_y,Y : STA.b $00 LDA.w SprY, X : CLC : ADC.w .offset_y, Y : STA.b $00
LDA.w SprYH,X : ADC.b #$00 : STA.b $01 LDA.w SprYH, X : ADC.b #$00 : STA.b $01
LDA.w SprX,X : CLC : ADC.w .offset_x,Y : STA.b $02 LDA.w SprX, X : CLC : ADC.w .offset_x, Y : STA.b $02
LDA.w SprXH,X : ADC.b #$00 : STA.b $03 LDA.w SprXH, X : ADC.b #$00 : STA.b $03
LDA.w $0F20,X LDA.w $0F20, X
PHY PHY
JSL $06E87B ; GetTileType_long JSL $06E87B ; GetTileType_long
@@ -231,7 +230,7 @@ Statue_BlockSprites:
LDA.w $0E20, Y : CMP.b #$1C : BEQ .skip LDA.w $0E20, Y : CMP.b #$1C : BEQ .skip
CPY.w $0FA0 : BEQ .skip CPY.w $0FA0 : BEQ .skip
TYA : EOR.b $1A : AND.b #$01 : BNE .skip TYA : EOR.b $1A : AND.b #$01 : BNE .skip
LDA.w SprState,Y : CMP.b #$09 : BCC .skip LDA.w SprState, Y : CMP.b #$09 : BCC .skip
LDA.w SprX, Y : STA.b $04 LDA.w SprX, Y : STA.b $04
LDA.w SprXH, Y : STA.b $05 LDA.w SprXH, Y : STA.b $05

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