Skool Daze Routines
28968: Get identifier and coordinates of blackboard closest to character
Used by the routines at 28994, 29148, 29160, 29284, 32048, 62208, 63056, 63146 and 64016. Returns with the following values in A and DE depending on which blackboard the character is closest to.
A (D,E) Description
236 (155,42) Reading Room blackboard
238 (161,26) White Room blackboard
240 (161,41) Exam Room blackboard
H Character number (152-169)
28968 LD L,97 Byte 97 holds the character's y-coordinate
28970 LD A,(HL) Pick this up in A
28971 LD DE,39722 D=155 (y-coordinate), E=42 (x-coordinate)
28974 CP 160
28976 LD A,236 236=Reading Room blackboard
28978 RET C Return if the character's on the top floor
28979 INC L L=98
28980 LD DE,41242 D=161 (y-coordinate), E=26 (x-coordinate)
28983 LD A,(HL) A=character's x-coordinate
28984 CP 37 37=x-coordinate of wall between White and Exam Rooms
28986 LD A,238 238=White Room blackboard
28988 RET C
28989 LD E,41 D=161 (y-coordinate), E=41 (x-coordinate)
28991 LD A,240 240=Exam Room blackboard
28993 RET