Prev: B626 Up: Map Next: B64B
B62E: Check Room Objects
Used by the routine at HandlerDisplayRoomExits.
Check Room Objects.
Input
A Room number
Output
A 00 or 01 if objects are found or not
CheckRoomObjects B62E LD HL,$AD76 Point HL at the item-location table.
B631 LD BC,($AEF0) Take the length of the item-location table.
CheckRoomObjects_Loop B635 CPIR Search for the room number in the table.
B637 RET NZ Return if no objects are found.
B638 PUSH HL Keep the object location table pointer on the stack.
B639 CALL ValidateObject Call ValidateObject to check that the object is here.
B63C POP HL Restore the object location table pointer from the stack.
B63D JR NZ,NoRoomObjectsFound Jump to NoRoomObjectsFound if there are no objects found here.
B63F LD E,A Temporarily store A in E.
B640 LD A,B Are there more objects to check?
B641 OR C
B642 LD A,E Put back the A register.
B643 JR NZ,CheckRoomObjects_Loop Jump to CheckRoomObjects_Loop if there are more objects to check.
Set the "successful" output.
B645 LD A,$01 Set A to 01 to indicate that objects were found.
B647 AND A Clear the zero flag to report that objects were found.
B648 RET Return.
Set the "failure" output.
NoRoomObjectsFound B649 XOR A Set A to 00 to indicate that no objects were found.
B64A RET Return.
View the equivalent code in;
Prev: B626 Up: Map Next: B64B