Prev: 8E29 Up: Map Next: 8E6C
8E42: Draw overlay messages
Reveals a list of overlay message blocks - the arrest bonus screen, for one - a message at a time. Each call draws the messages revealed so far, then counts the delay down; when it hits zero a fresh delay is read from the message stream and the count goes up by one, so one more message appears next call. That continues until the stop sentinel is reached, at which point transition_control is taken from the byte before the sentinel to trigger whatever comes next.
The state is held in the code itself: the HL at 8E45 is the base message pointer, the B at 8E45 the current count and the delay is the operand at 8E49.
Used by the routines at transition and draw_mugshots.
draw_overlay_messages 8E42 LD HL,$0000 Load address of current message thing (frame delay, flags, attrs, bufaddr, attraddr, string)
8E45 LD B,$00 B = 0 -- self modified by (8E58 increments it), (8E8D resets it to 1)
dom_loop 8E47 DJNZ dom_1 Loop? to dom_1
8E49 LD A,$14 A = <self modified> frame delay. Self modified by 8E4C, 8E51, (8E84 sets it)
8E4B DEC A A--
8E4C LD ($8E4A),A Self modify 8E49 above
8E4F RET NZ Return if non-zero
8E50 LD A,(HL) A = *HL
8E51 LD ($8E4A),A Self modify 8E49 above
8E54 LD A,($8E46) Increment operand of 8E45, affects TIME UP state if disabled
8E57 INC A
8E58 LD ($8E46),A
8E5B INC B B++
dom_1 8E5C INC HL A = *++HL
8E5D LD A,(HL)
8E5E AND A Jump to dom_2 if A is zero
8E5F JR Z,dom_2
8E61 CALL print_message Call print_message
8E64 JR dom_loop Loop to dom_loop
dom_2 8E66 DEC HL transition_control = HL[-1]
8E67 LD A,(HL)
8E68 LD ($A231),A
8E6B RET Return
Prev: 8E29 Up: Map Next: 8E6C