Back to Skool Routines
26453: Collect information about a blackboard
Used by the routines at 24133, 26513, 26752, 28658 and 61696. If the character is not standing at a blackboard, the routine returns with the carry flag set. Otherwise the routine returns with the carry flag reset, B holding the blackboard identifier (the LSB of 32596, 32602, 32608, 32614 or 32620), and DE holding the coordinates of the top left-hand square of the board.
H Number of character interested in the board
26453 LD B,3 Three blackboards on the top floors
26455 LD DE,54071 Point DE at the blackboard info table (see below)
26458 LD L,2 Byte 2 holds the character's y-coordinate
26460 LD A,(HL) Pick this up in A
26461 DEC L L=1
26462 CP B Is the character on the top floor?
26463 JR Z,26472 Jump if so
26465 LD E,58
26467 DEC B B=2 (two blackboards on the middle floor)
26468 CP 10 Is the character on the middle floor?
26470 JR NZ,26484 Jump if not
26472 LD A,(DE) A=x-coordinate of left end of a blackboard
26473 CP (HL) Is the character to the left of this blackboard?
26474 JR NC,26484 Jump if so
26476 ADD A,n Is the character within n character spaces (n=4 usually, or 12 if coming from 28658) of the left of this blackboard?
26478 CP (HL)
26479 JR NC,26486 Jump if so
26481 INC E Next blackboard
26482 DJNZ 26472
26484 SCF Signal: character not standing at a blackboard
26485 RET
The character is standing close enough to the blackboard (to either write on it or start wiping it).
26486 EX DE,HL Now HL points to the blackboard info table
26487 LD A,(HL) A=x-coordinate of left end of blackboard
26488 INC H
26489 LD B,(HL) B=blackboard identifier (84, 90, 96, 102 or 108)
26490 INC H
26491 LD H,(HL) H=y-coordinate of top row of blackboard
26492 LD L,A Pass the x-coordinate to L
26493 AND A Clear carry flag to indicate success
26494 EX DE,HL DE=coordinates of top-left corner of blackboard
26495 RET
The contents of the blackboard info table are as follows:
x ID y
D=211 D=212 D=213 Room
E=55 3 84 3 Blue room
E=56 41 90 3 Yellow room
E=57 161 96 3 Top-floor room in girls' skool
E=58 32 102 9 Science lab
E=59 161 108 9 Middle-floor room in girls' skool