Closing in on Magic menu working again. Had to get distracted by
completely re-organizing how complex strings are drawn. Because dealing with that branching mess was driving me crazy.
So some dumb, some maybe-smart, and some huh:
To try and save space while drawing MP, I thought, rather than try to calculate it, why not use the bits of code that already do that. Which ended up with this:
@DrawPlayerMP:
LDA #BANK_MENUS
JSR SwapPRG_L
JSR DrawBattle_IncSrcPtr ; inc the pointer to get the spell level
LDA (btldraw_src), Y ; load it
PHA ; back it up
CLC
ADC #$2C ; add the current MP stat byte to it
JSR PrintCharStat
LDA format_buf-1
JSR DrawBattleString_DrawChar ; draws current MP
LDA #$7A
JSR DrawBattleString_DrawChar ; draws /
PLA ; spell level byte
CLC
ADC #$34 ; add maximum MP stat byte to it
JSR PrintCharStat
LDA format_buf-1
JMP DrawBattleString_DrawChar ; draws max MP
And this was great, by doing a stat code ($15) followed by $00-$07, you could print CurrentMP/MaxMP, in any battle message box! So long as char_index is set beforehand anyway.
Then, disaster! Control code $15 was only good for battle message boxes... but to scroll text inside a box, the same string is drawn by DrawComplexString, with line breaks and terminators set based on how far into the list the cursor is. So I had to program that same thing into DrawComplexString. So that's dumb.
And then, when trying to test this, even though the last 3 tiles are the only ones that need a complex routine to decode instead of just bally well printing it to the screen, the one row was TOO LONG to print inside VBlank.

The very last tile wouldn't make it. And then I thought, so WHY is this routine ALWAYS setting the exact PPU address before drawing a tile? When doing "STA $2007" already increments the destination to the right by one? So a little jumbling of code later, and it no longer does that; now it only explicitly sets the destination after waiting for VBlank or doing a line break. Right!
But then even with that change, this last tile barely makes it in on time!
Huh.But, it does. So it works. Yay!
I think I might look into the magic string creation routine just calculating the MP manually though. The $15 control code will still work nicely for the Ether box at least.
(Also, with adding a similar routine to the one I posted here in DrawComplexString, after my re-organization of the whole damn thing, it ended up only adding on like 3 bytes or something... at least when I last checked, before it was fully functional. I just hope no other parts are broken from it.)
Edit: Can you test the cursor responsiveness in menus in the stable versions? I don't like how there's a weird input delay set up for these battle menus. Its like sometimes the cursor shoots over super fast and sometimes it takes a few taps to move at all. Is it just me bothered by it?
And for some reason I can't select spells in the third column, now... guess that's tomorrow me's problem. Also gotta make sure selected spells actually match...