Routines

26175: Knock character out of chair if necessary


Used by routines at 26263 and 62460

H Number of character trying to sit down

26175 16B7 LD D,183 183=little girl no. 1
26177 2E01 LD L,1
26179 018711 LD BC,4487 B=17 (7 girls, 10 boys), C=135
26182 CD2166 CALL 26145 Are any of these characters sitting in the chair?
26185 281C JR Z,26215 Jump if so
26187 018702 LD BC,647 B=2, C=135
26190 16D0 LD D,208 208=EINSTEIN
26192 CD1866 CALL 26136 Are any of the main kids sitting here?
26195 2812 JR Z,26215 Jump if so
26197 1112D2 LD DE,53778 D=210 (ERIC), E=18
26200 04 INC B B=1
26201 AF XOR A
26202 12 LD (DE),A Zero out byte 18 of ERIC's buffer
26203 CD2166 CALL 26145 Is ERIC sitting here?
26206 C0 RET NZ Return if not
26207 11FB7F LD DE,32763
26210 EB EX DE,HL
26211 CBFE SET 7,(HL) Signal: ERIC has been knocked to the floor (though this doesn't happen!)
26213 EB EX DE,HL
26214 C9 RET

A character (not ERIC) has been knocked out of the chair.
26215 3E66 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 12 LD (DE),A
26218 1D DEC E
26219 3E70 LD A,112
26221 12 LD (DE),A
26222 C9 RET