mirror of
https://github.com/cc65/cc65.git
synced 2024-08-28 18:29:20 +00:00
Merge pull request #323 from bbbradsmith/rand_fix
Fix broken rand() implementation.
This commit is contained in:
commit
fb53bfc25d
@ -44,7 +44,6 @@ _rand: clc
|
|||||||
lda rand+1
|
lda rand+1
|
||||||
adc #$59
|
adc #$59
|
||||||
sta rand+1
|
sta rand+1
|
||||||
pha
|
|
||||||
lda rand+2
|
lda rand+2
|
||||||
adc #$41
|
adc #$41
|
||||||
sta rand+2
|
sta rand+2
|
||||||
@ -53,8 +52,7 @@ _rand: clc
|
|||||||
lda rand+3
|
lda rand+3
|
||||||
adc #$31
|
adc #$31
|
||||||
sta rand+3
|
sta rand+3
|
||||||
pla ; return bit 8-22 in (X,A)
|
rts ; return bit (16-22,24-31) in (X,A)
|
||||||
rts
|
|
||||||
|
|
||||||
_srand: sta rand+0 ; Store the seed
|
_srand: sta rand+0 ; Store the seed
|
||||||
stx rand+1
|
stx rand+1
|
||||||
|
Loading…
Reference in New Issue
Block a user