Sherlock: annotated disassembly

Routines

Prev: C8C6 Up: Map Next: C929
C8EF: Point $A013 and $A015 at the direct and indirect objects' records
Addresses named in the title: $A013, $A015.
Rooms (D224) for requirement codes below 5, things (D237) otherwise; a number or nothing ($FE, $FF) is left alone.
Input
$A034, $A035 The objects
Output
$A013 The direct object's record
$A015 The indirect object's record
C8EF LD A,($A034) Read $A034 in "Game variables" into A - The direct object ($A034): $FE or $FF (a number, or none) has no record
C8F2 CP $FE Compare A with $FE
C8F4 JR NC,$C90C If A is $FE or more, skip ahead to C90C
C8F6 LD A,($A00F) Read $A00F in "Game variables" into A - Its requirement code ($A00F) below 5: a room (D224)...
C8F9 CP $05 Compare A with $05
C8FB LD A,($A034) Read $A034 in "Game variables" into A
C8FE JR NC,$C905 If A is $05 or more, skip ahead to C905
C900 CALL $D224 Call the routine "Find a room record" (D224)
C903 JR $C908 Skip ahead to C908
C905 CALL $D237 ...otherwise a thing (D237)
C908 LD ($A013),IX Its record to $A013
C90C LD A,($A035) Read $A035 in "Game variables" into A - The same for the indirect object ($A035, code $A010) into $A015
C90F CP $FE Compare A with $FE
C911 RET NC If A is $FE or more, return
C912 LD A,($A010) Read $A010 in "Game variables" into A
C915 CP $05 Compare A with $05
C917 LD A,($A035) Read $A035 in "Game variables" into A
C91A JR NC,$C921 If A is $05 or more, skip ahead to C921
C91C CALL $D224 Call the routine "Find a room record" (D224)
C91F JR $C924 Skip ahead to C924
C921 CALL $D237 Call the routine "Resolve an id (in A) to its full entity record" (D237)
C924 LD ($A015),IX Store IX in the direct and indirect objects' records ($A015)
C928 RET Return to the caller
Prev: C8C6 Up: Map Next: C929