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 Point HL at Table_ItemEventLocations.
AB9A LD BC,($A7E6) Load the number of items into BC.
Search Table_ItemEventLocations for the next object in this place.
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_ItemEventLocations 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
Move on to the next object in the table.
FindObject_Next ABAE LD E,A Temporarily hold the object type in E.
ABAF POP HL Restore the current place in Table_ItemEventLocations 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 back to FindObject_Loop until all objects in the table have been checked.
All matching objects have been printed.
ABB5 RET Return.
Prev: AB88 Up: Map Next: ABB6