Sherlock: annotated disassembly

Routines

Prev: 9B25 Up: Map Next: 9B7F
9B50: A cabbie told where to go: can he get there from here?
Sets up the cab ($A017) for the journey - its +1 from the actor in $A036, its room (+15) and A00A from the cabbie's - and looks for a journey from here to the destination in $A034 (9C07). If there is one, returns Z. If not, the cabbie replies 'SORRY GUV'NOR I CANNOT GET THERE FROM 'ERE' (6C34) and this returns NZ to its caller's caller (it drops its own return address). Asked for Old Mill Road from Baker Street, 'The cabbie replies " Sorry guv'nor I cannot get there from'ere ".'
Input
IX The cabbie's record (found from $A036)
Output
F Z when a journey exists; otherwise the caller is abandoned after the apology is printed
9B50 LD A,($A036) Read $A036 in "Game variables" into A - The cab is the cabbie's number less one (cabbie 31 drives cab 30, 34 drives 33)
9B53 DEC A Subtract one from A
9B54 LD IY,($A017) Read $A017 in "Game variables" into IY - The cabbie is in the cab; remember the cab at E2C6
9B58 LD (IY+$01),A Store A in byte +1 of the record at IY
9B5B LD ($E2C6),A Store A in "HAIL: the cab hailed, plus one" (E2C6)
9B5E CALL $D237 Call the routine "Resolve an id (in A) to its full entity record" (D237) - The cabbie's room becomes the cab's room, and the current room
9B61 LD A,(IX+$0F) Read byte +15 of the record at IX into A
9B64 LD (IY+$0F),A Store A in byte +15 of the record at IY
9B67 LD ($A00A),A Store A in the current actor's room (A00A)
9B6A LD A,($A034) Read $A034 in "Game variables" into A - Is there a journey from here to the destination ($A034)?
9B6D LD C,A Copy A into C
9B6E LD A,($A00A) Read the current actor's room (A00A) into A
9B71 CALL $9C07 Call the routine "Find the cab journey between two rooms" (9C07)
9B74 RET Z Yes: Z
9B75 POP HL No: drop the return address, so the record stops here,
9B76 LD HL,$6C34 Point HL at the message "YOU REPLIES" SORRY GUV'NOR I CANNOT GET THERE... (6C34) - and say SORRY GUV'NOR I CANNOT GET THERE FROM 'ERE
9B79 CALL $A59F Call the routine "Print the message at HL" (A59F)
9B7C OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller
9B7E RET Return to the caller
Prev: 9B25 Up: Map Next: 9B7F