Loading [MathJax]/extensions/tex2jax.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Toggle main menu visibility
Main Page
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
o
p
q
r
s
t
u
w
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
o
p
q
r
s
t
u
w
Variables
a
b
c
d
e
f
g
h
j
l
m
p
s
w
Typedefs
Enumerations
Enumerator
c
e
o
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
i
j
m
o
p
r
s
t
u
v
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
▼
Twilight Princess
►
About
►
Topics
►
Namespaces
►
Classes
▼
Files
▼
File List
►
docs
▼
include
►
c
►
d
►
dolphin
►
f_ap
►
f_op
►
f_pc
▼
JSystem
►
J2DGraph
►
J3DGraphAnimator
►
J3DGraphBase
►
J3DGraphLoader
►
J3DU
►
JAudio2
►
JFramework
►
JGadget
►
JHostIO
►
JKernel
▼
JMath
►
JMath.h
►
JMATrigonometric.h
random.h
►
JMessage
►
JParticle
►
JStage
►
JStudio
►
JSupport
►
JUtility
►
JGeometry.h
►
TPosition3.hh
►
m_Do
►
REL
►
SSystem
►
TRK_MINNOW_DOLPHIN
►
Z2AudioLib
dol2asm.h
►
DynamicLink.h
►
global.h
►
src
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Loading...
Searching...
No Matches
random.h
Go to the documentation of this file.
1
#ifndef RANDOM_H
2
#define RANDOM_H
3
4
#include "
dolphin/types.h
"
5
6
namespace
JMath
{
7
12
struct
TRandom_fast_
{
13
u32
value
;
14
15
TRandom_fast_
(
u32
value
);
16
u32
get
(
void
) {
17
value
= (
value
* 0x19660d) + 0x3c6ef35f;
18
return
value
;
19
}
16
u32
get
(
void
) {
…
}
20
21
u32
get_bit32
(
void
) {
return
this->
get
(); }
22
23
u8
get_uint8
(
u8
param_0) {
24
return
get_ufloat_1
() * param_0;
25
}
23
u8
get_uint8
(
u8
param_0) {
…
}
26
27
// due to the float constant, having this function inlined adds that float to data,
28
// making it not match
29
float
get_ufloat_1
(
void
) {
30
// !@bug UB: in C++ it's not legal to read from an union member other
31
// than the last one that was written to.
32
union
{
33
f32
f;
34
u32
s
;
35
} out;
36
out.s = (this->
get
() >> 9) | 0x3f800000;
37
return
out.f - 1;
38
}
29
float
get_ufloat_1
(
void
) {
…
}
39
40
void
setSeed
(
u32
seed) {
value
= seed; }
41
};
12
struct
TRandom_fast_
{
…
};
42
}
// namespace JMath
43
44
#endif
/* RANDOM_H */
s
s
Definition
e_acos.c:94
JMath
Definition
JMATrigonometric.cpp:79
JMath::TRandom_fast_
Definition
random.h:12
JMath::TRandom_fast_::get
u32 get(void)
Definition
random.h:16
JMath::TRandom_fast_::get_uint8
u8 get_uint8(u8 param_0)
Definition
random.h:23
JMath::TRandom_fast_::get_ufloat_1
float get_ufloat_1(void)
Definition
random.h:29
JMath::TRandom_fast_::TRandom_fast_
TRandom_fast_(u32 value)
Definition
random.cpp:9
JMath::TRandom_fast_::setSeed
void setSeed(u32 seed)
Definition
random.h:40
JMath::TRandom_fast_::get_bit32
u32 get_bit32(void)
Definition
random.h:21
JMath::TRandom_fast_::value
u32 value
Definition
random.h:13
types.h
u32
unsigned long u32
Definition
types.h:9
f32
float f32
Definition
types.h:22
u8
unsigned char u8
Definition
types.h:5
include
JSystem
JMath
random.h
Generated by
1.12.0