Prev: 7E75 Up: Map Next: 7EB0
7E7B: Make MISS TAKE chase ERIC (2)
The address of this interruptible subcommand routine is placed into bytes 0x09 and 0x0A of MISS TAKE's buffer by the routine at 7E75. It makes MISS TAKE stalk ERIC while he's in the girls' skool or the girls' playground, but stand on guard by the skool gate if ERIC is on the boys' side.
Input
H 0xCC (MISS TAKE)
7E7B LD L,$1D Point HL at byte 0x1D of MISS TAKE's buffer
7E7D LD A,$CD 0xCD=ALBERT
7E7F SET 7,(HL) Set bit 7 at byte 0x1D of MISS TAKE's buffer, making her run
7E81 LD ($7FF5),A Set the character number of the adult who last gave ERIC lines (stored at 7FF5) to 0xCD (ALBERT); this has the effect of making any teacher (including whoever last gave ERIC lines) available for lines-giving ASAP (see 7D20 and 7D3E)
7E84 LD L,$00 Point HL at byte 0x00 of MISS TAKE's character buffer
7E86 BIT 0,(HL) Is MISS TAKE midstride?
7E88 JP NZ,$655E Finish the stride if so
Now check whether a command list restart has been requested. This request will have been made if the lesson in which MISS TAKE started chasing ERIC has ended, and the next lesson has just begun (see F74D).
7E8B LD L,$1D Set the zero flag if MISS TAKE should continue hounding ERIC
7E8D BIT 0,(HL)
This entry point is used by the routines at F09B and F54A with the zero flag reset and H holding the character number of a teacher chasing ERIC.
7E8F LD L,$01 Collect the teacher's coordinates in DE
7E91 LD E,(HL)
7E92 INC HL
7E93 LD D,(HL)
7E94 JR Z,$7EA2 Jump if this teacher is MISS TAKE and she should continue chasing ERIC
7E96 CALL $63D2 Is the teacher on a staircase?
7E99 JP NC,$6390 If not, terminate this interruptible subcommand
The chase is over, and the teacher is on a staircase. It's not a good idea to remove the interruptible subcommand routine address from bytes 0x09 and 0x0A of the teacher's buffer at this point, though, because the next command in the teacher's command list will be 6464, and that command will not work if the teacher's starting point is on a staircase. So continue chasing ERIC until the top or bottom of the staircase has been reached.
7E9C JP $6558 Continue chasing ERIC
7E9F NOP
7EA0 NOP
7EA1 NOP
MISS TAKE is chasing ERIC, but she only chases so far.
7EA2 LD A,($D201) A=ERIC's x-coordinate
7EA5 CP $8A This x-coordinate is just to the right of the plant in the girls' playground
7EA7 JR NC,$7EAD Jump if ERIC's to the right of this
7EA9 LD A,E A=MISS TAKE's x-coordinate
7EAA CP $89 This is the x-coordinate where MISS TAKE stands on guard for the truant ERIC
7EAC RET Z Return if MISS TAKE is already here
7EAD JP $6558 Otherwise MISS TAKE continues chasing ERIC
Prev: 7E75 Up: Map Next: 7EB0