summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-10-22 23:46:58 -0700
committerYamaArashi <shadow962@live.com>2016-10-22 23:46:58 -0700
commit6bde99d93b06dcd7b8480ec14f3103707d8835e2 (patch)
tree5423bd9c5bd79f5c5b6ec10485fbef098fffc9bb /src
parentff71f9b220f7aec6faf059a129649868e7a43d5e (diff)
add note about RNG multiplier value
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;
}