summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rng.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rng.c b/src/rng.c
index 89c6d2baf..7d4b5600e 100644
--- a/src/rng.c
+++ b/src/rng.c
@@ -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;
}