![]() |
Routines |
H | Character number (152-169) |
63374 | LD A,255 | Adjust the length of the lesson to allow the character enough time to find ERIC |
63376 | CALL 64004 |
63379 | LD L,105 | Initialise byte 105 to 160, so on this first pass we compare ERIC's location with that of his chaser |
63381 | LD (HL),160 | |
63383 | LD L,111 | Place 63390 in bytes 111 and 112 of the character's buffer |
63385 | LD (HL),158 | |
63387 | INC L | |
63388 | LD (HL),247 |
63390 | LD A,H | A=number of character looking for ERIC |
63391 | CP 163 | Is MR WACKER looking for ERIC? |
63393 | CALL Z,32234 | If so, make him walk fast |
63396 | LD L,105 | Is it time to make the character looking for ERIC move one step closer to him? |
63398 | LD A,(HL) | |
63399 | CP 251 | |
63401 | JP Z,31739 | Jump if so |
63404 | CALL 31229 | Get ERIC's coordinates in DE |
63407 | LD L,97 | Byte 97 holds the character's y-coordinate |
63409 | LD A,(HL) | Pick this up in A |
63410 | CP D | Set the zero flag if ERIC is on same floor |
63411 | CALL 63973 | Compare this character's coordinates with ERIC's |
63414 | JR NZ,63444 | Jump if this character is either on a staircase or on a different floor from ERIC |
63416 | INC L | L=98 |
63417 | LD A,(HL) | A=character's x-coordinate |
63418 | SUB E | Are ERIC and this character in exactly the same location? |
63419 | JR NZ,63436 | Jump if not |
63421 | LD A,(32763) | Check ERIC's status flags at 32763, and return if ERIC is firing, hitting, jumping, being spoken to by a little boy, knocked out, or writing on a blackboard |
63424 | AND 127 | |
63426 | RET NZ | |
63427 | LD L,112 | Remove any routine address from bytes 111 and 112 of the character's buffer |
63429 | LD (HL),A | |
63430 | LD L,106 | Remove any routine address from bytes 105 and 106 of the character's buffer |
63432 | LD (HL),A | |
63433 | JP 25256 | Move to the next instruction in the command list |
63436 | JR NC,63440 | Jump if character is to the right of ERIC |
63438 | NEG | |
63440 | CP 4 | Is ERIC less than 4 spaces away? |
63442 | JR C,63421 | Jump if so |
63444 | CALL 31452 | Determine this character's next move |
63447 | JP 31711 | Set him off in the appropriate direction |