![]() |
Routines |
| Prev: C5B4 | Up: Map | Next: C5CE |
|
Updates the random seed from the frame counter, the old seed and the memory refresh register.
|
||||
| RandomNumber | C5BB | LD HL,($BBB2) | Fetch the frame counter and the random number. | |
| C5BE | LD DE,($BBAA) | |||
| C5C2 | LD A,R | Fetch a random number from 80 to FF. | ||
| C5C4 | ADD A,E | Add the low byte of the random number, and then the low byte of the frame counter, to it. | ||
| C5C5 | ADC A,L | |||
| C5C6 | LD L,A | Make that the low byte of the new random number. | ||
| C5C7 | LD A,D | Add the high byte of the frame counter to the high byte of the random number. | ||
| C5C8 | ADD A,H | |||
| C5C9 | LD H,A | |||
| C5CA | LD ($BBAA),HL | Store the new random number. | ||
| C5CD | RET | Return. | ||
| Prev: C5B4 | Up: Map | Next: C5CE |