Users browsing this thread: 4 Guest(s)
Newbie Still Doesn't Understand Code
09-21-2016, 11:04 AM
(This post was last modified: 09-21-2016, 11:05 AM by Turbotastic.)
I was looking at the C3 dissassembly and when looking at the code to draw spells for the magic menu, I noticed this.
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?
Code:
C3/4FE4: 20A250 JSR $50A2 (get spells learned amount)
C3/4FE7: C9FF CMP #$FF
C3/4FE9: D02F BNE $501A (branch if spell is already learned?)
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?
« Next Oldest | Next Newest »
Users browsing this thread: 4 Guest(s)