Prev: 25373 Up: Map Next: 25402
25374: Check whether a signal has been raised
Used by the routines at 25303 and 32167. On entry, A holds the event identifier, which will be one of:
A Description Flags Bit
0 End of lesson/playtime 32712 0
8 Teacher has arrived at the Map Room 32713 0
9 Teacher has arrived at the Reading Room 32713 1
10 Teacher has arrived at the Exam Room 32713 2
11 Teacher has arrived at the White Room 32713 3
16 Little boy no. 1 is ready to stampede 32714 0
17 Little boy no. 1 is ready to stampede again 32714 1
26 EINSTEIN or BOY WANDER is ready 32715 2
27 MR WACKER is ready 32715 3
28 ERIC has been told about EINSTEIN, BOY WANDER or ANGELFACE 32715 4
29 EINSTEIN has told MR WACKER what ERIC's up to, or ERIC has mumps 32715 5
The routine returns with the zero flag reset if the corresponding signal has been raised.
Input
A Event ID from a command list
25374 PUSH AF Save the event identifier briefly
25375 AND 248 Keep only bits 3-7 (the byte index) and shift them into bits 0-4
25377 RRCA
25378 RRCA
25379 RRCA
25380 ADD A,200 Modify the LD A,(m) instruction at 25396 below so that m is 32712, 32713, 32714 or 32715
25382 LD (25397),A
25385 POP AF Restore the event identifier to A
25386 AND 7 Keep only bits 0-2 (the bit index)
25388 ADD A,A Modify the BIT n,A instruction at 25399 below so that n=A (0-7)
25389 ADD A,A
25390 ADD A,A
25391 ADD A,71
25393 LD (25400),A
25396 LD A,(32712) Pick up the byte holding the signal flag for this event (the operand of this instruction is modified earlier in this routine)
25399 BIT 0,A Reset the zero flag if the signal has been raised (this instruction is modified earlier in this routine to check the appropriate bit)
25401 RET
Prev: 25373 Up: Map Next: 25402