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:

LF4B8:
       LDA    $83
       ASL   
       ASL   
       ASL   
       EOR    $83 
       ASL   
       ROL    $83  

LFAC6: 
       LDA    $EA  
       ASL   
       ASL   
       ASL   
       EOR    $EA 
       ASL   
       ROL    $E9  
       ROL    $EA 
       RTS           

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
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |


_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName@xxxxxx, 8MB Speicher, Verschluesselung - http://freemail.web.de



-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread