From 6bde99d93b06dcd7b8480ec14f3103707d8835e2 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 22 Oct 2016 23:46:58 -0700 Subject: add note about RNG multiplier value --- src/rng.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3