Prev: 9AB9 Up: Map Next: 9AF0
9ACF: Reset timer to initial value then load E with random value from sequence (in graphic layout data)
Used by the routines at 9AA9 and 9AB9.
Input
B Always zero
IX Current address in graphic layout data
9ACF LD A,(IX+$01) Set current timer value to maximum.
9AD2 LD (IX+$00),A
9AD5 LD A,(IX+$02) Load A with number of states.
9AD8 CALL $955A Set C to a random number between 03 and (number of states + 02).
9ADB ADD A,$03
9ADD LD C,A
9ADE PUSH IX Stash IX (current position in graphic layout data) on the stack.
9AE0 ADD IX,BC Advance IX by C bytes.
9AE2 LD E,(IX+$00) Load E with the value at this position.
9AE5 POP IX Restore IX (old position in graphic layout data) from the stack.
This entry point is used by the routine at 9AB9.
9AE7 LD A,(IX+$02) Advance IX by number of states + 03 bytes to arrive at start of next data.
9AEA ADD A,$03
9AEC LD C,A
9AED ADD IX,BC
9AEF RET Return.
Prev: 9AB9 Up: Map Next: 9AF0