Users browsing this thread: 1 Guest(s)
Items not affected by Optimum function
10-13-2017, 12:52 AM
(This post was last modified: 10-13-2017, 12:53 AM by GrayShadows.)
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:
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.
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.
« Next Oldest | Next Newest »
|
||||
Users browsing this thread: 1 Guest(s)