Routines

24175: Deal with ERIC when he's writing on a board


This routine is called by the routine at 63405 when bit 4 at 32763 is set

24175 21F37F LD HL,32755
24178 35 DEC (HL) Is it time to deal with ERIC yet?
24179 C0 RET NZ Return if not
24180 2100D2 LD HL,53760 Point HL at byte 0 of ERIC's buffer
24183 7E LD A,(HL) A=ERIC's animatory state
24184 0F RRCA Is ERIC's arm up?
24185 3011 JR NC,24204 Jump if not
24187 CD0DF3 CALL 62221 Make sound effect and update SRB
24190 21D77F LD HL,32727
24193 7E LD A,(HL) A=code of key last pressed
24194 FE0D CP 13 Was it ENTER?
24196 CADC5D JP Z,24028 Jump if so
24199 3E56 LD A,86 Message no. 86: DON'T TOUCH BLACKBOARDS
24201 C398F8 JP 63640
24204 CDBE71 CALL 29118 Get character code of keypress in A
24207 C8 RET Z Return if no keys were pressed
24208 21D77F LD HL,32727
24211 77 LD (HL),A Store code of last keypress
24212 2C INC L
24213 6E LD L,(HL) L=board identifier (84, 90, 96, 102 or 108)
24214 2C INC L
24215 0604 LD B,4
24217 2C INC L
24218 CB7E BIT 7,(HL) Is a space available to store this keypress?
24220 2004 JR NZ,24226 Jump if so
24222 10F9 DJNZ 24217
24224 1801 JR 24227
24226 77 LD (HL),A Store keypress code
24227 FE0D CP 13 Was it ENTER?
24229 26D2 LD H,210
24231 C49467 CALL NZ,26516 Write letter on board if not
24234 18B9 JR 24165 Update SRB for ERIC and raise his arm