Prev: F171 Up: Map Next: F18E
F17F: Get a random number
Used by the routines at 61CF, 621E, 62DB, 634C, 6670, 6FC8, 72B1, 77A3, 7996, 7B6A, F485, F6E9, F748, F82A, FA05 and FB52. Returns with a random number in A.
F17F PUSH HL
F180 LD HL,($7FDE) Collect the random number seed from 7FDE
F183 INC HL Add 257 to it
F184 INC H
F185 LD ($7FDE),HL Store the new seed
F188 LD A,($5C78) Collect the LSB of the system variable FRAMES, which is incremented every 20ms
F18B XOR (HL) A=random number
F18C POP HL
F18D RET
Prev: F171 Up: Map Next: F18E