Back to Skool Routines
26175: Knock character out of chair if necessary
Used by the routines at 26263 and 62460.
H Number of character trying to sit down
26175 LD D,183 183=little girl no. 1
26177 LD L,1
26179 LD BC,4487 B=17 (7 girls, 10 boys), C=135
26182 CALL 26145 Are any of these characters sitting in the chair?
26185 JR Z,26215 Jump if so
26187 LD BC,647 B=2, C=135
26190 LD D,208 208=EINSTEIN
26192 CALL 26136 Are any of the main kids sitting here?
26195 JR Z,26215 Jump if so
26197 LD DE,53778 D=210 (ERIC), E=18
26200 INC B B=1
26201 XOR A
26202 LD (DE),A Zero out byte 18 of ERIC's buffer
26203 CALL 26145 Is ERIC sitting here?
26206 RET NZ Return if not
26207 LD DE,32763 Set bit 7 of ERIC's status flags at 32763, indicating that he's been knocked to the floor; however, bit 7 is ignored by the routine at 63405 (because bit 2 is also set), so ERIC actually stays in his seat (which is a bug)
26210 EX DE,HL
26211 SET 7,(HL)
26213 EX DE,HL
26214 RET
A character (not ERIC) has been knocked out of the chair.
26215 LD A,102 Place the address of the routine at 26224 into bytes 17 and 18 of the buffer of the character who's been knocked out of the chair
26217 LD (DE),A
26218 DEC E
26219 LD A,112
26221 LD (DE),A
26222 RET