pokediamond/arm9/lib/MSL_C/src/rand.c
2025-02-23 22:13:48 +00:00

14 lines
257 B
C

#include "code32.h"
#include "stdlib.h"
static unsigned long int random_next = 1;
int rand(void) {
random_next = random_next * 1103515245 + 12345;
return ((random_next >> 16) & 0x7fff);
}
void srand(unsigned int seed) {
random_next = seed;
}