![]() |
Routines |
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 |
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 |
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 |
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 |