Routines

62032: Make MR WACKER put kids in detention


Used by table of A&P number 72

H 200 (MR WACKER)

62032 3AFF7F LD A,(32767) A=column of play area at far left of screen
62035 FE30 CP 48 48: Is the stage off-screen to the right?
62037 D8 RET C Return if so
62038 FE58 CP 88 88: Is the stage off-screen to the left?
62040 D0 RET NC Return if so
62041 CD9162 CALL 25233 A=random number
62044 118C7F LD DE,32652
62047 6F LD L,A
62048 E607 AND 7
62050 C690 ADD A,144 A=144, 145, 146, 147, 149, 149, 150 or 151 (verb)
62052 12 LD (DE),A
62053 7D LD A,L
62054 0F RRCA
62055 0F RRCA
62056 0F RRCA
62057 E607 AND 7
62059 1E8E LD E,142 DE=32654
62061 C698 ADD A,152 A=152, 153, 154, 155, 156, 157, 158 or 159 (noun)
62063 12 LD (DE),A
62064 1E60 LD E,96 Message no. 96: YOU'RE ALL IN DETENTION...
62066 01086A LD BC,27144 Redirect control to the routine at 27144 (make character speak) and then return to 62072
62069 CD9F63 CALL 25503
62072 EB EX DE,HL
62073 21807F LD HL,32640
62076 CBBE RES 7,(HL) Reset bits 6 and 7 at 32640 (ERIC no longer has to be in the assembly hall)
62078 CBB6 RES 6,(HL)
62080 00 NOP
62081 00 NOP
62082 00 NOP
62083 00 NOP
62084 2EE4 LD L,228 HL=32740
62086 3601 LD (HL),1 Set the MSB of the lesson time counter to 1
62088 EB EX DE,HL
62089 C38C63 JP 25484 Move to the next instruction in the table of A&P