Sherlock: annotated disassembly

Routines

Prev: CB28 Up: Map Next: CB40
CB2C: Dispatch to a handler routine via a computed jump
Loads IX and IY from a saved 'action context' (CB28/CB2A), calls through to a plain `JP (HL)` at CB40, then stores whatever IX/IY the handler left behind back into CB28/CB2A. So IX/IY persist from one dispatched handler to the next, like a pair of global registers - the caller's own IX/IY are not protected. CB34 is a second entry point that skips the load (used by the action-record interpreter at C9EB to run a record's pre-check routine with the current IX/IY).
Input
HL The handler
Output
F, HL From the handler
CB28, CB2A The IX and IY the handler left
CB2C LD IX,($CB28) Load the action context's IX...
CB30 LD IY,($CB2A) ...and IY
This entry point is used by the routine at C9BF.
CB34 CALL $CB40 Run the handler (second entry point: keep current IX/IY)
CB37 LD ($CB28),IX Save whatever IX the handler left as the new context...
CB3B LD ($CB2A),IY ...and IY
CB3F RET Return to the caller
Prev: CB28 Up: Map Next: CB40