![]() |
Routines |
31188 | CALL 31229 | Get ERIC's coordinates in DE |
31191 | LD A,D | A=ERIC's y-coordinate |
31192 | PUSH HL | |
31193 | LD HL,30608 | 30608=region table for top floor; see 30636 |
31196 | CP 155 | 155=top floor |
31198 | JR Z,31214 | Jump if ERIC's on the top floor |
31200 | CP 162 | 162=middle floor |
31202 | LD L,156 | HL=30620 (region table for middle floor; see 30636) |
31204 | JR Z,31214 | Jump if ERIC's on the middle floor |
31206 | LD L,166 | HL=30630 (region table for bottom floor; see 30636) |
31208 | CP 169 | 169=bottom floor |
31210 | JR Z,31214 | Jump if ERIC's on the bottom floor |
31212 | POP HL | |
31213 | RET | Return with the zero flag reset |
31214 | LD A,E | A=ERIC's x-coordinate |
31215 | CP (HL) | Find the region identifier (0-7; see 30636) for ERIC's current location |
31216 | INC HL | |
31217 | INC HL | |
31218 | JR NC,31215 | |
31220 | DEC HL | HL now points at the region identifier |
31221 | LD A,(32756) | Pick up the current lesson descriptor in A |
31224 | AND 7 | Keep only the room bits (0-2) |
31226 | CP (HL) | Is ERIC where he should be? |
31227 | POP HL | |
31228 | RET | Return with the zero flag set if so |