diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rng.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,11 +1,14 @@ #include "global.h" #include "rng.h" +// The number 1103515245 comes from the example implementation of rand and srand +// in the ISO C standard. + u32 gRngValue; u16 Random(void) { - gRngValue = 0x41c64e6d * gRngValue + 0x00006073; + gRngValue = 1103515245 * gRngValue + 24691; return gRngValue >> 16; } |