Skool Daze Routines
26282: 'P' pressed - right
Called from the main loop at 26471. Also used by the routines at 25983 and 26084.
B ERIC's animatory state
DE ERIC's coordinates
26282 CALL 25956 Is ERIC sitting or lying down?
26285 RET NZ Return if so
26286 CALL 26184 Check whether ERIC is on a staircase
26289 LD A,E A=ERIC's x-coordinate
26290 JR Z,26300 Jump if ERIC's not on a staircase
26292 CP 48 Is ERIC on a staircase at the right of the skool?
26294 JP NC,26084 Jump if so
26297 JP 25983
26300 BIT 7,B Is ERIC facing left?
26302 JP Z,25962 Jump to turn ERIC round if so
26305 CP 93 Is ERIC at the far right of the skool?
26307 RET Z Return if so
26308 LD A,D A=ERIC's y-coordinate
26309 CP 169 Is ERIC on the bottom floor?
26311 JR Z,26329 Jump if so
26313 CP 162 Is ERIC on the middle floor?
26315 JR NZ,26325 Jump if not
26317 LD A,E A=ERIC's x-coordinate
26318 CP 78 Is ERIC facing the far right wall on the middle floor?
26320 RET Z Return if so
26321 LD A,37 37=x-coordinate of wall between White and Exam Rooms
26323 JR 26327
26325 LD A,56 56=x-coordinate of wall between Reading and Map Rooms
26327 CP E Is ERIC facing this wall (from the left)?
26328 RET Z Return if so (ERIC cannot walk through walls)
26329 LD A,129 129=ERIC midstride, facing right
26331 LD L,E L=ERIC's current (and midstride) x-coordinate
26332 INC E E=ERIC's post-midstride x-coordinate
26333 JP 26238 Put ERIC midstride