Advertisement
Guest User

Untitled

a guest
Jul 1st, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. void hvl_GenWhiteNoise( int8 *buf, uint32 len )
  2. {
  3.   uint32 ays;
  4.  
  5.   ays = 0x41595321;
  6.  
  7.   do {
  8.     uint16 ax, bx;
  9.     int8 s;
  10.  
  11.     s = ays;
  12.  
  13.     if( ays & 0x100 )
  14.     {
  15.       s = 0x7f;
  16.  
  17.       if( ays & 0x8000 )
  18.         s = 0x80;
  19.     }
  20.  
  21.     *buf++ = s;
  22.     len--;
  23.  
  24.     ays = (ays >> 5) | (ays << 27);
  25.     ays = (ays & 0xffffff00) | ((ays & 0xff) ^ 0x9a);
  26.     bx  = ays;
  27.     ays = (ays << 2) | (ays >> 30);
  28.     ax  = ays;
  29.     bx  += ax;
  30.     ax  ^= bx;
  31.     ays  = (ays & 0xffff0000) | ax;
  32.     ays  = (ays >> 3) | (ays << 29);
  33.   } while( len );
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement