Sherlock: annotated disassembly

Routines

Prev: A684 Up: Map Next: A6BB
A68C: Codes $0F, $14-$17: only in one part of the day
Each asks C00C what part of the day it is (1-5) and, unless it is the code's own (code $0F: 5, $14: 4, $15: 3, $16: 2, $17: 1), skips the next element of the message (A6B2, A6BB). So a message can say different things by day and by night.
Input
IX The position of the code
Output
F Z; the next element is printed only in the code's own part of the day, otherwise it is skipped
A 0 when skipped
A68C CALL $C00C Call the routine "What part of the day is it? (A = 1-5)" (C00C) - Code $0F: the part of the day (C00C) is 5?
A68F CP $05 Compare A with $05
A691 RET Z If A equals $05, return
A692 JR $A6B2 Skip ahead to A6B2
A694 CALL $C00C Call the routine "What part of the day is it? (A = 1-5)" (C00C) - Code $14: is it 4?
A697 CP $04 Compare A with $04
A699 RET Z If A equals $04, return
A69A JR $A6B2 Skip ahead to A6B2
A69C CALL $C00C Call the routine "What part of the day is it? (A = 1-5)" (C00C) - Code $15: is it 3?
A69F CP $03 Compare A with $03
A6A1 RET Z If A equals $03, return
A6A2 JR $A6B2 Skip ahead to A6B2
A6A4 CALL $C00C Call the routine "What part of the day is it? (A = 1-5)" (C00C) - Code $16: is it 2?
A6A7 CP $02 Compare A with $02
A6A9 RET Z If A equals $02, return
A6AA JR $A6B2 Skip ahead to A6B2
A6AC CALL $C00C Call the routine "What part of the day is it? (A = 1-5)" (C00C) - Code $17: is it 1?
A6AF CP $01 Compare A with $01
A6B1 RET Z If A equals $01, return
A6B2 INC IX Step IX on to the next byte - Not that part: skip the element that follows (A6BB)
A6B4 CALL $A6BB Call the routine "Skip one message element at IX" (A6BB)
A6B7 DEC IX Step IX back one byte
A6B9 XOR A Set A to zero, which sets the zero flag for the caller - and print nothing
A6BA RET Return to the caller
Prev: A684 Up: Map Next: A6BB