![]() |
Routines |
| H | Character number (if entering at 28242) |
| 28240 | LD H,210 | 210=ERIC |
| 28242 | LD L,1 | Collect the character's coordinates in DE |
| 28244 | LD E,(HL) | |
| 28245 | INC L | |
| 28246 | LD D,(HL) | |
| 28247 | LD A,D | A=character's y-coordinate |
| 28248 | CP 3 | Is the character on the top floor? |
| 28250 | RET Z | Return with carry reset if so |
| 28251 | CP 10 | Is the character on the middle floor? |
| 28253 | RET Z | Return with carry reset if so |
| 28254 | CP 17 | Is the character on the bottom floor? |
| 28256 | RET Z | Return with carry reset if so |
| 28257 | CP 14 | The stage has y-coordinate 14 |
| 28259 | JR NZ,28269 | Jump if the character's y-coordinate doesn't match that |
| 28261 | LD A,E | A=character's x-coordinate |
| 28262 | CP 82 | 81 is the x-coordinate of the right-hand edge of the assembly hall stage |
| 28264 | JR NC,28269 | Jump if the character's to the right of this |
| 28266 | CP 76 | 76 is the x-coordinate of the left-hand edge of the assembly hall stage |
| 28268 | RET NC | Return with the carry flag reset if the character's on the stage |
| 28269 | LD A,D | A=character's y-coordinate |
| 28270 | CP 10 | Is the character somewhere between the middle and bottom floors? |
| 28272 | JR NC,28287 | Jump if so |
| 28274 | LD A,E | A=character's x-coordinate |
| 28275 | CP 64 | Is the character on the stairs leading up to the revision library? |
| 28277 | JR C,28283 | Jump if so |
| 28279 | LD A,0 | Signal: character is on an up-and-to-the-left staircase |
| 28281 | SCF | Signal: character's on a staircase |
| 28282 | RET | Return with the carry flag set and A=0 |
| 28283 | LD A,128 | Signal: character is on an up-and-to-the-right staircase |
| 28285 | SCF | Signal: character's on a staircase |
| 28286 | RET | Return with the carry flag set and A=128 |
| 28287 | CP 15 | |
| 28289 | LD A,E | A=character's x-coordinate |
| 28290 | JR C,28298 | Jump if the character is on or above the level of the assembly hall stage |
| 28292 | CP 128 | Is the character on either the stairs leading down from the stage or the stairs leading down from the toilets in the boys' skool? |
| 28294 | JR C,28279 | Jump if so |
| 28296 | JR 28283 | The character is on the stairs leading down to the bottom floor in the girls' skool |
| 28298 | CP 64 | Is the character on either the stairs leading down to the stage or the stairs leading down to the bottom floor in the girls' skool? |
| 28300 | JR NC,28283 | Jump if so |
| 28302 | LD A,0 | Signal: character is on an up-and-to-the-left staircase (the one leading down from the toilets in the boys' skool, in fact) |
| 28304 | RET | Return with the carry flag set and A=0 |