diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-05-29 20:02:58 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-05-29 20:02:58 +0200 |
commit | 197767d1c83f8d940698cd200785e91fbc2ccc98 (patch) | |
tree | c1ee0bb77ae0dbef844cf45eb9d2ffb00b08895f /src/main.cpp | |
parent | Particle, ParticleMgr done (diff) | |
download | re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.gz re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.bz2 re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.lz re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.xz re3-197767d1c83f8d940698cd200785e91fbc2ccc98.tar.zst re3-197767d1c83f8d940698cd200785e91fbc2ccc98.zip |
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4f125098..853308a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,17 +24,37 @@ void operator delete(void *ptr) noexcept { gtadelete(ptr); } unsigned __int64 myrand_seed = 1; + +int _cwrand() // original codewarrior rand +{ + return ((int (__cdecl *)())0x5A41D0)(); +} + int -myrand(void) +myps2rand(void) { + return _cwrand(); myrand_seed = 0x5851F42D4C957F2D * myrand_seed + 1; return ((myrand_seed >> 32) & 0x7FFFFFFF); } +int myrand(void) +{ +#if USE_PS2_RAND == TRUE + return myps2rand(); +#else + return _cwrand(); +#endif +} + void mysrand(unsigned int seed) { +#if USE_PS2_RAND == TRUE myrand_seed = seed; +#else + ; +#endif } // platform stuff |