libSPEC
Pokemon Save Editing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Pages
Typedefs | Functions
prng.h File Reference

Contains the Psudo-Random Number Generator used by the games. More...

#include <stdint.h>

Typedefs

typedef uint32_t prng_seed_t
 Defines a prng seed value.
 

Functions

void prng_prev_seed (prng_seed_t *)
 Decrements the seed to the next seed value. More...
 
void prng_next_seed (prng_seed_t *)
 Increments the seed to the next seed value. More...
 
uint16_t prng_prev (prng_seed_t *)
 Decrements the seed value, and gets the previous value from the PRNG. More...
 
uint16_t prng_next (prng_seed_t *)
 Increments the seed value, and gets the next value from the PRNG. More...
 
uint16_t prng_current (prng_seed_t *)
 Gets the value for the current seed of the PRNG. More...
 

Detailed Description

Contains the Psudo-Random Number Generator used by the games.

Function Documentation

void prng_prev_seed ( prng_seed_t seed)

Decrements the seed to the next seed value.

Parameters
seedThe PRNG seed value.
void prng_next_seed ( prng_seed_t seed)

Increments the seed to the next seed value.

Parameters
seedThe PRNG seed value.
uint16_t prng_prev ( prng_seed_t seed)

Decrements the seed value, and gets the previous value from the PRNG.

Parameters
seedThe PRNG seed value.
Returns
The generated psuedo-random number.
uint16_t prng_next ( prng_seed_t seed)

Increments the seed value, and gets the next value from the PRNG.

Parameters
seedThe PRNG seed value.
Returns
The generated psuedo-random number.
uint16_t prng_current ( prng_seed_t seed)

Gets the value for the current seed of the PRNG.

Parameters
seedThe PRNG seed value.
Returns
The psuedo-random number.