Prev: C426 Up: Map Next: C456
C439: 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 C439 LD HL,$BBF0 HL=Table_ItemLocations.
C43C LD BC,($BD28) BC=*Count_Items.
CheckRoomObjects_Loop C440 CPIR Search for the room number in the table.
C442 RET NZ Return if no objects are found.
C443 PUSH HL Stash the object location table pointer on the stack.
C444 CALL ValidateObject Call ValidateObject.
C447 POP HL Restore the object location table pointer from the stack.
C448 JR NZ,NoRoomObjectsFound Jump to NoRoomObjectsFound if there are no objects found here.
C44A LD E,A Temporarily store A in E.
C44B LD A,B Are there more objects to check?
C44C OR C
C44D LD A,E Restore the A register.
C44E JR NZ,CheckRoomObjects_Loop Jump to CheckRoomObjects_Loop if there are more objects to check.
Set the "successful" output.
C450 LD A,$01 Set A to 01 to indicate that objects were found.
C452 AND A Set flags.
C453 RET Return.
Set the "failure" output.
NoRoomObjectsFound C454 XOR A Set A to 00 to indicate that no objects were found.
C455 RET Return.
Prev: C426 Up: Map Next: C456