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

#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)



Messages In This Thread
RE: Items not affected by Optimum function - by GrayShadows - 10-13-2017, 12:52 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite