summaryrefslogtreecommitdiff
path: root/include/random.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/random.h')
-rw-r--r--include/random.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/random.h b/include/random.h
index 139316f9d..bf4af42d0 100644
--- a/include/random.h
+++ b/include/random.h
@@ -13,6 +13,11 @@ u16 Random2(void);
//Returns a 32-bit pseudorandom number
#define Random32() (Random() | (Random() << 16))
+// The number 1103515245 comes from the example implementation of rand and srand
+// in the ISO C standard.
+#define ISO_RANDOMIZE1(val)(1103515245 * (val) + 24691)
+#define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345)
+
//Sets the initial seed value of the pseudorandom number generator
void SeedRng(u16 seed);
void SeedRng2(u16 seed);