![]() |
Routines |
| Prev: 8672 | Up: Map | Next: 871A |
|
Used by the routines at SPAWN_MONSTER_INTO_ROOM, MOVE_BAT, MOVE_HOPPER, MOVE_FACE, MOVE_WITCH and MOVE_FACING_FLYER.
Reads the refresh register twice: for each axis one bit picks a speed of 1 or 2 and another its sign, and the results go into +$09 and +$08.
|
||||
| RANDOM_VELOCITY | 86F2 | LD A,R | ||
| 86F4 | BIT 0,A | |||
| 86F6 | JR Z,RANDOM_VELOCITY_2 | |||
| 86F8 | AND $04 | |||
| 86FA | SUB $02 | |||
| RANDOM_VELOCITY_0 | 86FC | LD (IX+$09),A | ||
| 86FF | LD A,R | |||
| 8701 | RRA | |||
| 8702 | BIT 0,A | |||
| 8704 | JR Z,RANDOM_VELOCITY_3 | |||
| 8706 | AND $04 | |||
| 8708 | SUB $02 | |||
| RANDOM_VELOCITY_1 | 870A | LD (IX+$08),A | ||
| 870D | RET | |||
| RANDOM_VELOCITY_2 | 870E | AND $02 | ||
| 8710 | SUB $01 | |||
| 8712 | JR RANDOM_VELOCITY_0 | |||
| RANDOM_VELOCITY_3 | 8714 | AND $02 | ||
| 8716 | SUB $01 | |||
| 8718 | JR RANDOM_VELOCITY_1 | |||
| Prev: 8672 | Up: Map | Next: 871A |