Users browsing this thread: 1 Guest(s)
Items not affected by Optimum function

#1
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
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
  Find
Quote  

#2
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
The wiki ROM map list them at $ED82E4 also. It's just a list of item IDs, there's no code there..
  Find
Quote  

#3
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
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.
  Find
Quote  

#4
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
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.
Quote  
[-] The following 1 user says Thank You to assassin for this post:
  • Warrax (10-13-2017)

#5
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
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.
  Find
Quote  

#6
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
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.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  
[-] The following 1 user says Thank You to GrayShadows for this post:
  • Warrax (10-13-2017)

#7
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
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.
  Find
Quote  

#8
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
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.
  Find
Quote  

#9
Posts: 208
Threads: 3
Thanks Received: 0
Thanks Given: 8
Joined: May 2013
Reputation: 0
Status
None
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!
  Find
Quote  

#10
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
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.
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite