Users browsing this thread: 1 Guest(s)
Newbie Still Doesn't Understand Code
10-18-2016, 10:29 PM
the first pass is reading from a list of spells known by a character. it starts at 7E/1A6E for Character 0, and also exists outside of battle.
the second pass is reading from a character's in-battle menu. the addresses of the 4 party members' menus are read from C2/2616, and saved in $302C,index.
so the answer is that FFh means different things in the two structures. as a general rule, FFh will mean null in a menu. in the first structure (which has the learn %), it means the spell is already fully learned. the special value is used in place of 100 because it's quicker/smaller to check the Zero Flag than do "cmp #$64" everywhere. also, there's another special value of 80h, which is used by end battle code to represent "just learned".
after the first quoted code, the game does some more processing using a couple intermediate/temporary RAM structures, and eventually saves the spell ID and other information to the menu at C2/5651.
i will give C2/55A1 a comment matching C2/6055.
the second pass is reading from a character's in-battle menu. the addresses of the 4 party members' menus are read from C2/2616, and saved in $302C,index.
so the answer is that FFh means different things in the two structures. as a general rule, FFh will mean null in a menu. in the first structure (which has the learn %), it means the spell is already fully learned. the special value is used in place of 100 because it's quicker/smaller to check the Zero Flag than do "cmp #$64" everywhere. also, there's another special value of 80h, which is used by end battle code to represent "just learned".
after the first quoted code, the game does some more processing using a couple intermediate/temporary RAM structures, and eventually saves the spell ID and other information to the menu at C2/5651.
i will give C2/55A1 a comment matching C2/6055.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)