| Routines

6438: Guide a character up a staircase

The address of this interruptible subcommand routine is placed into bytes 0x09 and 0x0A of a character's buffer by the routine at 6464.
Input
H | Character number (0xB7-0xD1)
6438 | LD L,$00 | Point HL at byte 0x00 of the character's buffer
643A | BIT 0,(HL) | Is the character midstride?
643C | JP NZ,$63FD | Finish the stride if so
643F | LD L,$0B | Byte 0x0B of the character's buffer holds the number of steps left to be climbed
6441 | DEC (HL) | One fewer now
6442 | JP Z,$6390 | Terminate this interruptible subcommand if the top of the staircase has been reached
6445 | CALL $61B4 | Update the SRB for the character's current animatory state and location
6448 | DEC D | Up a step
6449 | INC A | One foot forward
644A | JP $6130 | Update the character's animatory state (to midstride) and location and update the SRB