Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JPARandom.h
Go to the documentation of this file.
1#ifndef JPARANDOM_H
2#define JPARANDOM_H
3
4#include "dolphin/types.h"
5
10struct JPARandom {
11public:
12 JPARandom() { mSeed = 0; }
13 void set_seed(u32 seed) { mSeed = seed; }
14
15 u32 get_rndm_u() { return mSeed = mSeed * 0x19660du + 0x3c6ef35fu; }
16
18 union {
19 u32 u;
20 f32 f;
21 } a;
22 a.u = ((get_rndm_u() >> 9) | 0x3f800000);
23 return a.f - 1.0f;
24 }
25
27 f32 f = get_rndm_f();
28 return (f + f) - 1.0f;
29 }
30
32 return get_rndm_f() - 0.5f;
33 }
34
35 s16 get_rndm_ss() { return (s16)(get_rndm_u() >> 16); }
36
37public:
39};
40
41#endif
T cLib_calcTimer(T *value)
Definition c_lib.h:74
double u
Definition e_pow.c:163
a
Definition k_cos.c:89
Definition JPARandom.h:10
JPARandom()
Definition JPARandom.h:12
s16 get_rndm_ss()
Definition JPARandom.h:35
f32 get_rndm_f()
Definition JPARandom.h:17
f32 get_rndm_zh()
Definition JPARandom.h:31
f32 get_rndm_zp()
Definition JPARandom.h:26
u32 get_rndm_u()
Definition JPARandom.h:15
void set_seed(u32 seed)
Definition JPARandom.h:13
u32 mSeed
Definition JPARandom.h:38
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5