git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Extended MM_Dump to dump table addresses
[tpg/acess2.git]
/
Kernel
/
lib.c
diff --git
a/Kernel/lib.c
b/Kernel/lib.c
index
88dc90c
..
c106351
100644
(file)
--- a/
Kernel/lib.c
+++ b/
Kernel/lib.c
@@
-319,21
+319,12
@@
Sint64 timestamp(int sec, int mins, int hrs, int day, int month, int year)
*/
Uint rand()
{
*/
Uint rand()
{
- #if 0
- Uint ret = giRandomState;
- int roll = randomState & 31;
- randomState = (randomState << roll) | (randomState >> (32-roll));
- randomState ^= 0x9A3C5E78;
- return ret;
- #else
Uint old = giRandomState;
Uint old = giRandomState;
+ // Get the next state value
giRandomState = (RANDOM_A*giRandomState + RANDOM_C) & 0xFFFFFFFF;
giRandomState = (RANDOM_A*giRandomState + RANDOM_C) & 0xFFFFFFFF;
- if(giRandomState == old) {
- giRandomState += RANDOM_SPRUCE;
- }
- Log("giRandomState = 0x%x", giRandomState);
+ // Check if it has changed, and if it hasn't, change it
+ if(giRandomState == old) giRandomState += RANDOM_SPRUCE;
return giRandomState;
return giRandomState;
- #endif
}
EXPORT(timestamp);
}
EXPORT(timestamp);
UCC
git Repository :: git.ucc.asn.au