Subject: RE: [stella] incoming source From: "Dennis Debro" <dennis@xxxxxxxxxxxxxxx> Date: Sun, 12 Dec 2004 19:46:03 -0500 |
Hi David, > ; The hardware does this: next_bit5 = not(bit0 XOR bit1) > ; lfsr cannot be initialized to 63 > > lsr lfsr ; always shift lfsr and put bit0 into carry > lda lfsr ; get bit1 (now in bit0 position) > adc #$00 ; add bit0 (in carry) with bit one (effectively bit0 XOR bit1) > lsr ; (bit0 XOR bit1) now in carry > bcs .skipOr ; > lda lfsr ; > ora #$20 ; set bit 5 if result was zero > sta lfsr ; > .skipOr This looks similar to the PRNG Larry Kaplan uses... NextRandom lsr randomSeed rol eor randomSeed lsr lda randomSeed bcs .leaveNextRandom ora #$40 sta randomSeed .leaveNextRandom rts Take care, Dennis
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] incoming source, David Galloway | Thread | Re: [stella] incoming source, Thomas Jentzsch |
Re: [stella] incoming source, David Galloway | Date | RE: [stella] incoming source, Dennis Debro |
Month |