| Routines

31040: Print the lesson

Used by the routine at 63909. Prints the lesson (or DINNER or PLAYTIME) in the lesson box.
31040 | LD A,(32756) | Pick up the lesson descriptor from 32756
31043 | AND 7 | Keep only the 'room' bits (bits 0-2)
31045 | CP 5 | Set the zero flag if this period is REVISION LIBRARY, and set the carry flag if this is a classroom period
31047 | LD DE,60720 | Point DE at the appropriate spot in the lesson box graphic buffer (at 60672) for the first line of text
31050 | LD HL,55945 | 55945=' ' (single space)
31053 | JR NZ,31057 | Jump if this period is not REVISION LIBRARY
31055 | LD L,128 | HL=55936: 'REVISION'
31057 | JR NC,31076 | Jump if this is REVISION LIBRARY, DINNER or PLAYTIME
This period takes place in a classroom. With which teacher?
31059 | LD A,(32756) | Pick up the lesson descriptor from 32756
31062 | AND 240 | Keep only the 'teacher' bits (bits 4-7)
31064 | LD L,A | Point HL at the appropriate teacher's name: 55736 (MR WACKER), 55750 (MR ROCKITT), 55764 (MR WITHIT), or 55778 (MR CREAK)
31065 | RRCA
31066 | RRCA
31067 | RRCA
31068 | LD H,A
31069 | LD A,L
31070 | SUB H
31071 | ADD A,184
31073 | LD L,A
31074 | LD H,217
31076 | CALL 30042 | Write the first line of text (' ', 'REVISION' or the teacher's name) into the lesson box graphic buffer
31079 | LD A,(32756) | Pick up the lesson descriptor from 32756
31082 | AND 7 | Keep only the 'room' bits (bits 0-2)
31084 | ADD A,A | Point HL at the appropriate room name: 55952 (READING ROOM), 55968 (MAP ROOM), 55984 (WHITE ROOM), 56000 (EXAM ROOM), 56032 (DINNER), or 56048 (PLAYTIME)
31085 | ADD A,A
31086 | ADD A,A
31087 | ADD A,A
31088 | ADD A,128
31090 | LD L,A
31091 | LD H,218
This entry point is also used by the routine at 63909.
31093 | LD DE,60800 | Point DE at the appropriate spot in the lesson box graphic buffer (at 60672) for the second line of text
31096 | CALL 30042 | Write the second line of text into the buffer
31099 | LD HL,60672 | Point HL at the start of the lesson box graphic buffer
31102 | LD DE,23212 | Set DE to the attribute file address for the lesson box
31105 | JP 29977 | Copy the lesson box graphic buffer to the screen