Sets the random seed used by cpct_getRandom_lcg_u8.
void cpct_setSeed_lcg_u8 (u8 seed) __z88dk_fastcall;
(1B L) seed | New seed to be set for the random number generator. |
call cpct_setSeed_lcg_u8_asm
This function sets the random seed that cpct_getRandom_lcg_u8 uses internally for generating pseudo-random numbers. This can be used to randomize the start of the pseudo-random sequence or to make it predictable (setting the same seed again).
Please, do read documentation from cpct_getRandom_lcg_u8 for more details about how this random generator works.
A
2 bytes
Case | microSecs (us) | CPU Cycles ----------------------------------------- Any | 7 | 28 -----------------------------------------
Random generation original code comes from Fast RND, which can be found published by z80-info. The original code is reported to be from Spectrum ROM.