Sprite housekeeping

This commit is contained in:
scawful
2025-01-18 10:59:45 -05:00
parent a6eac7dc4f
commit 90225c3b4a
6 changed files with 529 additions and 614 deletions

View File

@@ -48,8 +48,6 @@ Sprite_Kydreeok_Long:
RTL
}
; =========================================================
Sprite_Kydreeok_Prep:
{
PHB : PHK : PLB
@@ -121,8 +119,6 @@ MaybeRespawnHead:
RTS
}
; =========================================================
Sprite_Kydreeok_Main:
{
%SpriteJumpTable(Kydreeok_Start,

View File

@@ -29,7 +29,7 @@
!ImpervSwordHammer = 00 ; 01 = Impervious to sword and hammer attacks
!Boss = 00 ; 00 = normal sprite, 01 = sprite is a boss
%Set_Sprite_Properties(Sprite_BusinessScrub_Prep, Sprite_BusinessScrub_Long);
%Set_Sprite_Properties(Sprite_BusinessScrub_Prep, Sprite_BusinessScrub_Long)
Sprite_BusinessScrub_Long:
{

View File

@@ -21,7 +21,7 @@
!DeflectArrow = 00 ; 01 = deflect arrows
!WaterSprite = 00 ; 01 = can only walk shallow water
!Blockable = 00 ; 01 = can be blocked by link's shield?
!Prize = 0 ; 00-15 = the prize pack the sprite will drop from
!Prize = 00 ; 00-15 = the prize pack the sprite will drop from
!Sound = 00 ; 01 = Play different sound when taking damage
!Interaction = 00 ; ?? No documentation
!Statue = 00 ; 01 = Sprite is statue
@@ -47,8 +47,6 @@ Sprite_Poltergeist_Long:
RTL
}
; =========================================================
Sprite_Poltergeist_Prep:
{
PHB : PHK : PLB
@@ -155,14 +153,12 @@ PictureFrame:
SEP #$20
LDA #$01 : STA.w SprMiscA, X
LDA #$02 : STA.w SprHeight, X
.notcloseenough
SEP #$20
LDA.w SprMiscA, X : BNE .chase
RTS
.chase
%PlayAnimation(0, 3, 6)
@@ -174,9 +170,7 @@ PictureFrame:
JSL Sprite_CheckDamageFromPlayer : BCC .noShatter
JMP Shatter
.noShatter
RTS
}
@@ -214,7 +208,6 @@ Chair:
LDA.w SprMiscA, X : BNE +
LDA #$01 : STA.w SprMiscA, X
+
.notcloseenough
SEP #$20
@@ -223,28 +216,22 @@ Chair:
; Prepare to raise in the air
LDA.b #$20 : STA.w SprTimerA, X
INC.w SprMiscA, X
RTS
+
CMP #$02 : BNE +
; Prepare to raise in the air
LDA.w SprTimerA, X : BNE .stillrising
LDA.b #$10 : STA.w SprTimerA, X
INC.w SprMiscA, X
RTS
.stillrising
; OPTIONAL DELAY THE INCREASING SPRHEIGHT WITH TIMER
LDA.w SprTimerC, X : BNE .optionalTimer
LDA #$02 : STA.w SprTimerC, X
INC.w SprHeight, X
.optionalTimer
RTS
+
@@ -255,7 +242,6 @@ Chair:
JSL Sprite_CheckDamageFromPlayer : BCS Shatter
;JSL Sprite_CheckTileCollision : BNE Shatter
RTS
+
RTS
@@ -271,19 +257,12 @@ Shatter:
LDA.b #$A6 : STA.w SprNbrOAM, X
LDA.b #$1F : JSL Sound_SetSfx2PanLong
STZ $0DC0, X
LDA.b #$04 : STA.w SprMiscB, X
LDA.b #$06 : STA.w SprState, X
LDA.b #$1F : STA.w SprTimerA, X
LDA.b #$EC : STA $0E20, X
LDA.w SprNbrOAM, X : CLC : ADC #$04 : STA.w SprNbrOAM, X
STZ $0EF0, X
LDA.b #$80 : STA.w SprMiscB, X
RTS
}
@@ -294,11 +273,9 @@ Axe:
REP #$20
JSR GetLinkDistance16bit : CMP #$0050 : BCS .notcloseenough
SEP #$20
LDA.w SprMiscA, X : BNE +
LDA #$01 : STA.w SprMiscA, X
+
.notcloseenough
SEP #$20
@@ -312,22 +289,17 @@ Axe:
CMP #$02 : BNE +
; Prepare to raise in the air
LDA.w SprTimerA, X : BNE .stillrising
LDA.b #$10 : STA.w SprTimerA, X
INC.w SprMiscA, X
RTS
.stillrising
; OPTIONAL DELAY THE INCREASING SPRHEIGHT WITH TIMER
LDA.w SprTimerC, X : BNE .optionalTimer
LDA #$02 : STA.w SprTimerC, X
INC.w SprHeight, X
.optionalTimer
RTS
+
@@ -335,36 +307,27 @@ Axe:
LDA.w SprSubtype, X : CMP #$11 : BNE .notAxe
JSR PlayAxe
BRA .done
.notAxe
CMP #$12 : BNE .notKnife
JSR PlayKnife
BRA .done
.notKnife
JSR PlayFork
.done
LDA.w SprTimerA, X : BNE .waitingdelay
JSL Sprite_MoveLong
JSL Sprite_CheckDamageToPlayer : BCC .noShatter
JMP Shatter
JSL Sprite_CheckDamageFromPlayer : BCC .noShatter
JMP Shatter
JSL Sprite_CheckTileCollision : BEQ .noShatter
JMP Shatter
.noShatter
RTS
+
RTS
.waitingdelay
@@ -528,9 +491,6 @@ Sprite_Poltergeist_Draw:
JSL Sprite_DrawShadow
.noshadow
RTS
}
; =========================================================
.start_index
db $00, $02, $04, $06, $08, $09, $0F, $15, $16, $17, $18, $19, $1A, $1B, $1C, $1D, $1F, $20, $22, $23, $25, $26, $28, $29, $2A, $2B, $2C, $2D, $2E, $2F, $30, $31, $33, $35, $37, $39, $3B, $3F, $41, $42, $44, $45, $47, $48, $4A
@@ -772,3 +732,4 @@ Sprite_Poltergeist_Draw:
db $02
db $00, $00
db $02
}

View File

@@ -43,13 +43,7 @@ RanchGirl_TeachSong:
.not_started
.running_dialog
.has_song
LDA.b $1A
LSR A
LSR A
LSR A
LSR A
AND.b #$01
STA.w $0DC0,X
LDA.b $1A : LSR #4 : AND.b #$01 : STA.w $0DC0,X
RTL
}

View File

@@ -34,7 +34,6 @@
Sprite_Vasu_Long:
{
PHB : PHK : PLB
LDA.w SprSubtype, X : BNE +
JSR Sprite_Vasu_Draw
JMP ++

View File

@@ -35,13 +35,13 @@ Sprite_IceBlock_Long:
PHB : PHK : PLB
LDA.w SprMiscC, X : BEQ .not_being_pushed
STZ.w SprMiscC, X
STZ.b $5E ; Clear Links speed
STZ.b LinkSpeedTbl
STZ.b $48 ; Clear push actions bitfield
.not_being_pushed
LDA.w SprTimerA, X : BEQ .retain_momentum
LDA.b #$01 : STA.w SprMiscC, X
LDA.b #$84 : STA.b $48 ; Set statue and push block actions
LDA.b #$04 : STA.b $5E ; Slipping into pit speed
LDA.b #$04 : STA.b LinkSpeedTbl ; Slipping into pit speed
.retain_momentum
JSR Sprite_IceBlock_Draw
@@ -60,7 +60,6 @@ Sprite_IceBlock_Prep:
LDA.w SprY, X : STA.w SprMiscE, X
LDA.w SprXH, X : STA.w SprMiscF, X
LDA.w SprYH, X : STA.w SprMiscG, X
STZ.w SprDefl, X
PLB
RTL
@@ -110,6 +109,7 @@ Sprite_IceBlock_Main:
LDA.b $26 : STA.w SprMiscA, X
JSR ApplyPush
.push_cached
LDA.b #$07 : STA.w SprTimerA, X
STZ.b $5E
JSL Sprite_RepelDash
@@ -227,71 +227,36 @@ Statue_BlockSprites:
LDY.b #$0F
.next
LDA.w $0E20,Y
CMP.b #$1C ; SPRITE 1C
BEQ .skip
; SPRITE 1C
LDA.w $0E20, Y : CMP.b #$1C : BEQ .skip
CPY.w $0FA0 : BEQ .skip
TYA : EOR.b $1A : AND.b #$01 : BNE .skip
LDA.w SprState,Y : CMP.b #$09 : BCC .skip
CPY.w $0FA0
BEQ .skip
TYA
EOR.b $1A
AND.b #$01
BNE .skip
LDA.w SprState,Y
CMP.b #$09
BCC .skip
LDA.w SprX,Y
STA.b $04
LDA.w SprXH,Y
STA.b $05
LDA.w SprY,Y
STA.b $06
LDA.w SprYH,Y
STA.b $07
LDA.w SprX, Y : STA.b $04
LDA.w SprXH, Y : STA.b $05
LDA.w SprY, Y : STA.b $06
LDA.w SprYH, Y : STA.b $07
REP #$20
LDA.w SprCachedX
SEC
SBC.b $04
CLC
ADC.w #$000C
LDA.w SprCachedX : SEC : SBC.b $04 : CLC : ADC.w #$000C
CMP.w #$0018 : BCS .skip
CMP.w #$0018
BCS .skip
LDA.w SprCachedY
SEC
SBC.b $06
CLC
ADC.w #$000C
CMP.w #$0024
BCS .skip
LDA.w SprCachedY : SEC : SBC.b $06 : CLC : ADC.w #$000C
CMP.w #$0024 : BCS .skip
SEP #$20
LDA.b #$04
STA.w $0EA0,Y
LDA.b #$04 : STA.w $0EA0, Y
PHY
LDA.b #$20
JSL Sprite_CheckSlopedTileCollision ; JSR Sprite_ProjectSpeedTowardsLocation
PLY
LDA.b $00
STA.w SprYRecoil,Y
LDA.b $01
STA.w SprXRecoil,Y
LDA.b $00 : STA.w SprYRecoil, Y
LDA.b $01 : STA.w SprXRecoil, Y
.skip
SEP #$20