mirror of https://github.com/bsnes-emu/bsnes.git
15 lines
293 B
C++
15 lines
293 B
C++
|
Random random;
|
||
|
|
||
|
auto Random::seed(uint seed) -> void {
|
||
|
iter = seed;
|
||
|
}
|
||
|
|
||
|
auto Random::operator()(uint result) -> uint {
|
||
|
if(!settings.random) return result;
|
||
|
return iter = (iter >> 1) ^ (((iter & 1) - 1) & 0xedb88320);
|
||
|
}
|
||
|
|
||
|
auto Random::serialize(serializer& s) -> void {
|
||
|
s.integer(iter);
|
||
|
}
|