Prev: 39609 Up: Map Next: 39664
39631: Reset timer to initial value then load E with random value from sequence (in graphic layout data)
Used by the routines at 39593 and 39609.
Input
B Always zero
IX Current address in graphic layout data
39631 LD A,(IX+1) Set current timer value to maximum.
39634 LD (IX+0),A
39637 LD A,(IX+2) Load A with number of states.
39640 CALL 38234 Set C to a random number between 3 and (number of states + 2).
39643 ADD A,3
39645 LD C,A
39646 PUSH IX Stash IX (current position in graphic layout data) on the stack.
39648 ADD IX,BC Advance IX by C bytes.
39650 LD E,(IX+0) Load E with the value at this position.
39653 POP IX Restore IX (old position in graphic layout data) from the stack.
This entry point is used by the routine at 39609.
39655 LD A,(IX+2) Advance IX by number of states + 3 bytes to arrive at start of next data.
39658 ADD A,3
39660 LD C,A
39661 ADD IX,BC
39663 RET Return.
Prev: 39609 Up: Map Next: 39664