Routines 
Prev: F5B6  Up: Map  Next: F5D9 
Used by the routine at F533. Returns with the carry flag set if ERIC is standing on a boy.


F5B9  LD C,E  Set E=x1 and C=x+2 where x is ERIC's xcoordinate; any boy with an xcoordinate in this range is a potential step for ERIC  
F5BA  DEC E  
F5BB  INC C  
F5BC  INC C  
F5BD  LD L,$61  Byte 0x61 of the boy's buffer holds his ycoordinate  
This entry point is also used by the routine at F533 with H=0xA7 (BOY WANDER) and B=0x03 (and E and C already set as above).


F5BF  LD A,D  A=y+1 (y=ERIC's ycoordinate)  
F5C0  CP (HL)  Is there a boy at this ycoordinate?  
F5C1  JR NZ,$F5D4  Jump if not  
F5C3  DEC L  Collect the boy's animatory state from byte 0x60 of his buffer  
F5C4  LD A,(HL)  
F5C5  INC L  L=0x61  
F5C6  AND $0F  Keep only bits 03 of the animatory state  
F5C8  CP $07  Is the boy lying flat on his back?  
F5CA  JR NZ,$F5D4  Jump if not  
F5CC  INC L  Collect the boy's xcoordinate from byte 0x62 of his buffer  
F5CD  LD A,(HL)  
F5CE  DEC L  L=0x61  
F5CF  CP E  Return with the carry flag set if ERIC is standing on this boy; otherwise continue  
F5D0  JR C,$F5D4  
F5D2  CP C  
F5D3  RET C  
F5D4  INC H  Next boy  
F5D5  DJNZ $F5BF  Jump back until all the boys have been checked  
F5D7  AND A  Return with the carry flag reset to indicate that ERIC is not standing on a boy  
F5D8  RET 
Prev: F5B6  Up: Map  Next: F5D9 