![]() |
Routines |
| Prev: 46066 | Up: Map | Next: 46100 |
|
Used by the routine at UpdateShot.
Chooses a step of 255, 0 or 1 at random, with zero twice as likely as the others.
|
||||||||
| ChooseRandomStep | 46083 | LD A,(39884) | The second random byte. | |||||
| 46086 | AND %00000011 | Keep the bits of A that are set in 3. | ||||||
| 46088 | LD B,0 | Clear B. | ||||||
| 46090 | CP 2 | Return if A is less than 2. | ||||||
| 46092 | RET C | |||||||
| 46093 | DEC B | Step B back. | ||||||
| 46094 | CP 3 | Return if A is 3. | ||||||
| 46096 | RET Z | |||||||
| 46097 | INC B | Advance B. | ||||||
| 46098 | INC B | Advance B. | ||||||
| 46099 | RET | Return. | ||||||
| Prev: 46066 | Up: Map | Next: 46100 |