Re: [stella] pseudoplayers

Subject: Re: [stella] pseudoplayers
From: Erik Mooney <emooney@xxxxxxxxxxxxxxxx>
Date: Mon, 12 Feb 2001 10:52:31 -0500
> The idea is to store the missile graphics as a series of width and offset
> numbers like so:
>
> RUNNING ANIM
> FRAME 1:
>
> shape           width   offset
> 0000111100      4       4
> 0000111100      4       4
> 0000011000      2       5
> 0011111111      8       2
> 0000111100      4       4
> 0000111100      4       4
> 1111111100      8       0
> 0000001100      2       6
> 0000001100      2       6
> 0000001111      4       6

You'll want to store the offsets as the change from the previous line,
rather than an absolute value.  That way, on each scanline, you can just
read the byte and dump it into HMM0 or HMM1.  (You'll also store the
offset in the upper 4 bits of the byte in this case.)  That does also keep
the ability to skew the object to be more than 8 pixels wide, like you
have there.

> These would only have to be stored in ROM, actually.  The RAM would only be
> a pointer to the appropriate frame of animation.  Unlike the players I'd
> have to manually store the mirror images to get these pseudoplayers able to
> move in both directions.

You wouldn't have to, if your code in the kernel can take the negative of
an upper nibble quickly enough.  I think doing XOR #$F0 / CLC / ADC #$10
will work, and you may be able to skip the CLC if some code immediately
previous (usually a compare) leaves the carry in a known state.


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

Current Thread