Sherlock: annotated disassembly

Routines

Prev: CC78 Up: Map Next: CD47
CD24: Plan opcode 8, SIGNAL: leave a token for another actor
Allocates a 2-byte node (this actor, the argument) on the list headed at 9FE7. AWAIT (opcode 9) in the other actor's script looks for it. Always succeeds.
Input
IX The instruction (+1 the actor signalled)
Output
The token left on the list at $9FE7; the step succeeds
CD24 LD A,(IX+$01) Read byte +1 of the record at IX into A - The actor being signalled
CD27 PUSH AF Save AF on the stack
CD28 LD A,$02 Load A with $02 - Allocate a 2-byte node
CD2A CALL $A11C Call the routine "Allocate A + 3 bytes from the free list, cleared" (A11C)
CD2D LD HL,($9FE7) Read SIGNAL tokens (9FE7) into HL - Link it in at the head of the 9FE7 list
CD30 LD ($9FE7),IX Store IX in SIGNAL tokens (9FE7)
CD34 LD (IX-$02),L Store L in byte -2 of the record at IX
CD37 LD (IX-$01),H Store H in byte -1 of the record at IX
CD3A LD A,($A036) Read $A036 in "Game variables" into A - Node +0 = who signalled
CD3D LD (IX+$00),A Store A in the first byte of the record at IX
CD40 POP AF Restore AF from the stack - Node +1 = who it is for
CD41 LD (IX+$01),A Store A in byte +1 of the record at IX
CD44 JP $CE8F Succeed
Prev: CC78 Up: Map Next: CD47