Back to Skool Routines
27804: Check if any characters were hit by fist
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.
B Number of characters to check
C 0 if punching character's facing right, 128 if left
D Number of first character 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 character in front of 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 candidate
27816 DJNZ 27804 Jump back to consider any remaining characters
27818 SCF Signal: no characters were hit
27819 RET