very strange.. i think because the game waits until after the Sneeze/Baba animation to remove the character from the battlefield, C2/1211 will continue to run and count down during the animation. but i can't see a problem with that unless the timer happens to run out then, which:
- i'm assuming didn't happen in your tests
- is likely harmless anyway
to be sure: did you start from a clean ROM?
I'm going to call it for tonight, but yes, definitely a clean ROM. Also, I MAY have spoke too soon on the garbage values, it does look like they are being continually reduced until 0 (at least with my own patch). I edited out all the calls (to update supply) one by one from my patch, starting with the C2/1211 one, but it seems the culprit is the one I make when bit 1 of 3AA0,index is clear, i.e. when Terra has been removed from battle.
To clarify (I also posted the code earlier), my fix calls a routine if the check for battle presence at C2/1143 indicates that Terra is no longer present. This routine clears $3EE2,
updates the supply, and skips calling C2/1211, which is perhaps why my patch affects running as well.
I haven't looked closely at Leet's code, but I think he has that presence check duplicated (or moved?) inside C2/1211 instead, but C2/1211 doesn't clear $3EE2, nor does being removed from battle (I think?), causing C2/1211 to keep running until Terra is actually removed. It seems that the culprit in his case is the call to update the supply inside C2/1211. I didn't look closely at his code, but I think he handles zeroing the timer differently in there. Perhaps the cause is that the low byte of the timer isn't cleared and so it empties over and over again, re-updating the supply each time?
Yep, I removed the pre-C2/1211 call (to update supply) from my patch, re-added it into C2/1211 and now Sneeze or running mid-Morph no longer affects the supply. The culprit is the call to update the timer if removed from battle.(edit: wait, what?) Remove it, and let the battle ending code handle updating the supply.
I mean, maybe getting sneezed should update the supply (once, before zeroing the timer), but it no longer "updates" it into oblivion.
NOTE: I'm drunk and have one foot out the door from this project, so any or all of the above may be partially or fully wrong. :P