EURO_RND.CPP 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include <stdlib.h>
  2. #include "eurodefs.h"
  3. #include "euro_fxd.h"
  4. #include "euro.equ"
  5. #include "euro_sym.h"
  6. #include "euro_def.h"
  7. #include "euro_var.h"
  8. //********************************************************************************************************************************
  9. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  10. //º º
  11. //º Random number method 1 -> originates from Mike Hart, slightly modified º
  12. //º º
  13. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  14. short GetRnd1()
  15. {
  16. long rnd = EUROseed1;
  17. if ( rnd == 0 )
  18. rnd = 0x024272;
  19. if ( rnd > 2147483648 )
  20. {
  21. rnd+= rnd;
  22. rnd^= 0x01d872b45;
  23. }
  24. else
  25. rnd+= rnd;
  26. EUROseed1 = rnd+7;
  27. return( (short)EUROseed1 );
  28. }
  29. //********************************************************************************************************************************
  30. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  31. //º º
  32. //º Watcom Random number º
  33. //º º
  34. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  35. unsigned short GetRnd2()
  36. {
  37. return((short)rand());
  38. }
  39. //********************************************************************************************************************************
  40. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  41. //º º
  42. //º Random number method 3 -> originates from Zool GameGear Z80 º
  43. //º º
  44. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  45. unsigned short GetRnd3()
  46. {
  47. short t2 = EUROseed3*32;
  48. short t3 = (EUROseed3*16)-EUROseed3;
  49. t3 = ((((( t3-t2 ) *8 )+EUROseed3)*4)+EUROseed3)+0x01d872b45;
  50. EUROseed3 = t3;
  51. return(t3);
  52. }
  53. //********************************************************************************************************************************