Cleanup Pols Voice

This commit is contained in:
scawful
2024-11-19 14:57:39 -05:00
parent 1abe75ddb1
commit d88410e9c2

View File

@@ -1,6 +1,6 @@
; ========================================================= ; =========================================================
; Sprite Properties ; Sprite Properties
; ========================================================= ; =========================================================
!SPRID = Sprite_PolsVoice !SPRID = Sprite_PolsVoice
!NbrTiles = 02 ; Number of tiles used in a frame !NbrTiles = 02 ; Number of tiles used in a frame
@@ -11,7 +11,7 @@
!DeathAnimation = 00 ; 00 = normal death, 01 = no death animation !DeathAnimation = 00 ; 00 = normal death, 01 = no death animation
!ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it !ImperviousAll = 00 ; 00 = Can be attack, 01 = attack will clink on it
!SmallShadow = 00 ; 01 = small shadow, 00 = no shadow !SmallShadow = 00 ; 01 = small shadow, 00 = no shadow
!Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow !Shadow = 00 ; 00 = don't draw shadow, 01 = draw a shadow
!Palette = 00 ; Unused in this template (can be 0 to 7) !Palette = 00 ; Unused in this template (can be 0 to 7)
!Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool !Hitbox = 00 ; 00 to 31, can be viewed in sprite draw tool
!Persist = 00 ; 01 = your sprite continue to live offscreen !Persist = 00 ; 01 = your sprite continue to live offscreen
@@ -37,28 +37,22 @@
Sprite_PolsVoice_Long: Sprite_PolsVoice_Long:
{ {
PHB : PHK : PLB PHB : PHK : PLB
JSR Sprite_PolsVoice_Draw
JSR Sprite_PolsVoice_Draw ; Call the draw code
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_PolsVoice_Main
JSR Sprite_PolsVoice_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_PolsVoice_Prep: Sprite_PolsVoice_Prep:
{ {
PHB : PHK : PLB PHB : PHK : PLB
LDA.b #$80 : STA.w SprTimerA, X LDA.b #$80 : STA.w SprTimerA, X
LDA.b #$00 : STA.w SprDefl, X LDA.b #$00 : STA.w SprDefl, X
LDA.b #$00 : STA.w SprTileDie, X LDA.b #$00 : STA.w SprTileDie, X
PLB PLB
RTL RTL
} }
@@ -84,7 +78,7 @@ Sprite_PolsVoice_Main:
JSL Sprite_BounceFromTileCollision JSL Sprite_BounceFromTileCollision
JSL Sprite_DamageFlash_Long JSL Sprite_DamageFlash_Long
%DoDamageToPlayerSameLayerOnContact() %DoDamageToPlayerSameLayerOnContact()
JSL GetRandomInt : AND #$3F : BNE .not_done JSL GetRandomInt : AND #$3F : BNE .not_done
@@ -94,10 +88,10 @@ Sprite_PolsVoice_Main:
JSL Sprite_CheckDamageFromPlayer : BCC .no_damage JSL Sprite_CheckDamageFromPlayer : BCC .no_damage
JSL Sprite_DirectionToFacePlayer JSL Sprite_DirectionToFacePlayer
; Apply the speed positive or negative speed ; Apply the speed positive or negative speed
LDA $0E : BPL .not_up LDA $0E : BPL .not_up
LDA #$20 : STA.w SprYSpeed, X LDA #$20 : STA.w SprYSpeed, X
BRA .not_down BRA .not_down
.not_up .not_up
LDA #$E0 : STA.w SprYSpeed, X LDA #$E0 : STA.w SprYSpeed, X
@@ -133,10 +127,8 @@ Sprite_PolsVoice_Main:
.no_damage .no_damage
RTS RTS
} }
} }
; ========================================================= ; =========================================================
Sprite_PolsVoice_Draw: Sprite_PolsVoice_Draw:
@@ -155,17 +147,17 @@ Sprite_PolsVoice_Draw:
.nextTile .nextTile
PHX ; Save current Tile Index? PHX ; Save current Tile Index?
TXA : CLC : ADC $06 ; Add Animation Index Offset TXA : CLC : ADC $06 ; Add Animation Index Offset
PHA ; Keep the value with animation index offset? PHA ; Keep the value with animation index offset?
ASL A : TAX ASL A : TAX
REP #$20 REP #$20
LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y LDA $00 : CLC : ADC .x_offsets, X : STA ($90), Y
AND.w #$0100 : STA $0E AND.w #$0100 : STA $0E
INY INY
LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y LDA $02 : CLC : ADC .y_offsets, X : STA ($90), Y
CLC : ADC #$0010 : CMP.w #$0100 CLC : ADC #$0010 : CMP.w #$0100
@@ -182,14 +174,14 @@ Sprite_PolsVoice_Draw:
INY INY
LDA .properties, X : ORA $08 : STA ($90), Y LDA .properties, X : ORA $08 : STA ($90), Y
PHY PHY
TYA : LSR #2 : TAY TYA : LSR #2 : TAY
LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer LDA .sizes, X : ORA $0F : STA ($92), Y ; store size in oam buffer
PLY : INY PLY : INY
PLX : DEX : BPL .nextTile PLX : DEX : BPL .nextTile
PLX PLX
@@ -233,4 +225,4 @@ Sprite_PolsVoice_Draw:
db $02 db $02
db $02 db $02
db $02, $02 db $02, $02
} }