Sherlock: annotated disassembly

Routines

Prev: DFF0 Up: Map Next: E022
E003: Shared TAKE OFF action ($AA71 entry #5)
Addresses named in the title: AA71.
Used by the China man's disguise (object 14). The body calls E03A with A = 0, then clears the disguise's container and sets its room to A00A.
The object records show how it is reached: through the disguise's own TAKE OFF entry.
Output
F NZ; the actor is itself again and the disguise lies in the player's room
E003 DEFB $47,$10,$F8,$DF Action record header: flags $47; bit 6: pre-check at DFF8; byte 1 $10
This entry point is used by the routine at DFEA.
E007 XOR A Clear A to zero (and the carry flag) - A = 0: the actor turns back into thing 0 (E03A)
E008 CALL $E03A Call the routine "Set the worn state of the actor (A = 1 wear, 0 take..." (E03A)
E00B LD IX,($A013) Read $A013 in "Game variables" into IX - The disguise (the direct object) is no longer held by anyone (+1 = 0)...
E00F LD (IX+$01),$00 Set byte +1 of the record at IX to $00
E013 LD A,($A00A) Read the current actor's room (A00A) into A - ...and lies in the room the player is in (+15)
E016 LD (IX+$0F),A Store A in byte +15 of the record at IX
E019 OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller
E01B RET Return to the caller
E01C LD A,($A036) Read $A036 in "Game variables" into A - Pre-check for TAKE OFF: the actor must be the player (A = 0)
E01F AND A Test A for zero (this leaves A as it was and clears carry)
E020 JR $DFFD Go back to DFFD
Prev: DFF0 Up: Map Next: E022