Prev: B5B0 Up: Map Next: B631
B614: Check Bullet Hit
Used by the routines at HandleCactus, HandleOutlaw and HandleBystander.
Checks whether any of the bullets (objects of type 02, in the second, third and fourth slots) is touching the object being handled.
Input
IX The address of the object
Output
F The carry flag is set if a bullet is touching the object
IY The address of the bullet, if there is one
CheckBulletHit B614 LD IY,$A28D Point IY at the second object slot.
B618 LD DE,$0010 Set the size of an object slot.
B61B LD B,$03 Set the number of bullet slots to three.
Check whether this slot holds a bullet.
CheckBulletHit_Loop B61D LD A,(IY+$00) Fetch the type of the object.
B620 CP $02 Jump to CheckBulletHit_Next if it is not a bullet.
B622 JR NZ,CheckBulletHit_Next
B624 PUSH BC Stash the number of slots on the stack.
B625 PUSH DE Stash the size of a slot on the stack.
B626 CALL CheckOverlap Check whether the bullet is touching the object.
B629 POP DE Retrieve the size of a slot.
B62A POP BC Retrieve the number of slots.
B62B RET C Return if the bullet is touching it.
Check the next slot.
CheckBulletHit_Next B62C ADD IY,DE Move on to the next slot.
B62E DJNZ CheckBulletHit_Loop Loop back until all three slots have been checked.
B630 RET Return.
Prev: B5B0 Up: Map Next: B631