Anybody know a way to get around this...?
I tried to make my own rand() function like this but had no luck because now it doesn't recognise the time() function,
Code: Select all
SceKernelUtilsMt19937Context ctx;
int RandomInit(void) {
sceKernelUtilsMt19937Init(&ctx, time(NULL));
return 0;
}
int get_random(int lo, int hi) {
u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
rand_val = lo + rand_val % (hi+1);
return (int)rand_val;
}
int rand(void) {
return get_random(0,RAND_MAX);
}
Thanks anyway...