Prev: ABA4 Up: Map Next: ABF3
ABA8: Check Object Hit By Shot
Used by the routine at UpdateMapObjects.
Checks whether the object that was drawn has been shot, and if it has been destroyed, marks its entry in the map table as destroyed.
Input
IX Address of the object
CheckObjectHitByShot ABA8 BIT 7,(IX+$03) Return if bit 7 of offset 03 of IX is set.
ABAC RET NZ
ABAD LD A,($B832) The special-shot flag.
ABB0 AND A Return if A is zero.
ABB1 RET Z
ABB2 BIT 7,(IX+$10) Return if bit 7 of offset 10 of IX is clear.
ABB6 RET Z
ABB7 BIT 3,(IX+$17) Return if bit 3 of offset 17 of IX is set.
ABBB RET NZ
ABBC LD A,(IX+$13) The state.
ABBF CP $0B Return if A is 0B.
ABC1 RET Z
ABC2 CALL FindHitPosition Call FindHitPosition.
ABC5 CALL FindShot Call FindShot.
ABC8 CALL CheckObjectAgainstShots Call CheckObjectAgainstShots.
ABCB BIT 3,(IX+$17) Return if bit 3 of offset 17 of IX is clear.
ABCF RET Z
ABD0 LD A,(IX+$18) Read offset 18 of IX.
ABD3 AND %00000001 Keep the bits of A that are set in 01.
ABD5 LD H,A H=A.
ABD6 LD L,(IX+$19) Read offset 19 of IX into L.
ABD9 LD DE,$5C94 The map table.
ABDC ADD HL,DE HL gains DE.
ABDD SET 7,(HL) Set bit 7 of the byte at the address in HL.
ABDF LD A,(IX+$00) The type.
ABE2 CP $0D Return if A is not 0D.
ABE4 RET NZ
ABE5 LD A,(IX+$13) The state.
ABE8 CP $08 Jump to MarkCellDestroyed if A is less than 08.
ABEA JR C,MarkCellDestroyed
ABEC CP $0B Return if A is 0B or more.
ABEE RET NC
ABEF LD (IY+$13),A Write the state.
ABF2 RET Return.
Prev: ABA4 Up: Map Next: ABF3