npc housekeeping

This commit is contained in:
scawful
2024-11-28 11:27:34 -05:00
parent d54d3147e7
commit a0a31549e8
2 changed files with 34 additions and 48 deletions

View File

@@ -38,20 +38,17 @@ Sprite_Vasu_Long:
PHB : PHK : PLB PHB : PHK : PLB
LDA.w SprSubtype, X : BNE + LDA.w SprSubtype, X : BNE +
JSR Sprite_Vasu_Draw ; Call the draw code JSR Sprite_Vasu_Draw
JMP ++ JMP ++
+ +
JSR Sprite_Error_Draw JSR Sprite_Error_Draw
++ ++
JSL Sprite_DrawShadow JSL Sprite_DrawShadow
JSL Sprite_CheckActive ; Check if game is not paused JSL Sprite_CheckActive : BCC .SpriteIsNotActive
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive JSR Sprite_Vasu_Main
JSR Sprite_Vasu_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
; ========================================================= ; =========================================================
@@ -59,13 +56,10 @@ Sprite_Vasu_Long:
Sprite_Vasu_Prep: Sprite_Vasu_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.b #$80 : STA.w SprDefl, X LDA.b #$80 : STA.w SprDefl, X
LDA.w SprSubtype, X : BEQ + LDA.w SprSubtype, X : BEQ +
LDA.b #$04 : STA.w SprAction, X LDA.b #$04 : STA.w SprAction, X
+ +
PLB PLB
RTL RTL
} }
@@ -196,7 +190,6 @@ Sprite_Vasu_Draw:
LDA.w SprFrame, X : TAY ;Animation Frame LDA.w SprFrame, 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
@@ -275,7 +268,6 @@ Sprite_Error_Draw:
LDA.w SprFrame, X : TAY ;Animation Frame LDA.w SprFrame, 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

View File

@@ -33,29 +33,23 @@
Sprite_ZoraPrincess_Long: Sprite_ZoraPrincess_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_ZoraPrincess_Draw
JSR Sprite_ZoraPrincess_Draw ; Call the draw code JSL Sprite_CheckActive : BCC .SpriteIsNotActive
JSL Sprite_CheckActive ; Check if game is not paused JSR Sprite_ZoraPrincess_Main
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
JSR Sprite_ZoraPrincess_Main ; Call the main sprite code
.SpriteIsNotActive .SpriteIsNotActive
PLB ; Get back the databank we stored previously PLB
RTL ; Go back to original code RTL
} }
Sprite_ZoraPrincess_Prep: Sprite_ZoraPrincess_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.l $7EF302 LDA.l $7EF302 : BEQ .doesnt_have_mask
BEQ .doesnt_have_mask
STZ.w SprState, X ; Kill the sprite STZ.w SprState, X ; Kill the sprite
.doesnt_have_mask .doesnt_have_mask
LDA #$00 : STA.w SprDefl, X LDA #$00 : STA.w SprDefl, X
LDA #$00 : STA.w SprTileDie, X LDA #$00 : STA.w SprTileDie, X
PLB PLB
RTL RTL
} }