D | y-coordinate of play area |
E | x-coordinate of play area |
189 | Top floor, left of left study door in boys' skool |
190 | Middle floor, left of far wall of science lab storeroom |
191 | Anywhere on bottom floor (or in mid-air!) |
192 | Assembly hall stage |
193 | Near middle-floor window in boys' skool |
194 | Top floor, right of left study door in boys' skool |
195 | Middle floor, girls' skool |
196 | Top floor, girls' skool |
0 | None of the places below |
1 | Playground |
2 | Various places in boys' skool outside classrooms |
3 | Assembly hall |
4 | Dining hall |
5 | Revision library, just outside yellow room door |
6 | Science lab |
7 | Blue room |
8 | Yellow room |
25554 | CDA36D | CALL 28067 | Divert back to the calling routine with the carry flag reset if the character is on the assembly hall stage |
25557 | 7A | LD A,D | D contains the y-coordinate |
25558 | 04 | INC B | Set B to 183 (186) if D≤6 (top floor), 184 (187) if 7≤D≤13 (middle floor), or 185 (188) if 14≤D≤18 (bottom floor) |
25559 | D607 | SUB 7 | |
25561 | 30FB | JR NC,25558 | |
25563 | FEFC | CP 252 | Does D=3, 10 or 17 (top, middle, bottom floor)? |
25565 | 2804 | JR Z,25571 | Jump if so |
25567 | 37 | SCF | Signal: D does not correspond exactly to top, middle or bottom floor |
25568 | 00 | NOP | |
25569 | 00 | NOP | |
25570 | 00 | NOP | |
25571 | F5 | PUSH AF | Save carry flag temporarily (note: C=59) |
25572 | 0C | INC C | |
25573 | 0A | LD A,(BC) | |
25574 | 0C | INC C | |
25575 | BB | CP E | |
25576 | 38FA | JR C,25572 | |
25578 | F1 | POP AF | Restore the carry flag (reset if D=3, 10 or 17; set otherwise) |
25579 | 0A | LD A,(BC) | A holds value in range 189-196 or 0-8 (see tables above) |
25580 | C9 | RET |
C=60 | C=62 | C=64 | C=66 | C=68 | |||||||
x | A | x | A | x | A | x | A | x | A | ||
B=183 | 72 | 189 | 96 | 194 | 159 | 191 | 224 | 196 | top floor | ||
B=184 | 63 | 190 | 76 | 191 | 96 | 193 | 159 | 191 | 224 | 195 | middle floor |
B=185 | 224 | 191 | bottom floor |
C=60 | C=62 | C=64 | C=66 | C=68 | C=70 | ||||||||
x | A | x | A | x | A | x | A | x | A | x | A | ||
B=186 | 23 | 7 | 29 | 2 | 40 | 5 | 63 | 8 | 224 | 0 | top floor | ||
B=187 | 30 | 2 | 53 | 6 | 224 | 0 | middle floor | ||||||
B=188 | 42 | 2 | 63 | 4 | 77 | 3 | 96 | 2 | 159 | 1 | 224 | 0 | bottom floor |