![]() |
Routines |
Bit(s) | Meaning | 2 | ERIC is stepping off a plant straight to the floor | 3 | ERIC is falling and will land on his feet ("down" pressed) | 2 & 3 | ERIC is stepping off a fully grown plant in the direction of an open window or the closed skool gate |
---|
64316 | LD HL,32755 | 32755 holds ERIC's animation timer |
64319 | DEC (HL) | Is it time to deal with ERIC yet? |
64320 | RET NZ | Return if not |
64321 | INC (HL) | Set ERIC's animation timer to 1, ensuring that we pass through the following section of code on the next call to this routine if no keypress is detected this time |
64322 | CALL 29178 | Get the offset of the last key pressed from the keypress table |
64325 | RET Z | Return if no keys were pressed |
64326 | LD HL,32755 | Reset ERIC's animation timer at 32755 to 5 |
64329 | LD (HL),5 | |
64331 | RES 3,A | Reset bit 3 of the keypress code to make it lower case |
64333 | CP 86 | Was "down" pressed? |
64335 | JR NZ,64342 | Jump if not |
64337 | LD L,237 | HL=32749 (ERIC's status flags) |
64339 | LD (HL),8 | Set bit 3: ERIC is falling and will land on his feet |
64341 | RET |
64342 | EX DE,HL | |
64343 | LD HL,53760 | Point HL at the first byte of ERIC's buffer |
64346 | CP 82 | Was "right" pressed? |
64348 | JR NZ,64400 | Jump if not |
64350 | BIT 7,(HL) | Is ERIC facing left? |
64352 | JP Z,28216 | Turn ERIC round if so |
64355 | INC L | L=1 |
64356 | LD A,(HL) | A=ERIC's x-coordinate |
64357 | EX DE,HL | |
64358 | INC L | HL=32756 (which holds the door/window status flags) |
64359 | CP 132 | 132=x-coordinate of the plant pot to the left of the gate |
64361 | JR C,64383 | Jump if ERIC is standing on a plant pot in the boys' skool |
64363 | JR Z,64370 | Jump if ERIC is standing on one of the plant pots beside the gate |
64365 | LD A,4 | Make a sound effect, update SRB and set bit 2 at 32749 (ERIC is stepping off a plant/plant pot) |
64367 | JP 64244 |
64370 | BIT 4,(HL) | Is the skool gate open? |
64372 | JR NZ,64365 | Jump if so |
64374 | LD B,14 | 14=y-coordinate of ERIC if he's standing on a fully grown plant on the bottom floor |
64376 | INC E | Point DE at byte 2 of ERIC's buffer |
64377 | LD A,(DE) | A=ERIC's y-coordinate |
64378 | CP B | Is ERIC on top of a fully grown plant? |
64379 | RET NZ | Return if not |
64380 | JP 64242 | Otherwise make a sound effect, update SRB, and set bits 2 and 3 at 32749 |
64383 | CP 91 | Is ERIC standing on the top floor plant pot? |
64385 | JR NZ,64394 | Jump if not |
64387 | LD B,0 | 0=y-coordinate of ERIC if he's standing on a fully-grown plant on the top floor |
64389 | BIT 6,(HL) | Is the top floor window closed? |
64391 | RET Z | Return if so |
64392 | JR 64376 | |
64394 | LD B,7 | 7=y-coordinate of ERIC if he's standing on a fully-grown plant on the middle floor |
64396 | BIT 7,(HL) | Set the zero flag if the middle floor window is closed |
64398 | JR 64391 |
64400 | CP 80 | Was "left" pressed? |
64402 | RET NZ | Return if not |
64403 | BIT 7,(HL) | Is ERIC facing right? |
64405 | JP NZ,28216 | Turn ERIC round if so |
64408 | INC L | Point HL at byte 1 of ERIC's buffer |
64409 | LD A,(HL) | A=ERIC's x-coordinate |
64410 | EX DE,HL | |
64411 | INC L | HL=32756 (which holds the door/window status flags) |
64412 | CP 135 | 135=x-coordinate of the plant pot to the right of the gate; set the carry flag if ERIC is to the left of this, or set the zero flag if he's standing on it |
64414 | JR 64363 |