Re: [stella] behold, i am become shiva, destroyer of kernals!

Subject: Re: [stella] behold, i am become shiva, destroyer of kernals!
From: Christopher Tumber <christophertumber@xxxxxxxxxx>
Date: Sat, 13 Mar 2004 00:23:40 -0500
>You say
>"At any rate, replacing the two PHP instructions with PLA should solve all 
>these problems, permanently (knock wood)."
>
>but is it just PHP->PLA, or 
>do I modify the two PLPs as well?

Ugh, sorry about that. The problem is with PLP not PHP - you need those. 

PLP is pull flags from stack, PHP is push flags onto stack. The problem occurs because you pull an undefined value from the stack onto the flags which is having the unfortunate effect of turning on the BCD bit and screwing up your arithmatic operations.

Replace both instances of PLP with PLA. 

The only reason you're using PLP is to reset the stack back to ENAM0 (or ENAM1, whichever, I forget) after every scanlineline. PLA will do the same thing but the value from the stack goes into A instead of the flags and is just ignored.

Chris...

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


Current Thread