Prev: 54795 Up: Map Next: 54924
54897: Find Next Valid Exit
Used by the routine at PrintLocationExitsWithFormatting.
Steps through the exit list until it finds one whose door object is zero.
Input
IX Pointer to exit data
BC Exit data length
Output
F Zero flag clear when a valid exit is found
FindNextValidExit 54897 ADD IX,BC Step to the next exit entry.
54899 LD A,255 Take the end marker.
54901 CP (IX+0) See whether this exit is the end marker.
54904 RET Z Return if this exit is the end marker.
54905 XOR A Go to FindNextValidExit if the door object is not zero.
54906 CP (IX+1)
54909 JR NZ,FindNextValidExit
54911 LD A,(IX+0) Jump to FindNextValidExit if this exit has no direction.
54914 AND A
54915 JR Z,FindNextValidExit
54917 CP 11 Go to FindNextValidExit if the direction is 11 or more.
54919 JR NC,FindNextValidExit
54921 OR %00000001 Reset the zero flag.
54923 RET Return.
View the equivalent code in;
Prev: 54795 Up: Map Next: 54924