]> git.sur5r.net Git - cc65/commitdiff
Merge pull request #323 from bbbradsmith/rand_fix
authorOliver Schmidt <ol.sc@web.de>
Thu, 14 Jul 2016 19:58:26 +0000 (21:58 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Jul 2016 19:58:26 +0000 (21:58 +0200)
Fix broken rand() implementation.

libsrc/common/rand.s

index 48a88b7c413254b4ebe3b2d675c9470ab91d4b35..8ad7bcdb48bd575539948fdc6852b3dfdd992f46 100644 (file)
@@ -44,7 +44,6 @@ _rand:  clc
         lda     rand+1
         adc     #$59
         sta     rand+1
-        pha
         lda     rand+2
         adc     #$41
         sta     rand+2
@@ -53,8 +52,7 @@ _rand:  clc
         lda     rand+3
         adc     #$31
         sta     rand+3
-        pla                     ; return bit 8-22 in (X,A)
-        rts
+        rts                     ; return bit (16-22,24-31) in (X,A)
 
 _srand: sta     rand+0          ; Store the seed
         stx     rand+1