Sherlock: annotated disassembly

Routines

Prev: A771 Up: Map Next: A793
A780: Codes $0C and $0E: YOUR or HIS
DE = $09F2 if the actor in $A036 (code $0C) or the direct object in $A034 (code $0E) is the player (0), $0414 otherwise; returns NZ so that the interpreter prints DE as a word reference (A633 -> A5EA): $09F2 is YOUR and $0414 is HIS.
Input
$A036 The actor (code $0C); $A034 the direct object (code $0E)
Output
DE $09F2 (YOUR) for the player, $0414 (HIS) for anyone else
F NZ
A780 LD A,($A036) Code $0C: whose? A = the actor ($A036)
A783 LD DE,$0414 Load DE with $0414 - DE = $0414 (HIS), returned NZ when A is not zero
A786 AND A Clear the carry flag for the caller (A is unchanged)
A787 RET NZ If A is not zero, return
A788 LD DE,$09F2 Load DE with $09F2 - The player (A = 0): DE = $09F2 (YOUR), NZ
A78B OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller
A78D RET Return to the caller
A78E LD A,($A034) Read $A034 in "Game variables" into A - Code $0E: the same for the direct object ($A034)
A791 JR $A783 Go back to A783
Prev: A771 Up: Map Next: A793