Prev: 627D Up: Map Next: 62A0
6291: Get a random number
Used by the routines at 62D0, 64D7, 6880, 7414, 775B, 77F2, 7854, 7A16, 7B0E, 7B55, 7CAB, F02F, F05D, F100, F250, F2E2 and F5BE. Returns with a random number in A.
6291 PUSH HL
6292 LD HL,($7FFD) Pick up the current random number seed from 7FFD
6295 INC HL Update the seed (by adding 257)
6296 INC H
6297 LD ($7FFD),HL
629A LD A,($5C78) Pick up the LSB of the system variable FRAMES in A
629D XOR (HL) Now A=a pseudo-random number
629E POP HL
629F RET
Prev: 627D Up: Map Next: 62A0