Prev: 41733 Up: Map Next: 41786
41748: 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 41748 PUSH HL Stash HL, DE and BC on the stack.
41749 PUSH DE
41750 PUSH BC
41751 LD HL,40840 HL=Table_ItemLocations.
41754 LD BC,(48071) BC=*Count_Items.
Search Table_ItemLocations for the next object in this place.
FindObject_Loop 41758 CPIR Search for matching objects.
41760 JR NZ,PrintObjects_Return Jump to PrintObjects_Return if no objects were found.
41762 PUSH HL Stash the current place in Table_ItemLocations on the stack.
41763 CALL ValidateObject Call ValidateObject.
41766 JR Z,FindObject_Next Jump to FindObject_Next if the object is invalid.
41768 PUSH AF Temporarily stash the object type and object counter on the stack.
41769 PUSH BC
41770 CALL PrintCompressedStringAndNewline Call PrintCompressedStringAndNewline.
41773 POP BC Restore the object counter and object type from the stack.
41774 POP AF
Move on to the next object in the table.
FindObject_Next 41775 LD E,A Temporarily hold the object type in E.
41776 POP HL Restore the current place in Table_ItemLocations from the stack.
41777 LD A,B Test if all objects have been checked.
41778 OR C
41779 LD A,E Restore the object type to A.
41780 JR NZ,FindObject_Loop Jump back to FindObject_Loop until all objects in the table have been checked.
Restore the registers saved on entry to the routine and return.
PrintObjects_Return 41782 POP BC Restore BC, DE and HL from the stack.
41783 POP DE
41784 POP HL
41785 RET Return.
Prev: 41733 Up: Map Next: 41786