![]() |
Routines |
| B | ERIC's animatory state |
| DE | ERIC's coordinates |
| 25983 | CALL 25956 | Is ERIC sitting or lying down? |
| 25986 | RET NZ | Return if so |
| 25987 | BIT 6,A | Bit 6 at 32763 is always reset, so this jump (which should be to 26067) is never made |
| 25989 | JR NZ,26068 | |
| 25991 | LD A,D | A=ERIC's y-coordinate |
| 25992 | CP 169 | Is ERIC on the bottom floor? |
| 25994 | JR Z,26067 | Jump forward to move him left or right if so |
| 25996 | CP 162 | Is ERIC on the middle floor? |
| 25998 | JR Z,26047 | Jump if so |
| 26000 | CP 155 | Is ERIC on the top floor? |
| 26002 | JR Z,26047 | Jump if so |
| 26004 | LD A,E | A=ERIC's x-coordinate |
| 26005 | CP 48 | Set the carry flag if ERIC's on a staircase on the left |
| 26007 | BIT 7,B | Set the zero flag if ERIC is facing left |
| 26009 | JR C,26016 | Jump if ERIC's on a staircase on the left |
| 26011 | JP NZ,25962 | Turn ERIC round if he's facing up a staircase on the right |
| 26014 | JR 26019 | |
| 26016 | JP Z,25962 | Turn ERIC round if he's facing up a staircase on the left |
| 26019 | LD H,D | Copy ERIC's coordinates to HL |
| 26020 | LD L,E | |
| 26021 | NOP | |
| 26022 | INC D | Down a step |
| 26023 | DEC E | One pace to the left |
| 26024 | LD B,2 | 2=ERIC standing, facing left |
| 26026 | CP 48 | Is ERIC on a staircase on the right side of the skool? |
| 26028 | JR NC,26034 | Jump if so |
| 26030 | LD B,130 | 130=ERIC standing, facing right |
| 26032 | INC E | One pace to the right (taking into the account the one pace to the left at 26023) |
| 26033 | INC E | |
| 26034 | LD A,B | A=2/130 |
| 26035 | BIT 0,L | A=1/129, B=2/130 if ERIC's current x-coordinate is even; A=3/131, B=0/128 if ERIC's current x-coordinate is odd; |
| 26037 | JR Z,26043 | |
| 26039 | DEC B | |
| 26040 | DEC B | |
| 26041 | ADD A,2 | |
| 26043 | DEC A | |
| 26044 | JP 25916 | Update ERIC's animatory state and location |
| 26047 | LD A,E | A=ERIC's x-coordinate |
| 26048 | CP 12 | 12=x-coordinate of top of staircases at left of skool |
| 26050 | JR NZ,26059 | Jump unless ERIC is there |
| 26052 | BIT 7,B | Is ERIC facing left? |
| 26054 | JP Z,26194 | Move ERIC left if so |
| 26057 | JR 26019 | Otherwise send ERIC down a step |
| 26059 | CP 77 | 77=x-coordinate of top of staircases at right of skool |
| 26061 | JR NZ,26067 | Jump unless ERIC is there |
| 26063 | BIT 7,B | Is ERIC facing left? |
| 26065 | JR Z,26019 | Send ERIC down a step if so |
| 26067 | BIT 7,B | Is ERIC facing left? |
| 26069 | JP Z,26194 | Move ERIC left if so |
| 26072 | JP 26282 | Otherwise move ERIC right |