RE: [stella] disassembling River Raid

Subject: RE: [stella] disassembling River Raid
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
Date: Tue, 7 Aug 2001 11:19:33 +0200
Mark De Smet wrote:
> > > after disassembling Starmaster, I want to try River Raid now, because I
> > want to know exactly how the terrain generator works.

> As Carol Shaw explained in "Stella at 20 V2"(Thanks Glenn!), it is
> generated with a Pseudo random number generator(a LFSR).  IIRC in the
> video she debates the size of it, but thinks it is 15 bits, which would
> put it at 32767(*2 for the straight levels) different screens, without any
> tables necessary.
> Please let us know how it turns out!

I'm not finished yet, but it looks like she used two quite simple LFSRs, one with one byte and one very similar, but with two bytes. Here is the code:

       LDA    $83
       EOR    $83 
       ROL    $83  

       LDA    $EA  
       EOR    $EA 
       ROL    $E9  
       ROL    $EA 

More soon... (I'd guess $84 is used for random objects and sound, $E9/$EA for the terrain generation)

BTW: What are "straight levels" ?

> Thomas, if you are unfamiliar with LFSR's, mention it, and I'm sure
> someone on the list can explain.  I would probably help in figuring out
> the code.

Thanks, but I found a lot of info in the web. And LFSRs are not very complicated too :)

Have fun!
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |

1.000.000 DM gewinnen - kostenlos tippen -
IhrName@xxxxxx, 8MB Speicher, Verschluesselung -

Archives (includes files) at
Unsub & more at

Current Thread