Routines 
Prev: 66A4  Up: Map  Next: 66E0 


66AA  CALL $6564  Is ERIC sitting or lying down?  
66AD  RET NZ  Return if so  
66AE  CALL $6648  Check whether ERIC is on a staircase  
66B1  LD A,E  A=ERIC's xcoordinate  
66B2  JR Z,$66BC  Jump if ERIC's not on a staircase  
66B4  CP $30  Is ERIC on a staircase at the right of the skool?  
66B6  JP NC,$65E4  Jump if so  
66B9  JP $657F  
66BC  BIT 7,B  Is ERIC facing left?  
66BE  JP Z,$656A  Turn ERIC round if so  
ERIC is facing right, and is not on a staircase.


66C1  CP $5D  Is ERIC at the far right of the skool?  
66C3  RET Z  Return if so  
66C4  LD A,D  A=ERIC's ycoordinate  
66C5  CP $A9  Is ERIC on the bottom floor?  
66C7  JR Z,$66D9  Jump if so  
66C9  CP $A2  Is ERIC on the middle floor?  
66CB  JR NZ,$66D5  Jump if not  
66CD  LD A,E  A=ERIC's xcoordinate  
66CE  CP $4E  This is the xcoordinate of the far right wall on the middle floor  
66D0  RET Z  Return if ERIC is facing this wall  
66D1  LD A,$25  This is the xcoordinate of the wall between the White and Exam Rooms  
66D3  JR $66D7  
66D5  LD A,$38  This is the xcoordinate of the wall between the Reading and Map Rooms  
66D7  CP E  Is ERIC facing this wall (from the left side)?  
66D8  RET Z  Return if so (ERIC cannot walk through walls)  
There is no wall obstructing ERIC, so it's time to put him midstride.


66D9  LD A,$81  0x81=ERIC midstride, facing right  
66DB  LD L,E  L=ERIC's current xcoordinate  
66DC  INC E  E=ERIC's postmidstride xcoordinate  
66DD  JP $667E  Put ERIC midstride 
Prev: 66A4  Up: Map  Next: 66E0 