Re: [stella] Sprites - AAAAARGH!

Subject: Re: [stella] Sprites - AAAAARGH!
From: KirkIsrael@xxxxxxxxxxxxx
Date: 30 Jan 2004 18:15:47 -0000
Here is the code from JoustPong. I'm not clever enough 
by half to come up with this on my own, I think I was 
led by the hand by Andrew Davies. It positions the ball.

About the "battlezone" code, before it starts, what value
needs to be set to the horizontal position of the object?


;--------------------------------------
;SET BALL HORIZONTAL POSITION
;--------------------------------------

        sta HMCLR                       ; clear any previous movement 

        sta WSYNC 

        lda ballXposition

;;;set rough adjustment to Y and fine adjustment to A
;;;math magic to divide ballXposition by 15 by dividing
;;;by 16 and then....magic!

        tay 
        lsr    ; divide by 2 
        lsr    ; again 
        lsr    ; again 
        lsr    ; again 
        sta tempVar 
        tya 
        and #15 
        clc 
        adc tempVar 
        ldy tempVar 
        cmp #15 
        bcc NoBallHangover
        sbc #15 
        iny 
NoBallHangover
;do fine adjusment
        eor #7 
        asl 
        asl 
        asl 
        asl 
        sta HMBL
        sta WSYNC 

	SLEEP 15

DelayRoughPos  
	dey 
        bpl DelayRoughPos
        sta RESBL

-- 
KirkIsrael@xxxxxxxxxxxxx    http://kisrael.com
"It's the cracked ones who let all the light into the world."
        --writer from my Tufts writing class


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


Current Thread