| Routines

62099: Check whether the door that a character is standing next to is closed

Used by the routines at 30396, 62120, 62216, 62297 and 62339. Returns with the zero flag set if the door is closed, and with HL pointing at the door status flags.
Input
H | Character number (215-230)
62099 | LD L,1 | Point HL at byte 1 of the character's buffer
62101 | LD A,(HL) | A=character's x-coordinate
62102 | LD HL,65461 | Find the first entry in the door location table at 65462 that is greater than the character's x-coordinate
62105 | INC L
62106 | CP (HL)
62107 | JR NC,62105
62109 | LD A,L | A=LSB of the entry (182-191)
62110 | ADD A,58 | Point HL at one of the 10 door status flag bytes at at 32752
62112 | LD L,A
62113 | LD H,127
62115 | LD A,(HL) | Pick up the door status flags
62116 | AND 7 | Set the zero flag if the door is closed
62118 | RET |