Re: [stella] 1 cycle!

Subject: Re: [stella] 1 cycle!
From: "Fabrizio Zavagli" <rasty@xxxxxxxxx>
Date: Tue, 18 Mar 2003 00:01:14 +0100
Thank you everyone for the amazingly prompt reply!
All great stuff which I'm going to make use of :)

I still have a question: you're 100% correct, branching to the slower piece
of code is not exactly the most effective solution! But.. if I swap the 2
pieces of code, I'll be forced to add a JMP at the end of the slower piece:

[snip]
 BCC SkipDrawBall2 ; 2/3
DrawBall2    ; Slower piece of code starts here
 LDY BallTabPtr ; 3
 LDA BallSizeTab,Y ; 4
 STA CTRLPF ; 3
 LDA BallEnableShiftTab,Y ; 4    Merged tables
 STA ENABL ; 3
 STA HMBL ; 3
 DEC BallTabPtr ; 5
 JMP Continue ; 3 <-------- Jump the following code
SkipDrawBall2    ; Faster piece of code starts here
 LDA #0  ; 2
 STA ENABL ; 3
 SLEEP 18
Continue
[snip]

...or maybe I'm missing something? (probably!)

Anyway, thanks to you all now it's solved so I'm attaching the latest
version with a stable playfield! (plus some garbage at the end which I'm
soon going to take care of :))
I'm off to another business trip tomorrow and it feels good to have the code
fixed before leaving! :)

Greets,
Fabrizio.-

----- Original Message -----
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
To: <stella@xxxxxxxxxxx>
Sent: Monday, March 17, 2003 22:49 PM
Subject: Re: [stella] 1 cycle!


> Fabrizio wrote:
> > So, any idea on saving up cycles in that function is welcome.. I'm
willing
> > to use Illegal/Undocumented opcodes too, if required!
>
> No illegal opcodes this time. :-)
>
> You should move the code after BCS DrawBall2 behind JMP X3. This will
> save you one cycle in the timing critical path.
>
> For saving more cycles you could merge BallEnableTab and BallShiftTab,
> because HMBL and ENABLE can share the bits.
>
> With some shifting you can feed CTRLPF too (but that will cost 2 extra
> cycles):
>
>   lda BallTab,y    ; hhhhsse0
>   sta HMBL
>   sta ENABL
>   asl
>   asl
>   ora #5           ; hhsse101
>   sta CTRLPF
>
> 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/
>
>

Attachment: balls_src.zip
Description: Zip compressed data

Attachment: balls.bin
Description: Binary data

Current Thread