Prev: 46630 Up: Map Next: 46667
46638: Check Room Objects
Used by the routine at HandlerDisplayRoomExits.
Check Room Objects.
Input
A Room number
Output
A 0 or 1 if objects are found or not
CheckRoomObjects 46638 LD HL,44406 Point HL at the item-location table.
46641 LD BC,(44784) Take the length of the item-location table.
CheckRoomObjects_Loop 46645 CPIR Search for the room number in the table.
46647 RET NZ Return if no objects are found.
46648 PUSH HL Keep the object location table pointer on the stack.
46649 CALL ValidateObject Call ValidateObject to check that the object is here.
46652 POP HL Restore the object location table pointer from the stack.
46653 JR NZ,NoRoomObjectsFound Jump to NoRoomObjectsFound if there are no objects found here.
46655 LD E,A Temporarily store A in E.
46656 LD A,B Are there more objects to check?
46657 OR C
46658 LD A,E Put back the A register.
46659 JR NZ,CheckRoomObjects_Loop Jump to CheckRoomObjects_Loop if there are more objects to check.
Set the "successful" output.
46661 LD A,1 Set A to 1 to indicate that objects were found.
46663 AND A Clear the zero flag to report that objects were found.
46664 RET Return.
Set the "failure" output.
NoRoomObjectsFound 46665 XOR A Set A to 0 to indicate that no objects were found.
46666 RET Return.
View the equivalent code in;
Prev: 46630 Up: Map Next: 46667