| 
 
Subject: Re: [stella] Optimizing Qb (was: Horizontal Positioning once more...) From: "Thomas Jentzsch" <tjentzsch@xxxxxx> Date: Wed, 8 Aug 2001 12:42:46 +0200  | 
Manuel Polik wrote:
> BTW: In QB, there's this sethorpos routine, written by Andrew and
> improved with suggestions from you. I've just found yet another
> improvement!
> Looky here!
> 
> This is the end of the routine in QB:
> 
> ----------------------------------------
>         sta HMP0,x
>         sta WSYNC
>         jsr Ret				; Waste 12 cycles, 3 Byte
>         bit 0                           ; Waste 3 cycles, 2 Byte
> 					; + sum: 15 cycles, 5 Byte
> Jiggle  dey
>         bpl Jiggle
>         sta RESP0,x
> ----------------------------------------
> 
> Here's my idea:
> ----------------------------------------
>             STA HMP0,x
>             INY				; Waste 5 cycles, 1 Byte
>             STA WSYNC
>             INY				; Waste 7(!) cycles, 1 Byte
>             BIT 0			; Waste 3 cycles, 2 Byte
> 					; + sum: 15 cycles, _4_ Byte!!!
> PosDelay    dey
>             bpl PosDelay
>             STA RESP0,x
> ----------------------------------------
> 
> Apart from saving a byte, it prevents you from possibly losing another
> two byte to the stack...
> (Avoiding that was my original intention, in Gunfight there's _never_ a
> subroutine call within a subroutine call within a subroutine :-))
Yes, that should work, but sometimes you might waste a hole scanline when your first additional dey causes WSYNC to start to late.
You might have a look at this:
----------------------------------------
        sta HMP0,x
        sta WSYNC
        iny             ; waste 7 cylces, 1 byte
        iny             ; waste 7 cylces, 1 byte
                    
Jiggle  dey
        bpl Jiggle
        sta.w RESP0,x   ; waste 1 cylce, 1 byte
                        ; sum = 15 cylces, 3 bytes                                
----------------------------------------
One more byte saved and the WSYNC problem is gone too :)
Have fun!
Thomas
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |
_______________________________________________________________________
1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de
IhrName@xxxxxx, 8MB Speicher, Verschluesselung - http://freemail.web.de
-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/
| Current Thread | 
|---|
  | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [stella] Horizontal Positioning, Manuel Polik | Thread | Re: [stella] Optimizing Qb (was: Ho, Manuel Polik | 
| Re: [stella] Horizontal Positioning, Manuel Polik | Date | Re: [stella] Optimizing Qb (was: Ho, Manuel Polik | 
| Month |