Skool Daze Routines
63973: Compare character's coordinates with ERIC's
Used by the routine at 63374. On entry, the zero flag is set if ERIC and the character looking for him are on the same floor. On exit, the zero flag is set if the character looking for ERIC is either (a) on the same floor as ERIC, or (b) not on a staircase.
A y-coordinate of character looking for ERIC
D ERIC's y-coordinate
H Number of character looking for ERIC (152-169)
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 not
63984 AND A Set the zero flag if the y-coordinates are equal
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