Aw: RE: Aw: Re: [stella] Incoming

Subject: Aw: RE: Aw: Re: [stella] Incoming
From: cybergoth@xxxxxxxx
Date: Wed, 30 Jan 2002 09:52:54 +0100 (CET)
Hi Billy!

> missile_enables
> 	ds	66
> 	dc	$02
> 	ds	69

> I setup two variable miss0index and miss1index before the field is drawn
> and
> then, in my display loops I have this (in the second line):
> 
> 	ldy	miss0index
> 	lda	#missile_enables,y
> 	sta	ENAM0
> 
> 	ldy	miss1index
> 	lda	#missile_enables,y
> 	sta	ENAM1
> 
> 	inc	miss0index	;increment the indexes
> 	inc	miss1index

That seems to be a rather strange code to do missiles :-)

Normal code to handle more than one missile would be something like

Set up stack:
LDX #$1E ; (1F if you do the ball too)
TXS

Activate:
CPY/CPX missile1Y
PHP     ; (Pushes the zero flag into ENAMX!!)
CPY/CPX missile2Y
PHP

That's all it takes. 
Don't forget restoring the stack after the routine. Wether you 
use CPY or CPX depends on where you stored the line-counter.

Greetings,
     Manuel


-----------------------------------------------------------------------
PCs & Notebooks: Riesenauswahl an neuen und gebrauchten
Geräten aller Anbieter. eBay, der weltweite Online-Marktplatz!
http://www.arcor.de/home/redir.php/ebaypc
-----------------------------------------------------------------------

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


Current Thread