2#include <game/cLib/c_random.hpp>
16 register u32 c, b, a, x;
34 return ((u64)
mSeed * max) >> 32;
39 u32 tmp = 0x3f800000 | (
mSeed >> 9 & 0x7fffff);
40 return (*(
float *)&tmp)-1.0f;
45 u32 tmp = 0x3f800000 | (
mSeed >> 9 & 0x7fffff);
46 return (*(
float *)&tmp)-1.5f;
u32 l_RANDOM_MUL
Constant a from the ranqd1 algorithm.
u32 l_RANDOM_ADD
Constant c from the ranqd1 algorithm.
float getRandomFByAsm()
Generates a floating point number between 0 and 1.
float getRandomF2ByAsm()
Generates a floating point number between -0.5 and 0.5.
u32 mSeed
The current seed.
u32 getRandomByAsm(ulong max)
Generates an integer between 0 and the given max.
u32 ranqdStep()
Implementation of the ranqd1 algorithm.