Sherlock: annotated disassembly

Routines

Prev: E2C6 Up: Map Next: E2EE
E2C7: Shared HAIL action ($AA71 entry #11)
Addresses named in the title: AA71.
The player's INVENTORY/WAIT/STAND UP never reach it. It is reached through object action lists that map HAIL (and, for the same object, GET) to shared action 11 - see 8F06.
Record header: flags $47 (bit 6: pre-check routine at E298), byte 1 $10; body at E2CB. The body remembers the player's room (A00A) and the hailed cab's id + 1 (the cabbie) in E2C6, calls DD0E to move the cab into the player's room, then calls E2EE to start the cabbie on the script at F2B6 with the hailer and the cab as objects. HAIL CAB in Baker Street prints 'You hail the hansom cab.', the cabbie says 'Hello guv'nor.' and the next LOOK shows the cab with the cabbie in the street.
Input
$A034 The cab hailed
Output
F NZ; the cab moved to the player and the cabbie started on its fare script
E2C7 DEFB $47,$10,$98,$E2 Action record header: flags $47; bit 6: pre-check at E298; byte 1 $10
E2CB LD A,($A00A) Read the current actor's room (A00A) into A - Remember the player's room...
E2CE LD B,A Copy A into B
E2CF LD A,($A034) Read $A034 in "Game variables" into A - ...and the target's id + 1, in the variable at E2C6
E2D2 INC A Add one to A
E2D3 LD ($E2C6),A Store A in "HAIL: the cab hailed, plus one" (E2C6)
E2D6 DEC A Subtract one from A
E2D7 CALL $DD0E Move the cab (thing A = the hailed cab, id in $A034) into the player's room (B): DD0E sets its +15
E2DA LD A,($A036) Read $A036 in "Game variables" into A - B = the actor doing the hailing
E2DD LD B,A Copy A into B
E2DE LD A,($A034) Read $A034 in "Game variables" into A - C = the thing being hailed
E2E1 LD C,A Copy A into C
E2E2 LD DE,$F2B6 DE = F2B6, the cabbie's fare script
E2E5 LD A,($E2C6) Read "HAIL: the cab hailed, plus one" (E2C6) into A
E2E8 CALL $E2EE Start the cabbie (the cab's id + 1) on that script, with the hailer and the cab as its objects (E2EE)
E2EB OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller - Succeed
E2ED RET Return to the caller
Prev: E2C6 Up: Map Next: E2EE