Sherlock: annotated disassembly

Routines

Prev: 9ED1 Up: Map Next: 9F38
9F1E: Store A at HL, put the actor in room B, and its next turn DE minutes on
The actor's own record ($A017) gets room B and no container; the actor-table entry at IY has its next-turn minute (+6/+7) moved on by DE. Used twice by the gardener's after-turn routine (9ED1): at 9pm he is put off stage (room 0, his room remembered at 9ED0) with his next turn about 504 minutes later (plus a random number up to 30, added to the low byte only), and on that turn he is put back.
The gardener left at 9:05pm each night and came back at 5:30am on Tuesday, but at 1:40am on Wednesday and 1:35am on Thursday - see the Bugs page.
Input
A The value to store
HL Where to store it
B The room to put the actor in
DE The minutes until its next turn
IY The actor's entry in the actor table
Output
IX The actor's own record ($A017)
9F1E LD (HL),A Store A at HL
9F1F LD IX,($A017) Read $A017 in "Game variables" into IX - The actor's own record ($A017): its room (+15) = B...
9F23 LD (IX+$0F),B Store B in byte +15 of the record at IX
9F26 LD (IX+$01),$FF ...and held by nothing (+1 = $FF)
9F2A LD L,(IY+$06) Read byte +6 of the record at IY into L - The actor's next turn (IY+6/+7) is DE minutes later
9F2D LD H,(IY+$07) Read byte +7 of the record at IY into H
9F30 ADD HL,DE Add DE to HL
9F31 LD (IY+$06),L Store L in byte +6 of the record at IY
9F34 LD (IY+$07),H Store H in byte +7 of the record at IY
9F37 RET Return to the caller
Prev: 9ED1 Up: Map Next: 9F38