Re: [stella] Confused newbie...

Subject: Re: [stella] Confused newbie...
From: Christopher Tumber <christophertumber@xxxxxxxxxx>
Date: Fri, 08 Oct 2004 02:22:40 -0400

This may be dead obvious at this point, but, I don't think it's been completely spelled out - Sprite positioning code (ie Thomas' example) is used to position the sprite horizontally. Skipdraw is used to decide which scanlines to draw the sprite on. The two don't really have anything to do with each other except that they both work with sprites.

On a more modern system, you'd just plug some values into some registers and the graphics chip(s) would do all the dirty work for you. The 2600 has no such luxury, so you have to "manually" position the sprite horizontally and you then also have to determine on a scanline by scanline basis whether or not to draw the sprite (and if so, which part of the bitmap to draw on that scanline). The TIA will rememeber the horizontal position so you only have to do that once don't have to set it every scanline (unless you want to, to reposition the sprite for re-use as another object) but you do have to explicitly tell the 2600 which scanline to draw the sprite on. And you do this just before each scanline is about to be drawn (generally, in the proceeding HBLANK).

In effect, what Skipdraw does is:

If (Scanline<=TopOfSprite)and(Scanline>=BottomOfSprite) then DrawSprite

And you make this test for every scanline that's within the sprite's range of vertical motion. Skipdraw is just a really efficient way to do this - Since this test is being done on every scanline, in real-time, as the scanline is being (or about to be, in HBLANK) drawn doing this test as quickly and efficiently as possible is a really good thing since it means you can do more other things on each scanline (ie: change other registers, like the PF registers).

More accurately (I simplified the above a little), what skipdraw does is:

If (Scanline>=TopOfSprite)and(Scanline<=BottomOfSprite) then DrawSpriteRow(Scanline-TopOfSprite)


Current Thread