Newbie Still Doesn't Understand Code - Printable Version +- FF6 Hacking (https://www.ff6hacking.com/forums) +-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html) +--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html) +--- Thread: Newbie Still Doesn't Understand Code (/thread-3335.html) |
Newbie Still Doesn't Understand Code - Turbotastic - 09-21-2016 I was looking at the C3 dissassembly and when looking at the code to draw spells for the magic menu, I noticed this. Code: C3/4FE4: 20A250 JSR $50A2 (get spells learned amount) I'm relying on the comments because I don't understand everything...but is the commentary wrong in this case? The part where it's branching (501A) to is the "blanking out" part. However, there's already a check for not knowing a spell at all prior to this, and this check is for if something is NOT equal to something (what BNE is, essentially). Is 4FE9 just redudnant code or am I terribly misunderstanding what that is checking for? RE: Newbie Still Doesn't Understand Code - dn - 09-21-2016 That code is part of the code that shows spell+MP cost (enabled by pressing Y), which blanks out partially learned spells as well as unlearned ones. It likely is redundant but wouldn't save much space, as the blanking code is needed regardless. If you'll notice above it, there's a check for whether MP display is enabled or not, and it branches elsewhere if it isn't. That code actually displays learn %. Code: Draw text in spell slot of Magic menu RE: Newbie Still Doesn't Understand Code - B-Run - 09-21-2016 You also might want to check out this. If you are working on understanding the code, this is a much more exhaustive commentary on C3. RE: Newbie Still Doesn't Understand Code - Turbotastic - 09-21-2016 Thank you both for the help, resources, and handholding. One of these days I'll either get it or give up. RE: Newbie Still Doesn't Understand Code - B-Run - 09-21-2016 I was in the same boat at one point. Really, the best way to get over the hump is to pick something small you'd like to do and start working on it. Ask for help when you're stuck and let experience show you how the logic works. RE: Newbie Still Doesn't Understand Code - Gi Nattak - 09-21-2016 I've been lost at sea on that boat for years now. RE: Newbie Still Doesn't Understand Code - Lockirby2 - 09-21-2016 (09-21-2016, 09:44 PM)Gi Nattak Wrote: I've been lost at sea on that boat for years now. Oh, so that sea is made out of alcohol then? RE: Newbie Still Doesn't Understand Code - Gi Nattak - 09-21-2016 Bwahaha! RE: Newbie Still Doesn't Understand Code - Turbotastic - 10-06-2016 I'm a slow learner. I'm only now starting to figure out one reason why I was misunderstanding this and other sections of code. I was assuming "FF" meant "255" After consulting more documentation, I learned it probably means "-1" instead. Now it's starting to come together a little. RE: Newbie Still Doesn't Understand Code - Tenkarider - 10-06-2016 decimals: 0-255 hex: 00-FF there's the zero, so FF is 256 - 1 = 255 |