Re: [stella] Sprites - AAAAARGH!

Subject: Re: [stella] Sprites - AAAAARGH!
From: Thomas Jentzsch <tjentzsch@xxxxxx>
Date: Fri, 30 Jan 2004 21:33:53 +0100
KirkIsrael wrote:

> This code, I assume, WSYNCs, and then waits just long enough
> so that when the RESP0 is called the object is repositioned
> at just the right point?

Almost, see below.


> Does this code assume that when it's called as a subroutine
> Accumulator is set to the position, and X is 0 or 1 based on
> which player you're trying to move, or what?

Yup! And you can also position both missiles and the ball with that.


> In short, what 
> are the preconditions for this routine, and/or does it involve
> something w/ the stack?

a contains x-position (0..159)
x contains object index (0..4)

And there is an important *post*condition. After all objects have been
*coarse* positioned you have to do this once:

  sta WSYNC
  sta HMOVE


> (Actually, I tend to be more concerned about time than ROM space (or
> reusability) so I tend not to use subrotuines much at all...)

A few, not too nested subroutines aren't that bad.

And if you store all x-positions in consecutive RAM locations, you can
make this a loop (without any JSR) too.

Have fun!
Thomas                            
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |

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


Current Thread