mirror of https://github.com/bsnes-emu/bsnes.git
19 lines
331 B
C++
Executable File
19 lines
331 B
C++
Executable File
Random random;
|
|
|
|
void Random::seed(unsigned seed_iter) {
|
|
iter = seed_iter;
|
|
}
|
|
|
|
unsigned Random::operator()(unsigned result) {
|
|
if(config.random == false) return result;
|
|
return iter = (iter >> 1) ^ (((iter & 1) - 1) & 0xedb88320);
|
|
}
|
|
|
|
void Random::serialize(serializer &s) {
|
|
s.integer(iter);
|
|
}
|
|
|
|
Random::Random() {
|
|
iter = 0;
|
|
}
|