Prev: AF31 Up: Map Next: AF56
AF39: 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 AF39 LD HL,$A66C HL=Table_ItemLocations.
AF3C LD BC,($A7E6) BC=*Count_Items.
CheckRoomObjects_Loop AF40 CPIR Search for the room number in the table.
AF42 RET NZ Return if no objects are found.
AF43 PUSH HL Stash the object location table pointer on the stack.
AF44 CALL ValidateObject Call ValidateObject.
AF47 POP HL Restore the object location table pointer from the stack.
AF48 JR NZ,NoRoomObjectsFound Jump to NoRoomObjectsFound if there are no objects found here.
AF4A LD E,A Temporarily store A in E.
AF4B LD A,B Are there more objects to check?
AF4C OR C
AF4D LD A,E Restore the A register.
AF4E JR NZ,CheckRoomObjects_Loop Jump to CheckRoomObjects_Loop if there are more objects to check.
Set the "successful" output.
AF50 LD A,$01 Set A to 01 to indicate that objects were found.
AF52 AND A Set flags.
AF53 RET Return.
Set the "failure" output.
NoRoomObjectsFound AF54 XOR A Set A to 00 to indicate that no objects were found.
AF55 RET Return.
Prev: AF31 Up: Map Next: AF56