Routines

28002: Check for teachers near ERIC


Used by routine at 32062. Returns with the carry flag set if there is a teacher nearby.

28002 26D2 LD H,210 210=ERIC

This entry point is used by the routines at 30555 (with H=206: BOY WANDER) and 30706 (with H=207: ANGELFACE):
28004 CDEE6C CALL 27886 Collect in C and B the lower and upper x-coordinates of the limits of the 20-character-space-wide region around the boy
28007 D9 EXX
28008 26C8 LD H,200 200=MR WACKER
28010 0606 LD B,6 There are 6 adult characters
28012 D9 EXX
28013 CD326D CALL 27954 Can any of them see the boy?
28016 3807 JR C,28025 Jump if so
28018 A7 AND A Have we checked all the adult characters yet?
28019 C8 RET Z Return if so
28020 CD4C6D CALL 27980 Check any remaining adult characters
28023 30F9 JR NC,28018 Jump if there are none left or none can see the boy
28025 D9 EXX
28026 7C LD A,H A=character number of adult character who saw the boy
28027 D9 EXX
28028 C9 RET