Re: [stella] GunFight 2600: One Limit Reached!

Subject: Re: [stella] GunFight 2600: One Limit Reached!
From: Manuel Polik <manuel.polik@xxxxxxxxxxx>
Date: Thu, 15 Feb 2001 11:42:37 +0100
Andrew Davie wrote:
 
> Firstly, I find UPPERCASE quite difficult to read.  I'm a lower-case guy
> myself, so prefer mnemonics in lowercase, and CONSTANTS in uppercase.  It's
> pretty standard in the assembler world.  Yes, it's a matter of personal
> preference;  now you know mine!

I'm just used to Uppercase letters from my C64 days, but I'd have no
problem to change that. But then everybody on the list should follow the
same standards.
Are there any general 'coding conventions' in the list? Maybe we should
work out some?

What about:

Equations: ALLUPPERCASE
RAM: startLowThenHighlightEveryNewWord
ROM: alllowercase
Label: HighlightEveryWord

ROM Pointer: endwithptr
RAM Pointer: endWithPtr

ROM Table: endwithtab
RAM Table: endWithTab

Please discuss. I try to use them already in every code I write myself.
If we could come to some _commom_ guidelines, I'd have no problem
adopting these.
 
> 1) What is the value of X when nextLine is first reached?  It did not seem
> to be defined, as far as I could tell.

X counts down the scannlines I'm doing. At the moment with a 2LK it's
initialised with $60 <=> 192/2 lines. See SCREENSTART on the beginning
of the source.
 
>   CLC
>   SBC verPos             ;
>   STA WSYNC
>   STA WSYNC
>   ADC #$13
 
> Check your usage of the carry flag.  When subtracting, SEC - and it will
> leave the carry flag set if there's no overflow.  If there is overflow, it
> will be clear.  Likewise, for addition, CLC beforhand and it will be clear
> if no carry.  The above code does subtraction with carry clear (so subtracts
> one more), and then (probably) the carry is set after the subtraction (no
> overflow) and it immediately does an add (which will add one more because
> the carry is set).  This MIGHT be what you want, but just make sure you know
> what the carry is, and what you expect to happen isn't because you're
> fudging numbers until it 'looks right' :)

Hehe, you're right. At the moment it's just: If I don't do the two CLCs,
the sprites start to jump. Maybe it's worth to investigate WHY :-)
 
> 3) Skipdraw is 'wasting cycles'.  A while ago there was some discussion on
> the list as to the most efficient way to waste cycles (that is, least number
> of bytes used, etc).  Worth digging up.  In this case you're doing 10 cycles

2 more and I'd just JSR to a RTS :-) 
Hm... 10 cycles... PHA+PLA is 7 I think...
I see a whole new world of fine-tuning coming :-)
 
> 4)  Looks like you've tried very hard to get the two writes to GRPx in the
> same scanline (to get the players to line up).  Don't forget you can use
> VDELPx to shift one player down a line.  This works very well, and is
> extremely easy to use.  Then your loop doesn't need those two WSYNCs
> side-by-side.  You may already know this, but you asked for comments :)

I'll use the delay for the 2LK. Now it really is just forced to a 2LK
with the second WSYNC. That was the last instruction I added before
sending the demo :-)
 
> 5) The PosPlayer code was of interest to me.  That HorzTable routine must
> have taken ages to work out (!).  

Not really. There's a very simple system in it. Try to figure it out :-)
It was more or less just try & error to find the correct *range* for the
160 values. 
The trick is, that the few instructions before the STA RESP0,X just
*jump* you over the 68 CC blank spot. 

> Check out recent discussion on the list on
> how to do this with a routine instead of a table (MUCHO bytes savings...
> about 128 bytes, approx).  Check the routine PositionSprites in Qb, for
> example).

Check the number of WSYNCS in both routines. You see the difference? :-)
(I've mid-screen repositioning in mind, so saving a whole scanline might
make a BIG difference in finding the right spot for a repositioning -
well worth 128 bytes :-))

> I reckon what you have already looks pretty good... I'd like to see more
> work done on it.

I see a small time-slot on monday for more work on that. Today is my
'homepage day' for this week. Maybe I'm setting up a page for 'Gunfight
2600' as well today.

Greetings,
	thanks for all the valuable input so far,
		Manuel

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

Current Thread