Users browsing this thread: 2 Guest(s)
Condensing Spell List in Battle
10-31-2017, 01:15 PM
I'm not at my desktop with most of my notes, but I checked through my PM history where we were talking about it, and it looks like we did try with a bounds check.
Which, unless I'm mistaken, should either find the spell in the character's list, OR reach the end of the known list and hit $FF, and therefore exit. Thinking about it, you might even be able to get away without INCing and just do a BMI, since the top bit shouldn't be set for any actual spell value, yes? Only saves a byte, but every byte is precious. ;)
(And the bounds check will be going into a new public version of the code whenever I get around to releasing it... XD )
Code:
.findSpell
LDA ($F2),Y
CMP $F0
BEQ .getMPCost
INC
BEQ .returnZero
INY #4
BRA .findSpell
Which, unless I'm mistaken, should either find the spell in the character's list, OR reach the end of the known list and hit $FF, and therefore exit. Thinking about it, you might even be able to get away without INCing and just do a BMI, since the top bit shouldn't be set for any actual spell value, yes? Only saves a byte, but every byte is precious. ;)
(And the bounds check will be going into a new public version of the code whenever I get around to releasing it... XD )
« Next Oldest | Next Newest »
Users browsing this thread: 2 Guest(s)