Baron Knoxburry
Level 30 Mixist
 
Atari TIA Chip
5th/5

 
heart magic 
300th Σ2.920

 
brain tech 
252nd Σ4.188

 
bleep squeeze 
291st Σ3.347

 
deep tweak 
285th Σ3.515

 
the winter of our pants 
292nd Σ3.090

 
dingledown [no rng mix]
 
  291st/317   Σ17.061   Feb 14th 2021 11:47am
 
 
uh... started writing my own play routine
because of what irrlicht said
lost a day to trying to implement an 8bit lfsr psuedo random number generator lol
so here's a loop i guess
57
4
31
3
27
 


previous entry
nitrofurano - 1


nextious entry
queddd - EXE4.xm
 
136471
Level 23 Chipist
irrlicht project
 
 
 
post #136471 :: 2021.02.14 1:40pm :: edit 2021.02.14 1:42pm
  
  Baron Knoxburry liēkd this
Not strictly speaking a lfsr, but here's some el cheapo prng for ya:

clc
state_lo:
lda #0
adc #$57
sta state_lo+1
state_hi:
lda #0
adc #$21
clc
rol
adc #1
sta state_hi+1


On VCS you'd have to use some zp location, ofc.
 
 
136594
Level 30 Mixist
Baron Knoxburry
 
 
 
post #136594 :: 2021.02.15 4:40pm
i'm confused:: why are you stashing the accumulator into the lda neumonic? (state_lo+1 and state_hi+1)
maybe i don't understand your compiler
 
 
136628
Level 23 Chipist
irrlicht project
 
 
 
post #136628 :: 2021.02.16 6:04am :: edit 2021.02.16 1:30pm
it's stashed into the immediate value that follows the lda. so after the first round, it'll be

state_lo:
lda #$57
...

You can use other values instead of $57/$21 btw, but not all values work equally well.

err, did that answer your question, actually?
 
 

LOGIN or REGISTER to add your own comments!