Re: [stella] AOTM AFOS problems

Subject: Re: [stella] AOTM AFOS problems
From: Manuel Rotschkar <cybergoth@xxxxxxxx>
Date: Thu, 01 Jul 2004 08:44:00 +0200
Hi there!

Shrek wrote:
I attach the code, and the place where all trouble began is commented "HERE BEGINS THE PROBLEM".

Erik wrote:
When in doubt, don't guess at the cycles. Count them. Here's your code with cycle counts added. You can see it's running a total of 92 cycles per loop iteration, which is of course over the limit of 76. You can also see that the version without the UFO ran right up to 71 cycles, so adding anything to that would make it spill over.

Also, when looking at the code, I think the main problem is, that its using sprite code to do missiles. Drawing a missile is a way simpler thing, there's various shortcuts to draw it, depending on it's height.


In Seawolf I draw them using the illegal opcaode DCP:

    LDA #3
    DCP torpedoyPos
    ADC #2
    STA ENABL

And in Star Fire I use the stack trick:

    LDX #$1F		; Set stack outside loop
    TXS
...
    LDY vline		; Draw both missiles and ball
    CPY yposBackup+2    ; inside loop
    PHP
    CPY yposBackup+1
    PHP
    CPY yposBackup
    PHP
...				
    LDX #$FF		; Restore stack outside loop
    TXS

There's more methods hidden in the archive, specialized to diverse situations or heights of missiles.

Greetings,
	Manuel

Current Thread