| Routines

32178: Make a teacher conduct a class

Used by the teachers' command lists 128, 130, 132 and 134. Determines whether the teacher is conducting ERIC's class, and hands over to 62208 if so or 32048 if not.
Input
H | Teacher's character number (163-166)
32178 | LD A,(32756) | Pick up the lesson descriptor from 32756
32181 | AND 240 | Keep only the 'teacher' bits (4-7)
32183 | RLCA | A=character number of the teacher (163-166) who is teaching ERIC and EINSTEIN this period
32184 | RLCA
32185 | RLCA
32186 | RLCA
32187 | ADD A,163
32189 | CP H | Set the zero flag if this teacher is teaching ERIC
32190 | LD L,99 |
32192 | JR Z,32199 | Jump if we're dealing with ERIC's teacher
32194 | LD (HL),48 | Replace the address of this routine in bytes 99 and 100 of the teacher's buffer with 32048, and jump there now to start the lesson
32196 | JP 32048
This teacher has the pleasure of conducting ERIC's class this period.
32199 | LD (HL),0 | Replace the address of this routine in bytes 99 and 100 of the teacher's buffer with that of 62208
32201 | INC L
32202 | LD (HL),243
32204 | LD A,0 | Clear all the lesson status flags at 32712
32206 | LD (32712),A
32209 | JP 62208 | Start the lesson