![]() |
Routines |
26342 | LD HL,5376 | Reset the lesson time counter at 32759 |
26345 | LD (32759),HL | |
26348 | LD HL,32761 | Advance the lesson number by one and get the next lesson number (0-63) in A |
26351 | INC (HL) | |
26352 | LD A,(HL) | |
26353 | CP 64 | |
26355 | JR NZ,26359 | |
26357 | XOR A | |
26358 | LD (HL),A | |
26359 | LD E,A | E=lesson number (0-63) |
26360 | CALL 63749 | Get the identifier for this lesson in A |
26363 | CP D | D=254; ring the bell unless this is the second PLAYTIME in a row (only PLAYTIMEs 254 and 255 follow another PLAYTIME) |
26364 | PUSH AF | |
26365 | CALL C,26450 | |
26368 | LD HL,32712 | Zero out bytes 32712-32731 of the game status buffer (thus clearing all the signal flags) |
26371 | LD B,20 | |
26373 | LD (HL),0 | |
26375 | INC L | |
26376 | DJNZ 26373 | |
26378 | POP AF | |
26379 | LD E,A | E=lesson identifier (224-255) from the main timetable |
26380 | LD D,172 | Pick up the lesson descriptor (which determines who is teaching ERIC and in what room) and place it in 32756 |
26382 | LD A,(DE) | |
26383 | LD (32756),A | |
26386 | PUSH DE | |
26387 | CALL 63909 | Print the teacher and room names in the lesson box |
26390 | POP DE | |
26391 | LD B,20 | There are 20 non-player characters to prepare for the new lesson, starting with little boy no. 1 (152) |
26393 | LD H,152 |
26395 | EXX | |
26396 | LD H,254 | The addresses of the command lists are in page 254 |
26398 | EXX | |
26399 | LD D,H | D=character number (152-171) |
26400 | LD L,122 | Set bit 0 of byte 122 of the character's buffer; this will trigger a restart of the command list in the routine at 25172 |
26402 | SET 0,(HL) | |
26404 | LD L,119 | |
26406 | LD A,(DE) | Pick up the command list number for this lesson from the character's personal timetable |
26407 | EXX | |
26408 | LD L,A | A=LSB of the address of the command list |
26409 | LD A,(HL) | |
26410 | INC L | Point HL' at the MSB of the address of the command list |
26411 | EXX | |
26412 | LD (HL),A | Copy the LSB to byte 119 of the character's buffer |
26413 | INC L | L=120 |
26414 | EXX | |
26415 | LD A,(HL) | A=MSB of the address of the command list |
26416 | EXX | |
26417 | LD (HL),A | Copy the MSB to byte 120 of the character's buffer |
26418 | INC H | Next character |
26419 | DJNZ 26399 | Jump back until all characters have been done |
26421 | RET |