Prev: 54791 Up: Map Next: 54897
54795: Print Location Exits
Used by the routine at DescribeCurrentRoom.
Reads this room's exits and prints them.
Input
A Room ID
PrintLocationExits 54795 PUSH BC Call GetLocationExitData to get location exit data.
54796 PUSH DE
54797 PUSH IY
54799 PUSH IX
54801 CALL GetLocationExitData
54804 PUSH IX Jump ahead to PrintLocationExits_DoesMatchCharacter to step to the next schedule entry and take the end marker.
54806 POP IY
54808 JR PrintLocationExits_DoesMatchCharacter
Skip this exit when its door object is zero.
PrintLocationExits_Loop 54810 LD A,(IY+1) Jump to PrintLocationExits_DoesMatchCharacter if the door object is zero.
54813 AND A
54814 JR Z,PrintLocationExits_DoesMatchCharacter
54816 LD A,(IY+0) Jump to PrintLocationExits_DoesMatchCharacter if the direction is 11 or more.
54819 CP 11
54821 JR NC,PrintLocationExits_DoesMatchCharacter
54823 LD A,(IY+1) Look up the door object.
54826 CALL FetchObjectDataPointer
54829 BIT 7,(IX+5) Jump ahead to PrintLocationExits_DoesMatchCharacter if the object-attribute flag is clear.
54833 JR Z,PrintLocationExits_DoesMatchCharacter
54835 LD A,(IY+0) Call GetDirectionToken to get direction token.
54838 CALL GetDirectionToken
54841 CP 9 Jump ahead to PrintLocationExits_Next if the direction is below a tab.
54843 JR C,PrintLocationExits_Next
54845 LD DE,10 Take a step of 0010 and jump ahead to PrintLocationExits_PrintTextToken if the direction token is 9.
54848 JR Z,PrintLocationExits_PrintTextToken
54850 LD DE,231 Use a step of 0231 and join PrintLocationExits_PrintTextToken.
54853 JR PrintLocationExits_PrintTextToken
Use the text: message at 26812 as the pointer, then use the text: exits at 26857 as the pointer, then advance the schedule entry by the count.
PrintLocationExits_Next 54855 LD HL,26812 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
54858 CALL PrintTextAndHandleControlCharacters
Print text token.
PrintLocationExits_PrintTextToken 54861 CALL PrintTextToken Call PrintTextToken to print the dictionary word.
54864 LD HL,26857 Take the exits message, then call PrintTextAndHandleControlCharacters to print the exits message.
54867 CALL PrintTextAndHandleControlCharacters
54870 PUSH IY Keep the schedule entry, then call TakeTheFoundObject to run object entry alternate.
54872 CALL TakeTheFoundObject
54875 CALL PrintFullStop Call PrintFullStop to print a full stop.
54878 POP IY Restore the schedule entry from the stack.
PrintLocationExits_DoesMatchCharacter 54880 ADD IY,BC Jump back to PrintLocationExits_Loop unless the next entry is the end marker (255).
54882 LD A,255
54884 CP (IY+0)
54887 JP NZ,PrintLocationExits_Loop
54890 POP IX Restore the saved character record, the saved schedule entry, the saved source and the saved count from the stack.
54892 POP IY
54894 POP DE
54895 POP BC
54896 RET Return.
View the equivalent code in;
Prev: 54791 Up: Map Next: 54897