Users browsing this thread: 3 Guest(s)
Condensing Spell List in Battle
10-05-2017, 03:51 AM
between the original code and the calculateMPDeduction function, it's a bit of an "LDA $3A7N" fest: five of those 3-byte bastards.
so i'm thinking after C2/4F22, we add an "XBA". and replace all "LDA $3A7N"s in your function with that same instruction.
we're mostly past the point where we need the 0 default MP Cost held in A.top. i believe the only case that still needs it is the Desperation Attack or an Interceptor counter being detected. and for that, we can achieve the 0 manually with a "TDC" or "LDA #$00".
aaanndd.. because there is only that one case of branching to "fka_4F53", we ought to be able to chuck that label (and its JMP), replacing it with a "return_zero:" label before the "fka_4F45" (which .calculateSummon no longer proceeds to).
if the fallback MP cost in A.top were something *variable*, this could get bigger and/or messier, but we know it's a zero. we also know that entering C2/4F53, A.bottom holds meaningless crap (as it varies by the path taken through C2/4F08) that we shouldn't need to preserve/duplicate.
so i'm thinking after C2/4F22, we add an "XBA". and replace all "LDA $3A7N"s in your function with that same instruction.
we're mostly past the point where we need the 0 default MP Cost held in A.top. i believe the only case that still needs it is the Desperation Attack or an Interceptor counter being detected. and for that, we can achieve the 0 manually with a "TDC" or "LDA #$00".
aaanndd.. because there is only that one case of branching to "fka_4F53", we ought to be able to chuck that label (and its JMP), replacing it with a "return_zero:" label before the "fka_4F45" (which .calculateSummon no longer proceeds to).
if the fallback MP cost in A.top were something *variable*, this could get bigger and/or messier, but we know it's a zero. we also know that entering C2/4F53, A.bottom holds meaningless crap (as it varies by the path taken through C2/4F08) that we shouldn't need to preserve/duplicate.
« Next Oldest | Next Newest »
Users browsing this thread: 3 Guest(s)