mirror of
https://github.com/LIV2/libnix.git
synced 2025-12-06 00:23:08 +00:00
27 lines
270 B
C
27 lines
270 B
C
#if 1
|
|
|
|
#include <exec/types.h>
|
|
|
|
ULONG FastRand(ULONG seed)
|
|
{ ULONG a=seed<<1;
|
|
if((LONG)seed<=0)
|
|
a^=0x1d872b41;
|
|
return a;
|
|
}
|
|
|
|
#else
|
|
|
|
asm("
|
|
.text
|
|
|
|
.globl _FastRand
|
|
|
|
_FastRand: movel sp@(4:W),d0
|
|
addl d0,d0
|
|
bhis L1
|
|
eoril #0x1D872B41,d0
|
|
L1: rts
|
|
");
|
|
|
|
#endif
|