![]() |
Routines |
63210 | LD HL,32739 | 32739 holds the lesson time counter |
63213 | DEC (HL) | Decrement the LSB |
63214 | JR NZ,63223 | Jump if it's non-zero |
63216 | INC L | Point HL at the MSB of the lesson time counter |
63217 | DEC (HL) | Decrement the MSB |
63218 | LD A,(HL) | Copy the new MSB to A |
63219 | INC A | Have we reached the end of the lesson? |
63220 | CALL Z,63309 | Ring the bell and start the next lesson if so |
63223 | CALL 63156 | Do various main-loop-type things |
63226 | LD HL,32763 | 32763 holds ERIC's status flags |
63229 | LD A,(HL) | Pick these up in A |
63230 | AND A | Is ERIC simply standing still or walking? |
63231 | JR Z,63238 | Jump if so |
63233 | CALL 63405 | Deal with ERIC if any of the bits at 32763 are set (he's up to something) |
63236 | JR 63283 |
63238 | LD L,243 | Decrement ERIC's main animation timer at 32755 |
63240 | DEC (HL) | |
63241 | JR NZ,63283 | Jump unless it's 0 |
63243 | DEC L | Collect the midstride animation timer from 32754 into A; it will be non-zero if ERIC is midstride or mid-action |
63244 | LD A,(HL) | |
63245 | LD (HL),0 | Reset the midstride animation timer to 0 |
63247 | INC L | Copy the previous contents of the midstride animation timer into 32755 |
63248 | LD (HL),A | |
63249 | AND A | Is ERIC midstride or mid-action? |
63250 | JR NZ,63280 | Jump if so |
63252 | CALL 62483 | Check for keypresses |
63255 | JR Z,63283 | Jump if there haven't been any |
63257 | LD (32753),A | Store the code of the last keypress in 32753 |
63260 | LD H,229 | HL will index the keypress table at 58624 |
63262 | LD DE,63283 | Push the address 63283 (see below) onto the stack so we return there after dealing with the keypress |
63265 | PUSH DE | |
63266 | LD L,A | Point HL at the appropriate keypress table entry |
63267 | LD C,(HL) | Copy the address of the routine for dealing with the keypress into BC |
63268 | INC L | |
63269 | LD B,(HL) | |
63270 | PUSH BC | Push this address onto the stack |
63271 | LD HL,53760 | Point HL at byte 0 of ERIC's buffer |
63274 | LD A,(HL) | Collect ERIC's animatory state into A, and his coordinates into DE |
63275 | INC L | |
63276 | LD E,(HL) | |
63277 | INC L | |
63278 | LD D,(HL) | |
63279 | RET | Make an indirect jump to the relevant keypress-handling routine, and then return to 63283 |
63280 | CALL 28160 | Update SRB for ERIC's new animatory state and location, and scroll the screen if necessary |
63283 | CALL 25248 | Update the display |
63286 | LD HL,32755 | 32755 holds ERIC's animation timer |
63289 | LD A,(HL) | Pick this up in A |
63290 | AND A | Did we check for keypresses on this pass? |
63291 | JR NZ,63295 | Jump if not |
63293 | LD (HL),2 | Otherwise reset ERIC's animation timer to 2 |
63295 | LD L,217 | HL=32729 (which holds the LSB of the system variable FRAMES as it was when the last pass through the main loop was completed) |
63297 | LD A,(23672) | A=LSB of the system variable FRAMES, which is incremented every 1/50th of a second |
63300 | SUB (HL) | Now A=0 if FRAMES hasn't been incremented since the last pass through the main loop |
63301 | CP 1 | Was FRAMES incremented? |
63303 | JR C,63297 | Jump back if not to check again |
63305 | ADD A,(HL) | Store the current value of the LSB of FRAMES at 32729 |
63306 | LD (HL),A | |
63307 | JR 63210 | Jump back to the start of the main loop |