Re: [stella] Sprite graphics

Subject: Re: [stella] Sprite graphics
From: "Andrew Davie" <atari2600@xxxxxxxxxxxxx>
Date: Wed, 13 Oct 2004 20:00:01 +1100
One must be careful that timing loops don't straddle page boundaries. I haven't checked this in your case, but remember that a branch will take an extra cycle if the destination address is on a different page. This can cause problems like what you are seeing.

----- Original Message ----- From: "Kevin Lipe" <kevin.lipe@xxxxxxxxx>
To: <stella@xxxxxxxxxxxxxxxxxx>
Sent: Wednesday, October 13, 2004 12:27 PM
Subject: Re: [stella] Sprite graphics

Well... now I've gotten myself into a new problem and I don't know how
to remedy it. I'm using the simple code from the 2600 Programming for
Newbies tutorial to move the Bad Llama sprite across the screen, and
this subroutine is giving me problems:

sta WSYNC ; (4)
; Pass X register holding desired X position of sprite!
lda Divide15,x ; xPosition / 15...
SimpleLoop dex
bne SimpleLoop

sta RESP1 ; start drawing the sprite

The problem is that once Bad Llama gets about halfway across the
screen, the SimpleLoop starts taking too long and the kernel makes an
extra scanline, which goes away once Bad Llama resets to being on the
left side of the screen. I've wracked my brain for a good hour and
can't come up with a quicker way to do this... how do the pros do it?

Thanks for letting me ask dumb beginner questions when I don't
understand things,

Archives (includes files) at
Unsub & more at
You are subscribed as: atari2600@xxxxxxxxxxxxx
To unsubscribe, send email to:
Or go to:

Current Thread