Prev: A68C Up: Map Next: A6B1
A694: Check Room Objects
Used by the routine at Handler_RoomExits.
Input
A Room number
Output
A 00 or 01 if objects are found or not
CheckRoomObjects A694 LD HL,$9F88 HL=Table_ItemLocations.
A697 LD BC,($BBC7) BC=*Count_Objects_1.
CheckRoomObjects_Loop A69B CPIR Search for the room number in the table.
A69D RET NZ Return if no objects are found.
A69E PUSH HL Stash the object location table pointer on the stack.
A69F CALL ValidateObject Call ValidateObject.
A6A2 POP HL Restore the object location table pointer from the stack.
A6A3 JR NZ,NoRoomObjectsFound Jump to NoRoomObjectsFound if there are no objects found here.
A6A5 LD E,A Temporarily store A in E.
A6A6 LD A,B Are there more objects to check?
A6A7 OR C
A6A8 LD A,E Restore the A register.
A6A9 JR NZ,CheckRoomObjects_Loop Jump to CheckRoomObjects_Loop if there are more objects to check.
Set the "successful" output.
A6AB LD A,$01 Set A to 01 to indicate that objects were found.
A6AD AND A Set flags.
A6AE RET Return.
Set the "failure" output.
NoRoomObjectsFound A6AF XOR A Set A to 00 to indicate that no objects were found.
A6B0 RET Return.
View the equivalent code in;
Prev: A68C Up: Map Next: A6B1