FF6 Hacking
Items not affected by Optimum function - 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: Items not affected by Optimum function (/thread-3546.html)

Pages: 1 2


Items not affected by Optimum function - Warrax - 10-12-2017

I've read on Mnrogar forum (a post by assassin) that there is 10 items that are not affected by the Optimum function, that their IDs are in a list at offset ED82E4.

Does anyone have more information about that? I would like to change some of the items to be affected by Optimum and the hexes at ED82E4 are not familiar to me (I don't see item IDs in here). I'm looking for Titanium Helm (Dec: 113, Hex: 83) and Imp's Armor (Dec: 155, Hex: 9B) for now but a complete list would be great for future reference.

Edit: I'm dumb, excluded items IDs are actually there. I can do what I've planned now.

Code:
At Offsets ED82E4 to ED82ED:

Item Name | ID in Hex

Cursed Shld = 66
Thornlet = 82
Imp Halberd = 24
TortoiseShld = 65
Titanium Helm = 83
Imp's Armor = 9B
Atma Weapon = 1C
Drainer = 12
Soul Sabre = 16
Heal Rod = 33



RE: Items not affected by Optimum function - madsiur - 10-12-2017

The wiki ROM map list them at $ED82E4 also. It's just a list of item IDs, there's no code there..


RE: Items not affected by Optimum function - Warrax - 10-12-2017

Oh ok, I'm still learning how the ROM is structured so this can be confusing to learn. I searched both here and Mnrogar forums and I haven't found much data about this so I guess this is not yet known how to mess with that list. I just wish I could EA the items I don't want in that list.

All I can do for now is skip the routine completely so there is no excluded list to look for.

To those interested: EA everything from C3/982D to C3/9832 inclusively.


RE: Items not affected by Optimum function - assassin - 10-12-2017

it's known.   just re-type the list so all still-valid options are at the start, and shorten both loop bounds at C3/9834 and C3/9860.  there's really nothing left to decode; it's just a matter of doing the quick busywork.


RE: Items not affected by Optimum function - Warrax - 10-12-2017

I was looking at the wrong place, this is what happen when ROM has an header and you miscalculate the gap in Windhex. All the expected item IDs are found at ED82E4 as I initially expected.

Thanks for the tip about rebuilding and shortening the list, I might actually have to do that if typing EA on specific item IDs doesn't work. Edit: Changing the id to EA does work so far.


RE: Items not affected by Optimum function - GrayShadows - 10-13-2017

I mean, EA will work, but what you're doing is excluding Optimum from equipping X-Potions; EA is the X-Potion item ID. 

Look at this section of code:
Code:
C3/9829:    BD6918      LDA $1869,X    (Items currently in inventory)
C3/982C:    FA          PLX
C3/982D:    DFE482ED    CMP $ED82E4,X  (Items excluded from "Optimum" selection)
C3/9831:    F009        BEQ $983C      (if item matched, branch to do something...)

So what's happening is that we're loading data from RAM ($1869 is the start of the inventory list; loading $1869,X loads the data at $1869 plus whatever value is in X at the time, so if X = 1, it would load $186A, if X = FE it would load $1967, etc.). The thing with RAM is that it's variable -- each address in the range $1869 through $1968 could hold ANY item ID, depending on what order they're sorted in. 

Then the game compares the value it pulled from the inventory list with hard-coded data -- this isn't variable, this data is coded directly into the ROM at ED/82E4. The ten bytes in the list aren't opcodes, because they're not intended to be executed. You'll see data all over the ROM, for things like what Magitek skills are available for Terra vs. anyone else with Magitek, or which relics change commands and what commands they change to/from. 

So basically, yeah, replacing the item IDs in the list with EA will get the game to do what you want right now, with this bit of code, but you're not actually NOPing it -- you're just putting in an item ID that is (presumably?) already excluded because it's not equippable gear. It'll do the thing now, but you can't rely on that when working with other data later on. Depending on the kind of data you're overwriting, you could pretty heavily break the game.

As a side note, I hadn't really looked at it before, but WOW getting rid of Optimum is going to free up so much space for me in C3.


RE: Items not affected by Optimum function - Warrax - 10-13-2017

Yeah I would rather have clean code than having to bandaid so I'm gonna work on that list as suggested.
Thanks a lot for the explanation, I really appreciate the information.


RE: Items not affected by Optimum function - madsiur - 10-13-2017

IIRC, dummy entries are FF. This is data not ASM, so EA will make checks for item #$EA. #$FF is the "Nothing" item in this case I think. The end of the list already has null entries I think.


RE: Items not affected by Optimum function - Warrax - 10-13-2017

That's pretty much what I figured when messing with the list, seems like we can have up to 16 items in here but only 10 was added.

Suggestion by assassin and GrayShadows worked like a charm. Thanks guys!


RE: Items not affected by Optimum function - assassin - 10-13-2017

Madsiur: i wouldn't do that here.  putting FFh in that list while keeping the same loop bound will cause Empty to be ruled out during Optimize, for everything but hand slots with Gauntlet.  the way the game is written, it relies on fallback FFs in the generated Item list to use should Optimum run out of options.