Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/random/random.cpp
2 views
1
Random random;
2
3
void Random::seed(unsigned seed_iter) {
4
iter = seed_iter;
5
}
6
7
unsigned Random::operator()(unsigned result) {
8
if(config.random == false) return result;
9
return iter = (iter >> 1) ^ (((iter & 1) - 1) & 0xedb88320);
10
}
11
12
void Random::serialize(serializer &s) {
13
s.integer(iter);
14
}
15
16
Random::Random() {
17
iter = 0;
18
}
19
20