Routines
 Prev: F487 Up: Map Next: F4CB
F49C: Wait till everyone has gone past the gate or the boys' skool door
Used by command list 0x4C. Makes ALBERT wait at the skool gate or the boys' skool door until all the female characters are on the girls' side of the gate and all the male characters are to his left.
Input
H 0xCD (ALBERT)
F49C LD L,\$01 Point HL at byte 0x01 of ALBERT's buffer
F49E LD E,(HL) E=ALBERT's x-coordinate
F49F LD H,\$D1 0xD1=HAYLEY
F4A1 LD A,(HL) A=HAYLEY's x-coordinate
F4A2 LD H,\$B6
F4A4 LD B,\$04 There are 4 little girls (0xB7-0xBA) who sometimes venture past the skool gate
F4A6 JR \$F4A9
F4A8 LD A,(HL) A=girl's x-coordinate
F4A9 CP \$88 Is this girl on the right side of the gate?
F4AB RET C Return if not
F4AC INC H Next girl
F4AD DJNZ \$F4A8 Jump back until HAYLEY and girls 1-4 have been checked
The female characters are safely on the right side of the gate. Now check the male characters.
F4AF LD A,E A=ALBERT's x-coordinate
F4B0 SUB \$02
F4B2 LD H,\$D2 0xD2=ERIC
F4B4 CP (HL) Is ERIC at least 2 spaces to the left of ALBERT?
F4B5 RET C Return if not
F4B6 LD H,\$C1 0xC1=little boy no. 4
F4B8 LD B,\$0B There are 7 little boys and 4 male teachers who may venture out of the boys' skool
F4BA CP (HL) Is this character at least 2 spaces to the left of ALBERT?
F4BB RET C Return if not
F4BC INC H Next teacher or little boy
F4BD DJNZ \$F4BA Jump back until little boys 4-10 and the male teachers have been checked
ERIC, the male teachers and all the little boys are safely to ALBERT's left. Now check the remaining boys.
F4BF LD H,\$CE 0xCE=BOY WANDER
F4C1 LD B,\$03 3 main boys: BOY WANDER, ANGELFACE and EINSTEIN
F4C3 CP (HL) Is this character at least 2 spaces to the left of ALBERT?
F4C4 RET C Return if not
F4C5 INC H Next main boy
F4C6 DJNZ \$F4C3 Jump back until the three main boys have been checked
F4C8 JP \$638C Move to the next command in the command list now it's safe to shut the gate or door
 Prev: F487 Up: Map Next: F4CB