Re: [stella] Animating the Marbles

Subject: Re: [stella] Animating the Marbles
From: Paul Slocum <paul-stella@xxxxxxxxxxxxxx>
Date: Wed, 03 Jul 2002 19:30:10 -0500

Hm, I don't see the routine for drawing the score, but you might be able
to reuse the pointers used there. Are you reusing registers at
all (except for title screen)?

I reuse everything. The score and game logic routines use the pMarble pointers and pfBuffer for all their temp locations. The only variables dedicated to the score are the four p#Score BCD variables which can't be changed. I've already scrounged for memory several times, so I don't think there's much left. I've even taken many of the variables than only used 4 or 5 bits and used their high bits for flags.


>          tya               ;2
>          adc #13           ;2
>          adc pMarble       ;3
>          bcc noMarbleReset ;2/3

>          sta pMarble       ;3
>          jmp marbleReset   ;3

> noMarbleReset
>          lda (pMarble),y   ;5*
>          sta GRP0          ;3

> marbleReset

Hm, I do not understand how this should work. How do you initialize
pMarble?

Let's say I put the marble graphics 13 bytes from the top of the page and it's 10 bytes tall (so it's at 233) and I zero out everything before and after it. And I make Y start at zero and increase on each line of the kernal (to 156 or so). So if I want to display the marble on line 100, I set pMarble to 133 (and pMarble+1 to the page with the data). Then it should display the marble correctly, but when Y reaches around 120 or so where it's close to crossing the page boundary, my routine will catch it and set pMarble back to a low value (<13), keeping it from crossing the page boundary and causing the kernal to copy zeros into GRP0 for the rest of the frame. And by alternating, I mean maybe I could change the 13 to a 26 and make a switch to alternate doing this check for player 1 or player 2 each loop. I'm not sure exactly how that would be done, though.


Anyway, it seems like it would work okay, but it's still going to be tough to find that many cycles.

And I fixed my cycle comments so I'll stop posting stuff that's mislabeled!

-Paul

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


Current Thread