Prev: 27803 Up: Map Next: 27820
27804: Check whether any characters were punched
Used by the routine at 30664. Returns with the carry flag reset if someone was hit in the face, and D holding the character number of the stricken one.
Input
B Number of potential victims to check
C 0 if the puncher is facing right, 128 if left
D Character number of the first potential victim to check
H Puncher's character number: 207 (ANGELFACE) or 210 (ERIC)
27804 CALL 27820 Are any characters in front of the puncher's fist?
27807 RET C Return if not
27808 LD E,0
27810 LD A,(DE) A=animatory state of the character in front of the puncher's fist
27811 AND 128 Keep only the 'direction' bit (bit 7)
27813 XOR C Compare with the direction bit of the punching character
27814 RET Z Return with the carry flag reset if the punched character was facing the puncher (i.e. was hit in the face)
27815 INC D Otherwise move on to the next potential victim
27816 DJNZ 27804 Jump back to consider any remaining potential victim
27818 SCF Signal: no characters were hit
27819 RET
Prev: 27803 Up: Map Next: 27820