Re: [stella] GunFight 2600: One Limit Reached!

Subject: Re: [stella] GunFight 2600: One Limit Reached!
From: Manuel Polik <manuel.polik@xxxxxxxxxxx>
Date: Fri, 16 Feb 2001 13:50:06 +0100
Thomas Jentzsch wrote:

> > 1 - assimilated all of Thomas' superior knowledge and put it
> >     straight into the kernel
> Well, you almost did, but i think it's my fault. I'll try to exlain my tip #3 by example.

I tried my best :-)
>     tya
> ;    CLC                        ; i think you already eliminated this
>     SBC verPos
>     ADC #$13
>     BCC SkipDraw
>     LDA (playerpointer),Y
>     STA  GRP0
>     ...
>     dey
>     BNE nextLine
> Notice that i didn't change Y, i'm directly using the line counting value. You "just" have to change the pointer variables and realign your data ;-)
> The example only saves 2 cylces (you're doing this twice), but it frees X for something else.

Ok I try again to fully understand you this time. 
During VBlank for example I'd say playerpointer = shapestartoffset -
verPos, right?
And since verPos might have values from $C0-$13 (or $60-$14 in a 2LK),
all my shape data has to start higher than $C0 ($60) in the data pages.

Did I get it this time? :-)

Brilliant - again! Having X back is very valuable, even more than the
cycles :-)

> For your missile problem, i'd suggest the following trick, which can be found in the Combat listing:

Guess _which_ source I started to read yesterday? :-)
>     ldx     #ENAM1
>     txs
>     ...
>     cpy     M0line
>     php
>     cpy     M1line
>     php
> You can use this for the ball too.

Unfortunately my missiles need to be higher than a line, but I can use
this definitely for the ball.

I found something very interesting regarding quick/clever missile
enabling/disabling in the archive:

I goes like this:

Do this before the display loop:
LDX #$1E        ;for ENAM1 - could also be used for ENABL or ENAM0

And in the loop:
LDA MissileY
SBC Scanline    ;A has (MissileY - Scanline).  If it is >=0 but <4,
                ;we want the carry clear.
ADC #252        ;If 0 <= A <= 3, the carry will now be clear.
LDA #00
ADC #00         ;If the carry was clear, A now = 0, so Z is set.
PHP             ;Plug it into ENABL.

I think it can be optimised here & there. Besides the carry especially
the last part. Wouldn't...
PHP the the trick way shorter & quicker than
LDA #00
ADC #00         ;If the carry was clear, A now = 0, so Z is set.
PHP             ;Plug it into ENABL.

But still... wouldn't it be best to make the missile yellow like the
background, where there is no gun? The only other object actually
crossing that *invisible* missile would be the ball. Can't the ball just
have a higher priority than the misslie?


Archives (includes files) at
Unsub & more at

Current Thread