Re: Aw: Re: [stella] Incoming

Subject: Re: Aw: Re: [stella] Incoming
From: Ben Larson <wazzapfool@xxxxxxxxx>
Date: Tue, 29 Jan 2002 19:55:31 -0800 (PST)
--- Thomas Jentzsch <tjentzsch@xxxxxx> wrote:

> If you align (something like: align 256 + 120) the
> data P1/P2Offset are
> pointing to, then you can avoid the extra cycles for
> crossing a page.
> Then all code in your main kernel has a constant
> timing, which would
> allow you to remove WSYNC and get some more cycles.

If you look at the player drawing routine, you'll
notice that it's very simple and super-fast...a mere
12 cycles max per player:

   ; Load player 1 data
   LDA (P1Offset),Y		;[3]+5-6
   STA GRP0			;[8-9]+3

The problem, though, is that this approach requires me
to put 154 blank bytes before and after the player
graphic.  Because of this, it's inevitable that a page
is going to be crossed at some point, since the whole
'graphic' is going to use up 314 bytes.  Fortunately,
I only have one other graphic so far (the shot), and I
can share one of the blank spaces between the two of

As far as the approaches Billy and Manuel suggested,
I'm still thinking.  RAM is pretty tight also, though.
 One reason is the fact that I need 75 bytes just to
store the playfield.  Also, each variable that relates
to shot velocity or position is stored using 2 bytes,
to simulate floating point numbers (actually fixed
point) for the physics calculations.  Anyway here's a
rundown of total usage so far:

75 bytes for the terrain (the biggest chunk)
12 bytes to store memory index locations for the digit
graphic lookups in the 6-digit E-P-W readout
8 bytes for shot x/y position and velocity
4 bytes for player 1 / 2 x/y positions
4 bytes to store memory index locations for the player
graphic lookups 
4 bytes for player 1 / 2 elevation and power
4 bytes for the psuedo random number register
2 bytes for player 1 / 2 health
1 byte for wind
1 byte to deal with shot wrapping off the top of the
1 byte for game status
1 byte for score

So that leaves 12 bytes.  8 as it is right now,
because I need 4 for the stack on a certain 2-deep
subroutine call (although I could make it all linear).
 Anyway I'm going to think things over and would also
appreciate any more suggestions...


Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
Archives (includes files) at
Unsub & more at

Current Thread