Skool Daze Routines
Prev: 27125 Up: Map Next: 27191
27126: Trip people up
The address of this routine is placed into bytes 124 and 125 of the little boys' character buffers by the routine at 27246.
H Character number of little boy (152-162)
27126 LD L,97 Pick up little boy no. 1's y-coordinate in A
27128 LD A,(HL)
27129 CALL 26185 Is the boy on a staircase?
27132 RET NZ Return if so
27133 LD B,10 We will check characters 163-172 (teachers and main kids)
27135 LD DE,41826 D=163 (MR WACKER), E=98
27138 INC L L=98
27139 EX DE,HL
27140 LD A,(DE) A=x-coordinate of little boy no. 1
27141 CP (HL) Does this teacher's or main kid's x-coordinate match?
27142 JR Z,27149 Jump if so
27144 INC H Next teacher or main kid
27145 DJNZ 27140 Jump back until all teachers and main kids have been checked
27147 EX DE,HL
27148 RET
A teacher or main kid is at the same x-coordinate as little boy no. 1. Now check the y-coordinates.
27149 DEC E E=L=97
27150 DEC L
27151 LD A,(DE) A=y-coordinate of little boy no. 1
27152 INC E E=98
27153 CP (HL) Does this teacher's or main kid's y-coordinate match?
27154 INC HL L=98
27155 JR NZ,27144 Jump to consider the next teacher or main kid if not
A teacher or main kid is at the same location as little boy no. 1.
27157 LD L,112 Bytes 111 and 112 of the character's buffer may hold a routine address; pick up the MSB in A
27159 LD A,(HL)
27160 LD L,98
27162 AND A Is there a routine address in bytes 111 and 112?
27163 JR NZ,27144 Consider the next teacher or main kid if so
27165 LD A,H A=number of the character in the same location as little boy no. 1
27166 CP 172 Is it ERIC?
27168 JR Z,27184 Jump if so
27170 LD L,111 Place the address of the routine at 27206 into bytes 111 and 112 of the teacher's or main kid's buffer
27172 LD (HL),70
27174 INC L
27175 LD (HL),106
27177 INC L Place a timing parameter in byte 113 of the character's buffer
27178 LD (HL),20
27180 LD L,98
27182 JR 27144 Consider the next teacher or main kid
ERIC is in the same location as little boy no. 1. Knock ERIC out.
27184 LD HL,32763 32763 holds ERIC's status flags
27187 SET 4,(HL) Signal: ERIC has been knocked out
27189 EX DE,HL
27190 RET
Prev: 27125 Up: Map Next: 27191