a possible loophole is if the Morph timer gets reduced to something like FFFFh (and then 00FFh) when a Revert-prohibiting status is in effect, and you have a VERY small Morph decrementor (e.g. 16d). once the status is gone, Revert won't necessarily be queued right after, as the next few calls to C2/1211 won't zero Morph's timer. should the battle end quickly, you're now hoping that the end-of-battle code calls C2/0B36. i don't like relying on it for this, especially given there are multiple ways for a battle to end, and thus multiple holes to plug for patchmakers.
I'm not 100% sure I understand what you're trying to explain, so bear with me... when you say "something like FFFFh", you mean if the subtraction is performed when $3F32 > $3F30, correct? As in, the last tick of the timer?
So if I understand you correctly, this is caused by not zeroing $3F30 in C2/1211? The smallest natural decrementor is 8 (Max supply, after Phunbaba, with Slow), so if $3F30 was exactly FFh, there can be a delay of up to 32 frames to run down the timer again and re-queue Revert, during which the battle could end, thus preventing Revert for about half a second. Correct?
in order:
yes, yes.
yes.
close; i think 64 frames with Slow, because C2/111B exits every other frame.
With the Stop/Quick/Freeze check in effect, those statuses will prevent C2/1211 from running the few remaining ticks of the timer down and re-queueing Revert until they end, while Sleep will let it keep running down over and over again and try to re-queue Revert every 32 (at most) frames, until the battle ends. If I'm not mistaken.
i thought Freeze was in the same category as Sleep, not Stop/Quick. it's not a time-freeze; for instance, periodic damage/healing still work under it. just carving out an exception for Morph -- if that's what you're indeed driving at -- seems a bit inconsistent.
As you say, this could also happen if the battle ends while Terra is Sleeping, or if Stopped/Frozen (and her timer ran out during their animation), or if her timer ran out while someone cast Quick, and then finished the battle while Quicked.
In the case of Stop/Freeze/Quick being in effect through battle end, since we pause C2/1211 for those statuses, we're always relying on battle ending code to correctly update the supply. In any case, since we're stopping the timer for battle end, we should make sure all battle endings update the supply as well.
but as i also said, my loophole "example is more obnoxious" than some of those, "given the Morph timer initially expired _during_ battle".
however, no disagreement that fixing battle ending scenarios is important. it's just that when we lean on them for what's actually a mid-battle (albeit almost end-battle) change, we're putting more of our eggs in one basket.
a well-timed Haste or Slow casting might mitigate the problem of the "a possible loophole ..." scenario laid out in my May 5th post. the now-recalculated, post-timer-expiration Morph decrementor will be rather large, so that will minimize the wait for a follow-up Revert to be queued. (a wait that should really be infinitesimal or nonexistent, so this is an improvement, however weird).
---
oops, think i got that wrong, by assuming that a very low Morph supply would simply give a very large decrementor. but the supply in that example is 0, and there are problems calling C2/0B01 with that:
- you edited out the decrementor capping at 2048.
- even with capping, the earlier "JSR $4792" will perform a divide by 0, and return nonsense.
so it's better called "an ill-timed Haste or Slow casting". :/
thus, i recommend adding back the capping check, and adding a "BEQ $0B2C" before the "JSR $4792", so a minimum supply gives a maximum decrementor.
while it might be tempting to drop the "JSR $0B36" to avoid this particular issue, my May 05, 2016, 10:18:44 PM CDT (May 06, 2016, 03:18:44 AM GMT) post -- and numerous others -- explains why doing that is nonsense and risky.
Sorry to open the debate on this again, but this just has me MORE convinced that updating the supply the very instant the timer runs out is the risky option. I seems safer to update the supply only once we've cleared $3EE2, thus stopping the calls to C2/1211 AND C2/0B01.
correct me if i'm wrong.. this risk presents once you do the following:
1) stop clearing $3EE2, in an effort to fix the bug. noting that it's not the only way to fix it; relaxing C2/4BB2 could also work.
AND
2) give Function C2/0B01 a responsibility not held in the original game: handling Haste/Slow toggling. noting that it's not the only option; Haste/Slow could instead use a modified decrementor on-the-fly in C2/1211.
AND
3) despite C2/0B01 having MORE responsibility in the patch, making it LESS robust by dropping the 2048 decrementor cap. simply because you want to save space.
am i wrong on any of those three?
it seems to me that there's nothing inherently risky about C2/0B36 calls,
until you choose to modify the game in a very
specific way -- with one of those changes being driven not by any logical flaw in the vanilla code, but purely by space savings.
I just think it makes sense to only update supply after Morph definitely has ended, as marked by Revert executing, or the battle ending. In other words, dropping the "JSR $0B36" in C2/1211 in favour of a "STZ $3F30".
i still lean towards thinking you're nuts. :P
but a devil's advocate argument to fuck with myself:
if the Morph timer counts down from 65535 to 500, we don't update the Morph supply. yet when it goes from 500 to 0, updating Morph supply is now vital? while 0 is indeed a special case, is it special enough to say that a change of 500 outweighs a change of 65035?
i think an empty gauge would show up in end battle even if the latter is no longer called, but should really test it.
I'm not exactly sure if by "empty gauge" you mean "no decreasing green gauge" or a literally empty gauge (no increasing white ATB gauge either). If it's the former, clearing $3EE2 at battle end (thus stopping the calls to C2/1211) does indeed clear the green bar and restores the white ATB bar.
cool.. i wasn't sure exactly what i meant, just that the zeroing of the Morph gauge variable should show up in some way.