Fix Sprite_CheckForPresence and Sprite_SetupHitBox
This commit is contained in:
@@ -319,30 +319,29 @@ Sprite_Damage_Flash:
|
|||||||
}
|
}
|
||||||
|
|
||||||
; $00 - ID of the sprite to check
|
; $00 - ID of the sprite to check
|
||||||
|
; $01 - Current sprite index
|
||||||
; $02 - Index of the sprite found
|
; $02 - Index of the sprite found
|
||||||
Sprite_CheckForPresence:
|
Sprite_CheckForPresence:
|
||||||
{
|
{
|
||||||
|
STX $01
|
||||||
PHX
|
PHX
|
||||||
CLC
|
CLC
|
||||||
LDX.b #$10
|
LDX.b #$10
|
||||||
.x_loop
|
.x_loop
|
||||||
DEX
|
DEX
|
||||||
LDY.b #$04
|
LDA $0E20, X : CMP.b $00 : BEQ .set_flag
|
||||||
.y_loop
|
BRA .continue
|
||||||
DEY
|
.set_flag
|
||||||
LDA $0E20, X : CMP.b $00 : BEQ .set_flag
|
CPX.b $01 : BEQ .continue
|
||||||
BRA .not_b0
|
|
||||||
.set_flag
|
|
||||||
SEC ; Set flag indicating sprite is present
|
SEC ; Set flag indicating sprite is present
|
||||||
STX.w $02
|
STX.w $02
|
||||||
BRA .done
|
BRA .done
|
||||||
|
|
||||||
.not_b0
|
.continue
|
||||||
CPY.b #$00 : BNE .y_loop
|
|
||||||
CPX.b #$00 : BNE .x_loop
|
CPX.b #$00 : BNE .x_loop
|
||||||
.done
|
.done
|
||||||
PLX
|
PLX
|
||||||
RTS
|
RTL
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,9 +398,9 @@ Sprite_SetupHitBox:
|
|||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
Sprite_SetupHitBox_Alt:
|
.Alt:
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
LDA.w SprHeight, X : BMI .too_high
|
LDA.w SprHeight, X : BMI .too_high2
|
||||||
PHY
|
PHY
|
||||||
LDA.w SprHitbox, X : AND.b #$1F : TAY
|
LDA.w SprHitbox, X : AND.b #$1F : TAY
|
||||||
LDA.w SprX, X : CLC : ADC.w .offset_x_low, Y : STA.b pos1_x_low
|
LDA.w SprX, X : CLC : ADC.w .offset_x_low, Y : STA.b pos1_x_low
|
||||||
@@ -419,7 +418,7 @@ Sprite_SetupHitBox_Alt:
|
|||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
.too_high
|
.too_high2
|
||||||
LDA.b #$80 : STA.b pos1_x_high
|
LDA.b #$80 : STA.b pos1_x_high
|
||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
|
|||||||
Reference in New Issue
Block a user