Prev: 43940 Up: Map Next: 44019
43944: 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 43944 BIT 7,(IX+3) Return if bit 7 of offset 3 of IX is set.
43948 RET NZ
43949 LD A,(47154) The special-shot flag.
43952 AND A Return if A is zero.
43953 RET Z
43954 BIT 7,(IX+16) Return if bit 7 of offset 16 of IX is clear.
43958 RET Z
43959 BIT 3,(IX+23) Return if bit 3 of offset 23 of IX is set.
43963 RET NZ
43964 LD A,(IX+19) The state.
43967 CP 11 Return if A is 11.
43969 RET Z
43970 CALL FindHitPosition Call FindHitPosition.
43973 CALL FindShot Call FindShot.
43976 CALL CheckObjectAgainstShots Call CheckObjectAgainstShots.
43979 BIT 3,(IX+23) Return if bit 3 of offset 23 of IX is clear.
43983 RET Z
43984 LD A,(IX+24) Read offset 24 of IX.
43987 AND %00000001 Keep the bits of A that are set in 1.
43989 LD H,A H=A.
43990 LD L,(IX+25) Read offset 25 of IX into L.
43993 LD DE,23700 The map table.
43996 ADD HL,DE HL gains DE.
43997 SET 7,(HL) Set bit 7 of the byte at the address in HL.
43999 LD A,(IX+0) The type.
44002 CP 13 Return if A is not 13.
44004 RET NZ
44005 LD A,(IX+19) The state.
44008 CP 8 Jump to MarkCellDestroyed if A is less than 8.
44010 JR C,MarkCellDestroyed
44012 CP 11 Return if A is 11 or more.
44014 RET NC
44015 LD (IY+19),A Write the state.
44018 RET Return.
Prev: 43940 Up: Map Next: 44019