Prev: 60146 Up: Map Next: 60179
60152: Check whether a character is on the sidewalk or road
Used by the routines at 25789 and 60179. 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 (215-230)
60152 LD L,1 Point HL at byte 1 of the character's buffer
60154 LD E,(HL) E=character's x-coordinate
60155 INC L L=2
60156 LD D,(HL) D=character's y-coordinate
60157 LD L,4
This entry point is used by the routines at 25789 and 60726.
60159 LD A,D A=y-coordinate for comparison
60160 CP 34 34 is the y-coordinate of a character on the sidewalk
60162 RET C Return with the carry flag set if the character is above the level of the sidewalk (A<=33)
60163 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 25420.
60164 LD A,E A=x-coordinate for comparison
This entry point is used by the routines at 25944, 29361 and 64338.
60165 CP 7 Is A<=6 (where there is sidewalk)?
60167 CCF Return with the carry flag reset if so
60168 RET NC
60169 CP 15 Is 7<=A<=14 (where there is no sidewalk)?
60171 RET C Return with the carry flag set if so
60172 CP 164 Is 15<=A<=163 (where there is sidewalk)?
60174 CCF Return with the carry flag reset if so
60175 RET NC
60176 CP 199 Set the carry flag if 164<=A<=198 (where there is no sidewalk), or reset it if A>=199 (where there is sidewalk)
60178 RET
Prev: 60146 Up: Map Next: 60179