Skool Daze Routines
63931: Check whether ERIC has 10000 lines
Used by the routine at 30457. The number of lines has just been printed. Has ERIC gone over the limit?
63931 LD A,(32711) 32711 holds the MSB of the number of lines
63934 CP 3 Is the number of lines < 7680 (30 * 256)?
63936 RET C Return if so
63937 JR NZ,63945 Jump if the MSB > 3 (lines > 10240)
63939 LD A,(32710) So the MSB is 3; pick up the LSB in A
63942 CP 232 Is the number of lines < 10000?
63944 RET C Return if so
ERIC has 10000 lines or more. The end (of the game) is nigh.
63945 PUSH HL
63946 LD HL,64226 Point HL at the last two instructions in command list 222
63949 LD (41847),HL Place this address in bytes 119/120 of MR WACKER's buffer
63952 LD HL,41850 Set bit 0 of byte 122 of MR WACKER's buffer, triggering a command list restart
63955 SET 0,(HL)
63957 LD HL,32760 Set the MSB of the lesson time counter to 255 (so WACKER has enough time to find ERIC before the lesson ends)
63960 LD (HL),255
63962 POP HL
63963 RET