remove duplicate sprite apply speed function
This commit is contained in:
@@ -19,12 +19,12 @@ SprAction = $0D80 ; Indexes the action jump table
|
||||
SprFrame = $0D90 ; Indexes the SprGfx for drawing
|
||||
SprGfx = $0DC0 ; Determine the GFX used for the sprite
|
||||
|
||||
SprMiscA = $0DA0 ; Sprite_DamageFlash palette index
|
||||
SprMiscA = $0DA0 ; Direction, position, or other misc usage
|
||||
SprMiscB = $0DB0 ; Various usages, truly auxiliary
|
||||
SprMiscC = $0DE0 ; Cardinal direction the sprite is facing
|
||||
SprMiscD = $0E90 ; Pikit stolen item, misc usage
|
||||
SprMiscE = $0EB0 ; Head direction 0123 -> udlr
|
||||
SprMiscF = $0EC0 ;
|
||||
SprMiscF = $0EC0 ;
|
||||
SprMiscG = $0ED0 ;
|
||||
|
||||
; Used in sprite state 0x03 (falling in water)
|
||||
|
||||
@@ -213,7 +213,7 @@ Sprite_Kydreeok_Main:
|
||||
%PlayAnimation(0, 2, 10)
|
||||
|
||||
LDA $36 : STA $00
|
||||
JSR Sprite_ApplySpeedTowardsPlayerXOrY
|
||||
JSL Sprite_ApplySpeedTowardsPlayerXOrY
|
||||
JSR StopIfOutOfBounds
|
||||
JSL MoveBody
|
||||
|
||||
@@ -608,97 +608,6 @@ StopIfOutOfBounds:
|
||||
|
||||
; =========================================================
|
||||
|
||||
Sprite_ApplySpeedTowardsPlayerXOrY:
|
||||
{
|
||||
JSL Sprite_IsBelowPlayer : BEQ .player_below
|
||||
;playerAbove
|
||||
|
||||
REP #$20
|
||||
; if link.y is 6 above sprite.y it is considered below
|
||||
LDA SprCachedY : SEC : SBC $20 : CLC : ADC.w #$0006 : STA $01 ;delta Y
|
||||
SEP #$20
|
||||
|
||||
JSL Sprite_IsToRightOfPlayer : BEQ .player_to_the_Right1
|
||||
;player_to_the_Left
|
||||
REP #$20
|
||||
LDA SprCachedX : SEC : SBC $22 ; delta X
|
||||
|
||||
CMP $01 : BCS .XGreaterThanY1
|
||||
;YGreaterThanX
|
||||
SEP #$20
|
||||
LDA.b #$00 : SEC : SBC $00 : STA.w SprYSpeed
|
||||
STZ.w SprXSpeed
|
||||
RTS
|
||||
|
||||
.XGreaterThanY1
|
||||
SEP #$20
|
||||
LDA.b #$00 : SEC : SBC $00 : STA.w SprXSpeed
|
||||
STZ.w SprYSpeed
|
||||
RTS
|
||||
|
||||
.player_to_the_Right1
|
||||
REP #$20
|
||||
LDA $22 : SEC : SBC SprCachedX ; delta X
|
||||
|
||||
CMP $01 : BCS .XGreaterThanY2
|
||||
;YGreaterThanX
|
||||
SEP #$20
|
||||
LDA.b #$00 : SEC : SBC $00 : STA.w SprYSpeed
|
||||
STZ.w SprXSpeed
|
||||
RTS
|
||||
|
||||
.XGreaterThanY2
|
||||
SEP #$20
|
||||
LDA.b #$00 : CLC : ADC $00 : STA.w SprXSpeed
|
||||
STZ.w SprYSpeed
|
||||
RTS
|
||||
|
||||
|
||||
.player_below
|
||||
REP #$20
|
||||
; if link.y is 6 above sprite.y it is considered below
|
||||
LDA $20 : SEC : SBC SprCachedY : CLC : ADC.w #$0006 : STA $01 ; delta Y
|
||||
SEP #$20
|
||||
|
||||
JSL Sprite_IsToRightOfPlayer : BEQ .player_to_the_Right2
|
||||
;player_to_the_Left
|
||||
REP #$20
|
||||
LDA SprCachedX : SEC : SBC $22 ; delta X
|
||||
|
||||
CMP $01 : BCS .XGreaterThanY3
|
||||
;YGreaterThanX
|
||||
SEP #$20
|
||||
LDA.b #$00 : CLC : ADC $00 : STA.w SprYSpeed
|
||||
STZ.w SprXSpeed
|
||||
RTS
|
||||
|
||||
.XGreaterThanY3
|
||||
SEP #$20
|
||||
LDA.b #$00 : SEC : SBC $00 : STA.w SprXSpeed
|
||||
STZ.w SprYSpeed
|
||||
RTS
|
||||
|
||||
|
||||
.player_to_the_Right2
|
||||
REP #$20
|
||||
LDA $22 : SEC : SBC SprCachedX ; delta X
|
||||
|
||||
CMP $01 : BCS .XGreaterThanY4
|
||||
;YGreaterThanX
|
||||
SEP #$20
|
||||
LDA.b #$00 : CLC : ADC $00 : STA.w SprYSpeed
|
||||
STZ.w SprXSpeed
|
||||
RTS
|
||||
|
||||
.XGreaterThanY4
|
||||
SEP #$20
|
||||
LDA.b #$00 : CLC : ADC $00 : STA.w SprXSpeed
|
||||
STZ.w SprYSpeed
|
||||
RTS
|
||||
}
|
||||
|
||||
; =========================================================
|
||||
|
||||
ApplyPalette:
|
||||
{
|
||||
REP #$20 ;Set A in 16bit mode
|
||||
|
||||
@@ -443,7 +443,7 @@ Sprite_Manhandla_Move:
|
||||
MoveXorY:
|
||||
{
|
||||
LDA $36 : STA $00
|
||||
JSL Sprite_ApplySpeedTowardsPlayerXOrY_Long
|
||||
JSL Sprite_ApplySpeedTowardsPlayerXOrY
|
||||
JSR Manhandla_StopIfOutOfBounds
|
||||
JSL MoveBody
|
||||
|
||||
|
||||
@@ -763,7 +763,7 @@ Sprite_SetupHitBox:
|
||||
|
||||
; =========================================================
|
||||
|
||||
Sprite_ApplySpeedTowardsPlayerXOrY_Long:
|
||||
Sprite_ApplySpeedTowardsPlayerXOrY:
|
||||
{
|
||||
JSL Sprite_IsBelowPlayer : BEQ .player_below
|
||||
;playerAbove
|
||||
|
||||
Reference in New Issue
Block a user