![]() |
Routines |
| Prev: A7AA | Up: Map | Next: A814 |
|
Anyone but Elrond examining the map gets the ordinary EXAMINE. Elrond puts back the road NEW_GAME_CHOICES shut and tells the way along it: "go ... from the ... to get to the ...", with the direction and the two places' names. The entry is found through the operand of the LD IY at SHUT_ROAD, which NEW_GAME_CHOICES writes.
The put-back is skipped if ROAD_OPEN is not zero, but nothing ever makes it so: NEW_GAME_CHOICES clears it and no instruction writes it otherwise (the only other F1 B6 in memory is in the picture code, where it is POP AF and then OR (HL)). So the road is put back again, to the same three bytes, every time Elrond reads the map. Watched: the treeless opening's west exit, wiped to zeros by NEW_GAME_CHOICES, came back as $04 $00 $14, written by the LD (HL),A in the loop above, when Elrond examined the map, and ROAD_OPEN was still 0 afterwards.
|
||||
| ELROND_READS_MAP | A7C4 | LD A,(ACTING) | Not Elrond: the ordinary EXAMINE | |
| A7C7 | CP $41 | |||
| A7C9 | JP NZ,DO_EXAMINE | |||
| A7CC | CALL FOR_REAL | The test ends here | ||
| SHUT_ROAD | A7CF | LD IY,$0000 | IY = the road that was shut; HL = its exit in the room record | |
| A7D3 | LD L,(IY+$01) | |||
| A7D6 | LD H,(IY+$02) | |||
| A7D9 | LD A,(ROAD_OPEN) | Already put back? Just say the way -- never taken: nothing sets ROAD_OPEN | ||
| A7DC | CP $00 | |||
| A7DE | JR NZ,ELROND_READS_MAP_1 | |||
| A7E0 | LD B,$03 | Put the exit back | ||
| ELROND_READS_MAP_0 | A7E2 | LD A,(IY+$03) | ||
| A7E5 | LD (HL),A | |||
| A7E6 | INC HL | |||
| A7E7 | INC IY | |||
| A7E9 | DJNZ ELROND_READS_MAP_0 | |||
| A7EB | LD IY,($A7D1) | IY = the road again | ||
| ELROND_READS_MAP_1 | A7EF | LD A,(IY+$05) | The destination's name, from its room record, on the stack | |
| A7F2 | CALL GET_ROOM | |||
| A7F5 | INC IX | |||
| A7F7 | INC IX | |||
| A7F9 | PUSH IX | |||
| A7FB | LD A,(IY+$00) | And the location's | ||
| A7FE | CALL GET_ROOM | |||
| A801 | INC IX | |||
| A803 | INC IX | |||
| A805 | PUSH IX | |||
| A807 | LD A,(IY+$03) | And the direction's word | ||
| A80A | CALL DIRECTION_WORD | |||
| A80D | PUSH DE | "go ... from the ... to get to the ..." | ||
| A80E | LD HL,MSG_GO_FROM_TO_GET | |||
| A811 | JP SAYS | |||
| Prev: A7AA | Up: Map | Next: A814 |