Re: [stella] Horizontal Positioning once more...

Subject: Re: [stella] Horizontal Positioning once more...
From: Manuel Polik <cybergoth@xxxxxxxx>
Date: Wed, 08 Aug 2001 10:40:24 +0200
Thomas Jentzsch schrieb:

> > I try to eliminate the blank HMOVE lines via doing HMOVE on cycle 74.
> > There the HMXX values are shifted 8 pixel into the negative. To
> > compensate that, I just tried adding 8 at the beginning of my
> > positioning routine.
> > Now, when coming close to the end of the screen with any value >164 the
> > routine no longer functions properly.
 
> Try positioning at X modulo 160, I think that should solve the problem.
> Correct me, if I'm wrong :)

It worked!
*bounce*
Thanks!

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 :-))

Greetings,
	Manuel

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

Current Thread