Re: [stella] Death Derby, new build

Subject: Re: [stella] Death Derby, new build
From: Manuel Polik <cybergoth@xxxxxxxx>
Date: Sun, 07 Oct 2001 19:05:30 +0100
Hi Thomas!

> I agree, but here optimizations will make the explanations quite
> difficult.

IIRC You had to send everything in german, until I finally understood
everything - But now, knowing how it works, it reads quite clearly
explained... :-)
> The first step, you should try, is to use Y as THE universal rowcounter.
> Try not to use Y for anything else, and do all loading of the graphics
> (cars, later the pedestrians) with this rowcounter. That way you save a
> lot of cycles during the kernel and some RAM space. You have a two-line
> kernel, so let Y countdown every 2nd row.

Uhm... that's already the first point where the Gunfight kernel differs

(Thomas and I discussed that quite some time privately. The main reason
why I go different ways here is because I'd actually need two different
counters, since my sprites are done in 2LK way and the playfield is
drawn in a way a 4LK would do it, only without wasting the space for a
4LK. Another difference is that I can read the sprites with $$,X since
they're completely buffered in the RAM. I'm saving a lot of bytes here,
since I've stored the heads of the cowboys only once in the ROM, but
I've lots of different feets :-))
> And you have to arrange your data very carefully, if you want to avoid
> additional cycles for crossing a page. If your kernel is 180 lines tall,
> you countdown Y every 2nd line and the car can be displayed in every
> row, then your data must be inside 256*n+180/2 and 256*(n+1)-1.

> I hope, this makes sense to you. But my english is limited and here the
> kernel is starting to get complex. Maybe Manuel can explain this better.

I'll try doing it the simple way... :-)

The calculation of the object pointer (done outside the kernel, if
Thomas didnt make that clear enough) looks like this:

LDA #<CarRotation0
        SBC #50 	
        STA P0_CurrentFramePtr
        LDA #>CarRotation0
        SBC #0
        STA P0_CurrentF

Where #50 represents the scanline, where the oject starts. In the given
exmple #50 might be replaced by any value between #0 and #90, and we're
subtracting it! 

So it's as simple as: If we fall below zero here, we cross a page later,
so our data must start above #90 :-)

(Hm... uhm... Thomas: Why isn't the size of the displayed thing taken
into account here? Could it be... Oh my god... if one'd already let dasm
calculate it... that'd be LDA #<CarRotation0+size ... then... Oh-oh...
I've to quit now, there's probaly an optimisation run in gunfight

Archives (includes files) at
Unsub & more at

Current Thread