Prev: 86ED Up: Map Next: 8745
8708: Find the next candidate instrument
As 86BC, for the instrument; the position is kept at $8341, and the candidate goes into B5DA.
8708 XOR A Assume reach does not matter, for now
8709 LD ($B5FF),A
870C PUSH IY Save the caller's IY
870E LD IX,($8341) IX = where the instrument search last left off
8712 LD A,($B5F0) Is the instrument actually meant to be a room?
8715 DEC A
8716 JR Z,$873A Yes: search rooms instead
8718 LD IY,$9D2E No: IY = the object-search routine
871C LD A,($B60E) A = the action's own filter
871F AND $03
8721 LD ($B600),A
8724 CALL $8745 Find the next candidate object for which it would work
8727 CP $FF
8729 LD ($8341),IX Remember where the search has got to
872D POP IY Restore the caller's IY
872F PUSH AF Save the result for a moment
8730 LD A,($B60D) Does this particular action say reach does not matter?
8733 AND $01
8735 LD ($B5FF),A
8738 POP AF Restore the result
8739 RET
873A LD IY,$9DE9 Rooms: IY = the room-search routine instead
873E CALL $8745 Find the next candidate room for which it would work
8741 CP $FF
8743 JR $8729
Prev: 86ED Up: Map Next: 8745