Re: [stella] Very BASIC ASM Info needed...

Subject: Re: [stella] Very BASIC ASM Info needed...
From: Manuel Polik <manuel.polik@xxxxxxxxxxx>
Date: Wed, 07 Mar 2001 17:41:00 +0100
Thomas Jentzsch wrote:

> Well, the most compact way is (as always) to count down (8 bytes):
> 
>     dec FrameCounter
>     bpl .skipReset
>     lda #2
>     sta FrameCounter
> .skipReset

Hehe, you'd need another 2 Bytes to actually load the counter.
At the moment, I use the table Andrew suggested:

LDX bulletCounter
LDY bulletcountertab,X
STY bulletCounter

Now Y is already indexing with 0/1/2.
10 bytes too, but faster.

But very interesting to see so many variations on such a simple theme
:-)
 
> But I don't know an EOR trick for this too.

The mighty EOR then works only with powers of two, or was that even
numbers?
 
> > Just for the record, can someone come up with an elegant 'division by 3'
> > solution?

> I guess, what you need is a framecounter that allows you to do 
> something every 2nd, 3rd or maybe 6th frame. I had the same problem
> with Thrust too. My solution was to combine both counters into one byte.
> I used the upper two bits for counting to 3 and the lower 6
> bits for counting up to 64.

I have three fields of bullet data and have to continously replace
replace them every frame, so that the three sets of bullets are
displayed evenly. With a power of two, one would just 

INC FrameCounter
LDA FrameCounter
AND $XX
TAX

This would leave the frame counter intact for other use.

Greetings,
	Manuel

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

Current Thread