Prev: 46363 Up: Map Next: 46418
46385: Reset timer to initial value then load E with random value from sequence (in graphic layout data)
Used by the routines at 46347 and 46363.
Input
B Always zero
IX Current address in graphic layout data
46385 LD A,(IX+1) Set current timer value to maximum
46388 LD (IX+0),A
46391 LD A,(IX+2) Load A with number of states
46394 CALL 54222 Set C to a random number between 3 and (number of states + 2)
46397 ADD A,3
46399 LD C,A
46400 PUSH IX Store IX (current position in graphic layout data)
46402 ADD IX,BC Advance IX by C bytes
46404 LD E,(IX+0) Load E with value at this position
46407 POP IX Restore IX (old position in graphic layout data)
This entry point is used by the routine at 46363.
46409 LD A,(IX+2) Advance IX by number of states + 3 bytes to arrive at start of next data
46412 ADD A,3
46414 LD C,A
46415 ADD IX,BC
46417 RET Return
Prev: 46363 Up: Map Next: 46418