Prev: 27822 Up: Map Next: 27886
27823: 'S' pressed - sit/stand
The address of this routine is found in the table of keypress handling routines at 26624. It is called from the main loop at 26471 when 'S' is pressed.
27823 LD HL,32763 Flip bit 7 of ERIC's status flags at 32763
27826 LD A,(HL)
27827 XOR 128
27829 LD (HL),A
27830 LD H,172 172=ERIC
27832 RLCA Is ERIC sitting now?
27833 JR C,27843 Jump if so
27835 CALL 25108 Update the SRB for ERIC's current animatory state
27838 AND 128 A=animatory state of ERIC standing up
27840 JP 25008 Update ERIC's animatory state and update the SRB
ERIC is sitting now - on the floor, the stairs, or a chair?
27843 CALL 25108 Update the SRB for ERIC's current animatory state
27846 LD B,A B=ERIC's animatory state
27847 CALL 26184 Is ERIC on a staircase?
27850 JR Z,27864 Jump if not
ERIC is on a staircase.
27852 LD A,E A=ERIC's x-coordinate
27853 CP 48 Set the carry flag if ERIC's on the left side of the skool
27855 LD A,133 133=ERIC sitting down facing right
27857 JR C,27861 Jump if ERIC is on a staircase on the left side of the skool
27859 LD A,5 5=ERIC sitting down facing left
27861 JP 25008 Update ERIC's animatory state and update the SRB
ERIC is not on a staircase.
27864 CP 169 Is ERIC on the bottom floor?
27866 JR Z,27878 Jump if so
27868 BIT 7,B Is ERIC facing right?
27870 JR NZ,27878 Jump if so
27872 CALL 27633 This should be CALL 27634 - is ERIC beside a chair?
27875 JP Z,27517 Seat him if so
27878 LD A,B A=6 or 134 (ERIC sitting on the floor)
27879 AND 128
27881 ADD A,6
27883 JP 25008 Update ERIC's animatory state and update the SRB
Prev: 27822 Up: Map Next: 27886