Prev: 9FF8 Up: Map Next: A068
A054: Find the next visible exit
Steps IX to the next exit that has a direction and no door. Returns with Z set at the end of the exits.
A054 ADD IX,BC Move on to the next exit
A056 LD A,$FF Have we reached the end of the exits?
A058 CP (IX+$00)
A05B RET Z Yes: give up
A05C XOR A Does this exit have a door?
A05D CP (IX+$01)
A060 JR NZ,$A054 It does: it is not a "visible" exit in the sense wanted here, so skip it
A062 CP (IX+$00) Does it even have a direction at all?
A065 JR Z,$A054 No direction (an unused slot): skip that too
A067 RET Found a plain, doorless exit
Prev: 9FF8 Up: Map Next: A068