Prev: 93CD Up: Map Next: 9404
93ED: UNLOCK
The target must be locked (bit 0 of its flags) or 'the door is unlocked'; the instrument must fit (A134). Then the RES instruction is written into 93CD and the lock is cleared there.
93ED LD IX,($B5F8) IX = the target's own record
93F1 BIT 0,(IX+$07) Is it actually locked?
93F5 LD A,$00 A = the state code for UNLOCKED
93F7 JP Z,$A09C No, already unlocked: say so
93FA CALL $A134 Locked: does the key fit (is the door open enough to check)?
93FD JP NZ,$A09C No: say why not
9400 LD A,$86 A = $86, the machine-code for a RES instruction
9402 JR $93D5 Poke that into the shared instruction, then join 93CD, which finishes the job by clearing the lock
Prev: 93CD Up: Map Next: 9404