RE: [stella] Stella 2.0 Alpha 2 available

Subject: RE: [stella] Stella 2.0 Alpha 2 available
From: "B. Watson" <atari@xxxxxxxxxxxxxx>
Date: Wed, 29 Jun 2005 09:11:36 -0400
On Wed, 29 Jun 2005, Thomas Jentzsch wrote:

> Fred wrote:
>> Clearing random bits by ANDing with random values, to be exact.

Fred, did you ever try exclusive OR instead of AND in your code?

> But when you repeat this code multiple times, wouldn't then all registers
> end cleared completely?
> BTW: When does the code get executed? During VSYNC?

It gets executed once per frame, after the last scanline where VSYNC
is active. At least it does in CVS Stella: I think Fred's version would
have to do the same thing, the way he's described it.

This means that the 6502 will run for a full frame, storing and modifying
RAM and the TIA as usual, in between runs of the randomizing code. This
should keep everything from being reset to zero and staying there...

The TIA registers aren't being randomized exactly the way RAM is: the TIA
locations access different regs depending on whether you're reading or
writing (e.g. $04 is NUSIZ0 when writing, or CXM0FB when reading). The
frying code reads from each location, ANDs the result with random bits,
then writes it back to the same location. When reading, the unconnected
bits (such bits 0-5 of CXM0FB) take whatever's on the data bus (usually
the location being read)... Hm, and reading from $1x, $2x, or $3x actually
means to read from $0x... much funkiness going on there, really.

I wonder whether the TIA scrambling actually affects the game state
much. Seems like the TIA state is ephemeral, whereas persistent changes
would involve RAM. Will try looping only over RAM and see what that does.

Archives (includes files) at
Unsub & more at

Current Thread