Re: [stella] "Zombie" optimizations

Subject: Re: [stella] "Zombie" optimizations
From: Thomas Jentzsch <tjentzsch@xxxxxx>
Date: Fri, 17 Jan 2003 21:18:46 +0100
Christopher Tumber wrote:
> This is the code I'm using in Space Instigators to draw the shots. I'm
> posting it because it's so different the DCP-Solution maybe it sparks
> some ideas...  

>       lda Scanline                 ;3 Cycles 2 Bytes
>       sbc DrawnShot_Pos_Y          ;3 Cycles 2 Bytes
>       lsr                          ;2 Cycles 1 Byte
>       tax                          ;2 Cycles 1 Byte
>       lda Player_Shot_Data_Table,x ;4 Cycles 3 Bytes
>       sta ENABL                    ;3 Cycles 2 Bytes

> ;17 Cycles - Could be 15 Cycles by removing the lsr and widening the
> table

Those table based approaches are normally a bit faster than branching.
But you have to "waste" a lot of ROM.

And then there are bit manipulation routines. How about that:

      lda Scanline                 ;3 Cycles 2 Bytes
      sbc DrawnShot_Pos_Y          ;3 Cycles 2 Bytes
      cmp #4                       ;2 Cycles 2 Bytes
      lda #3                       ;2 Cycles 2 Bytes
      adc #0                       ;2 Cycles 2 Bytes
      sta ENABL                    ;3 Cycles 2 Bytes

15 Cycles and no table. :-)

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/


Current Thread