GroovyBee 0 Report post Posted August 18, 2012 In the file rand.s the function _srand starts as :- _srand: move.l d2,-(sp) move.l #random_seeds,a0 move.l 4(sp),d1 move.l d1,d2 moveq #RANDGEN_K,d0 Which means that the new seed for the random number generator is actually the program counter of the instruction immediately after the "jsr _srand" in your program and not the new seed you passed to the function. It should be changed to :- _srand: move.l d2,-(sp) move.l #random_seeds,a0 move.l 4+4(sp),d1 move.l d1,d2 moveq #RANDGEN_K,d0 Quote Share this post Link to post Share on other sites
SebRmv 2 Report post Posted August 18, 2012 In the file rand.s the function _srand starts as :- _srand: move.l d2,-(sp) move.l #random_seeds,a0 move.l 4(sp),d1 move.l d1,d2 moveq #RANDGEN_K,d0 Which means that the new seed for the random number generator is actually the program counter of the instruction immediately after the "jsr _srand" in your program and not the new seed you passed to the function. It should be changed to :- _srand: move.l d2,-(sp) move.l #random_seeds,a0 move.l 4+4(sp),d1 move.l d1,d2 moveq #RANDGEN_K,d0 Well spotted! Thanks. Quote Share this post Link to post Share on other sites
GroovyBee 0 Report post Posted August 18, 2012 Well spotted! Thanks. No problem! I only found it because I was setting the seed and wondering why my latest project always looked the same :- http://www.atariage.com/forums/topic/20161...r-has-jag-powa/ Quote Share this post Link to post Share on other sites