Routines

63210: Main loop


The routine at 63189 continues here

63210 21E37F LD HL,32739 Lesson time counter
63213 35 DEC (HL) Decrease the LSB
63214 2007 JR NZ,63223
63216 2C INC L
63217 35 DEC (HL) Decrease the MSB
63218 7E LD A,(HL)
63219 3C INC A Have we reached the end of the lesson?
63220 CC4DF7 CALL Z,63309 Ring the bell and change lesson if so
63223 CDB4F6 CALL 63156 Do various main-loop-type things
63226 21FB7F LD HL,32763
63229 7E LD A,(HL)
63230 A7 AND A Is ERIC simply standing still or walking?
63231 2805 JR Z,63238 Jump if so
63233 CDADF7 CALL 63405 Deal with ERIC if he's up to something
63236 182D JR 63283
63238 2EF3 LD L,243 HL=32755
63240 35 DEC (HL) Is it time to deal with ERIC?
63241 2028 JR NZ,63283 Jump if not
63243 2D DEC L HL=32754
63244 7E LD A,(HL)
63245 3600 LD (HL),0
63247 2C INC L HL=32755
63248 77 LD (HL),A
63249 A7 AND A
63250 201C JR NZ,63280
63252 CD13F4 CALL 62483 Check for keypresses
63255 281A JR Z,63283 Jump if there haven't been any
63257 32F17F LD (32753),A Store keypress code here
63260 26E5 LD H,229 HL will index the keypress table at 58624
63262 1133F7 LD DE,63283
63265 D5 PUSH DE
63266 6F LD L,A
63267 4E LD C,(HL)
63268 2C INC L
63269 46 LD B,(HL) Now BC=address of routine to deal with keypress
63270 C5 PUSH BC
63271 2100D2 LD HL,53760
63274 7E LD A,(HL) A=ERIC's animatory state
63275 2C INC L
63276 5E LD E,(HL) E=ERIC's x-coordinate
63277 2C INC L
63278 56 LD D,(HL) D=ERIC's y-coordinate
63279 C9 RET Jump to the appropriate keypress-handling routine, and then return to 63283
63280 CD006E CALL 28160 Update SRB for ERIC, scroll screen if necessary
63283 CDA062 CALL 25248 Update the display
63286 21F37F LD HL,32755
63289 7E LD A,(HL)
63290 A7 AND A
63291 2002 JR NZ,63295
63293 3602 LD (HL),2
63295 2ED9 LD L,217 HL=32729
63297 3A785C LD A,(23672) A=LSB of system variable FRAMES
63300 96 SUB (HL)
63301 FE01 CP 1
63303 38F8 JR C,63297
63305 86 ADD A,(HL)
63306 77 LD (HL),A
63307 189D JR 63210