Sherlock: annotated disassembly

Routines

Prev: C929 Up: Map Next: C960
C933: Find the action record for the current command
So a person's list holds actions it does itself, not actions done to it - Tricia Fender's (TELL ABOUT / TELL, shared 3) and Mrs Jones's (shared 22) are the only ones. Only if that fails is the direct object's list searched. SAY TO TRICIA FENDER "TELL ME ABOUT THE BLOODSTAINED CLOTHES" reaches shared action 3 (E1B4) with Tricia acting and the clothes as indirect object, while TELL TRICIA FENDER ABOUT ... (the player acting) does not.
Chooses which action record carries out the current verb ($A033). If the actor ($A017) or the direct object ($A013) has its own entry for the verb (found by D1DC), the entry's second byte is an index into the shared action table at AA71 (C960). Otherwise the verb's default record comes from 9F38 (C972); a verb with no default fails via DC15. Either way, C996 then runs the record.
How it works:
1. If the actor is a person (+5 bit 6) and lists this verb in its own actions (D1DC), look the verb up in the shared actions table (D349); a shared action that is found is run.
2. If the direct object needs to be a thing (requirement code 7 or more) and lists this verb in its own actions, use that.
3. Otherwise look the verb up in the default-action table at 9F38; with no default the command fails (DC15).
Input
$A017 The actor's record
$A033 The verb
Output
The action record chosen and run through $C996
C933 LD IX,($A017) IX = the actor's own record
C937 BIT 6,(IX+$05)
C93B JR Z,$C94D If bit 6 of byte +5 of the record at IX is clear, skip ahead to C94D
C93D XOR A Clear A to zero (and the carry flag)
C93E CALL $D1DC Does the actor list this verb itself?
C941 JR NC,$C94D If the carry flag is clear, skip ahead to C94D
C943 LD A,($A033) Look the verb up in the shared actions table (D349)
C946 CALL $D349 Call the routine "Search a table of two-byte entries for A" (D349)
C949 CP $FF $FF = no shared action
C94B JR NZ,$C960 Yes: use the shared action it names
C94D LD A,($A00F)
C950 CP $07 Compare A with $07
C952 JR C,$C972 If A is below $07, skip ahead to C972
C954 LD IX,($A013) IX = the direct object's own record
C958 LD A,($A033) Does the object list this verb?
C95B CALL $D1DC Call the routine "Does this object list verb A in its own action list?" (D1DC)
C95E JR NC,$C972 No: use the verb's default action
Prev: C929 Up: Map Next: C960