mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
byuu says: Basically just a project rename, with s/bsnes/higan and the new icon from lowkee added in. It won't compile on Windows because I forgot to update the resource.rc file, and a path transform command isn't working on Windows. It was really just meant as a starting point, so that v091 WIPs can flow starting from .00 with the new name (it overshadows bsnes v091, so publicly speaking this "shouldn't exist" and will probably be deleted from Google Code when v092 is ready.)
28 lines
504 B
C++
Executable file
28 lines
504 B
C++
Executable file
#ifndef NALL_RANDOM_HPP
|
|
#define NALL_RANDOM_HPP
|
|
|
|
namespace nall {
|
|
//pseudo-random number generator
|
|
inline unsigned prng() {
|
|
static unsigned n = 0;
|
|
return n = (n >> 1) ^ (((n & 1) - 1) & 0xedb88320);
|
|
}
|
|
|
|
struct random_lfsr {
|
|
inline void seed(unsigned seed__) {
|
|
seed_ = seed__;
|
|
}
|
|
|
|
inline unsigned operator()() {
|
|
return seed_ = (seed_ >> 1) ^ (((seed_ & 1) - 1) & 0xedb88320);
|
|
}
|
|
|
|
random_lfsr() : seed_(0) {
|
|
}
|
|
|
|
private:
|
|
unsigned seed_;
|
|
};
|
|
}
|
|
|
|
#endif
|