Skool Daze Routines
31854: Make teacher perform dinner duty (1)
Used by command list 184. Makes the teacher on dinner duty pace up and down the dinner hall, checking whether ERIC is present. If ERIC is absent, the teacher is sent to find him, after which the command list is restarted.
H 163 (MR WACKER) or 165 (MR WITHIT)
31854 LD DE,32712 Set bit 7 at 32712, indicating that dinner has started (and so ERIC should be in the dinner hall)
31857 EX DE,HL
31858 SET 7,(HL)
31860 EX DE,HL
31861 CALL 31188 Set the zero flag if ERIC is where he should be
31864 LD DE,38689 D=151, E=33
This entry point is used by the routine at 31895 with D=117 and E=62, and also by the routine at 62208 with the zero flag reset.
31867 LD L,105
31869 JR Z,31879 Jump if ERIC is where he should be
31871 LD (HL),160 Place the address of the routine at 31648 in bytes 105 and 106 of the character's buffer
31873 INC L
31874 LD (HL),123
31876 JP 31648 And jump to that routine now
31879 LD (HL),60 Place the address of the routine at 25404 in bytes 105 and 106 of the character's buffer
31881 INC L
31882 LD (HL),99
31884 INC L Place 33 or 62 in byte 107 of the character's buffer (to make him go to that x-coordinate next)
31885 LD (HL),E
31886 INC L Place 0 in byte 108 of the character's buffer, giving him more than enough time to reach the other end of the dinner hall
31887 LD (HL),0
31889 LD L,99 Replace the address of this routine in bytes 99 and 100 of the character's buffer with that of 31895 or 31861
31891 LD (HL),D
31892 JP 25404