Prev: 49648 Up: Map Next: 49694
49663: Print Objects
Used by the routines at Handler_RoomExits and Action_Inventory.
Input
A 1 for inventory items, or room number for room objects
PrintObjects 49663 LD HL,48112 HL=Table_ItemLocations.
49666 LD BC,(48424) BC=*Count_Items.
FindObject_Loop 49670 CPIR Search for matching objects.
49672 RET NZ Return if no objects were found.
49673 PUSH HL Stash the current place in Table_ItemLocations on the stack.
49674 CALL ValidateObject Call ValidateObject.
49677 JR Z,FindObject_Next Jump to FindObject_Next if the object is invalid.
49679 PUSH AF Temporarily stash the object type and object counter on the stack.
49680 PUSH BC
49681 CALL PrintStringAndNewline Call PrintStringAndNewline.
49684 POP BC Restore the object counter and object type from the stack.
49685 POP AF
FindObject_Next 49686 LD E,A Temporarily hold the object type in E.
49687 POP HL Restore the current place in Table_ItemLocations from the stack.
49688 LD A,B Test if all objects have been checked...
49689 OR C
49690 LD A,E Restore the object type to A.
49691 JR NZ,FindObject_Loop Jump to FindObject_Loop until all objects in the table have been checked.
49693 RET Return.
Prev: 49648 Up: Map Next: 49694