Prev: AB88 Up: Map Next: ABB6
AB97: Print Objects
Used by the routines at Handler_RoomExits and Action_Inventory.
Input
A 01 for inventory items, or room number for room objects
PrintObjects AB97 LD HL,$A66C HL=Table_ItemLocations.
AB9A LD BC,($A7E6) BC=*Count_Items.
FindObject_Loop AB9E CPIR Search for matching objects.
ABA0 RET NZ Return if no objects were found.
ABA1 PUSH HL Stash the current place in Table_ItemLocations on the stack.
ABA2 CALL ValidateObject Call ValidateObject.
ABA5 JR Z,FindObject_Next Jump to FindObject_Next if the object is invalid.
ABA7 PUSH AF Temporarily stash the object type and object counter on the stack.
ABA8 PUSH BC
ABA9 CALL PrintStringAndNewline Call PrintStringAndNewline.
ABAC POP BC Restore the object counter and object type from the stack.
ABAD POP AF
FindObject_Next ABAE LD E,A Temporarily hold the object type in E.
ABAF POP HL Restore the current place in Table_ItemLocations from the stack.
ABB0 LD A,B Test if all objects have been checked...
ABB1 OR C
ABB2 LD A,E Restore the object type to A.
ABB3 JR NZ,FindObject_Loop Jump to FindObject_Loop until all objects in the table have been checked.
ABB5 RET Return.
Prev: AB88 Up: Map Next: ABB6