Always memory. One thing that has always bugged me is that in FFVI they actually remembers your last action between battles, so when you get in a new battle it puts the cursor on that action. Very handy when leveling up, you can just hit the button twice, once to go to your magic, and once more to cast the spell you cast last battle. I don't know why they removed that after FFVI.