Users browsing this thread: 1 Guest(s)
JSR Returning to wrong place in code

#7
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
The PLP is actually in reference to a PHP at the very start of the original codeblock (C2/5551), before the part I started changing, and the PLA is from a previously PHA under BuildCharLists.

Some of this is derived from vanilla code -- they used PHA/LDA $01,S to keep track of the spell ID while leaving it on the stack, and then using PLA instead for the last time it was being used. Initially, I had a PLA under IsSummon where it's now a LDA $01,S, right before that JSR $5723, but realised that it was being skipped if it was branching after NotSummon.

I'm clearly doing SOMETHING wrong with the stack, but all of my PH*/PL* are paired properly, as far as I can tell.

One thing I need to look at, actually, is LDA $01,S in the middle of NotSummon, although it's (probably) not causing the immediate problem -- would that be pulling the right value from the stack? It seems to be, from watching the accumulator while the stepping the code, but if the JSR pushes the address to the stack, would that interfere? XD Clearly I have much to learn about how the stack works.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  



Messages In This Thread
RE: JSR Returning to wrong place in code - by GrayShadows - 12-01-2016, 02:18 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite