| Routines

63973: Compare a character's coordinates with ERIC's

Used by the routine at 63374. On entry, the zero flag is set if ERIC's y-coordinate matches that of the character looking for him. On exit, the zero flag is set if the character looking for ERIC is within 3 y-coordinates of ERIC's location and not on a staircase (in which case the routine at 63374 checks whether the character is also within 3 x-coordinates of ERIC's location, i.e. has found ERIC).
Input
A | Character's y-coordinate
D | ERIC's y-coordinate
H | Character number (161, 163, 164)
L | 97
63973 | JR Z,63986 | Jump if ERIC and his chaser are on the same floor
63975 | SUB D | A=absolute difference between the y-coordinates of ERIC and his chaser
63976 | JR NC,63980
63978 | NEG
63980 | CP 4 | Are ERIC and his chaser within 3 y-coordinates of each other?
63982 | JR C,63986 | Jump if so
63984 | AND A | Reset the zero flag (ERIC has not been found)
63985 | RET |
63986 | LD A,(HL) | A=y-coordinate of the character looking for ERIC
63987 | JP 26185 | Set the zero flag set if the character is not on a staircase