Prev: A0BA Up: Map Next: A124
A0C8: Say where each way out through something lies
Used by the routine at DESCRIBE_LOCATION.
For every exit of the location that goes through an object which can be seen: "to the east there is ...", or "above there is ..." and "below there is ..." for up and down, with the object's name. This is how doors appear in a description.
Input
A The location
EXITS_THROUGH A0C8 PUSH BC
A0C9 PUSH DE
A0CA PUSH IY
A0CC PUSH IX
A0CE CALL EXITS_OF IY = the first exit
A0D1 ADD IX,BC
A0D3 PUSH IX
A0D5 POP IY
EXITS_THROUGH_0 A0D7 SUB A Not through anything: skip it
A0D8 CP (IY+$01)
A0DB JR Z,EXITS_THROUGH_3
A0DD LD A,(IY+$01) Through something that cannot be seen: skip it
A0E0 CALL GET_OBJECT
A0E3 BIT 7,(IX+$07)
A0E7 JR Z,EXITS_THROUGH_3
A0E9 LD DE,$0008 Its name, for the message
A0EC ADD IX,DE
A0EE PUSH IX
A0F0 LD A,(IY+$00) The direction's word
A0F3 CALL DIRECTION_WORD
A0F6 CP $09 Up is "above", down "below"
A0F8 JR C,EXITS_THROUGH_1
A0FA LD DE,$07B5
A0FD JR Z,EXITS_THROUGH_2
A0FF LD DE,$082B
A102 JR EXITS_THROUGH_2
EXITS_THROUGH_1 A104 LD HL,MSG_TO_THE The rest are "to the ..."
A107 CALL RUN_MESSAGE_HL
EXITS_THROUGH_2 A10A CALL PRINT_WORD_DE The word, then "there is ..."
A10D LD HL,MSG_THERE_IS
A110 CALL RUN_MESSAGE_HL
EXITS_THROUGH_3 A113 ADD IY,BC Until the $FF after the last exit
A115 LD A,$FF
A117 CP (IY+$00)
A11A JP NZ,EXITS_THROUGH_0
A11D POP IX
A11F POP IY
A121 POP DE
A122 POP BC
A123 RET
Prev: A0BA Up: Map Next: A124