Enter the glyph menu, then pause game play without leaving the glyph menu. Hold L1 or R1 and press Down, Circle, Up, Left, Up, Left. If you pause the game and enter the code, it refills health; if you enter the glyph menu and enter the code, it refills magic; if you enter the glyph menu, pause, then enter the code it it refills both magic and health.