Re: [stella] Sprite Delema

Subject: Re: [stella] Sprite Delema
From: Eckhard Stolberg <Eckhard_Stolberg@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Mar 1998 20:35:55 +0100
At 00:36 18.03.98 -0500, you wrote:

>I want to have both Sprites moving right to left on the top of the screen,
>both sprites stationary in the middle of the screen, then both sprites
>moving left to right on the bottom of the screen.
>
>But I can't come up with an eligant way to do this. Can someone give me a
>simple talk through on where my thinking needs to be at, thanks.

You would need to sacrifice some scanlines in your display kernal
to reposition the player graphics.

There are generic sprite positioning routines at the end of the
SoundX source code on the Stella CD and in the example file on
the ST devolopers kit disks.

A good way to do the positioning would be to store the horizontal
position of your objects in the high and low nibble of a byte for
each. The high nibble would hold the value for the HMOVE and the
low nibble would hold the value for the @1:DEY/BPL @1 delay loop.

The positioning routine would look like this:
   STA WSYNC
   LDA ypos0
   STA HMP0
   AND #$0F
   TAY
@1:DEY
   BPL @1
   STA RESP0
   STA WSYNC
   STA HMOVE

If the second player has a fixed spacing to the first, you can
position it in the same scanline. Otherwise you would need to
add a second delay loop before the HMOVE.

Moving the players would be done by adding or subtracting #$10
from the ypos value and checking if the high nibble has rolled 
so that the low nibble has to be fixed accordingly.


Ciao, Eckhard Stolberg 


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
Don't post pirate BINs to Stellalist.  Be a programmer, not a pirate.
Write the best game, win framed autographs of famous Atari alumni!!

Current Thread