Re: [stella] 1 cycle!

Subject: Re: [stella] 1 cycle!
From: Manuel Polik <cybergoth@xxxxxxxx>
Date: Tue, 18 Mar 2003 01:17:55 +0100
Hi there!

Another little optimization saving a few bytes:

You can merge the two ENABL writes into one:

>; --- Draw Ball ---
> DEC ScanCount ; 5
> LDA ScanCount ; 3
> SEC  ; 2
> SBC BallY ; 3
> ADC #BALL_HEIGHT; 2
> BCS DrawBall2 ; 2/3
> LDA #0  ; 2
> SLEEP 19
> JMP SkipDrawBall2 ; 3 47
>DrawBall2
> LDY BallTabPtr ; 3
> LDA BallSizeTab,Y ; 4
> STA CTRLPF ; 3
> LDA BallShiftTab,Y ; 4
> STA HMBL ; 3
> DEC BallTabPtr ; 5 ; 47
> LDA BallEnableTab,Y ; 4
>SkipDrawBall2
> STA ENABL ; 3

Oh, and another neato "should I draw or should I go" 
trick like this might work for you too:

> LDX #$1F
> TXS
> LDA BallY
> SEC
> SBC ScanCount    
> ADC #251        
> AND #$FC
> PHP

Works only for ballsize=4 and requires some stack 
overhead and hm... but you'd still need to verify your 
second ENABL condition... ah... ok, it'll probably not 
help you... 
;-)

Greetings,
	Manuel

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


Current Thread