Prev: B4FD Up: Map Next: B549
B517: Check And Process Objects
Used by the routine at CheckFlagAndSetDisplay_ProcessPointer.
Returns when the display flag at A01C is zero. Otherwise walks the character's objects and returns non-zero when one matches the room display parameter.
CheckFlagAndSetDisplay_CheckObjects B517 LD A,($A01C) Return if the display flag (A01C) is zero.
B51A AND A
B51B RET Z
B51C PUSH IY Keep the character record.
B51E PUSH DE
B51F PUSH IX
CheckFlagAndSetDisplay_ObjectLoop B521 CALL FollowCharacterLink Call FollowCharacterLink to follow the character link.
B524 BIT 6,(IY+$01) See whether bit 6 of the schedule entry is clear.
B528 JR Z,CheckFlagAndSetDisplay_RestoreAndReturn Jump ahead to CheckFlagAndSetDisplay_RestoreAndReturn if bit 6 of the schedule entry is clear.
B52A CALL AdjustObjectTableForSum Call AdjustObjectTableForSum to adjust the object table for this room.
CheckFlagAndSetDisplay_ProcessObject B52D PUSH IY Point HL at byte 08 of the record (IY+08).
B52F POP HL
B530 LD DE,$0008
B533 ADD HL,DE
B534 CALL ProcessObjectEntry Call ProcessObjectEntry to check the next object.
B537 CP $FF Jump back to CheckFlagAndSetDisplay_ObjectLoop if the entry is the end marker.
B539 JR Z,CheckFlagAndSetDisplay_ObjectLoop
B53B LD HL,$A034 Jump back to CheckFlagAndSetDisplay_ProcessObject while the object is not in the room on screen.
B53E CP (HL)
B53F JR NZ,CheckFlagAndSetDisplay_ProcessObject
B541 OR $01 Clear the zero flag to report that an object in the room on screen was found.
CheckFlagAndSetDisplay_RestoreAndReturn B543 POP IX Restore the saved character record, the saved source and the saved schedule entry from the stack.
B545 POP DE
B546 POP IY
B548 RET Return.
View the equivalent code in;
Prev: B4FD Up: Map Next: B549