Users browsing this thread: 1 Guest(s)
Condensing Spell List in Battle
10-07-2017, 01:49 AM
(This post was last modified: 10-07-2017, 01:54 AM by GrayShadows.)
(10-07-2017, 01:08 AM)assassin Wrote: re code snippet: or add a few to several bytes (depending on whether we want the option of going >= 256d past 3084h; i.e. setting A to 16-bit) but gain some speed with a 4-entry pointer table.... Yeah, that would work, too. XD Which is exactly what the game already does for the start of the spell list.
Quote:that'd avoid doing the Actor ID check, but what's the best or quickest way to make sure the index _into_ the list is a proper value?After you subtract 8Bh from A to convert the attack ID into a Lore ID, do a quick CMP to see if it's >23h? That's the first thing that comes to mind.
Quote:re building the individual $3084 lists: huh, guess i did underestimate it some.I mean, complicated definitely doesn't mean impossible. Maybe something like...
Code:
LDY #$04 ; we don't need a 16-bit index, because Y will max out at D8
LDX #$35
.loop
LDA ($F2),Y ;
BMI .exit ; BMI works here to exit because if the list is already shuffled, hitting FFh means the rest of that list is null
PHX : TAX
PHY : TYA
LSR #2
TAY
STY ($F0),X ; assuming that we save the start of the character's individual $3084 list in scratch memory at, uh, some point.
PLY
INY #4
PLX : DEX
BPL .loop
.exit
I'm also wondering if it's worth shuffling Lores BEFORE they're copied over to the individual spell lists; for one, that means we can shuffle the magic lists in 8-bit rather than 16-bit X/Y, since our index would never go above D8h, AND we could create the Lore Position list at the end of $3084 at the same time, since it doesn't need to be done per character.
ETA: For that matter, Lores would be shuffled in 8-bit as well, since we could just do a quick 24-entry loop.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)