diff options
author | camthesaxman <cameronghall@cox.net> | 2017-10-01 00:21:17 -0500 |
---|---|---|
committer | camthesaxman <cameronghall@cox.net> | 2017-10-01 00:21:17 -0500 |
commit | 1a8b3fa9af2c248bd40e72ae467b45ba888e31bf (patch) | |
tree | 66dec9ad8b1eac336690eda0c0438779012d28e2 /src/engine/rng.c | |
parent | 30bc88f6572c435ff49b62f16c3734c12f75f7f0 (diff) | |
parent | 83efcc9c3d1e81b78c2cd9ceab3ac6420a5f4070 (diff) |
move sound_check_menu.c to debug
Diffstat (limited to 'src/engine/rng.c')
-rw-r--r-- | src/engine/rng.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/engine/rng.c b/src/engine/rng.c new file mode 100644 index 000000000..7d4b5600e --- /dev/null +++ b/src/engine/rng.c @@ -0,0 +1,18 @@ +#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 = 1103515245 * gRngValue + 24691; + return gRngValue >> 16; +} + +void SeedRng(u16 seed) +{ + gRngValue = seed; +} |