Routines
 Prev: EAF2 Up: Map Next: EB13
EAF8: Check whether a character is on the sidewalk or road
Used by the routines at 64BD and EB13. Returns with the carry flag reset if the character has both feet on the ground (the sidewalk or road), and with the carry flag set otherwise.
Input
H Character number (0xD7-0xE6)
EAF8 LD L,\$01 Point HL at byte 0x01 of the character's buffer
EAFA LD E,(HL) E=character's x-coordinate
EAFB INC L L=0x02
EAFC LD D,(HL) D=character's y-coordinate
EAFD LD L,\$04
This entry point is used by the routines at 64BD and ED36.
EAFF LD A,D A=y-coordinate for comparison
EB00 CP \$22 34 is the y-coordinate of a character on the sidewalk
EB02 RET C Return with the carry flag set if the character is above the level of the sidewalk (A<=33)
EB03 RET NZ Return with the carry flag reset if the character is on the road (A=35)
This entry point is used by the routine at 634C.
EB04 LD A,E A=x-coordinate for comparison
This entry point is used by the routines at 6558, 72B1 and FB52.
EB05 CP \$07 Is A<=6 (where there is sidewalk)?
EB07 CCF Return with the carry flag reset if so
EB08 RET NC
EB09 CP \$0F Is 7<=A<=14 (where there is no sidewalk)?
EB0B RET C Return with the carry flag set if so
EB0C CP \$A4 Is 15<=A<=163 (where there is sidewalk)?
EB0E CCF Return with the carry flag reset if so
EB0F RET NC
EB10 CP \$C7 Set the carry flag if 164<=A<=198 (where there is no sidewalk), or reset it if A>=199 (where there is sidewalk)
EB12 RET
 Prev: EAF2 Up: Map Next: EB13