Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
random.h
Go to the documentation of this file.
1#ifndef DW3_RANDOM_H
2#define DW3_RANDOM_H
3
4/* Random numbers (system/random.c) */
5
6#include "common.h"
7
8/* The entries of RANDOM_TABLE, each 0 to RANDOM_COUNT - 1 */
9#define RANDOM_COUNT 0x1000
10
11/* Random numbers, walked in order through RANDOM_TABLE */
12typedef struct Random {
13 /* 0x0 */ s32 index; /* the entry returned last */
14 /* 0x4 */ void (*seed)(s32 seed);
15 /* 0x8 */ s32 (*next)(void); /* 0 to RANDOM_COUNT - 1 */
16} Random;
17
18void seedRandom(s32 seed);
19s32 random(void);
20
21extern Random RANDOM;
23
24#endif /* DW3_RANDOM_H */
signed int s32
Definition common.h:11
unsigned short u16
Definition common.h:10
void seedRandom(s32 seed)
Starts random() at entry seed of RANDOM_TABLE.
Definition random.c:5
s32 random(void)
The next entry of RANDOM_TABLE, 0 to RANDOM_COUNT - 1.
Definition random.c:10
#define RANDOM_COUNT
The entries of RANDOM_TABLE, each 0 to RANDOM_COUNT - 1.
Definition random.h:9
Random RANDOM
Definition random.c:533
u16 RANDOM_TABLE[0x1000]
The 4096 numbers random() walks through, 0-0xFFF.
Definition random.c:18
Random numbers, walked in order through RANDOM_TABLE.
Definition random.h:12
void(* seed)(s32 seed)
Definition random.h:14
s32 index
the entry returned last
Definition random.h:13
s32(* next)(void)
0 to RANDOM_COUNT - 1
Definition random.h:15