| Routines

667F: Deal with a character who's been dethroned (2)

The address of this uninterruptible subcommand routine is placed into bytes 0x11 and 0x12 of a character's buffer by the routine at 6670.
Input
H | Dethroned character's number (0xB7-0xD1)
667F | LD L,$13 | Byte 0x13 of the character's buffer holds the delay counter
6681 | DEC (HL) | Is it time for the character to get up off the floor yet?
6682 | RET NZ | Return if not
6683 | LD L,$11 | Replace the address of this routine in bytes 0x11 and 0x12 of the character's buffer with 6697
6685 | LD (HL),$97
6687 | CALL $61B4 | Update the SRB for the character's current animatory state and location
668A | AND $F8 | A=animatory state of the character standing up
668C | LD C,A | Store this in C temporarily
668D | LD A,H | A=number of the character knocked out of the chair
668E | CP $D0 | Is this EINSTEIN?
6690 | JR Z,$6693 | Jump if so
6692 | DEC E | E=x-coordinate of the character upon standing up (everyone but EINSTEIN will get up and try the seat in front)
6693 | LD A,C | A=animatory state of the character standing up
6694 | JP $6130 | Update the character's animatory state and location and update the SRB