| Routines

61555: Restart the command list or make a teacher tell the kids to sit down

Used by the teachers' command lists 22, 24, 58, 60 and 62. Restarts the teacher's command list if it's not time to start the class yet; otherwise makes the teacher tell the kids to sit down.
Input
H | Teacher's character number (201-204)
61555 | LD A,(32740) | Collect the MSB of the lesson clock (which starts at 16)
61558 | CP 12 | Is it time to tell the kids to sit down yet?
61560 | JR C,61568 | Jump if so
61562 | LD L,29 | Otherwise signal that the command list is to be restarted
61564 | SET 0,(HL)
61566 | JR 61591 |
61568 | CALL 25213 | Collect the event indicator for the start of the lesson (8, 9, 10, 11 or 12) from the command list
61571 | LD C,A | Save the event indicator in C briefly
61572 | CALL 31887 | Has the lesson already started?
61575 | JR NZ,61591 | Jump if so (the teacher must have just returned to the classroom doorway after hunting down the truant ERIC)
61577 | LD A,C | Restore the event indicator to A, and signal that the lesson has started
61578 | CALL 31896
61581 | LD A,H | A=teacher's character number
61582 | SUB 109 | E=92, 93, 94 or 95 (appropriate SIT DOWN message for this teacher)
61584 | LD E,A
61585 | LD BC,27144 | Redirect control to the routine at 27144 (make character speak) and then return to 61591 (below)
61588 | CALL 25503
61591 | JP 25484 | Move to the next command in the command list