Prev: 46065 Up: Map Next: 46111
46080: Print Objects
Used by the routines at HandlerDisplayRoomExits and Action_Inventory.
List the objects the player can see in this room.
Input
A 1 for inventory items, or room number for room objects
PrintObjects 46080 LD HL,44406 Point HL at Table_ItemLocations.
46083 LD BC,(44784) Load the number of items into BC.
PrintObjects_Loop 46087 CPIR Search Table_ItemLocations for the next item in this room.
46089 RET NZ Return if no matching items remain.
46090 PUSH HL Stash the current place in Table_ItemLocations on the stack.
46091 CALL ValidateObject Call ValidateObject to see whether this item has a description.
46094 JR Z,PrintObjects_Next Skip an item that has no description.
46096 PUSH AF Remember the room ID and the remaining count while the name is printed.
46097 PUSH BC
46098 CALL PrintStringAndANewline Call PrintStringAndANewline to print the string and start a new line.
46101 POP BC Restore the remaining count and the room ID from the stack.
46102 POP AF
PrintObjects_Next 46103 LD E,A Hold the room ID in E.
46104 POP HL Restore the current place in Table_ItemLocations from the stack.
46105 LD A,B See whether any items remain.
46106 OR C
46107 LD A,E Restore the room ID to A.
46108 JR NZ,PrintObjects_Loop Jump to PrintObjects_Loop while items remain.
46110 RET Return.
Prev: 46065 Up: Map Next: 46111