| Routines

FC00: Deal with a character who is stepping onto or over the roof of no. 19

Used by the routine at FB52. If the character is about to step off the edge of the roof of no. 17 or the apartment building next to no. 19 towards no. 19, this routine checks whether there is a rope above the roof of no. 19 and moves the character accordingly. Otherwise, if the character is about to move left onto the roof of no. 17 (having just crossed the roof of no. 19 by means of the rope), this routine removes the rope.
Input
B | Location indicator (2-6; see FB52)
H | Character number (0xD7-0xE6)
FC00 | LD A,B | A=location indicator
FC01 | CP $02 | Is the character standing on the right edge of the roof of one of the apartment buildings (next to no. 74 and no. 19), or on the left edge of the roof of no. 17?
FC03 | RET NZ | Return if not
FC04 | LD L,$01 | Point HL at byte 0x01 of the character's buffer
FC06 | LD A,(HL) | A=character's x-coordinate
FC07 | CP $CE | Is it less than 206 (meaning the character is standing on the right edge of the roof of the apartment building next to no. 74)?
FC09 | RET C | Return if so
FC0A | JR NZ,$FC16 | Jump unless the character's x-coordinate is 206
The character is standing on the right edge of the roof the apartment building next to no. 19, or the left edge of the roof of no. 17.
FC0C | LD A,($B91A) | Collect the Z value for 208<=x<=215, 6<=y<=11 from the block at B900
FC0F | CP $0B | Is there a rope connecting the roofs of no. 17 and the apartment building next to no. 19 (in which case A=9)?
FC11 | RET Z | Return if not
FC12 | POP BC | Drop the return address (FB55) from the stack
FC13 | JP $EC07 | Move the character midstride
The character is standing on the left edge of the roof of no. 17.
FC16 | DEC L | L=0x00
FC17 | BIT 7,(HL) | Is the character facing left?
FC19 | JR Z,$FC0C | Jump if so
The character is about to move right, away from the left edge of the roof of no. 17.
FC1B | LD A,($B91A) | Collect the Z value for 208<=x<=215, 6<=y<=11 from the block at B900
FC1E | CP $0B | Is there a rope connecting the roofs of no. 17 and the apartment building next to no. 19 (in which case A=9)?
FC20 | CALL NZ,$FC25 | Remove it if so
FC23 | JR $FC12 | Move the character midstride