Skool Daze Routines
Prev: 63930 Up: Map Next: 63964
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; collect the LSB from 32710
63942 CP 232 Is the number of lines < 10000 (=232+256*30)?
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 first of the last two instructions in command list 222 ('Find ERIC', and 'Expel ERIC')
63949 LD (41847),HL Place this address into bytes 119 and 120 of MR WACKER's buffer, so that these instructions become his command list
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 that the lesson cannot end before MR WACKER has begun looking for ERIC)
63960 LD (HL),255
63962 POP HL
63963 RET
Prev: 63930 Up: Map Next: 63964