Sherlock: annotated disassembly

Routines

Prev: B32D Up: Map Next: B36B
B34F: Start the direct-object search afresh
$B170 = 0, the number flag B4A2 = $FF, and the search position $B17E at the first thing (D04F) - or 0 when the requirement code ($A00F) is below 7.
Output
$B17E The first thing to search, or 0 for a room
B170 0, B4A2 $FF
B34F XOR A Clear A to zero (and the carry flag) - No direct-object candidates counted yet ($B170 = 0)
B350 LD ($B170),A Store A in $B170 in "Parser variables"
B353 LD A,$FF Load A with $FF - Number flag B4A2 = $FF
B355 LD ($B4A2),A Store A in "B4C1: $FF until the number in the direct-object..." (B4A2)
B358 CALL $D04F IX = the first thing (D04F)
B35B LD A,($A00F) Read $A00F in "Game variables" into A - Requirement code below 7 ($A00F): not a thing, so start at 0
B35E CP $07 Compare A with $07
B360 JR NC,$B366 If A is $07 or more, skip ahead to B366
B362 LD IX,$0000 Load IX with $0000
B366 LD ($B17E),IX Store IX in $B17E in "Parser variables" - Save the search position in $B17E
B36A RET Return to the caller
Prev: B32D Up: Map Next: B36B