Prev: 38941 Up: Map Next: 39041
39000: PickRoom_ActorScan — tail of the tracker sweep
C = an adjacent room: reject the sweep (motion detected) if any live actor stands in it; otherwise continue with the next direction slot, and after all five write the "all clear" result.
Used by the routine at 45705.
39000 LD B,8 all 8 actor slots:
39002 LD HL,29567 walk the +1 (room) column
39005 LD A,(HL) in the adjacent room?
39006 AND 63
39008 CP C
39009 JR NZ,39020
39011 PUSH HL yes: alive (+7 = 0)?
39012 ADD HL,DE
39013 DEC HL
39014 DEC HL
39015 XOR A
39016 CP (HL)
39017 JR Z,39034 yes: motion detected
39019 POP HL
39020 ADD HL,DE
39021 DJNZ 39005
39023 POP HL this direction is quiet:
39024 INC HL next direction slot
39025 POP BC
39026 DJNZ 38985
39028 POP HL all five quiet: NearRoomList
39029 LD A,(38356) entry = the holder's room
39032 LD (HL),A ("all clear")
39033 RET
39034 POP HL
This entry point is used by the routine at 45705.
39035 POP HL motion detected: unwind the scan
39036 POP BC and write 255 into the
39037 POP HL NearRoomList entry
39038 LD (HL),255
39040 RET
Prev: 38941 Up: Map Next: 39041