| Routines

29559: Make a policeman chase Sam or go to his last known whereabouts if appropriate

Used by the routine at 29361. Returns with the carry flag reset if the policeman starts either chasing Sam, or returning to where he first spotted Sam wearing a disguise that has just become known to the police.
Input
H | 222 or 223 (policeman)
29559 | CALL 29218 | Make the policeman start chasing Sam if appropriate
29562 | RET NC | Return if the policeman is now chasing Sam
29563 | LD L,29 | Pick up byte 29 of the policeman's buffer
29565 | LD A,(HL)
29566 | AND A | Was Sam recently spotted by the policeman while wearing a disguise that is unknown to the police?
29567 | SCF | Return with the carry flag set if not
29568 | RET Z
29569 | DEC (HL) | Decrement the disguise timeout counter in bits 0-4 of byte 29 of the policeman's buffer
29570 | LD A,(HL) | Pick up the result
29571 | AND 31 | Has the disguise timeout counter reached 0 (meaning that the disguise should now become known to the police)?
29573 | SCF | Return with the carry flag set if not
29574 | RET NZ
29575 | JP 29100 | Make the disguise known to the police, and send the policeman back to where he first spotted Sam wearing the disguise