Re: [stella] Bit flip

Subject: Re: [stella] Bit flip
From: Glenn Saunders <cybpunks2@xxxxxxxxxxxxx>
Date: Mon, 10 Sep 2001 01:51:08 -0700
At 06:36 PM 9/10/2001 +1000, you wrote:
Table-lookup, 256 bytes. Index your original value to get the bit-flipped


It wouldn't need 256 bytes because if only 1 bit is set then there can only be 8 possible values:

00000001
00000010
00000100
00001000
00010000
00100000
01000000
10000000

Would need to index a table containing:

Lookup
%10000000
%01000000
%00100000
%00010000
%00001000
%00000100
%00000010
%00000001

But how do you use a number like that to create an index?

Would you left shift the accumulator and test for zero and increment the X register until it reaches zero, then LDA Lookup,X?

To be more specific, I'm starting to think (getting ahead of myself, before I even have a working kernel) of how to translate an X/Y coordinate of a collision into a playfield bitmap RAM write. Because the playfield registers are stored in alternating normal and reversed bit order I can't just write directly. I need to potentially reverse the bit order before I OR it with the proper RAM location.


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

Current Thread