Use macro for randomization with ISO value

This commit is contained in:
GriffinR
2020-02-14 16:12:35 -05:00
committed by huderlem
parent 6eb44dc507
commit faf0ba8662
9 changed files with 13 additions and 18 deletions

View File

@@ -10,6 +10,9 @@ 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)