Prev: C1F0 Up: Map Next: C21E
C1FF: Print Objects
Used by the routines at Handler_RoomExits and Action_Inventory.
Print every object in the given place.
Input
A 01 for inventory items, or room number for room objects
PrintObjects C1FF LD HL,$BBF0 Point HL at Table_ItemLocations.
C202 LD BC,($BD28) Load the number of items into BC.
Search Table_ItemLocations for the next object in this place.
FindObject_Loop C206 CPIR Search for matching objects.
C208 RET NZ Return if no objects were found.
C209 PUSH HL Stash the current place in Table_ItemLocations on the stack.
C20A CALL ValidateObject Call ValidateObject.
C20D JR Z,FindObject_Next Jump to FindObject_Next if the object is invalid.
C20F PUSH AF Temporarily stash the object type and object counter on the stack.
C210 PUSH BC
C211 CALL PrintStringAndNewline Call PrintStringAndNewline.
C214 POP BC Restore the object counter and object type from the stack.
C215 POP AF
Move on to the next object in the table.
FindObject_Next C216 LD E,A Temporarily hold the object type in E.
C217 POP HL Restore the current place in Table_ItemLocations from the stack.
C218 LD A,B Test if all objects have been checked.
C219 OR C
C21A LD A,E Restore the object type to A.
C21B JR NZ,FindObject_Loop Jump back to FindObject_Loop until all objects in the table have been checked.
All matching objects have been printed.
C21D RET Return.
Prev: C1F0 Up: Map Next: C21E