Returns a pseudo-random byte uniformly distributed using fast method (33*Seed mod 257)
u8 cpct_setTaps_glfsr16 (u16 tapset) __z88dk_fastcall;
(2B HL) tapset | set of tap bits that cpct_getRandom_glfsr16_u8 and cpct_getRandom_glfsr16_u16 will use to produce pseudo-random number sequences. |
call cpct_setTaps_glfsr16_asm
This function sets the concrete sequence that cpct_getRandom_glfsr16_u8 and cpct_getRandom_glfsr16_u8 will produce. The sequence is picked up from 1024 different complete 65535-value sequences codified in TAPSETs (Check <GLFSR16_TAPS>). Therefore, this is like reordering the 65535 possible values that random generators will produce. There are 1024 different ordenations, this function picks one, and then pseudo-random numbers are retrieved in order when calling cpct_getRandom_glfsr16_u8 or cpct_getRandom_glfsr16_u8.
A
9 bytes
Case | microSecs (us) | CPU Cycles ----------------------------------------- Any | 13 | 52 -----------------------------------------