Final Fantasy Hacktics

Modding => Hacking/Patching Tools => Topic started by: Glain on May 14, 2011, 03:57:55 am

Title: FFT Patcher (.497)
Post by: Glain on May 14, 2011, 03:57:55 am

Latest release (.497) here (https://github.com/Glain/FFTPatcher/releases/tag/v0.497). (Direct download (https://github.com/Glain/FFTPatcher/releases/download/v0.497/FFTPatcher_497.7z))




Original post from fdc:

I know everyone's been waiting forever for this, so here it is.

This is the original from Melonhead for .478, errors and all.

NEWEST VERSION HERE:
http://ffhacktics.com/smf/index.php?topic=7163.msg212754#msg212754

-Elric
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on May 14, 2011, 04:30:57 am
What are some errors in .478? I heard that the propositions don't work but is there anything else?
Title: Re: FFT Patcher .478 Source Code
Post by: despa on May 14, 2011, 05:35:57 am
thanks for posting this, fdc! :)
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on May 16, 2011, 02:33:44 pm
Thank you.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on May 16, 2011, 07:42:42 pm
Quote from: Pride on May 14, 2011, 04:30:57 am
What are some errors in .478? I heard that the propositions don't work but is there anything else?


Let's see:
1) orgASM is reputed to fail (as in create bugged files).
2) TacText is reputed to fail (as in create glitched text).
3) My compilation of FFTPatcher doesn't load at all.
4) ShiShi's EVTCHR editor is half-done.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on May 16, 2011, 07:44:20 pm
Did you do this manually, or with Subversion?  Can we download specific builds with Subversion?
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on May 16, 2011, 07:46:09 pm
Quote from: Pickle Girl Fanboy on May 16, 2011, 07:44:20 pm
Did you do this manually, or with Subversion?  Can we download specific builds with Subversion?


I have no clue what Subversion is.  All I did last April was take melonhead's .478 files from his online source folder, opened it up in my C# compiler, fixed enough runtime bugs so the thing would compile right (this took 2 nights of work), and then released it.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on May 16, 2011, 07:49:49 pm
I just figured out what subversion is a week ago.  It automatically downloads source files from a specified location, and it can do other things too.  Hopefully, it can download specific versions.  Look into it, I'll be gone for another week, car still isn't fixed.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on September 10, 2011, 09:51:47 am
So, I did a Subversion checkout of the FFTPatcher, etc code at the Google Code page for it. To clarify, Subversion is source control (like SourceSafe or TFS or what have you). It lets you check in files, check out files, all that sort of jazz, but we don't really need it for anything other than just doing an initial download of what's there.

I grabbed the top download here (requires registration, which is annoying): http://www.open.collab.net/downloads/subversion/
Then was able to open a command prompt and use the command shown on the "Checkout" part of the Google Code page, namely:
svn checkout http://lioneditor.googlecode.com/svn/trunk/ lioneditor-read-only (It'll create its own subdirectory for the code in the directory you ran the prompt in)

What's interesting about this is that there were only three compile-time errors, all relating to a certain parameter (Something to do with PSP info) not being passed in to various methods. I added those in and am getting running versions of everything (Patcher, ASM, TacText, SSE). Navigate to (Project)/(x86, if necessary)/bin/Debug to find the appropriate executables. Patcher's missing two tabs (Propositions and Animations); not sure why. SSE also appears to have been reworked to have its own change files (like .fftpatch?) that you just apply to ISOs?

I'll check it out, though the problem is that the current descriptions of problems (patching incorrectly, etc) are really vague and may be hard to track down.
Title: Re: FFT Patcher .478 Source Code
Post by: Cheetah on September 10, 2011, 12:03:31 pm
Continuing work on FFTPatcher would be incredible. Do you need a more organized effort of testing out this latest version and finding all the errors?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on September 10, 2011, 01:01:36 pm
Hm. I actually suspect I've downloaded an old version; Patcher is showing v0.388. That would explain the missing forms, etc. I guess I need to find a new version. Not sure why I would have gotten an old version that way.

The problem is... I don't know where fdc got his files, and his zip seems to be missing some key components, or else I'm doing something terribly wrong. The build process is trying to find files that don't exist; I can't even get to the point where I could even try to build the code with those files.

If we could find a version to get started on, having some testing would, of course, be nice. That sort of thing never hurts. I'm basically just trying to get my bearings on this at this point though.

I suppose I'm going to try pasting the missing stuff from fdc's zip from the downloaded code into fdc's files and see where that gets me. Those files didn't seem like the type to really change ever (or were just text files), so hopefully they'll be the same, regardless of the Patcher version.

EDIT: I did get it to compile! I had to mess with a batch file, which hopefully didn't mess anything up! Patcher loads up okay, but calls itself v0.457. The current patcher is v0.478. Augh, is this another old version?

EDIT 2: Okay, melonhead's newest changes are in branches/imageEditorv2/ and not trunk/ which, I believe, is why I got the old version. I'll have to see what I can do with this.

EDIT 3: This seems to compile fine. Patcher=v0.457
Title: Re: FFT Patcher .478 Source Code
Post by: Cheetah on September 11, 2011, 12:19:13 pm
Excellent to hear that you at least have the newest version now. I would definitely throw a lot of resources towards improving FFTPatcher. You can count me in as a tester.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on September 11, 2011, 12:44:42 pm
Quote from: Cheetah on September 11, 2011, 12:19:13 pm
Excellent to hear that you at least have the newest version now. I would definitely throw a lot of resources towards improving FFTPatcher. You can count me in as a tester.


Most of the missing resources exist in my spreadsheets already, honestly.  Propositions, Shop Edits, etc. etc. etc.  It'd really just be translating all those into FFTPatcher.  It'd be nice to have everything in one place, sure, but it'd also put me out of a yob.  You really wanna put me out of a yob?
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on September 14, 2011, 02:15:20 pm
Quote from: RavenOfRazgriz on September 11, 2011, 12:44:42 pm
Most of the missing resources exist in my spreadsheets already, honestly.  Propositions, Shop Edits, etc. etc. etc.  It'd really just be translating all those into FFTPatcher.  It'd be nice to have everything in one place, sure, but it'd also put me out of a yob.  You really wanna put me out of a yob?

MAKE WAY FOR PROGRESS.  And besides, won't this leave you more time to work on, say, your patches, your non-spreadsheet editing tools, and your reverse-engineering projects?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on September 15, 2011, 09:59:21 pm
Well... okay, I haven't done too much with this yet. I am starting to get a feel for the code here and there. I'm sorta interested in the current state of the stuff I have, though. (i.e. how it works, if things really fail). There's some weird discrepancies between what I've found and what FDC was saying, so I find that a bit odd. (I didn't have any compile-time errors to fix, FFTPatcher loads fine for me, etc). I don't have all the greatest test cases or what have you, so I figured I'd upload my compile in case anyone wants to test it and see what's working and what isn't.

Hopefully I've included everything needed. I took the Debug/ directories of each application's subdirectory; let me know if there are any more files needed to get these EXEs to run.

EDIT - The latest version is attached further down in the thread. Removing from this post.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on December 07, 2011, 12:05:06 pm
Looking at this, all the tools work as they should, though I haven't yet tested orgASM.  If this version of orgASM works without bugs, we should have exactly one version of FFTP on the main site available for download which will include:

1) R999's 478 ShiShi
2) This version of FFTP with a modified Resources.zip (Melonhead actually removed the titles on a lot of names of flags that we already know about)
3) This version of orgASM, if it works.  Otherwise, it should include 457/466 orgASM.
4) This version of TacText, if it works.  Otherwise, it should include 457/466 TacText.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on December 30, 2011, 02:02:39 am
If I'm not mistaken, if we just fix the offset Patcher writes store inventory changes to, it should then work.

FILE: StoreInventory.cs
CHANGE:
               return Codes.GenerateCodes( Context.US_PSX, PatcherLib.PSXResources.Binaries.StoreInventories, this.ToByteArray(), 0x18D840, Codes.CodeEnabledOnlyWhen.World );
TO:
               return Codes.GenerateCodes( Context.US_PSX, PatcherLib.PSXResources.Binaries.StoreInventories, this.ToByteArray(), 0xAD844, Codes.CodeEnabledOnlyWhen.World );

The error melonhead made is obvious; he forgot to get the ROM address from WORLD.BIN RAM.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on December 30, 2011, 02:54:28 am
fdc, I believe that method, GenerateCodes(), is actually for generating the Gameshark codes, so the RAM address, and not the WORLD.BIN file address, would be correct. Not sure why it's off by 4, though.

melonhead seems to refer to gameshark codes as "Codes" throughout the FFTPatcher source, and actually writing to the game files as "patches", so we'd need to look at the analogous method for "Patches", which seems to be GetPatches() (StoreInventory.cs:213), where we see:

result.Add(PatcherLib.Iso.PsxIso.StoreInventories.GetPatchedByteArray(bytes));
(StoreInventory.cs:223)

PsxIso.StoreInventory is of type KnownPosition, which is made up of sector, start location, and length (the constructor for this type of object takes arguments in that order), and defined like this:

StoreInventories = new KnownPosition( Sectors.WORLD_WORLD_BIN, 0xAD844, 0x200 );
(PsxIso.cs:100)

So it looks like it's already looking at 0xAD844 in WORLD.BIN for patching.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on December 30, 2011, 03:44:38 am
Are you sure this routine actually works though?  Because this feature has existed since v.457 and no one seems to be able to get it to work.  Furthermore, this is doing exactly what RAven's spreadsheet is.  And yet, that has no problems.  Thus, the problem must lie with FFTP.

1) Is there any checking mechanism between what is being patched and the GS Code?
2) Somewhere along the line, could he have mistakenly called "StoreInventories" as "StoreInventory"?  I see he has both defined in his code.

EDIT: Testing shows that it's not getting written to WORLD.BIN.
3) Is there something wrong with the write to ISO routine?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on December 30, 2011, 11:05:47 am
One of my first thoughts was that the Sectors.WORLD_WORLD_BIN constant could be set to the wrong number (It's set to 84261; I have no clue if that would be right or not, or exactly what it even means)... however, that same constant seems to be used for TacText and I'm pretty sure that patches WORLD.BIN properly.

So I'm not really sure what the problem is, but finding out that WORLD.BIN isnt getting patched should be really useful. I'll try running my copy of his code through my local debugger and see what I can come up with.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on December 30, 2011, 11:37:13 am
Glain, 84261 is the disk sector WORLD.BIN starts in.  That would mean WORLD.BIN starts at 0x0BD003F0 = 84261 * 2352 in the ISO, which checks out as correct.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on December 30, 2011, 12:27:37 pm
I think I fixed it.

There was a variable that determined whether or not any store inventory patches were made... but it didn't update properly, because the "Store Inventory" checkbox on the Patch PSX ISO form didn't have an event handler. I added it in and I'm getting results.

I'm attaching my new version of FFTPatcher. Let me know if it works (i.e. you can edit shop inventories with it).

EDIT - This is in the latest attachment. Removing from this post.
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on December 30, 2011, 12:37:19 pm
It works, I just tested it. Wonderful job!
Title: Re: FFT Patcher .478 Source Code
Post by: Dome on December 30, 2011, 12:39:38 pm
So...we can edit shops with the FFPatcher now?
P.s: For the love of god, please tell me you guys are not using a FFPatcher with WOTL names
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on December 30, 2011, 12:40:56 pm
No, it had Vanilla names. And yes, the shop function works in this- as does Propositions. I tested Props earlier with FDC.
Title: Re: FFT Patcher .478 Source Code
Post by: Dome on December 30, 2011, 12:41:59 pm
Epicly awesome
Even better would me combining every tool we have into one...but I think it's not possible >_>
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on December 30, 2011, 01:06:00 pm
Any other unworking features in .478 can we get to work?

May as well do 'em all now, and I'll cut everything that works out of my Workbooks.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on December 30, 2011, 10:46:52 pm
I intend to submit this to Site Submissions, but before we do, can we please update the checkboxes and formula descriptions?  478 is in many respects worse than 457.  In other words, integrate the findings of:
http://ffhacktics.com/smf/index.php?topic=4714.msg105412#msg105412
http://ffhacktics.com/smf/index.php?topic=6538.0 (Just the formula descriptions)
http://ffhacktics.com/smf/index.php?topic=3092.0
http://ffhacktics.com/smf/index.php?topic=4554.msg103524#msg103524
into the formal descriptions of checkboxes on FFT Patcher.

I'll also soon give an picture attachment showing what I mean.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on December 31, 2011, 03:43:35 am
All right, here's the picture.

Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on December 31, 2011, 04:28:59 pm
Requesting 2x zoom version for people with bad eyesight.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on December 31, 2011, 09:24:33 pm
All right, I made a few changes, namely:

* Updated flag titles so that they're like the post above, with my own changes in some places (in an effort to make things clearer). In some cases, if I had already renamed a flag and it was similar to what fdc showed in the image, I didn't change it.
* Redid ENTD descriptions. Many events were listed as the wrong ENTD, some were unlisted. Many names were too long and got cut off, so those were shortened.
* Updated formula descriptions to include evasion type.

I'm calling this "0.479" to differentiate from previous versions, even though it doesn't really correspond to an SVN check-in or anything like that. This is basically a candidate for what we could end up using for "0.479".

Anyhow, this should work the same as before. Hopefully this update makes things a bit clearer. I'm attaching it to the bottom of the post.

EDIT: Unattached rar file because it didn't include the needed DLLs; see my post below for the new version.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on December 31, 2011, 10:13:08 pm
I just downloaded this and it looks very nice already, it's very helpful to someone like me, where i have done alot with ENTD but nothing with abilities personally.
Also, I was wondering if you guys could add in the 2 missing flags under immortal in ENTD or the one under Has ??? Stats? I don't even know what these are personally, but I'm sure
they could be useful
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 01, 2012, 01:25:36 am
Oops, I forgot to include the DLLs that it needs to run, so you might still see the old labels if you just run the program. Try this file instead; I've included the right DLLs in it.

EDIT - These changes are in the latest attachment. Removing from this post.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 10, 2012, 01:34:44 pm
I've been using the .479 you posted to assemble Journey of the Five Chapter 1's battle system, Glain, and I noticed a few things -

1. You have two flags in the box with "Learn with JP (Player)" etc. labeled as "Requires Monster Skill" and "Uses Weapon Range."  Yet, these flags are never used in the entire game, not even on Monster Skill attacks or the Charge command, where they would be applicable.  How do you have any clue they do as you've written they do?

2. In the top box full of flags, you have the topright-most one labeled as "Longbow Attack", but again, it's never used once in the entire game.  How can we be sure it's for "Longbow Attacks", then, when Vanilla can't even natively make a Longbow-only Attack?

Or maybe I'm retarded and these flags are used somewhere I skimmed over, but I couldn't find any instances of any of them being used once.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on January 10, 2012, 03:59:06 pm
Quote from: RavenOfRazgriz on January 10, 2012, 01:34:44 pm
I've been using the .479 you posted to assemble Journey of the Five Chapter 1's battle system, Glain, and I noticed a few things -

1. You have two flags in the box with "Learn with JP (Player)" etc. labeled as "Requires Monster Skill" and "Uses Weapon Range."  Yet, these flags are never used in the entire game, not even on Monster Skill attacks or the Charge command, where they would be applicable.  How do you have any clue they do as you've written they do?

2. In the top box full of flags, you have the topright-most one labeled as "Longbow Attack", but again, it's never used once in the entire game.  How can we be sure it's for "Longbow Attacks", then, when Vanilla can't even natively make a Longbow-only Attack?

Or maybe I'm retarded and these flags are used somewhere I skimmed over, but I couldn't find any instances of any of them being used once.


These are from SA's notes when he debugged part of the AI code.  These flags are unflagged on the skill table (SCUS), but are hard-code set when the skill has the necessary property and translated into the skill RAM table (BATTLE.BIN), which then affect the AI.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 10, 2012, 04:26:35 pm
I see.  Okay then.  Good to know.  Then shouldn't they have like, DO NOT TOUCH labels or something on them, then?

Also, why the hell was Persevere renamed to "Channel"?  I had to open up .457 to see what the fuck that even was, and Persevere is still the better name since it's easier to understand what the skill actually does.  (Aka, I can read the word Persevere and know the effect persists.  I read Channel, and, um, think of a TV, honestly.)  I heartily request that one gets reverted.  The other renames are much better overall, but that one sucks.  Though, speaking of a rename, I'm surprised "Vertical Fixed" wasn't at least attempted at giving a more descriptive name, but I suppose the current one is decent enough once you see how its used.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on January 10, 2012, 04:31:38 pm
Well, I could see the use for the "longbow range" flag since someone may want the AI to use a skill only from 3-7 range away (though the AI may try to overreach and hit units beyond its range if it stands at a higher elevation).
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 10, 2012, 04:42:31 pm
That last bit was what I thought too, main reason I suggested them having DO NOT TOUCH labels.  If the AI never targets outside its legal range from a higher elevation, though, I could see use for that flag.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 10, 2012, 05:27:52 pm
Another thing I noticed: The "Normal Attack?" flag was renamed to "Counter", but Counter is tied to the Countergrasp flag (which was inaccurately renamed to only be "Blade Grasp").  For example, I can Counter the skill Steal Weapon, but it does not have the "Counter"/"Normal Attack?" flag checked, merely the "Blade Grasp" flag.  Last I recalled, "Normal Attack?" governed Hamedo, but Hamedo triggers on skills such as Weapon Break which do not have "Counter"/"Normal Attack?" flagged - and it should be obvious that I can Counter these skills as well.

So please, rename "Blade Grasp" back to "Countergrasp."  I think that "Normal Attack?" is pretty much the correct name for that flag - the only skills that use it are the two we know govern the Attack command in some way. (Those would be the topmost skill, and bottommost skill that's directly above Potion.)  How this flag affects those skills, I do not know, but my theory would be that it tells the AI that those skills are legal for use within the Attack Command?  I tried to edit the Attack command to contain skills many eons ago and failed because the AI wouldn't use them, but none of the skills had "Normal Attack?" flagged.  Then again, I also couldn't flag it, as I was attempting to do this with the Charge skillset.  But still.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 10, 2012, 06:39:43 pm
We may need to think about some of these labels a bit, because in some cases the original names didn't make any sense either.

"Normal Attack?": This is fine, except I'm trying to avoid question marks, but we could use "Normal Attack" or keep "Normal Attack?" if there's really nothing better.

"Countergrasp":
Affected by Blade Grasp as the counter ability?
Having Blade Grasp equipped causes a counter strike?
Counters Blade Grasp with a counter strike?
Can't be affected by Blade Grasp, because the ability counters it?
Who knows!

Any way to make this better? Are Counter and Blade Grasp the only abilities affected? "Counterable" is really vague but we don't have much space. Maybe we need a tooltip or something. Or "Counterable (ALSO BLADE GRASP)" :)

"Persevere":
The only thing this flag name suggests is that you would continue charging the ability even if you get attacked. However... that's how all abilities work (Attacks don't interrupt you; you just take more damage). I tried changing it to "Channel" because at least an ability being flagged as channeled would imply that it uses up your action... however, as you say, that label still isn't necessarily great at describing what it does. I contend that "Persevere" is worse ("I had to persevere through the adversity of having turns in order to keep charging/channeling my ability?" I would never guess that it means that).

Continuous? Perform? Performing? Continue Through Turns? I played around with "Skip Turns" but it's ambiguous whether it skips the caster's turns or the target's, and in what situation. I don't know... we should be able to find something that makes sense here.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on January 10, 2012, 06:53:22 pm
Persevere = Performing because that's what that flag does.  It changes a charged attack into a performed one.

Countergrasp is affected by the following:
Counter
Blade Grasp
Counter Tackle
Brave Up
Dragon Spirit
Sunken State
This is the information from the Battle Mechanics Guide by Aerostar.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 10, 2012, 08:57:54 pm
I would leave it as "Normal Attack?" until more thorough research is done.  It's stupid to give it a name that sounds like we /know/ what it does when we very clearly don't have the full low-down on it yet.

Continuous pr Performing is fine for Persevering.  I prefer Continuous since it can be used on things that aren't actually a performance. (Aka, aren't Songs/Dances or even remotely related to them, you can have continuously-triggered weapon or magic attacks.) I still find Channel to be the worst name, though.  I can simply reverse your example - "I channeled magic and cast my spell through my foe's attacks."  At least Persevere is a synonym for Persist, whereas Channel is very much implied to be magic-only if you're read up on nerdy magic lore at all or is otherwise worthless.  It's too narrow and implies many things it shouldn't, like that it only works on magical skills, assuming you can even figure out what it is without cross-referencing it somehow.

Countergraspable is also fine because it's basic FFT slang - if you've ever read the Battle Mechanics Guide, you'll know the term, and know it refers to whether the ability is affected by the Reactions Counter Tackle, Counter, and Blade Grasp / Shirahadori, and whether the Reaction can trigger Dragon Spirit / Dragon's Soul, Sunken State / Vanish, and Brave Up / Bravery Boost.  The term Countergrasp is taken directly from the Battle Mechanics Guide and even got its own section in said guide, posted here:

COUNTERGRASP:  So called from the two most popular reaction abilities of
this class, Counter and Blade Grasp, these attacks will be triggered by
any of the physical attacks listed below. The attack does not have to
succeed or cause damage in order for the reaction ability to activate.
Like most reaction abilities, these will activate Br% of the time.

          ------------LIST OF COUNTERGRASP ACTIVATORS-------------
         |========================================================|
         |  ATTACK*           Eye Gouge         Beaking           |
         |  JUMP              Scratch           Shine Lover       |
         |  THROW             Poison Nail       Straight Dash     |
         |  CHARGE            Blood Suck**      Bite              |
         |  BATTLE SKILL      Tentacle (squid)  Shake Off         |
         |  Steal Helmet      Knife Hand        Wave Around       |
         |  Steal Armor       Sleep Touch       Tentacle (morbol) |
         |  Steal Weapon      Grease Touch      Goo               |
         |  Steal Accessry    Drain Touch       Stab Up           |
         |  Steal Shield      Zombie Touch      Sudden Cry        |
         |  Gil Taking        Snake Carrier     Dash (dragon)     |
         |  Choco Attack      Wing Attack       Tail Swing        |
         |  Tackle            Scratch Up        Triple Attack     |
         |  Goblin Punch      Beak                                |
         |                                                        |
         |  * Countergrasp reactions (except Blade Grasp) do not  |
         |    work against ATTACKs with magic guns                |
         |  ** Vampire version of 'Blood Suck' only!              |
          --------------------------------------------------------

   [Blade Grasp] - 700 JP, Samurai  
   This ability makes the base hit percentage for Countergrasp
   activators executed against you equal to (Base - YourBr) instead of
   Base, where Base is the success rate of the attack before evasion
   is considered.  Unlike the other Countergrasp reaction abilities,
   Blade Grasp DOES work against magic guns.  Blade Grasp can only
   activate once per attack, so it will at most block one of the two
   hits from a Two Swords attack.  Blade Grasp is NOT considered to
   be evasion, and its effects stack with those of evasion. See
   section 6.6 for details.

   [Brave Up] - 500 JP, Dancer
   Your Br is increased by 3.

   [Counter] - 300 JP, Monk
   If the unit which attacked you is within range of your equipped
   weapon, you will counter with an ATTACK directive. The Counter-ATTACK
   can't trigger reactions (except pseudo-supports), which means it can't
   be blocked by Blade Grasp.

   [Counter Tackle] - 180 JP, Squire
   If the unit that attacked you is within range of 'Dash', you will
   counter with 'Dash'.

   [Dragon Spirit] - 560 JP, Lancer  
   You gain Reraise status, unless you already have Reraise or are immune
   to Reraise.

   [Sunken State] - 900 JP, Ninja
   You gain Transparent status, unless you are immune to Transparent.


If you haven't even read the Battle Mechanics Guide... I can't expect you to be able mod the gameplay aspect of FFT competently, honestly.  It contains basic info on a lot of Formula and other-related stuff that most people here will assume you know or easily know how to look up as a baseline when modding.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on January 14, 2012, 12:51:43 pm
Quote from: RavenOfRazgriz on January 10, 2012, 08:57:54 pmAt least Persevere is a synonym for Persist...

Why not use "Persists"?
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on January 14, 2012, 12:56:14 pm
Why can't we stick with Persevere? Everyone knew what it did.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on January 14, 2012, 12:58:23 pm
Raven, you're missing my point.  Flagging "perform" flag causes the unit to gain "performing" status.  This status is different in vanilla FFT than "charging" since you don't take 1.5x damage when "performing".  Hence, it doesn't make much sense to give that flag any other name.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 14, 2012, 05:26:45 pm
I want to move away from Persevere because it isn't clear. I certainly didn't know what it meant.

If everyone knew what it did, then it was because everyone just memorized it, and in that case, it doesn't matter what the label is anyway. It might as well have been called Flag 22 or something.

We can't make any progress if we shy away from changing things because people memorized the old ways.

EDIT: For the record, I like "Performing" because of what fdc is saying.

Also, is the "Countergrasp" term really well known? Not sure how many people have really read the BMG. I'm okay with it if so. Counter/Grasp maybe, but it still doesn't show everything. I'll try adding a tooltip to it maybe to show all the things it affects.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on January 14, 2012, 05:40:09 pm
Does countergraspable refer to "When flagged, this ability triggers reactions dependent on HP damage"?  And, if anyone cares about my opinion, then FDC is right, it should be "Performing".
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 14, 2012, 05:48:13 pm
Quote from: Pickle Girl Fanboy on January 14, 2012, 05:40:09 pm
Does countergraspable refer to "When flagged, this ability triggers reactions dependent on HP damage"?


Look at the spoiler in this post (http://ffhacktics.com/smf/index.php?topic=7163.msg164333#msg164333), PGF.  You obviously read this post once since you replied to my response to Glain...



Performing is fine.  I wasn't saying it was wrong - it's right for the reasons FDC listed.  I just prefer "Continuous" because it shows the skill is continuous, and that the flag works on anything, and not just a "performance" skill like Singing or Dancing.  Yes that's a weird way to look at people but that's how your average shmoe who knows nothing about code could easily see it.  I'm fine with either label though, really.

Like I said, Glain, modding without reading the BMG sounds like a terrible idea.  If you don't know how things work, how can you mod it?  If you can add a tooltip, though, that'd be fine.  Just name it CounterGraspable and have a tooltip pop up if you hover over the name for a minute or something, I dunno.  The only one Reaction I ever forget is Countergraspable is Brave Up though, myself, simply because I always expect it to be in parity with Faith Up.  (And hence, my request to you in your ASM thread.)
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on January 14, 2012, 06:04:05 pm
Quote from: RavenOfRazgriz on January 14, 2012, 05:48:13 pm
Look at the spoiler in this post (http://ffhacktics.com/smf/index.php?topic=7163.msg164333#msg164333), PGF.  You obviously read this post once since you replied to my response to Glain...

I was surprised by that, and I wanted verification, but I decided to be a little sneaky about it.  I thought the "bonus" reactions were separate from the "damage-enemies" and the "evade-attacks".
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 14, 2012, 06:11:19 pm
They're not.  What the Reaction does is irrelevant to the trigger.  There's several triggers:

Counter Grasp (Counter, Blade Grasp, etc)
Counter Flood
Counter Magic
HP Damage (Caution, Regenerator, PA Save, MA Save, some others)
Affected by Attack/Skill (Faith Up, maybe others)
Affected by Specific Formula (Catch, Finger Guard)

[Uncertain] Weapon Ranged Skill (Hamedo)

Then there's Distribute and maybe one or two others I missed with very weird and unique trigger conditions.  As you can see, what the skill does really isn't related to how it triggers.  There is no "Adds Status to Self" grouping or anything like that.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on January 14, 2012, 06:21:57 pm
My last off-topic post: I bet the asm for triggers, and R/S/M's in general, is royally screwed up.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 14, 2012, 08:40:02 pm
Hey Glain, you're the cool guy whose able to get .478 compiling correctly.  In FFTacText, it has a QuickEdit function that edits areas that appear many times over in files... but it's missing some key areas like Unit Name, Help Window editors, etc.  If I can assemble the titles of those windows and all the different files they appear in, would it be possible for you (or FDC, but he's busy enough with the ASM shit) to add QuickEdit options to FFTacText for these missing things so that trying to edit things like the tooltip that comes up when you press Select on a unit's Party Roster Number or the Unit Name List and stuff without it taking years.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 14, 2012, 11:58:16 pm
I'm sure it's possible... but I'll have to figure out how QuickEdit works first. I'll take a look at that while I make the edits to the flag names, etc., and see what I can do. It doesn't hurt to make the list regardless, because I'm sure I'll figure it out eventually.

EDIT: For flag names, I'm going with "Normal Attack?", "Performing", and "Countergrasp" and just hope people read the BMG. Can't do Countergraspable; it's inconsistent with things like "Counter Magic" and "Counter Flood" and I can't get those to sound right no matter what I do ("Affected by Counter Magic" is too long, etc, "Counter Magicable" is just... what?).

EDIT: I've also got ability IDs preceding ability names, like "015E Grand Cross"
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 16, 2012, 09:13:36 am
Quote from: Glain on January 14, 2012, 11:58:16 pmEDIT: I've also got ability IDs preceding ability names, like "015E Grand Cross"


Means redoing my Resources.zip for Abilities, but damn that's more useful than you realize.  (When Event Editing, you play an Effect by calling its Ability ID, not its Animation ID.  Having the Ability ID right there to look at when sifting through your skills for the one you want to play will help so much when Event Editing.)

Those flag names sound fine, too.  I'll try to get that QuickEdit list stuff to you tonight.  I've been busy doing a lot of FFTPatcher work for Journey of the Five, but I'm switching over to doing Spell Quotes tonight so I'll look up all the stuff you'll need to update the QuickEdit list before I get started on those.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 20, 2012, 01:56:18 am
I'm posting that stuff about FFTacText now.  I'm going to put the name of the field in quotation marks, then list every file the window is listed under.  This will also include every file only listed in one window, since honestly, QuickEdit should allow you to edit all the text in the game without jumping between files hunting for shit.  Whether you feel that way as well or not, I do not know, but everything will be here regardless.


ATTACK.OUT
OPEN.LZW
WORLD.LZW
WORLD.LZW (appears twice)



WLDHELP.LZW



REQUIRE.OUT



REQUIRE.OUT



REQUIRE.OUT
WORLD.BIN 05



ATCHELP.LZW
BUNIT.OUT
HELP.LZW
WLDHELP.LZW



EQUIP.OUT
HELP.LZW
WLDHELP.LZW



BATTLE.BIN
CARD2.OUT
WLDHELP.LZW
WORLD.BIN 04



BATTLE.BIN



HELP.LZW



HELP.LZW



BATTLE.BIN
WORLD.LZW



BATTLE.BIN



BATTLE.BIN



BATTLE.BIN



BATTLE.BIN



BUNIT.OUT



CARD1.OUT



OPEN.LZW



OPEN.LZW



OPEN.LZW



SNPLMES.BIN



TUTO1.MES to TUTO7.MES



WORLD.LZW



WLDHELP.LZW



WORLD.LZW



WORLD.LZW



WLDHELP.LZW
WORLD.BIN 09



WLDMES.BIN
WORLD.LZW (Facts only)



WORLD.BIN 08



WORLD.BIN 10



WORLD.LZW



WORLD.LZW



WORLD.LZW



WORLD.LZW



WORLD.LZW



WORLD.LZW


There you go.  Personally, I feel that the Text dropdown should BE the QuickEdit menu, and all this stuff should be what you get to choose from instead.  Since there's a lot of items, maybe group them into several obvious and intuitive quickedit groups, so you pick a group, then find what you need to edit off that list.  Either way, this is all the info, do with it as you will.


Also, for .479 FFTPatcher, can you please list the Item ID of an Item/Weapon/etc next to an Item/Weapon/etc in the same way you listed Ability IDs?  Having that info at a glance would be amazing for Event Editing, since you need to know Item IDs to assign Temporary Weapons.  It's on the Wiki, but it's stupid to have to go a million places for things that should all be contained in one place, and the Wiki's much harder to make use of if you're changing lots of weapon names and such.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 21, 2012, 12:19:52 pm
I've got item IDs in there now.

I've spent a while trying to figure out why it was generating Gameshark codes for Propositions even when nothing was changed. There's this concept of "buggy level bonuses" that keeps being referenced, and a bit value to say whether or not the level bonuses are buggy in the ISO? It was set to true, which made the values different from the ones it thought of as the defaults, so it generated the Gameshark codes to change them; setting the flag to false makes the codes disappear.

It just seems weird. Am I missing something by just setting that flag to false and being done with it? The code's got a bunch of branching decisions based on whether or not that "buggy level bonuses" flag is set and I have no idea what it's all about.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on January 21, 2012, 04:30:07 pm
Could you post the code?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 21, 2012, 06:05:50 pm
Er... I pretty well have to post the whole document it's in; it's sprinkled throughout. If you really want it:



using System;
using System.Collections.Generic;
using System.Text;
using PatcherLib.Utilities;
using PatcherLib.Datatypes;
using PatcherLib;
using Lokad;

namespace FFTPatcher.Datatypes
{
   public enum PropositionClass
   {
       Squire = 0,
       Chemist,
       Knight,
       Archer,
       Monk,
       Priest,
       Wizard,
       TimeMage,
       Summoner,
       Thief,
       Mediator,
       Oracle,
       Geomancer,
       Lancer,
       Samurai,
       Ninja,
       Calculator,
       Bard,
       Dancer,
       Mime,
       Specials,
       Monsters
   }

   public enum RandomSuccessClass
   {
       None = 0,
       Squire,
       Chemist,
       Knight,
       Archer,
       Monk,
       Priest,
       Wizard,
       TimeMage,
       Summoner,
       Thief,
       Mediator,
       Oracle,
       Geomancer,
       Lancer,
       Samurai,
       Ninja,
       Calculator,
       Bard,
       Dancer,
       Mime,
   }

   public enum BraveFaithRange
   {
       _1to20 = 0,
       _21to40,
       _41to60,
       _61to80,
       _81to100
   }

   public enum LevelRange
   {
       _1to10 = 0,
       _11to20,
       _21to30,
       _31to40,
       _41to50,
       _51to60,
       _61to70,
       _71to80,
       _81to90,
       _91to100,
   }

   public enum BonusPercent
   {
       _50Percent = 0,
       _40Percent,
       _10Percent
   }

   public enum BonusIndex
   {
       Nothing = 0,
       _One,
       _Two,
       _Three,
       _Four,
       _Five,
       _Six,
       _Seven,
       _Eight,
   }
   public class AllPropositions : PatchableFile, IXmlDigest, IGenerateCodes
   {
       public const int NumPropositions = 96;
       public const int propLength = 23;

       public AllPropositions( IList<byte> bytes, bool brokenLevelBonuses )
           : this( bytes, null as AllPropositions, brokenLevelBonuses )
       {
       }

       public AllPropositions( IList<byte> bytes, IList<byte> defaultBytes, bool brokenLevelBonuses )
           : this( bytes, new AllPropositions( defaultBytes, true ), brokenLevelBonuses )
       {
       }

       public bool MirrorLevelRanges { get { return !CanFixBuggyLevelBonuses( FFTPatch.Context ); } }

       public IList<UInt16> Prices { get; private set; }
       public IList<UInt16> SmallBonuses { get; private set; }
       public IList<UInt16> LargeBonuses { get; private set; }
       public IList<UInt16> JPMultipliers { get; private set; }
       public IList<UInt16> GilMultipliers { get; private set; }

       private TupleDictionary<PropositionType, PropositionClass, byte> propTypeBonuses;
       public TupleDictionary<PropositionType, PropositionClass, byte> PropositionTypeBonuses { get { return propTypeBonuses; } }

       private TupleDictionary<BraveFaithNeutral, PropositionClass, byte> bfBonuses;
       public TupleDictionary<BraveFaithNeutral, PropositionClass, byte> BraveFaithBonuses { get { return bfBonuses; } }

       private TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte> braveBonuses;
       public TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte> BraveStatBonuses { get { return braveBonuses; } }

       private TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte> faithBonuses;
       public TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte> FaithStatBonuses { get { return faithBonuses; } }

       private TupleDictionary<BraveFaithNeutral, LevelRange, byte> levelBonuses;
       public TupleDictionary<BraveFaithNeutral, LevelRange, byte> LevelBonuses { get { return levelBonuses; } }

       private IDictionary<PropositionType, BonusIndex> treasureLandJpBonuses;
       public IDictionary<PropositionType, BonusIndex> TreasureLandJpBonuses { get { return treasureLandJpBonuses; } }

       private IDictionary<PropositionType, BonusIndex> treasureLandGilBonuses;
       public IDictionary<PropositionType, BonusIndex> TreasureLandGilBonuses { get { return treasureLandGilBonuses; } }

       private TupleDictionary<PropositionType, BonusPercent, BonusIndex> bonusCashGilBonuses;
       public TupleDictionary<PropositionType, BonusPercent, BonusIndex> BonusCashGilBonuses { get { return bonusCashGilBonuses; } }

       private TupleDictionary<PropositionType, BonusPercent, BonusIndex> bonusCashJpBonuses;
       public TupleDictionary<PropositionType, BonusPercent, BonusIndex> BonusCashJpBonuses { get { return bonusCashJpBonuses; } }

       IList<byte> realLevelBonusBytes;

       public void SetPropositionTypeBonus( PropositionType type, PropositionClass _class, byte value )
       {
           propTypeBonuses[type, _class] = value;
       }

       public void SetBraveFaithBonus( BraveFaithNeutral bfn, PropositionClass _class, byte value )
       {
           bfBonuses[bfn, _class] = value;
       }

       public AllPropositions Default { get; private set; }

       public AllPropositions( IList<byte> bytes, AllPropositions defaults, bool brokenLevelBonuses )
       {
           Default = defaults;
           var names = FFTPatch.Context == Context.US_PSP ? PSPResources.Lists.Propositions : PSXResources.Lists.Propositions;

           List<Proposition> props = new List<Proposition>();
           if (defaults != null)
           {
               for (int i = 0; i < NumPropositions; i++)
               {
                   props.Add( new Proposition( names[i], bytes.Sub( i * propLength, (i + 1) * propLength - 1 ), defaults.Propositions[i] ) );
               }
           }
           else
           {
               for (int i = 0; i < NumPropositions; i++)
               {
                   props.Add( new Proposition( names[i], bytes.Sub( i * propLength, (i + 1) * propLength - 1 ) ) );
               }
           }

           Prices = new UInt16[8];
           for (int i = 0; i < 8; i++)
           {
               var b = bytes.Sub( propLength * NumPropositions + i * 2 + 2, propLength * NumPropositions + i * 2 + 2 + 1 );
               Prices[i] = Utilities.BytesToUShort( b[0], b[1] );
           }

           unknownBytes = bytes.Sub( 0x8b2, 0x8bf ).ToArray();

           propTypeBonuses = new TupleDictionary<PropositionType, PropositionClass, byte>();

           foreach (PropositionType type in (PropositionType[])Enum.GetValues( typeof( PropositionType ) ))
           {
               foreach (PropositionClass _class in (PropositionClass[])Enum.GetValues( typeof( PropositionClass ) ))
               {
                   propTypeBonuses[type, _class] = bytes[0x8C0 + ((int)type - 1) * 22 + (int)_class];
               }
           }
           propTypeBonuses = new TupleDictionary<PropositionType, PropositionClass, byte>( propTypeBonuses, false, true );

           bfBonuses = new TupleDictionary<BraveFaithNeutral, PropositionClass, byte>();
           foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues( typeof( BraveFaithNeutral ) ))
           {
               foreach (PropositionClass _class in (PropositionClass[])Enum.GetValues( typeof( PropositionClass ) ))
               {
                   bfBonuses[bfn, _class] = bytes[0x970 + ((int)bfn - 1) * 22 + (int)_class];
               }
           }
           bfBonuses = new TupleDictionary<BraveFaithNeutral, PropositionClass, byte>( bfBonuses, false, true );

           braveBonuses = new TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte>();
           faithBonuses = new TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte>();
           levelBonuses = new TupleDictionary<BraveFaithNeutral, LevelRange, byte>();

           int levelBonusesOffset = brokenLevelBonuses ? 0x9B4 : 0x9D4;
           foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues( typeof( BraveFaithNeutral ) ))
           {
               foreach (BraveFaithRange range in (BraveFaithRange[])Enum.GetValues( typeof( BraveFaithRange ) ))
               {
                   braveBonuses[bfn, range] = bytes[0x9B4 + ((int)bfn - 1) * 5 + (int)range];
                   faithBonuses[bfn, range] = bytes[0x9C4 + ((int)bfn - 1) * 5 + (int)range];
               }

               foreach (LevelRange range in (LevelRange[])Enum.GetValues( typeof( LevelRange ) ))
               {
                   levelBonuses[bfn, range] = bytes[levelBonusesOffset + ((int)bfn - 1) * 10 + (int)range];
               }
           }


           braveBonuses = new TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte>( braveBonuses, false, true );
           faithBonuses = new TupleDictionary<BraveFaithNeutral, BraveFaithRange, byte>( faithBonuses, false, true );
           levelBonuses = new TupleDictionary<BraveFaithNeutral, LevelRange, byte>( levelBonuses, false, true );

           treasureLandJpBonuses = new Dictionary<PropositionType, BonusIndex>();
           treasureLandGilBonuses = new Dictionary<PropositionType, BonusIndex>();
           bonusCashGilBonuses = new TupleDictionary<PropositionType, BonusPercent, BonusIndex>();
           bonusCashJpBonuses = new TupleDictionary<PropositionType, BonusPercent, BonusIndex>();

           foreach (PropositionType type in (PropositionType[])Enum.GetValues( typeof( PropositionType ) ))
           {
               treasureLandGilBonuses[type] = (BonusIndex)bytes[0x9F4 + 2 * ((int)type - 1)];
               treasureLandJpBonuses[type] = (BonusIndex)bytes[0x9F4 + 2 * ((int)type - 1) + 1];

               bonusCashGilBonuses[type, BonusPercent._10Percent] = (BonusIndex)bytes[0xA04 + ((int)type - 1) * 6 + 2 * 2];
               bonusCashGilBonuses[type, BonusPercent._40Percent] = (BonusIndex)bytes[0xA04 + ((int)type - 1) * 6 + 2 * 1];
               bonusCashGilBonuses[type, BonusPercent._50Percent] = (BonusIndex)bytes[0xA04 + ((int)type - 1) * 6 + 2 * 0];

               bonusCashJpBonuses[type, BonusPercent._10Percent] = (BonusIndex)bytes[0xA04 + ((int)type - 1) * 6 + 2 * 2 + 1];
               bonusCashJpBonuses[type, BonusPercent._40Percent] = (BonusIndex)bytes[0xA04 + ((int)type - 1) * 6 + 2 * 1 + 1];
               bonusCashJpBonuses[type, BonusPercent._50Percent] = (BonusIndex)bytes[0xA04 + ((int)type - 1) * 6 + 2 * 0 + 1];
           }
           bonusCashGilBonuses = new TupleDictionary<PropositionType, BonusPercent, BonusIndex>( bonusCashGilBonuses, false, true );
           bonusCashJpBonuses = new TupleDictionary<PropositionType, BonusPercent, BonusIndex>( bonusCashJpBonuses, false, true );

           SmallBonuses = new UInt16[8];
           LargeBonuses = new UInt16[8];
           for (int i = 0; i < 8; i++)
           {
               SmallBonuses[i] = Utilities.BytesToUShort( bytes[0xA34 + i * 2], bytes[0xA34 + i * 2 + 1] );
               LargeBonuses[i] = Utilities.BytesToUShort( bytes[0xA44 + i * 2], bytes[0xA44 + i * 2 + 1] );
           }

           JPMultipliers = new UInt16[10];
           GilMultipliers = new UInt16[10];

           for (int i = 0; i < 10; i++)
           {
               JPMultipliers[i] = Utilities.BytesToUShort( bytes[0xA54 + i * 2], bytes[0xA54 + i * 2 + 1] );
               GilMultipliers[i] = Utilities.BytesToUShort( bytes[0xA68 + i * 2], bytes[0xA68 + i * 2 + 1] );
           }


           Propositions = props.AsReadOnly();
       }

       private IList<byte> unknownBytes;

       public IList<Proposition> Propositions
       {
           get;
           private set;
       }

       public string GetCodeHeader( PatcherLib.Datatypes.Context context )
       {
           return context == Context.US_PSP ? "_C0 Propositions" : "\"Propositions";

       }

       public IList<string> GenerateCodes( PatcherLib.Datatypes.Context context )
       {
           if (context == Context.US_PSP)
           {
               return Codes.GenerateCodes( Context.US_PSP, PSPResources.Binaries.Propositions, this.ToByteArray(), 0x2E9634 );
           }
           else
           {
               return Codes.GenerateCodes( Context.US_PSX, PSXResources.Binaries.Propositions, this.ToByteArray(), 0x9D380, Codes.CodeEnabledOnlyWhen.World );
           }
       }

       public void WriteXmlDigest( System.Xml.XmlWriter writer )
       {
           throw new NotImplementedException();
       }

       public byte[] ToByteArray()
       {
           List<byte> result = new List<byte>( 0xA7C );
           Propositions.ForEach( p => result.AddRange( p.ToByteArray() ) );
           result.Add( 0x00 );
           result.Add( 0x00 );
           Prices.ForEach( p => result.AddRange( p.ToBytes() ) );
           result.AddRange( unknownBytes );

           PropositionClass[] classes = (PropositionClass[])Enum.GetValues( typeof( PropositionClass ) );
           PropositionType[] propTypes = (PropositionType[])Enum.GetValues( typeof( PropositionType ) );
           foreach (PropositionType type in propTypes)
           {
               foreach (PropositionClass _class in classes)
               {
                   result.Add( propTypeBonuses[type, _class] );
               }
           }
           BraveFaithNeutral[] bfnVals = (BraveFaithNeutral[])Enum.GetValues( typeof( BraveFaithNeutral ) );
           foreach (BraveFaithNeutral bfn in bfnVals)
           {
               foreach (PropositionClass _class in classes)
               {
                   result.Add( bfBonuses[bfn, _class] );
               }
           }

           result.Add( 0x00 );
           result.Add( 0x00 );
           BraveFaithRange[] bfnRanges = (BraveFaithRange[])Enum.GetValues( typeof( BraveFaithRange ) );

           foreach (BraveFaithNeutral bfn in bfnVals)
           {
               foreach (BraveFaithRange range in bfnRanges)
               {
                   result.Add( braveBonuses[bfn, range] );
               }
           }

           result.Add( 0x00 );

           foreach (BraveFaithNeutral bfn in bfnVals)
           {
               foreach (BraveFaithRange range in bfnRanges)
               {
                   result.Add( faithBonuses[bfn, range] );
               }
           }

           result.Add( 0x00 );

           LevelRange[] levelRanges = (LevelRange[])Enum.GetValues( typeof( LevelRange ) );
           foreach (BraveFaithNeutral bfn in bfnVals)
           {
               foreach (LevelRange range in levelRanges)
               {
                   result.Add( levelBonuses[bfn, range] );
               }
           }

           result.Add( 0x00 );
           result.Add( 0x00 );

           foreach (PropositionType type in propTypes)
           {
               result.Add( (byte)treasureLandGilBonuses[type] );
               result.Add( (byte)treasureLandJpBonuses[type] );
           }

           foreach (PropositionType type in propTypes)
           {
               for (int i = 0; i < 3; i++)
               {
                   result.Add( (byte)bonusCashGilBonuses[type, (BonusPercent)i] );
                   result.Add( (byte)bonusCashJpBonuses[type, (BonusPercent)i] );
               }
           }

           SmallBonuses.ForEach( b => result.AddRange( b.ToBytes() ) );
           LargeBonuses.ForEach( b => result.AddRange( b.ToBytes() ) );

           JPMultipliers.ForEach( b => result.AddRange( b.ToBytes() ) );
           GilMultipliers.ForEach( b => result.AddRange( b.ToBytes() ) );

           System.Diagnostics.Debug.Assert( result.Count == 0xA7C );
           return result.ToArray();
       }

       public override IList<PatchedByteArray> GetPatches( PatcherLib.Datatypes.Context context )
       {
           var result = new List<PatchedByteArray>( 2 );
           var bytes = ToByteArray();
           if (context == Context.US_PSX)
           {
               result.Add( PatcherLib.Iso.PsxIso.Propositions.GetPatchedByteArray( bytes ) );
               foreach (var good in goodPsxInstructions)
               {
                   result.Add( new PatchedByteArray( PatcherLib.Iso.PsxIso.Sectors.WORLD_WLDCORE_BIN,
                       good.Item1, good.Item2.ToArray() ) );
               }
           }
           else if (context == Context.US_PSP)
           {
               PatcherLib.Iso.PspIso.Propositions.ForEach( kp => result.Add( kp.GetPatchedByteArray( bytes ) ) );
           }

           return result;
       }

       public override bool HasChanged
       {
           get
           {
               return
                   Default != null &&
                   (!Utilities.CompareArrays( Prices, Default.Prices ) ||
                    !Utilities.CompareArrays( SmallBonuses, Default.SmallBonuses ) ||
                    !Utilities.CompareArrays( LargeBonuses, Default.LargeBonuses ) ||
                    !Utilities.CompareArrays(JPMultipliers, Default.JPMultipliers)||
                    !Utilities.CompareArrays(GilMultipliers, Default.GilMultipliers)||
                    !propTypeBonuses.Keys.TrueForAll( k => propTypeBonuses[k] == Default.propTypeBonuses[k] ) ||
                    !bfBonuses.Keys.TrueForAll( k => bfBonuses[k] == Default.bfBonuses[k] ) ||
                    !braveBonuses.Keys.TrueForAll( k => braveBonuses[k] == Default.braveBonuses[k] ) ||
                    !faithBonuses.Keys.TrueForAll( k => faithBonuses[k] == Default.faithBonuses[k] ) ||
                    !levelBonuses.Keys.TrueForAll( k => levelBonuses[k] == Default.levelBonuses[k] ) ||
                    !treasureLandJpBonuses.Keys.TrueForAll( k => treasureLandJpBonuses[k] == Default.treasureLandJpBonuses[k] ) ||
                    !treasureLandGilBonuses.Keys.TrueForAll( k => treasureLandGilBonuses[k] == Default.treasureLandGilBonuses[k] ) ||
                    !bonusCashGilBonuses.Keys.TrueForAll( k => bonusCashGilBonuses[k] == Default.bonusCashGilBonuses[k] ) ||
                    !bonusCashJpBonuses.Keys.TrueForAll( k => bonusCashJpBonuses[k] == Default.bonusCashJpBonuses[k] ) ||
                   !Propositions.TrueForAll( p => !p.HasChanged ));
           }
       }

       private static readonly IList<Tuple<int, IList<byte>>> badPsxInstructions = new List<Tuple<int, IList<byte>>> {
           Tuple.From(0x128C0, (IList<byte>)(new byte[] { 0x21, 0xB0, 0x40, 0x00 }.AsReadOnly())), // 0x128C0 move $s6, $v0
           Tuple.From(0x12A64, (IList<byte>)(new byte[] { 0x00, 0x00, 0x00, 0x00 }.AsReadOnly())), // 0x12A64 nop
           Tuple.From(0x12A74, (IList<byte>)(new byte[] { 0x21, 0x10, 0x56, 0x00 }.AsReadOnly())), // 0x12A74 addu $v0,$s6
           Tuple.From(0x1287C, (IList<byte>)(new byte[] { 0x00, 0x00, 0x00, 0x00 }.AsReadOnly())), // 0x1287C nop
           Tuple.From(0x128C8, (IList<byte>)(new byte[] { 0x00, 0x00, 0x00, 0x00 }.AsReadOnly())), // 0x128C8 nop
       }.AsReadOnly();

       private static readonly IList<Tuple<int, IList<byte>>> goodPsxInstructions = new List<Tuple<int, IList<byte>>> {
           Tuple.From(0x128C0, (IList<byte>)(new byte[] { 0x3C, 0x00, 0xA2, 0xAF }.AsReadOnly())), // 0x128C0 sw $v0, 0x68+var_2C($sp)
           Tuple.From(0x12A64, (IList<byte>)(new byte[] { 0x3C, 0x00, 0xA5, 0x8F }.AsReadOnly())), // 0x12A64 lw $a1, 0x68+var_2C($sp)
           Tuple.From(0x12A74, (IList<byte>)(new byte[] { 0x21, 0x10, 0x45, 0x00 }.AsReadOnly())), // 0x12A74 addu $v0,$a1
           Tuple.From(0x1287C, (IList<byte>)(new byte[] { 0x0A, 0x80, 0x16, 0x3C }.AsReadOnly())), // 0x1287C lui $s6, 0x800a
           Tuple.From(0x128C8, (IList<byte>)(new byte[] { 0x54, 0xDD, 0xD6, 0x26 }.AsReadOnly())), // 0x128C8 addiu $s6, 0xDD54
       }.AsReadOnly();

       public static bool CanFixBuggyLevelBonuses( Context context )
       {
           return context == Context.US_PSX;
       }

       public static bool IsoHasBuggyLevelBonuses( System.IO.Stream iso, Context context )
       {
           if (context == Context.US_PSP)
           {
               return true;
           }
           else
           {
               bool allBad = true;
               foreach (var badInstruction in badPsxInstructions)
               {
                   var kp = new PatcherLib.Iso.PsxIso.KnownPosition( PatcherLib.Iso.PsxIso.Sectors.WORLD_WLDCORE_BIN, badInstruction.Item1, 4 );
                   var bytes = kp.ReadIso( iso );
                   allBad &= Utilities.CompareArrays( bytes, badInstruction.Item2 );
               }

               if (allBad)
                   return true;

               bool allGood = true;
               foreach (var goodInstruction in goodPsxInstructions)
               {
                   var kp = new PatcherLib.Iso.PsxIso.KnownPosition( PatcherLib.Iso.PsxIso.Sectors.WORLD_WLDCORE_BIN, goodInstruction.Item1, 4 );
                   var bytes = kp.ReadIso( iso );
                   allGood &= Utilities.CompareArrays( bytes, goodInstruction.Item2 );
               }

               if (allGood)
                   return false;

               return true;
           }
       }
   }
}



Sometimes it's referred to as brokenLevelBonuses. Note this line:


int levelBonusesOffset = brokenLevelBonuses ? 0x9B4 : 0x9D4;


So if brokenLevelBonuses is true then it looks at the wrong offset (0x9B4) instead of the right one (0x9D4). I don't get it.

I changed a true to a false in FFTPatch.cs to eliminate the unnecessary Gameshark codes generated (to this):


Propositions = new AllPropositions( PSXResources.Binaries.Propositions, PSXResources.Binaries.Propositions, false );
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 21, 2012, 06:31:40 pm
I'd just switch it to false and call it a day, myself.  It's highly likely that it was supposed to be false and melonhead derped it.

Also fixed that derpy typo in my previous post.  Good to hear that you have Item IDs in there now, though.  Hopefully you come through on fixing up FFTacText to be less of a piece of shit, too.  Would make life amazing.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 22, 2012, 10:12:16 pm
Looking at the Status section now.

"Status Ignored if Mount" doesn't always display the full name.  Shorten it to "Mounting Ignores".  Same with Cancelled by Immortal, shorten it to "Immortal Cancels".  Reduce Target Priority could also trim a character and just be "Lower Target Priority?".  That last one's a bit OCD, but when I click it, a few chars off the end disappear, so shortening it as much as possible is still important.

Also, FDC, I thought you'd figured out a few more flags than this?  Huh.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 26, 2012, 12:01:34 am
Re: The TacText stuff: It sounds like a really good feature to be able to get all that stuff into QuickEdit. It seems melonhead controlled this with an XML file... however, there are no good examples for me to work off of for some of the sections I'm going to have to put in there. I think I can make a pretty good stab at getting it right, but I'm going to be guessing in a lot of places and it sounds nightmarish to test. I'll get something put together before too long and upload so people can look at it, I guess. Here's hoping?
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on January 26, 2012, 12:05:49 am
Hoping indeed.   I used the names of the menus inside the program to try and minimize guesswork, but I'm gonna guess they don't correspond to that XML file at all.  Heh.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 26, 2012, 08:44:06 am
It's not so much that as it seems generally the names are right, but QuickEdit basically wants (file, section, offset, length) for everything being edited, and some of the sections have no offset specified whatsoever (so what is it? 0? better hope that guess is right), for example, and don't even look like other XML sections, specifying different attributes altogether.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on February 19, 2012, 10:50:39 am
I noticed that theres a set of ability AI flags that was left out of the patcher:

0x07 - AI Behavior Flags 4?
      0x80 - Usable by AI
      0x40 - Cannot Target Enemy?
      0x20 - Cannot Target ally?
      0x10 -
      0x08 -
      0x04 -
      0x02 -
      0x01 - Can use physical Reactions?

the blank flags are not used in any skill, and may be hijacked to make custom AI behavior :). These are SA's notes, and with a quick scan of ability memory they seemed to be accurate. The only one i'm not sure about is 0x01, only because i didn't investigate exactly which abilities flag it.

Edit: Just saw where you implemented them in .479, although what/where is the 0x01 flag in .479?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on February 29, 2012, 08:38:45 am
Everything should be in order from where "Used by AI" starts, going from 0x80 to 0x01, so it's the bottom flag in the box that we have labelled as "Evade with Motion", which I believe is more accurate. "Can use physical reactions" sounds like the Countergrasp flag in the bottom section.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on March 24, 2012, 12:27:07 am
What does everyone think about this version of FFTactext?

EDIT - This is in the latest FFTPatcher 0.479 attachment. Removing from this post.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on March 24, 2012, 12:28:10 am
What did you change?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on March 24, 2012, 12:29:37 am
Quick edit. Everything (basically) is now in there, and it's the default.

(Amazing response time, by the way.)
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on March 24, 2012, 12:30:11 am
My body isn't ready for this!
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on March 24, 2012, 04:12:48 pm
All right, I'm releasing the current 0.479 suite. This should include all the edits to Patcher and Tactext.

The only thing I think we need at this point is to get all the ASM hack XML files together. I went to this thread (http://ffhacktics.com/smf/index.php?topic=8301.0), found the ones that seemed relevant, and put them in, with two new XML files (Assorted.xml and Pokeytax.xml) and I also grabbed Choto's mighty sword hack and added Choto.xml. I also added mine as Glain.xml. I don't have fdc's or the ones he'd been gathering, though... although all it amounts to is that we'd just have to add them to this archive.

I don't have whatever crazy version of Shishi was modified without being added to melonhead's source. We might want to get that code in the current project at some point. As such, the version of Shishi here is the normal melonhead 0.478 one.

Anyhow, here it is.

EDIT - 0.481 attached below... no need for this attachment.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on March 25, 2012, 09:39:00 am
Can you release the source code of your latest version as well?  (By the way, even though we're nowhere close to the maximum thread size limit of 48 MB, we probably should only release the source code on this thread of the latest version and the original we got from melonhead.  No need to clutter the place.)
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on March 25, 2012, 11:50:58 am
Guys, since the "normal attack" flag is only flagged for the "Frog Attack", is it possible that's the flag that tells you if a move can be used while frogged?  (Of course, frog also whites out your skillsets so I'm not sure flagging Cure or Fire would work unless those skills were moved into the skillset called by frog.)
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on March 25, 2012, 07:06:35 pm
I made some more updates to the code, notably, FFTorgASM should now allow multiple byte variables (up to 4 bytes) by specifying the "bytes" attribute (lowercase) in a <Variable> tag. I discussed this with fdc yesterday on IRC.

I created a new Google Code page at this location (https://code.google.com/p/fftpatcher-mod/) and checked my latest version of the code in to it. You should be able to check out the code with Subversion. (I mention how I did it for the original project here (http://ffhacktics.com/smf/index.php?topic=7163.0#msg155025). Replace "lioneditor" with "fftpatcher-mod".)

I believe the first ability (0000) also has "Normal Attack?" flagged.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on March 25, 2012, 08:40:46 pm
Quote
I believe the first ability (0000) also has "Normal Attack?" flagged.

Yeah, it does, sadly.

Another orgASM feature request: defaults.  Currently, all variables are set to zero when you open orgASM.  I want the XML file to be able to specify that a given variable defaults to a non-zero value when orgASM is opened.  With this and the ability to set words in our data structures, I should be able to eradicate any advantage of spreadsheets over orgASM except on the largest hacks.

Overall, Glain, what you've done for FFT Patcher is great.  Thanks for your work!
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on March 25, 2012, 08:58:06 pm
Thanks!

Default values should already be possible! Just specify a "default" attribute in your <Variable> tag. I noticed this functionality when going through and modifying the code.

EDIT - Though I may have to modify them to allow multiple bytes.

EDIT - Nope, I don't. It just works. Nice! \o/ ...Er, I mean... of course I spent tons of time making that work! (<_< ) (>_>)
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 01, 2012, 06:40:03 pm
I took fdc's version and my new compiled version (and fixed a bug) and compiled them into... 0.481! Even labels itself as such!

I separated out some of the edits to my hacks that fdc did into a different XML file (fdc_mod.xml) because they were too different from each other to really be the same hack. Both versions are selectable in those cases.

I also added R999's Shishi to the project. I don't like that it's a black box though. We need the source of it...
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 02, 2012, 12:16:09 pm
Your Signed Y hack would mean Fa_(MA + Y) can't take values greater than 127, which removes vanilla functionality for a variety of status magic.  That (and removing signed Y for fire / correctly setting the +/- stats for formulas like Yell) was the reason why I "fixed" your hack in the first place.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 02, 2012, 01:08:32 pm
Actually... no, I don't really understand. The only way sign extension on a byte load could change the value of the resulting register is if the value was > 127. These are the affected vanilla abilities:

00C5 Speed Ruin (Y=250)
00C6 Power Ruin (Y=250)
00C7 Mind Ruin   (Y=250)

I don't see any others. What's all this about fire, and stat increments becoming decrements, etc? Are you saying that the Y value (0x801938fa) gets overwritten in a formula (to suddenly be > 127 when it wasn't originally), then loaded in as a signed value?
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 02, 2012, 02:37:11 pm
Let's say someone makes a fire spell with Y = 130.  After all the stat multipliers, they have 5 MA.

5 * 130 unsigned = 650 (even with mult rather than multu)
5 * 130 signed = 5 * -126 (mult) = 5 * 0xFFFF FF7E (mflo) = 0xFFFF FD76 (sh as damage) = 0xFD76.  In the HP subtraction phase, the halfword is processed so it cannot be negative (andi 0x7FFF so it becomes 0x7D76) and then the minimum is taken between it and 999 (meaning the final HP damage is 999).  Thus, loading signed values on Y for attack formulas like Fire or Choco Meteor can cause inaccurate results.

Furthermore, making Y signed or unsigned has no effect on the status +/- formulas because in every stat change formula exists a line (andi 0x007F or ori 0x0080) that forces the result to be positive or negative.  All numbers above 0x80 constitute +Stats and all numbers below 0x80 constitute -Stats, but it doesn't follow sign conventions in that 0x81 means +1 Stat and 0x01 means -1 Stat.  My revision addressed this fact by deleting the force-fit line of code.  Of course, my revision does not work well with vanilla defaults (since you'd then have to change accumulate / yell / cheer up / scream / gather power by adding 128).

As for status formulas, that was a bad accusation on my part.  I forgot that the status formulas are MA + X, not Y.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 03, 2012, 09:50:57 am
Hey Glain, 2 things

the Mighty Sword has XX% chance to break appears in the Razele file as well as the Choto file. It's also got a bug, FDC found a bug in it a lil while ago, here's a fixed version:



Battle.bin
0x122b94
E8FFBD27
1000BFAF
8E1D060C
00000000
0C004014
64000434
B63B060C
XX000534
08004014
00000000
721E060C
00000000
1E004014
1980033C
902D638C
04000234
100062A0
01000234
020060A0
4421060C
000062A0
9717060C
00000000
E917060C
00000000
A921060C
00000000
1980033C
902D638C
42100200
040062A4
1980043C
DC388290
2A0062A0
00000000
00000000
00000000
00000000
00000000
F41B060C
00000000
3F1C060C
00000000
1000BF8F
1800BD27
0800E003
00000000


Also, I'm not sure if there's a death counter edit hack around but i thought some patches used it. Could you include that one in there if its floating around? Thanks!
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 03, 2012, 06:14:35 pm
Choto, that's because I overrode Razele's original.  Your version is better.  As a result, Choco.html does not need to exist since its data was incorporated into a larger file.  As for the bug, I incorporated the fixed version on Razele's (as well as another little tidbit), but it's probably not fixed in Choto.html since Glain probably just added my files of the .480 build to the files of his .479 build.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 03, 2012, 06:22:59 pm
There was a Choto.xml in your archive (FFTPatcher480.rar), fdc. D:

I'm trying to keep the hacks in the correct xml file with the actual author. I figure if someone has a problem/suggestion regarding one, they can find the XML file it's in and contact the person.

...Well, that won't work with some people because they aren't around anymore, but I figure it at least makes sense. That's one of the reasons I wanted to separate out the edits you made to my hacks into an XML file, because it had changed them enough that I didn't understand what they were doing anymore and I couldn't answer for them (and I want to be able to for everything in my XML file). I could be nuts... it just seemed reasonable to me.

So my vote would be to move the fixed version to Choto.xml and take it out of Razele.xml.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 03, 2012, 06:36:25 pm
Quote from: Glain on April 03, 2012, 06:22:59 pm
There was a Choto.xml in your archive (FFTPatcher480.rar), fdc. D:

Oops.  Sorry for blaming you there.

Quote from: Glain on April 03, 2012, 06:22:59 pm
I'm trying to keep the hacks in the correct xml file with the actual author. I figure if someone has a problem/suggestion regarding one, they can find the XML file it's in and contact the person.

...Well, that won't work with some people because they aren't around anymore, but I figure it at least makes sense. That's one of the reasons I wanted to separate out the edits you made to my hacks into an XML file, because it had changed them enough that I didn't understand what they were doing anymore and I couldn't answer for them (and I want to be able to for everything in my XML file). I could be nuts... it just seemed reasonable to me.

So my vote would be to move the fixed version to Choto.xml and take it out of Razele.xml.

Problem is, if we did that, Razele.xml would literally have nothing left because this contrasts with how I edited the hacks.  If you look closely at any of the 457 FFTP files, you'll see hacks by FFM, me, or Pride mixed in with edited versions of code made by Xif, nates, or Razele.  These edits were done to increase the number editable bug-free features so I had to merge similar hacks.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 03, 2012, 06:43:30 pm
Hmm... I see. No problem. That seems to work. Either way is fine.

I think I found another problem with a Razele hack. "Require Sword - Require Weapons" is editing BATTLE.BIN, but it's supposed to be SCUS.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 03, 2012, 06:47:25 pm
Yeah, that's me being dumb.  Feel free to fix that and re-upload 480.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 04, 2012, 02:57:39 pm
All right, I think I found my copy of R999's Source Code changes.
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 05, 2012, 04:16:43 pm
Glain, could you put the ID -after- the skill/item name? It makes it hard to type things in if you don't know the hex for everything.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on April 05, 2012, 10:16:06 pm
Quote from: Eternal248 on April 05, 2012, 04:16:43 pm
Glain, could you put the ID -after- the skill/item name? It makes it hard to type things in if you don't know the hex for everything.


You would need to widen the listboxes considerably for this, else the hex would be pushed off the page and be useless.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 06, 2012, 09:39:22 pm
I think I can alter the listbox itself to change what the type-ahead does. I don't really want to put the hex to the right because it breaks the convention.

I put in the R999 changes to Shishi. From what fdc uploaded, I took the two that seemed the most current/correct (there were three sets of the same two files), and imported them into the project... however, that only got me some of the functionality. I had to do a few things myself to get things to the same point. Not sure why that is but it seems to work now, so future Shishi versions should have those features (Quick reimport with Ctrl+R; frame numbers don't change when changing sprites).



I also did something... interesting with FFTorgASM. I've been importing some of my MHA code into the FFTP project... Now why would I do that? I present... an epic tale of patching ASM!

(http://img813.imageshack.us/img813/8247/asmtale.png)


Here's a hack I'm going to have in my XML file. This is a bit different from a previous hack because it checks item type instead of item number... but what's interesting is the way it looks in the XML:


  <Patch name="Require Materia Blade -> Require Item Type X (Default Lance)">
    <Description>
      Require Materia Blade -> Require Item Type X (Default 0x0F = Lance)
      (Weapon type list removed for space)
    </Description>
    <Location file="SCUS_942_21" offset="4CE24" mode="ASM">
      li      t0, 0x0f
      move      v1, a1
      sll     t1, v1, 1
      addu     t1, t1, v1
      sll     t1, t1, 2
      lui     at, 0x8006
      addu     at, at, t1
      lbu     v0, 0x2ebd(at)
      lbu     t3, 0x0184(s1)
      subu      t1, v0, t0
      sltiu     t1, t1, 1
      sll     t1, t1, 2
      or     t3, t3, t1
      j       0x5c668
      sb     t3, 0x0184(s1)
    </Location>
    <Variable name="X" file="SCUS_942_21" offset="4CE24" default="0F" />
  </Patch>


Heh heh. As for the pseudoinstructions here (li and move), so far I'm only allowing them if they map one-to-one to an instruction, but I may put in support for multi-instruction ones. You can also safely assume variables are patched in after the code itself, so you can write code and then just overwrite it with the variable, instead of trying to fool with the <Variable> and <Location> tags so they match up exactly, as I do here.
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 06, 2012, 10:36:40 pm
/me opens spoiler and reacts

(http://i221.photobucket.com/albums/dd289/Pride_Nick/Al-bundy-ed-oneill-animated-gif-2.gif)

Also the inventory section in the patcher does not work, would you be able to fix this?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 06, 2012, 11:26:23 pm
D:

I thought I fixed that a few months ago (the posts are earlier in this thread). Is it back to not working somehow or are you just not using one of our newer versions?
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 07, 2012, 12:20:02 am
I must not be using a newer version... I'll double check later

Edit: It works I must have accidently patched with .457 or something. :x Sorry for the scare
Title: Re: FFT Patcher .478 Source Code
Post by: Kourama on April 10, 2012, 08:34:33 am
Will most of the FFT Patcher changes you have made work in WotL?

Also Eternal was nice enough to supply me with a copy of his .fftext file for WotL KO because of the restrictions to patching the WotL version. Is there a way to add an option to FFTactext to remove the kanji code for the PSP version?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 10, 2012, 11:31:35 am
The PSP version doesn't have the expanded QuickEdit for TacText, at least as of yet. Adding it in would basically consist of mindlessly editing an XML file. If anyone's interested I can probably send the file and what you'd need to do.

I believe FFTorgASM hardcodes PSX values (locations of files in the ISO, etc) in a few places. Current ASM hacks don't work for PSP anyway.

Other than that, most changes should also apply to PSP. Pretty much every change to Patcher/Shishi should.

Is there a way to delete all the kanji? Probably... there usually is... but I might have to know each specific section that would have to be blanked.
Title: Re: FFT Patcher .478 Source Code
Post by: Kourama on April 10, 2012, 08:52:52 pm
Good to know. I knew about the asm hacks though.
Title: Re: FFT Patcher .478 Source Code
Post by: MysticKnightFF5 on April 13, 2012, 08:01:56 pm
Could we get some ctrl + v and ctrl + c all up in this shit?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 13, 2012, 09:23:02 pm
Er... what specifically should be copy-pasteable that isn't?
Title: Re: FFT Patcher .478 Source Code
Post by: MysticKnightFF5 on April 14, 2012, 08:18:45 pm
No no no, not adding in copy/pasta, just adding a shortcut to it.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 14, 2012, 10:39:49 pm
Well okay, so you're saying there are places where you can copy/paste but you can't use ctrl+c and ctrl+v? Where is that?
Title: Re: FFT Patcher .478 Source Code
Post by: MysticKnightFF5 on April 15, 2012, 12:03:43 am
In no areas can I use ctrl + c and ctrl + v.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 15, 2012, 12:27:07 am
Strange. Textboxes should allow that by default. It works for me.
Title: Re: FFT Patcher .478 Source Code
Post by: MysticKnightFF5 on April 15, 2012, 12:28:25 am
No, in FFTPatcher itself, for the cloning and pasting, not for FFTactext.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 15, 2012, 04:17:32 am
Can't you just right click on a selection and select copy difference / copy all?  I recall that working for spells and ENTDs.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 15, 2012, 01:04:41 pm
I have a question about XML and the patcher resources files.

About the resource files, i know you can generate a resources.zip, and then edit the words contained in those files, but then what do you have to do to apply those changes to the patcher. Where does the patcher application look to display that information?

About XML, I was wondering how they work in general. All I know is that they follow a certain format and apply changes, but i have no clue actually what they are or how they're used in a general sense. I'm guessing they're used by the main program, be it patcher, fftorgasm, etc.?

Thanks!
Title: Re: FFT Patcher .478 Source Code
Post by: MysticKnightFF5 on April 15, 2012, 02:43:32 pm
You can, but did I say you couldn't? It's too slow to do that in masses.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 15, 2012, 04:59:21 pm
I see what you mean now about copy/paste. For the record, it helps to be specific about these things.

I might be able to implement that... it comes down to trapping ctrl+c and ctrl+v and calling the appropriate copy/paste functions in the various tabs. Abilities have multiple paste options though... so I'd probably make ctrl+v be Paste All.

For the resource files, I believe all you have to do is re-zip your edits into Resources.zip and make sure it's in the same directory as the executable. FFTP looks for a Resources.zip in its main directory, and if it finds one, uses that instead of the standard naming.

XML is just a convenient format to represent data as a string of characters ("string" data type). Since it's a standard format, there are common functions already written that can be used by programs to parse XML and to return the data inside of it. There really isn't anything more to it than that. It's simply data. It's up to the program to use that data for something. FFTorgASM is set up to look at all *.xml files in a directory and load in everything in a <Patch> tag as a patch. It parses the tags to figure out what needs to be patched in the disc image and where.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 15, 2012, 07:22:51 pm
exactly what I was looking for, thanks much Glain!
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 16, 2012, 02:01:52 pm
@Glain:
Could you add the ability to edit things that don't matter in the game, to FFTPatcher?  Like the unused ability data for R/S/M abilties, as well as HP and MP bonuses to Shields?

Because a lot of that stuff depends on hard-coded offsets (and tables), and as those offsets are discovered and documented, we gain the ability to trade R/S/M abilities for more Action abilities, and the ability to modify the mechanics of the abilities in hard-coded skillsets (such as Item, Charge, Jump, Throw, Draw Out, and Math Skill).
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 16, 2012, 03:00:34 pm
That data doesn't exist, as far as I'm aware. The ability bytes mean different things based on what kind of ability you're looking at. Some have less data than others. (See SA's Data Locations.txt)

FFTPatcher generally presents all the data it can pull in for a specific item, whether we know what it means or not. It wouldn't really know how to hide 'irrelevant' data.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 16, 2012, 03:31:17 pm
I know that the HP and MP bonuses exist for shields, because someone talked about it, and about how you can edit them via hex editor.  I don't know about the rest - I simply assumed that the R/S/M and Item/Charge/Jump/Throw/Math Skill were the same.

If you can give me an address for where these things are in Battle.bin or SCUS, then I can check for myself.
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 16, 2012, 03:33:47 pm
80062eb8 - Item Data Start (12 bytes each)

   0x00 - Palette
   0x01 - Sprite ID
   0x02 - Required Level (for random generation)
   0x03: Type Flags
      0x80 - Weapon
      0x40 - Shield
      0x20 - Headgear
      0x10 - Armor
      0x08 - Accessory
      0x04 -
      0x02 - Rare
      0x01 -
   0x04 - Second Table ID
   0x05: Item Type
      01 - Knife
      02 - Ninja Blade
      03 - Sword
      04 - Knight Sword
      05 - Katana
      06 - Axe
      07 - Rod
      08 - Staff
      09 - Flail
      0a - Gun
      0b - Crossbow
      0c - Bow
      0d - Instrument
      0e - Book
      0f - Polearm
      10 - Pole
      11 - Bag
      12 - Cloth
      13 - Shield
      14 - Helmet
      15 - Hat
      16 - Hair Adornment
      17 - Armor
      18 - Clothing
      19 - Robe
      1a - Shoes
      1b - Armguard
      1c - Ring
      1d - Armlet
      1e - Cloak
      1f - Perfume
      20 - Throwing
      21 - Bomb
      22 - Chemist Item
   0x06 -
   0x07 - Item Attributes
   0x08 - Price
   0x0a - Shop Availability
   0x0b -

Correct me if I'm wrong, but I'm pretty sure bytes x06 and x0b are not found in the patcher?

Edit: You can search PGF but the data does not exist to give HP/MP bonus to shields.
The information above and below is the entire weapon data you can find, which after it starts the Inflict Status data. Minus -0xf800 to get to the SCUS offset.

80063ab8 - Weapon Secondary Data
   0x00 - Range
   0x01 - Attack Flags
      0x80 - Striking
      0x40 - Lunging
      0x20 - Direct
      0x10 - Arc
      0x08 - 2 Swords
      0x04 - 2 Hands
      0x02 - Throwable
      0x01 - Forced 2 Hands
   0x02 - Formula
   0x03 -
   0x04 - Weapon Power
   0x05 - Evade
   0x06: Element
      0x80 - Fire
      0x40 - Lightning
      0x20 - Ice
      0x10 - Wind
      0x08 - Earth
      0x04 - Water
      0x02 - Holy
      0x01 - Dark
   0x07 - Inflict Status/Cast Spell

80063eb8 - Shield Secondary Data
   0x00 - Physical Evade
   0x01 - Magical Evade

80063ed8 - Helm/Armor Secondary Data
   0x00 - HP Bonus
   0x01 - MP Bonus

80063f58 - Accessory Secondary Data
   0x00 - Physical Evade
   0x01 - Magical Evade

80063f98 - Item Secondary Data
   0x00 - Formula
   0x01 - Z value
   0x02 - Inflict Status ID
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 16, 2012, 03:36:16 pm
RAM to SCUS_942.21: Subtract 0xF800
RAM to BATTLE.BIN: Subtract 0x67000

I ssume that is SCUS_942.21, correct?

0x536B8 in SCUS, if correct.
341688 in decimal.

12 offsets
256 entries
3072 bytes total

341688 in decimal.  First byte.
344760 in decimal.  Last byte.

0x536B8
0x542B8

Wait a minute, why am I doing this when I can look up the Gameshark Handbook by Aerostar?
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 16, 2012, 03:43:15 pm
Yes, that is in SCUS
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 16, 2012, 03:50:44 pm
-===============-
EQUIPMENT BYTES I
-===============-

Thanks to NeoKamek for figuring a lot of these out, especially the
graphics!

BASEADDR +0 :  palette \  Best to just look these up in the table to
BASEADDR +1 :  graphic /  get the custom palette and graphic you want.

BASEADDR +2 :  weapon power / predicted evade%
                again, each weapon has its own entry so you can just
                look in the table to mimic any weapon you want.

BASEADDR +3 :  equipment type graphic:
               01 = Dagger           12 = Cloth
               02 = Ninja Sword      13 = Shield
               03 = Sword            14 = Helmet
               04 = Knight Sword     15 = Hat
               05 = Katana           16 = Ribbon
               06 = Axe              17 = Armor
               07 = Rod              18 = Clothes
               08 = Staff            19 = Robe
               09 = Flail            1A = Shoes
               0A = Gun              1B = Gauntlet
               0B = Crossbow         1C = Ring
               0C = Bow              1D = Armlet
               0D = Harp             1E = Mantle
               0E = Dictionary       1F = Perfume
               0F = Spear            20 = Shuriken
               10 = Stick            21 = Ball
               11 = Bag              22 = Chemist item

BASEADDR +4 :  identification number

BASEADDR +5 :  type of equipment (same digits as BASEADDR +3)

BASEADDR +6 :  always 0

BASEADDR +7 :  extra effects (again, just look in the table
               at the item whose effect you want to mimic)
               Some new ones discovered by NeoKamek:
               73 = Move +1, Jump +2
               84 = Move +2, Jump +9, PA +92
               85 = Move +2, Jump +3
               89 = Move +6, Jump +7, PA +92
               8F = Move +0
               91 = Move +8

BASEADDR +8 :  price, low byte
BASEADDR +9 :  price, high byte

BASEADDR +A :  when enemies start to carry the item
               01 - 0E = at progressive points through the game
               14 = never

BASEADDR +B :  always 0


(weapons I)

  BASEADDR   +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
+------------------------------------------------+-----------------+
| 30062EB8 | 00 00 00 80 00 00 00 00 00 00 00 00 | <BLANK>         |
+----------+-------------------------------------+-----------------+
| 30062EC4 | 00 01 01 80 01 01 00 00 64 00 01 00 | Dagger          |
| 30062ED0 | 00 02 03 80 02 01 00 00 F4 01 02 00 | Mythril Knife   |
| 30062EDC | 00 04 07 80 03 01 00 00 20 03 03 00 | Blind Knife     |
| 30062EE8 | 02 06 0B 80 04 01 00 00 DC 05 04 00 | Mage Masher     |
| 30062EF4 | 04 01 0E 80 05 01 00 00 08 07 06 00 | Platina Dagger  |
| 30062F00 | 00 03 15 80 06 01 00 00 B8 0B 0A 00 | Main Gauche     |
| 30062F0C | 04 05 19 80 07 01 00 00 A0 0F 0B 00 | Orichalcum      |
| 30062F18 | 00 06 1D 80 08 01 00 00 88 13 0C 00 | Assassin Dagger |
| 30062F24 | 04 02 21 80 09 01 00 00 40 1F 0E 00 | Air Knife       |
| 30062F30 | 02 04 5F 82 0A 01 00 00 E0 2E 14 00 | Zorlin Shape    |
+----------+-------------------------------------+-----------------+
| 30062F3C | 00 07 0A 80 0B 02 00 00 B8 0B 09 00 | Hidden Knife    |
| 30062F48 | 00 09 0D 80 0C 02 00 00 88 13 0A 00 | Ninja Knife     |
| 30062F54 | 00 08 0F 80 0D 02 00 00 58 1B 0B 00 | Short Edge      |
| 30062F60 | 02 07 16 80 0E 02 00 00 10 27 0C 00 | Ninja Edge      |
| 30062F6C | 04 08 1B 80 0F 02 00 00 80 3E 0D 00 | Spell Edge      |
| 30062F78 | 04 07 5F 82 10 02 00 00 0A 00 14 00 | Sasuke Knife    |
| 30062F84 | 0D 0A 60 82 11 02 00 00 0A 00 14 00 | Iga Knife       |
| 30062F90 | 0B 0B 60 82 12 02 00 00 0A 00 14 00 | Koga Knife      |
+----------+-------------------------------------+-----------------+
| 30062F9C | 00 0C 01 80 13 03 00 00 C8 00 01 00 | Broad Sword     |
| 30062FA8 | 00 0D 04 80 14 03 00 00 F4 01 02 00 | Long Sword      |
| 30062FB4 | 02 0E 07 80 15 03 00 00 84 03 03 00 | Iron Sword      |
| 30062FC0 | 02 0F 09 80 16 03 00 00 40 06 04 00 | Mythril Sword   |
| 30062FCC | 03 0E 0C 82 17 03 00 00 C4 09 05 00 | Blood Sword     |
| 30062FD8 | 01 10 0F 80 18 03 00 00 E4 0C 06 00 | Coral Sword     |
| 30062FE4 | 03 0F 15 80 19 03 00 00 88 13 09 00 | Ancient Sword   |
| 30062FF0 | 04 0C 17 80 1A 03 00 00 88 13 0A 00 | Sleep Sword     |
| 30062FFC | 04 11 1C 80 1B 03 00 00 F8 2A 0C 00 | Platinum Sword  |
| 30063008 | 00 12 1A 80 1C 03 00 00 40 1F 0B 00 | Diamond Sword   |
| 30063014 | 01 0D 22 80 1D 03 00 00 B0 36 0D 00 | Ice Brand       |
| 30063020 | 04 13 25 80 1E 03 00 01 20 4E 0E 00 | Rune Blade      |
| 3006302C | 03 14 5F 82 1F 03 00 00 0A 00 14 00 | Nagrarock       |
| 30063038 | 01 15 60 82 20 03 00 00 0A 00 14 00 | Materia Blade   |
+----------+-------------------------------------+-----------------+
| 30063044 | 03 16 5C 82 21 04 00 00 40 9C 14 00 | Defender        |
| 30063050 | 00 17 5F 82 22 04 00 02 0A 00 14 00 | Save the Queen  |
| 3006305C | 03 18 60 82 23 04 00 03 0A 00 14 00 | Excalibur       |
| 30063068 | 04 19 61 82 24 04 00 04 0A 00 14 00 | Ragnarok        |
| 30063074 | 04 16 62 82 25 04 00 05 0A 00 14 00 | Chaos Blade     |
+----------+-------------------------------------+-----------------+
| 30063080 | 00 1A 09 80 26 05 00 00 40 06 07 00 | Asura Knife     |
| 3006308C | 01 1B 0C 80 27 05 00 00 B8 0B 07 00 | Koutetsu Knife  |
| 30063098 | 01 1C 0F 80 28 05 00 00 88 13 08 00 | Bizen Boat      |
| 300630A4 | 04 1A 15 80 29 05 00 00 58 1B 09 00 | Murasame        |
| 300630B0 | 04 1D 18 80 2A 05 00 00 40 1F 0A 00 | Heaven's Cloud  |
| 300630BC | 05 1C 1B 80 2B 05 00 00 10 27 0C 00 | Kiyomori        |
| 300630C8 | 03 1E 1E 80 2C 05 00 00 98 3A 0D 00 | Muramasa        |
| 300630D4 | 05 1F 21 80 2D 05 00 00 F0 55 0E 00 | Kikuichimoji    |
| 300630E0 | 05 1B 5F 82 2E 05 00 00 0A 00 14 00 | Masamune        |
| 300630EC | 03 1A 60 82 2F 05 00 00 0A 00 14 00 | Chirijiraden    |
+----------+-------------------------------------+-----------------+
| 300630F8 | 00 20 04 80 30 06 00 00 DC 05 04 00 | Battle Axe      |
| 30063104 | 0F 21 0C 80 31 06 00 00 A0 0F 07 00 | Giant Axe       |
| 30063110 | 05 22 1F 80 32 06 00 00 E0 2E 0A 00 | Slasher         |
+----------+-------------------------------------+-----------------+
| 3006311C | 05 23 01 80 33 07 00 00 C8 00 01 00 | Rod             |
| 30063128 | 02 25 05 80 34 07 00 06 90 01 03 00 | Thunder Rod     |
| 30063134 | 06 24 05 80 35 07 00 07 90 01 03 00 | Flame Rod       |
| 30063140 | 01 25 05 80 36 07 00 08 90 01 03 00 | Ice Rod         |
| 3006314C | 06 24 0C 80 37 07 00 00 F4 01 06 00 | Poison Rod      |
| 30063158 | 00 26 17 80 38 07 00 09 40 1F 0B 00 | Wizard Rod      |
| 30063164 | 07 24 5F 82 39 07 00 00 E0 2E 14 00 | Dragon Rod      |
| 30063170 | 03 25 60 82 3A 07 00 49 0A 00 14 00 | Faith Rod       |
+----------+-------------------------------------+-----------------+
| 3006317C | 03 27 01 80 3B 08 00 00 78 00 01 00 | Oak Staff       |
| 30063188 | 02 27 05 80 3C 08 00 00 20 03 03 00 | White Staff     |
| 30063194 | 00 28 09 82 3D 08 00 00 A0 0F 04 00 | Healing Staff   |
| 300631A0 | 01 27 0C 80 3E 08 00 00 98 08 06 00 | Rainbow Staff   |
| 300631AC | 03 29 0F 80 3F 08 00 0A A0 0F 08 00 | Wizard Staff    |
| 300631B8 | 02 29 18 80 40 08 00 00 58 1B 0B 00 | Gold Staff      |
| 300631C4 | 00 2A 5F 82 41 08 00 0B 0A 00 14 00 | Mace of Zeus    |
| 300631D0 | 02 2A 60 82 42 08 00 00 0A 00 14 00 | Sage Staff      |
+----------+-------------------------------------+-----------------+
| 300631DC | 02 2B 0A 80 43 09 00 00 B0 04 08 00 | Flail           |
| 300631E8 | 01 2B 14 80 44 09 00 00 A0 0F 0A 00 | Flame Whip      |
| 300631F4 | 00 2B 20 80 45 09 00 00 28 23 0C 00 | Morning Star    |
| 30063200 | 03 2B 5A 82 46 09 00 00 40 9C 14 00 | Scorpion Tail   |
+----------+-------------------------------------+-----------------+
| 3006320C | 05 2C 0B 82 47 0A 00 00 88 13 07 00 | Romanda Gun     |
| 30063218 | 07 2C 0F 82 48 0A 00 00 98 3A 0A 00 | Mythril Gun     |
| 30063224 | 00 2D 5F 82 49 0A 00 48 0A 00 14 00 | Stone Gun       |
| 30063230 | 03 2E 5B 82 4A 0A 00 00 0A 00 14 00 | Blaze Gun       |
| 3006323C | 05 2E 5C 82 4B 0A 00 00 0A 00 14 00 | Glacier Gun     |
| 30063248 | 07 2E 5D 82 4C 0A 00 00 0A 00 14 00 | Blast Gun       |
+----------+-------------------------------------+-----------------+
| 30063254 | 03 2F 01 80 4D 0B 00 00 90 01 01 00 | Bow Gun         |
| 30063260 | 01 2F 05 82 4E 0B 00 00 DC 05 04 00 | Night Killer    |
| 3006326C | 07 2F 0B 80 4F 0B 00 00 D0 07 07 00 | Cross Bow       |
| 30063278 | 06 30 0E 80 50 0B 00 00 A0 0F 09 00 | Poison Bow      |
| 30063284 | 07 30 18 80 51 0B 00 00 40 1F 0B 00 | Hunting Bow     |
| 30063290 | 02 30 21 82 52 0B 00 00 20 4E 0E 00 | Gastrafitis     |
+----------+-------------------------------------+-----------------+
| 3006329C | 03 31 02 80 53 0C 00 00 20 03 03 00 | Long Bow        |
| 300632A8 | 02 31 06 80 54 0C 00 00 DC 05 04 00 | Silver Bow      |
| 300632B4 | 05 31 0B 80 55 0C 00 00 D0 07 05 00 | Ice Bow         |
| 300632C0 | 00 32 0F 80 56 0C 00 00 B8 0B 07 00 | Lightning Bow   |
| 300632CC | 07 31 1B 80 57 0C 00 00 40 1F 0B 00 | Windslash Bow   |
| 300632D8 | 07 33 14 80 58 0C 00 00 88 13 09 00 | Mythril Bow     |
| 300632E4 | 01 33 25 80 59 0C 00 00 F0 55 0E 00 | Ultimus Bow     |
| 300632F0 | 03 34 34 82 5A 0C 00 00 0A 00 14 00 | Yoichi Bow      |
| 300632FC | 05 35 35 82 5B 0C 00 00 0A 00 14 00 | Perseus Bow     |
+----------+-------------------------------------+-----------------+
| 30063308 | 03 36 0D 80 5C 0D 00 00 88 13 07 00 | Ramia Harp      |
| 30063314 | 06 36 19 80 5D 0D 00 00 10 27 0B 00 | Bloody Strings  |
| 30063320 | 02 36 24 82 5E 0D 00 00 30 75 14 00 | Fairy Harp      |
+----------+-------------------------------------+-----------------+
| 3006332C | 02 37 0D 80 5F 0E 00 00 B8 0B 07 00 | Battle Dict     |
| 30063338 | 07 37 17 80 60 0E 00 00 70 17 0A 00 | Monster Dict    |
| 30063344 | 05 37 22 80 61 0E 00 00 10 27 0B 00 | Papyrus Plate   |
| 30063350 | 03 37 5F 82 62 0E 00 00 30 75 14 00 | Madlemgen       |
+----------+-------------------------------------+-----------------+
| 3006335C | 02 38 0C 80 63 0F 00 00 E8 03 05 00 | Javelin         |
| 30063368 | 01 3B 10 80 64 0F 00 00 D0 07 07 00 | Spear           |
| 30063374 | 04 39 15 80 65 0F 00 00 94 11 09 00 | Mythril Spear   |
| 30063380 | 07 3B 19 80 66 0F 00 00 58 1B 0B 00 | Partisan        |
| 3006338C | 04 3A 1D 80 67 0F 00 00 10 27 0E 00 | Oberisk         |
| 30063398 | 02 3C 5F 82 68 0F 00 00 A0 8C 14 00 | Holy Lance      |
| 300633A4 | 05 38 60 82 69 0F 00 00 E0 AB 14 00 | Dragon Whisker  |
| 300633B0 | 06 3C 61 82 6A 0F 00 00 E8 03 14 00 | Javelin         |
+----------+-------------------------------------+-----------------+
| 300633BC | 00 3D 09 80 6B 10 00 00 E8 03 06 00 | Cypress Rod     |
| 300633C8 | 07 3E 0D 80 6C 10 00 00 78 05 07 00 | Battle Bamboo   |
| 300633D4 | 02 3D 15 80 6D 10 00 00 60 09 09 00 | Musk Rod        |
| 300633E0 | 01 3E 18 80 6E 10 00 00 A0 0F 0A 00 | Iron Fan        |
| 300633EC | 03 3F 1B 80 6F 10 00 00 4C 1D 0B 00 | Gokuu Rod       |
| 300633F8 | 06 40 5F 82 70 10 00 00 10 27 14 00 | Ivory Rod       |
| 30063404 | 00 3F 28 80 71 10 00 00 20 4E 0E 00 | Octagon Rod     |
| 30063410 | 03 41 60 82 72 10 00 00 88 90 14 00 | Whale Whisker   |
+----------+-------------------------------------+-----------------+
| 3006341C | 02 42 50 82 73 11 00 0C 08 CF 09 00 | C Bag           |
| 30063428 | 07 42 51 82 74 11 00 00 60 EA 14 00 | FS Bag          |
| 30063434 | 05 42 52 82 75 11 00 0D 20 CB 0B 00 | P Bag           |
| 30063440 | 01 42 53 82 76 11 00 0E 90 E2 0E 00 | H Bag           |
+----------+-------------------------------------+-----------------+
| 3006344C | 05 43 18 80 77 12 00 00 58 1B 0A 00 | Persia          |
| 30063458 | 07 44 1D 80 78 12 00 00 98 3A 0C 00 | Cashmere        |
| 30063464 | 06 43 5F 82 79 12 00 00 40 9C 14 00 | Ryozan Silk     |
+----------+-------------------------------------+-----------------+
| 30063470 | 00 45 01 80 7A 20 00 00 32 00 05 00 | Shuriken        |
| 3006347C | 03 45 12 80 7B 20 00 00 2C 01 0A 00 | Magic Shuriken  |
| 30063488 | 01 45 21 80 7C 20 00 00 E8 03 0D 00 | Yagyu Darkness  |
+----------+-------------------------------------+-----------------+
| 30063494 | 03 46 01 80 7D 21 00 00 FA 00 07 00 | Fire Ball       |
| 300634A0 | 05 46 12 80 7E 21 00 00 FA 00 07 00 | Water Ball      |
| 300634AC | 02 46 1D 80 7F 21 00 00 FA 00 07 00 | Lightning Ball  |
+----------+-------------------------------------+-----------------+


(shields I)

  BASEADDR   +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
+----------+-------------------------------------+-----------------+
| 300634B8 | 00 47 01 40 00 13 00 00 90 01 01 00 | Escutcheon      |
| 300634C4 | 02 4C 03 40 01 13 00 00 BC 02 03 00 | Buckler         |
| 300634D0 | 01 48 06 40 02 13 00 00 B0 04 04 00 | Bronze Shield   |
| 300634DC | 07 4C 09 40 03 13 00 00 40 06 05 00 | Round Shield    |
| 300634E8 | 05 4A 0C 40 04 13 00 00 C4 09 06 00 | Mythril Shield  |
| 300634F4 | 00 4E 0F 40 05 13 00 00 AC 0D 07 00 | Gold Shield     |
| 30063500 | 01 49 16 40 06 13 00 0F 70 17 09 00 | Ice Shield      |
| 3006350C | 03 4F 16 40 07 13 00 10 64 19 09 00 | Flame Shield    |
| 30063518 | 03 49 16 40 08 13 00 11 10 27 0A 00 | Aegis Shield    |
| 30063524 | 05 4D 19 40 09 13 00 00 E0 2E 0B 00 | Diamond Shield  |
| 30063530 | 01 4A 1D 40 0A 13 00 00 80 3E 0D 00 | Platina Shield  |
| 3006353C | 01 4D 24 40 0B 13 00 00 08 52 0E 00 | Crystal Shield  |
| 30063548 | 05 49 24 42 0C 13 00 00 0A 00 14 00 | Genji Shield    |
| 30063554 | 01 4C 27 42 0D 13 00 12 0A 00 14 00 | Kaiser Plate    |
| 30063560 | 03 4B 28 42 0E 13 00 13 0A 00 14 00 | Venetian Shield |
| 3006356C | 07 4E 32 42 0F 13 00 00 90 01 14 00 | Escutcheon      |
+----------+-------------------------------------+-----------------+


(armor I)

  BASEADDR   +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
+----------+-------------------------------------+-----------------+
| 30063578 | 00 50 01 20 00 14 00 00 C8 00 01 00 | Leather Helmet  |
| 30063584 | 0D 51 04 20 01 14 00 00 F4 01 02 00 | Bronze Helmet   |
| 30063590 | 09 51 07 20 02 14 00 00 E8 03 03 00 | Iron Helmet     |
| 3006359C | 0B 52 09 20 03 14 00 00 DC 05 05 00 | Barbuta         |
| 300635A8 | 0A 53 0C 20 04 14 00 00 34 08 06 00 | Mythril Helmet  |
| 300635B4 | 00 53 0F 20 05 14 00 00 F0 0A 07 00 | Gold Helmet     |
| 300635C0 | 0D 54 11 20 06 14 00 00 A0 0F 08 00 | Cross Helmet    |
| 300635CC | 0C 55 16 20 07 14 00 00 70 17 0A 00 | Diamond Helmet  |
| 300635D8 | 0A 56 19 20 08 14 00 00 40 1F 0C 00 | Platina Helmet  |
| 300635E4 | 0B 57 1D 20 09 14 00 00 10 27 0C 00 | Circlet         |
| 300635F0 | 09 55 1B 20 0A 14 00 00 B0 36 0E 00 | Crystal Helmet  |
| 300635FC | 0C 58 24 22 0B 14 00 00 0A 00 14 00 | Genji Helmet    |
| 30063608 | 09 59 28 22 0C 14 00 14 0A 00 14 00 | Grand Helmet    |
+----------+-------------------------------------+-----------------+
| 30063614 | 0B 5A 01 20 0D 15 00 00 96 00 01 00 | Leather Hat     |
| 30063620 | 0D 5B 04 20 0E 15 00 00 5E 01 02 00 | Feather Hat     |
| 3006362C | 0C 5C 07 20 0F 15 00 00 20 03 03 00 | Red Hood        |
| 30063638 | 0A 5D 0A 20 10 15 00 15 B0 04 05 00 | Headgear        |
| 30063644 | 0C 5E 0D 20 11 15 00 16 08 07 06 00 | Triangle Hat    |
| 30063650 | 0B 5F 10 20 12 15 00 17 B8 0B 07 00 | Green Beret     |
| 3006365C | 02 60 15 20 13 15 00 18 88 13 09 00 | Twist Headband  |
| 30063668 | 0B 61 18 20 14 15 00 19 70 17 0A 00 | Holy Miter      |
| 30063674 | 0F 5C 1B 20 15 15 00 00 58 1B 0B 00 | Black Hood      |
| 30063680 | 0B 62 20 20 16 15 00 1A E0 2E 0C 00 | Golden Hairpin  |
| 3006368C | 0D 63 26 20 17 15 00 1B 80 3E 0E 00 | Flash Hat       |
| 30063698 | 09 5F 2E 20 18 15 00 1C B8 88 0F 00 | Thief Hat       |
+----------+-------------------------------------+-----------------+
| 300636A4 | 0B 64 32 22 19 16 00 45 20 4E 14 00 | Cachusha        |
| 300636B0 | 0C 65 33 22 1A 16 00 46 20 4E 14 00 | Barette         |
| 300636BC | 0B 66 34 22 1B 16 00 47 60 EA 14 00 | Ribbon          |
+----------+-------------------------------------+-----------------+
| 300636C8 | 00 6A 01 10 1C 17 00 00 C8 00 01 00 | Leather Armor   |
| 300636D4 | 0B 6B 04 10 1D 17 00 00 58 02 02 00 | Linen Cuirass   |
| 300636E0 | 0E 67 06 10 1E 17 00 00 20 03 03 00 | Bronze Armor    |
| 300636EC | 03 6C 08 10 1F 17 00 00 14 05 04 00 | Chain Mail      |
| 300636F8 | 09 67 0B 10 20 17 00 00 D0 07 05 00 | Mythril Armor   |
| 30063704 | 00 68 0E 10 21 17 00 00 B8 0B 06 00 | Plate Mail      |
| 30063710 | 02 68 11 10 22 17 00 00 10 0E 07 00 | Gold Armor      |
| 3006371C | 0A 69 16 10 23 17 00 00 70 17 0A 00 | Diamond Armor   |
| 30063728 | 08 6D 1A 10 24 17 00 00 28 23 0C 00 | Platina Armor   |
| 30063734 | 08 6E 1E 10 25 17 00 00 C8 32 0D 00 | Carabini Mail   |
| 30063740 | 05 69 25 10 26 17 00 00 38 4A 0E 00 | Crystal Mail    |
| 3006374C | 03 6F 25 12 27 17 00 00 0A 00 14 00 | Genji Armor     |
| 30063758 | 03 70 27 12 28 17 00 1D 50 46 0E 00 | Reflect Mail    |
| 30063764 | 0D 71 2D 12 29 17 00 00 0A 00 14 00 | Maximillian     |
+----------+-------------------------------------+-----------------+
| 30063770 | 06 74 01 10 2A 18 00 00 96 00 01 00 | Clothes         |
| 3006377C | 03 75 03 10 2B 18 00 00 2C 01 02 00 | Leather Outfit  |
| 30063788 | 02 76 05 10 2C 18 00 00 F4 01 03 00 | Leather Vest    |
| 30063794 | 06 77 07 10 2D 18 00 00 84 03 04 00 | Chain Vest      |
| 300637A0 | 04 73 0A 10 2E 18 00 00 DC 05 05 00 | Mythril Vest    |
| 300637AC | 0B 73 0C 10 2F 18 00 00 40 06 06 00 | Adaman Vest     |
| 300637B8 | 03 78 0E 10 30 18 00 00 6C 07 07 00 | Wizard Outfit   |
| 300637C4 | 01 79 11 10 31 18 00 00 C4 09 08 00 | Brigandine      |
| 300637D0 | 00 7A 15 10 32 18 00 1E A0 0F 0A 00 | Judo Outfit     |
| 300637DC | 03 7B 19 10 33 18 00 1F 58 1B 0B 00 | Power Sleeve    |
| 300637E8 | 0B 7C 1D 10 34 18 00 20 10 27 0D 00 | Earth Clothes   |
| 300637F4 | 03 72 23 12 35 18 00 21 0A 00 14 00 | Secret Clothes  |
| 30063800 | 0B 72 25 10 36 18 00 22 E0 2E 0E 00 | Black Costume   |
| 3006380C | 03 7D 32 12 37 18 00 23 80 BB 14 00 | Rubber Costume  |
+----------+-------------------------------------+-----------------+
| 30063818 | 06 7E 03 10 38 19 00 00 B0 04 03 00 | Linen Robe      |
| 30063824 | 01 7E 05 10 39 19 00 00 60 09 04 00 | Silk Robe       |
| 30063830 | 0B 7F 0B 10 3A 19 00 24 A0 0F 07 00 | Wizard Robe     |
| 3006383C | 0B 80 10 12 3B 19 00 25 88 13 0A 00 | Chameleon Robe  |
| 30063848 | 0C 81 1A 10 3C 19 00 26 28 23 0B 00 | White Robe      |
| 30063854 | 0C 82 1F 10 3D 19 00 27 C8 32 0C 00 | Black Robe      |
| 30063860 | 0D 83 26 10 3E 19 00 28 30 75 0E 00 | Light Robe      |
| 3006386C | 0D 7F 2D 12 3F 19 00 29 0A 00 14 00 | Robe of Lords   |
+----------+-------------------------------------+-----------------+


(accessories I)

  BASEADDR   +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
+----------+-------------------------------------+-----------------+
| 30063878 | 00 84 0A 08 00 1A 00 2A E8 03 02 00 | Battle Boots    |
| 30063884 | 00 85 14 08 01 1A 00 2B B0 04 05 00 | Spike Shoes     |
| 30063890 | 01 86 1E 08 02 1A 00 2C 88 13 0A 00 | Germinas Boots  |
| 3006389C | 01 87 05 0A 03 1A 00 2D DC 05 07 00 | Rubber Shoes    |
| 300638A8 | 02 88 32 0A 04 1A 00 2E C4 09 09 00 | Feather Boots   |
| 300638B4 | 05 89 1E 0A 05 1A 00 2F 58 1B 0C 00 | Sprint Shoes    |
| 300638C0 | 03 8A 28 0A 06 1A 00 30 10 27 0E 00 | Red Shoes       |
+----------+-------------------------------------+-----------------+
| 300638CC | 00 8B 14 08 07 1B 00 31 88 13 06 00 | Power Wrist     |
| 300638D8 | 03 8C 32 0A 08 1B 00 32 0A 00 14 00 | Genji Gauntlet  |
| 300638E4 | 03 8D 23 08 09 1B 00 33 20 4E 09 00 | Magic Gauntlet  |
| 300638F0 | 04 8E 3C 08 0A 1B 00 34 50 C3 0C 00 | Bracer          |
+----------+-------------------------------------+-----------------+
| 300638FC | 00 8F 32 0A 0B 1C 00 35 10 27 09 00 | Reflect Ring    |
| 30063908 | 06 8F 19 08 0C 1C 00 36 88 13 07 00 | Defense Ring    |
| 30063914 | 00 90 19 08 0D 1C 00 37 10 27 0B 00 | Magic Ring      |
| 30063920 | 04 90 05 0A 0E 1C 00 38 0A 00 14 00 | Cursed Ring     |
| 3006392C | 08 91 19 0A 0F 1C 00 39 20 4E 0D 00 | Angel Ring      |
+----------+-------------------------------------+-----------------+
| 30063938 | 04 92 1A 08 10 1D 00 3A 88 13 08 00 | Diamond Armlet  |
| 30063944 | 0B 93 19 08 11 1D 00 3B 10 27 0A 00 | Jade Armlet     |
| 30063950 | 00 94 19 08 12 1D 00 3C 98 3A 0B 00 | 108 Gems        |
| 3006395C | 0B 95 19 08 13 1D 00 3D 10 27 09 00 | N-Kai Armlet    |
| 30063968 | 06 96 19 08 14 1D 00 3E 58 1B 07 00 | Defense Armlet  |
+----------+-------------------------------------+-----------------+
| 30063974 | 09 97 0A 08 15 1E 00 00 2C 01 03 00 | Small Mantle    |
| 30063980 | 0E 98 14 08 16 1E 00 00 20 03 05 00 | Leather Mantle  |
| 3006398C | 0D 99 1E 08 17 1E 00 3F D0 07 07 00 | Wizard Mantle   |
| 30063998 | 0B 9A 28 08 18 1E 00 00 40 1F 0A 00 | Elf Mantle      |
| 300639A4 | 0E 9B 31 08 19 1E 00 00 98 3A 0C 00 | Dracula Mantle  |
| 300639B0 | 0D 9C 32 08 1A 1E 00 00 20 4E 0E 00 | Feather Mantle  |
| 300639BC | 0E 9D 05 0A 1B 1E 00 40 0A 00 14 00 | Vanish Mantle   |
+----------+-------------------------------------+-----------------+
| 300639C8 | 0B 9E 05 0A 1C 1F 00 41 60 EA 14 00 | Chantage        |
| 300639D4 | 0D 9F 05 0A 1D 1F 00 42 60 EA 14 00 | Cherche         |
| 300639E0 | 02 A0 05 0A 1E 1F 00 43 60 EA 14 00 | Setiemson       |
| 300639EC | 08 A1 05 0A 1F 1F 00 44 60 EA 14 00 | Salty Rage      |
+----------+-------------------------------------+-----------------+


(items I)

  BASEADDR   +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B
+----------+-------------------------------------+-----------------+
| 300639F8 | 0D A2 01 02 00 22 00 00 32 00 01 00 | Potion          |
| 30063A04 | 0D B0 02 02 01 22 00 00 C8 00 03 00 | Hi-Potion       |
| 30063A10 | 0D B1 03 02 02 22 00 00 BC 02 09 00 | X-Potion        |
| 30063A1C | 0B A5 04 02 03 22 00 00 C8 00 07 00 | Ether           |
| 30063A28 | 0B A6 05 02 04 22 00 00 58 02 0B 00 | Hi-Ether        |
| 30063A34 | 0B A7 0E 02 0D 22 00 00 0A 00 14 00 | Elixir          |
| 30063A40 | 0C A8 06 02 05 22 00 00 32 00 01 00 | Antidote        |
| 30063A4C | 0E A9 07 02 06 22 00 00 32 00 01 00 | Eye Drop        |
| 30063A58 | 0B AA 08 02 07 22 00 00 32 00 02 00 | Echo Grass      |
| 30063A64 | 09 AB 09 02 08 22 00 00 32 00 02 00 | Maiden's Kiss   |
| 30063A70 | 0D AC 0A 02 09 22 00 00 64 00 02 00 | Soft            |
| 30063A7C | 09 AD 0B 02 0A 22 00 00 D0 07 05 00 | Holy Water      |
| 30063A88 | 0B AE 0C 02 0B 22 00 00 5E 01 07 00 | Remedy          |
| 30063A94 | 0E AF 0D 02 0C 22 00 00 2C 01 01 00 | Phoenix Down    |
+----------+-------------------------------------+-----------------+
| 30063AA0 | 00 00 00 02 00 00 00 00 00 00 00 00 | <BLANK>         |
| 30063AAC | 00 00 00 02 00 00 00 00 00 00 00 00 | <BLANK>         |
+----------+-------------------------------------+-----------------+


-=============-
SHIELD BYTES II
-=============-

BASEADDR +1 : Physical S-Evade
BASEADDR +2 : Magical S-Evade

  BASEADDR   +0 +1
+----------+-------+-----------------+
| 30063EB8 | 0A 03 | Escutcheon      |
| 30063EBA | 0D 03 | Buckler         |
| 30063EBC | 10 00 | Bronze Shield   |
| 30063EBE | 13 00 | Round Shield    |
| 30063EC0 | 16 05 | Mythril Shield  |
| 30063EC2 | 19 00 | Gold Shield     |
| 30063EC4 | 1C 00 | Ice Shield      |
| 30063EC6 | 1F 00 | Flame Shield    |
| 30063EC8 | 0A 32 | Aegis Shield    |
| 30063ECA | 22 0F | Diamond Shield  |
| 30063ECC | 25 0A | Platina Shield  |
| 30063ECE | 28 0F | Crystal Shield  |
| 30063ED0 | 2B 00 | Genji Shield    |
| 30063ED2 | 2E 14 | Kaiser Plate    |
| 30063ED4 | 32 19 | Venetian Shield |
| 30063ED6 | 4B 32 | Escutcheon      |
+----------+-------+-----------------+


-============-
ARMOR BYTES II
-============-

BASEADDR +0 :  HP to add
BASEADDR +1 :  MP to add

  BASEADDR   +0 +1
+----------+-------+-----------------+
| 30063ED8 | 0A 00 | Leather Helmet  |
| 30063EDA | 14 00 | Bronze Helmet   |
| 30063EDC | 1E 00 | Iron Helmet     |
| 30063EDE | 28 00 | Barbuta         |
| 30063EE0 | 32 00 | Mythril Helmet  |
| 30063EE2 | 3C 00 | Gold Helmet     |
| 30063EE4 | 46 00 | Cross Helmet    |
| 30063EE6 | 50 00 | Diamond Helmet  |
| 30063EE8 | 5A 00 | Platina Helmet  |
| 30063EEA | 64 00 | Circlet         |
| 30063EEC | 78 00 | Crystal Helmet  |
| 30063EEE | 82 00 | Genji Helmet    |
| 30063EF0 | 96 00 | Grand Helmet    |
+----------+-------+-----------------+
| 30063EF2 | 08 00 | Leather Hat     |
| 30063EF4 | 10 05 | Feather Hat     |
| 30063EF6 | 18 08 | Red Hood        |
| 30063EF8 | 20 00 | Headgear        |
| 30063EFA | 28 0C | Triangle Hat    |
| 30063EFC | 30 00 | Green Beret     |
| 30063EFE | 38 00 | Twist Headband  |
| 30063F00 | 40 14 | Holy Miter      |
| 30063F02 | 48 00 | Black Hood      |
| 30063F04 | 50 32 | Golden Hairpin  |
| 30063F06 | 58 0F | Flash Hat       |
| 30063F08 | 64 00 | Thief Hat       |
+----------+-------+-----------------+
| 30063F0A | 14 00 | Cachusha        |
| 30063F0C | 14 00 | Barette         |
| 30063F0E | 0A 00 | Ribbon          |
+----------+-------+-----------------+
| 30063F10 | 0A 00 | Leather Armor   |
| 30063F12 | 14 00 | Linen Cuirass   |
| 30063F14 | 1E 00 | Bronze Armor    |
| 30063F16 | 28 00 | Chain Mail      |
| 30063F18 | 32 00 | Mythril Armor   |
| 30063F1A | 3C 00 | Plate Mail      |
| 30063F1C | 46 00 | Gold Armor      |
| 30063F1E | 50 00 | Diamond Armor   |
| 30063F20 | 5A 00 | Platina Armor   |
| 30063F22 | 64 00 | Carabini Mail   |
| 30063F24 | 6E 00 | Crystal Mail    |
| 30063F26 | 96 00 | Genji Armor     |
| 30063F28 | 82 00 | Reflect Mail    |
| 30063F2A | C8 00 | Maximillian     |
+----------+-------+-----------------+
| 30063F2C | 05 00 | Clothes         |
| 30063F2E | 0A 00 | Leather Outfit  |
| 30063F30 | 12 00 | Leather Vest    |
| 30063F32 | 18 00 | Chain Vest      |
| 30063F34 | 1E 00 | Mythril Vest    |
| 30063F36 | 24 00 | Adaman Vest     |
| 30063F38 | 2A 0F | Wizard Outfit   |
| 30063F3A | 32 00 | Brigandine      |
| 30063F3C | 3C 00 | Judo Outfit     |
| 30063F3E | 46 00 | Power Sleeve    |
| 30063F40 | 55 0A | Earth Clothes   |
| 30063F42 | 14 00 | Secret Clothes  |
| 30063F44 | 64 00 | Black Costume   |
| 30063F46 | 96 1E | Rubber Costume  |
+----------+-------+-----------------+
| 30063F48 | 0A 0A | Linen Robe      |
| 30063F4A | 14 10 | Silk Robe       |
| 30063F4C | 1E 16 | Wizard Robe     |
| 30063F4E | 28 1C | Chameleon Robe  |
| 30063F50 | 32 22 | White Robe      |
| 30063F52 | 3C 1E | Black Robe      |
| 30063F54 | 4B 32 | Light Robe      |
| 30063F56 | 64 50 | Robe of Lords   |
+----------+-------+-----------------+]


Looks like I was wrong about shields boosting HP and MP.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 16, 2012, 04:24:16 pm
Pride, I think you're right about the 7th and 12th bytes in the item data... they're not in FFTP. Although those bytes always seem to be zero anyway, it seems that there is indeed some data not in FFTP...

...but the data PGF's talking about really doesn't exist. I just checked the ability data and found...

0x5fbf0 - Ability data 2 (normal abilities)
0x61010 - Item ability data

After the item data are data for other abilities (such as R/S/M, which have only one byte). That means that the abilities that have the "full" information are the ones between 0x5fbf0 and 0x61010. That section is 14 (0x0E) bytes per ability.

Byte length = 0x61010 - 0x5fbf0 = 0x1420 bytes
Number of abilities in section = 0x1420 / 0x0E = 0x170 abilities

That's exactly the number of abilities that have the "full" data in FFTP (0x000 Attack - 0x16F Frog Attack). That section isn't big enough to store any more. So... R/S/M doesn't have that data.
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 16, 2012, 04:31:04 pm
Would it be difficult to add those two bytes in the patcher? Always 0 but its nice to have something free located in the data itself to add something custom, such as an item defense system.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 16, 2012, 05:35:58 pm
I was wrong in the specifics, but the reason why I wanted it was so this stuff could be used for ASM hacks, and be easily editable in FFTPatcher, without requiring a custom table.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 16, 2012, 10:58:53 pm
Right, I understand. Unfortunately there's no ability data for R/S/M to put into FFTPatcher, but it is a good idea to add things into Patcher where we can, if the data exists and Patcher isn't showing it.

To that end... I did wire up Unknown1 (0x06) and Unknown2 (0x0B) as spinners (textboxes with up/down arrows) into the Item section. melonhead had already accounted for their existence (even came up with the awesome names for them), but just didn't show them and/or make them changeable on the form.
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 16, 2012, 11:02:56 pm
I know we discussed this before about the items having two bytes or however they're hardcoded, but I can't recall exactly if you said someone could make the Patcher place WotL Multiplayer items inside ENTDs/Move-Finds/Poaches. If that could be done, I think it's something that should be looked into.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 17, 2012, 01:02:40 am
No, it's not that easy. The data fields are only one byte big. Therefore, they can't accept WotL exclusive items.

The only way you could do it is through ASM hacking... and you'd probably have to use kanji space to redo the item ID arrays for all of those sections. Either that, or find a flag to set that means "This item ID is actually 0x100 + whatever it says!"
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 17, 2012, 02:38:58 am
Is the fourth byte in this data also missing in the patcher?

80063ab8 - Weapon Secondary Data

   0x00 - Range
   0x01 - Attack Flags
      0x80 - Striking
      0x40 - Lunging
      0x20 - Direct
      0x10 - Arc
      0x08 - 2 Swords
      0x04 - 2 Hands
      0x02 - Throwable
      0x01 - Forced 2 Hands
   0x02 - Formula
   0x03 -
   0x04 - Weapon Power
   0x05 - Evade
   0x06: Element
      0x80 - Fire
      0x40 - Lightning
      0x20 - Ice
      0x10 - Wind
      0x08 - Earth
      0x04 - Water
      0x02 - Holy
      0x01 - Dark
   0x07 - Inflict Status/Cast Spell
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 17, 2012, 09:45:56 am
It looks like it. I'll make a spinner for that too.

EDIT - Added it in to my build. The default seems to always be 0xFF.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 20, 2012, 05:40:52 pm
Could you add map previews for ENTD and Treasure/Trap editing, to FFTPatcher?

http://ffhacktics.com/smf/index.php?topic=5660

It doesn't need to be the actual maps, it just needs to be a visual representation of the following:
*height
*unpassable terrain
*1st and 2nd levels where applicable
*water and water depth where applicable
*X and Y axises

Bonus points if it displays where you placed your enemy units in the ENTD section, and where you placed your traps/treasures in the trap/treasure section.

There will be cake if it takes this data from the actual maps themselves, so that people can add their own custom maps to an FFT disc image and have FFTPatcher grab the above data from those maps.

Because, spreadsheets are really lame for previewing maps.  Honestly.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 20, 2012, 05:52:35 pm
This would actually be pretty cool to see happen, tho I dunno the amount of work it would take to do.

(Tho I see it being much more useful if many of the current maps didn't have incorrect values on the FFH main page :P)
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 20, 2012, 06:31:18 pm
While we're on the topic of what-ifs, would there be a way to add a feature that highlights when two units of the same ENTD are on the same tile?
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 20, 2012, 07:30:34 pm
Quote from: Eternal248 on April 20, 2012, 06:31:18 pm
While we're on the topic of what-ifs, would there be a way to add a feature that highlights when two units of the same ENTD are on the same tile?

Highlight them both in the ENTD character selection box with, say, yellow; when they are on the same tile, and when you click on one of them?

Or show all occupied tiles/squares/panels on the preview, and then show which units inhabit that square when you click on it?

Which is a better idea?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 20, 2012, 09:11:01 pm
I don't know how to read the map files. Even if I did, we'd be looking at (for each ENTD):

1. Search through ATTACK.OUT until you find this ENTD being referenced
2. Load the map ID from that entry in ATTACK.OUT (without regard to whether or not it actually is referenced anywhere)
3. Load the map data from the appropriate file(s) (???)
4. Formulate and implement an algorithm to somehow show all that map data you mentioned. I really have no idea how the upper level / lower level stuff would work.
5. Find a place to actually put it on the form.

...Ack.
Alternatively, I could just display an image, if the image was for the right map file, and an appropriate image exists. Probably wouldn't show where you put treasure, etc though.

Highlighting names in the ENTD: It sounds doable, although it adds processing.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 21, 2012, 04:57:34 pm
Well, could you create some kind of XML crap that can be edited for people who make custom maps, which they can replace themselves (or someone can write a python script to scan their custom maps, and create the XML)?  FFTPatcher will then use this XML to create the preview, with selectable squares/panels/tiles?

Also, where is the ATTACK.OUT editor?  Would it be a good idea to integrate it - and other tools - into the FFTPatcher suite?
Title: Re: FFT Patcher .478 Source Code
Post by: LastingDawn on April 23, 2012, 03:24:33 pm
A true successor to FFT Patcher! I am glad to see you taking up the mantle of this Glain! These improvements seem really nice!
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 23, 2012, 04:56:56 pm
Thanks!

Er, but if you're referring to the most recent suggestions, it's really ambitious and I'm not sure I'm doing that stuff...
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 23, 2012, 06:24:27 pm
The code for grabbing these things will probably be a pain in the ass, and you have to know how FFTPatcher gets at files that are in the disc image, so I assume that's what you consider ambitious.  The actual preview only needs to be a 2D grid, made up of color-coded squares with numbers on them.
Title: Re: FFT Patcher .478 Source Code
Post by: LastingDawn on April 23, 2012, 09:59:10 pm
Ah no, I'm referring to the work you've already accomplished. The other stuff if it can be done would just be a topping to the cake.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 24, 2012, 10:18:15 am
LD: Thanks! Glad to hear I'm doing useful stuff!

PGF: Generating the map previews themselves in XML seems pretty laborious (though that wouldn't require modifying code, thus doesn't have to be done by me). I still don't like the idea of searching attack.out to figure out which ENTD ties to which map, as it seems needlessly complicated. (Not to mention, taking the first match seems hokey... what if it's an unused entry?) Maybe yet another XML file tying ENTD to map ID would be useful.

Generating the preview... I guess I just need to experiment with Winforms. I'd have to check the form controls to see if there's something that would let me generate an image-type thing that I could just edit freely (from the code).

You'd also have to have a way to separate upper level from lower level, at least for squares that have both, and define them separately in the XML, as well as a good way to display them.

I actually think integrating the attack.out editor into FFTP is a really good idea... it just seems really difficult. Particularly the image preview thing that you can rotate/etc in the top right.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:17:37 pm
Quote from: Glain on April 24, 2012, 10:18:15 amYou'd also have to have a way to separate upper level from lower level, at least for squares that have both, and define them separately in the XML, as well as a good way to display them.

No you don't.  Download my spreadsheet and look at how I do it.

http://ffhacktics.com/smf/index.php?topic=5660.0

Or check out the screencaps here:
http://ffhacktics.com/smf/index.php?topic=8735.0
(height of top level)/(height of bottom level)
12/4  /*An example*/

If bottom level is Water, then make background color blue, and change layout as such:
(height of top level)/((height of bottom level)-(depth of bottom level))
9.5/2-2  /*An example*/

If one level is unpassable, then make the level that is unpassable have red text, and give the tile a yellow background.

Quote from: Glain on April 24, 2012, 10:18:15 amI actually think integrating the attack.out editor into FFTP is a really good idea... it just seems really difficult. Particularly the image preview thing that you can rotate/etc in the top right.

I was wondering about that, because:
1. You'd have everything a person needs to hack FFT in one package,
2. Improvements to FFTPatcher's code would become improvements to everything that shares that code.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2012, 03:18:11 pm
Maybe I'm misunderstanding, but wouldn't linking Map ID's to specific ENTD's also only be useful for Vanilla mods?

I mean we already have a map section on the FFH home page that has both the Top and normal map views.
Plus we have Ganesha for anyone that really wants to know the terrain heights.

Like you mentioned, it seems like it might be a bit more work then it is worth. But then again I would say the same
about adding the attack.out editor.  The GUI for that already works quite well, the only thing with attack.out that could use
a easier interface would be the Attack.out Conditions sheet that Xif made, since as of now it is still a spreadsheet,
but even that isn't to hard to manage on it's own.

Something I would like to see tho (for vanilla modders) would be a update to the Resources.zip that would give the correct ENTD names
since some of them aren't actually correct, which has caused some confusion in the help section from time to time.

EDIT:
Quote from: Pickle Girl Fanboy on April 24, 2012, 03:17:37 pm
1. You'd have everything a person needs to hack FFT in one package,


Not really, you would have everything that someone needs to make a vanilla mod. and Not even really all of that... Since most people use thing's like ALMA and such.
To have everything a person needs for a full hack you would also need to implement Worldmap 1.00 and several other tools.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:25:49 pm
Quote from: Elric42 on April 24, 2012, 03:18:11 pmMaybe I'm misunderstanding, but wouldn't linking Map ID's to specific ENTD's also only be useful for Vanilla mods?

Yeah, that's why I want it to NOT be hardcoded.  If there was some kind of XML map_resources.zip you could replace, that would generate the previews, that would be good for non-standard map mods.

Quote from: Elric42 on April 24, 2012, 03:18:11 pmI mean we already have a map section on the FFH home page that has both the Top and normal map views.
Plus we have Ganesha for anyone that really wants to know the terrain heights.

The x and y values of those maps don't correspond to the true x and y values used in the game.  And opening Ganesha (which uses an incredible amount of RAM) every time you want to edit ENTD or Treasures/Traps isn't feasible - does Ganesha even show x and y values?  How would you know where the enemies are being placed?  How do you know you're not placing them on an obstacle, or in a river (if they have Cannot Enter Water)?
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:30:36 pm
Quote from: Elric42 on April 24, 2012, 03:27:58 pm
Yes they do. I have made over 60 events using these x,y from the main page and they work fine on all but 2 maps. Not sure where you are basing this info off of

*tries to remember why he didn't use those maps (it's been a few years)*
*looks at those maps*
They don't clearly demonstrate which tiles are obstacles.
Also, I don't like downloading and renaming all those web pages, so I can view the first image.  Assuming that the formatting stays intact when downloaded (very doubtful).

http://ffhacktics.com/maps.php?id=12
^Outside of Lionel Castle being the worst offender.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2012, 03:31:51 pm
Quote from: Pickle Girl Fanboy on April 24, 2012, 03:25:49 pm
The x and y values of those maps don't correspond to the true x and y values used in the game.  And opening Ganesha (which uses an incredible amount of RAM) every time you want to edit ENTD or Treasures/Traps isn't feasible - does Ganesha even show x and y values?  How would you know where the enemies are being placed?  How do you know you're not placing them on an obstacle, or in a river (if they have Cannot Enter Water)?


Yes they do. I have made over 60 events using these x,y from the main page and they work fine on all but 2 maps. Not sure where you are basing this info off of. Also, the maps clearly show all the terrain. And unless something is unpassable, which is usually more then obvious, they can be places wherever you choose without issue. That why they can choose it.

I guess the main issue is that you for some reason seem to think that the x,y on the main page are incorrect, when they are indeed not. Only Lionel Office is off by -1 x,y and the Pub is off by -1 Y.. That's it

And no Ganesha doesn't show X/Y it shows the map. But for someone that really cannot figure out the levels on the maps we already have (dunno why) that would be an option.

As I said, maybe I'm just misunderstanding the purpose of this. For which i apologize.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:33:05 pm
Could you NOT delete your posts in non-spam topics?
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2012, 03:34:48 pm
I was trying to edit it and accidentally deleted it instead and if you look at the one you just replied after, you would see that everything i said in the first one remains in the one i editing and posted again

But way to fuckin flip out over it without even checking first. Bravo on that.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:37:24 pm
If you consider that a "fuckin flip out", then you don't know me very well. ;P

There's no way to save the map images in those web pages.  They seem to be a product of some kind of PHP magic.  So, the person I should be talking to is Xif, I guess.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2012, 03:38:52 pm
that may be the case, but all those maps are also viewable in EVSP

and I may have misspoken by calling it flipping out, but my edit was posted more then a minute before you said that :P So there WAS time to see that I fixed my error of delting it by mistake (since I've never intentionally delete a reply and normally edit them when needed)
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:39:23 pm
What's EVSP?
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2012, 03:41:01 pm
Easy Vent Super Perfect
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:41:55 pm
Linux user here - EVSP is a Visual Basic program, and will not work on Linux or Mac.

http://www.mono-project.com/Visual_Basic
^There is a Linux Visual Basic compiler, but your code probably contains calls to Windows specific libraries.  So EVSP is conceivably cross-platform, but probably not, in practice.  This ins't really your fault, because IIRC the Mono cross-platform library is a pain in the ass.
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 24, 2012, 03:45:45 pm
The world does not revolve around Linux users. Don't expect everyone to bend to your whims just because you can't run a certain program.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:46:54 pm
How did this become about my whims?  Didn't you want these features yourself a few posts ago?  And now you're against them?  WTF is going on here?
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 24, 2012, 03:47:53 pm
You're coming off as overly pushy. That's the problem.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 24, 2012, 03:49:32 pm
Quote from: Eternal248 on April 24, 2012, 03:47:53 pm
You're coming off as overly pushy. That's the problem.

Okay then.  Could you say so, next time?  Like, Warn me, instead of posting something like this:

Quote from: Eternal248 on April 24, 2012, 03:45:45 pm
The world does not revolve around Linux users. Don't expect everyone to bend to your whims just because you can't run a certain program.


Getting warned doesn't really bother me (I won't raegquit, I'll just stop whatever it offensive thing I'm doing), but ambiguity does fuck me up, because I don't process it well.  I need to have rules, because I understand rules, and will follow them perfectly.

Also, Xifanie PM'd me the link to the images used in the maps section.
http://ffhacktics.com/maps/
When I start learning a programming language, I'll make a cross-platform tool for previewing maps.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 24, 2012, 04:12:13 pm
Elric, the latest FFTP attached to this thread (this post (http://ffhacktics.com/smf/index.php?topic=7163.60#msg171009)) should have updated ENTD names. I changed a bunch of them for the very reason you're describing. Of course, the attack.out editor still has a bunch of wrong ones, but the ones in FFTP itself should be better.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2012, 04:39:31 pm
Ah very good to know Glain! This will definitely help me out a bit
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 28, 2012, 10:58:05 am
All right, I've added enough features at this point to release a new version, I think. (Rather than just talking about how I have the features on my computer). So, here it is!

Here are the features in .482:

* FFTPatcher can now edit the Unknown 1 (0x06) and Unknown 2 (0x0b) item bytes, as well as Unknown in Weapon Secondary Data (0x03).
* The ENTD in FFTPatcher should display rows that have location conflicts (Same X/Y/UpperLevel) in red (for any units that are not Randomly Present or Sprite Set 00).
* Ctrl+C, Ctrl+V should now work in FFTPatcher in any place where you can right-click and copy, right-click and paste. I didn't add copy/paste to any area that didn't already have it, however.
* The lists of abilities/jobs/items/etc (on the left) in FFTPatcher should now support a type-ahead that will select the first matching list item as you type its name. The hex prefix should be ignored, so for example, if you type "Gran" it will select "015E Grand Cross". You can delete characters from the type-ahead with backspace, or clear it with ESC and start again.
* Added some hacks to FFTorgASM, notably adding Choto's remove zodiac compat hack (I had to restrain myself from deleting that leading nop :)) and fixing a Razele hack, as well as adding some hacks of my own.
* Added a defense (damage percentage reduction) hack to FFTorgASM based on the item 0x06 and 0x0b bytes. (It sounded like a good idea, Pride :D)
* Shishi should have the R999 changes.

* FFTorgASM can now understand ASM and encode/patch it directly! Specify mode="ASM" in a <Location> tag to use ASM instead of the hex encoding. Currently, ASM mode is available for any <Location> tags where the file is specified as SCUS_942_21, BATTLE_BIN, or WORLD_WORLD_BIN. That covers the vast majority of ASM hacks. Support can be added for other files if we know their file-to-RAM offsets.
* Additionally, FFTorgASM can support many psuedoinstructons even if they take multiple lines. The list of psuedoinstructions here (http://en.wikipedia.org/wiki/MIPS_architecture) should mostly be supported. You can also do fun things like lw r2,0x80192d90 and lbu r3,0x801908cc(r4), although these commands always generate the entire address, so this will be less efficient in cases where you can reuse part of the address. Those two statements would become 5 lines of regular ASM, but this example can be done in 4. As a sidenote, these pseudoinstruction patterns are very apparent in FFT's ASM code. Check MassHexASM (also being updated now) to see how these encode/decode.

...I believe that's everything!
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on April 28, 2012, 12:48:12 pm
Which Razele hack is it?
Title: Re: FFT Patcher .478 Source Code
Post by: Pride on April 28, 2012, 03:31:13 pm
Awesome ^__^

/me downloads both
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 28, 2012, 03:32:19 pm
I love you Glain. That is all. My only gripe is I'd like it if the Patcher showed if units are on the same X,Y even if they're Randomly Present. Still though, amazing work. :D
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 28, 2012, 05:12:45 pm
@Eternal
If they are randomly present you shouldnt have any issues really :P Or atleast from how i understand it, since they at called are different parts in the event.
Often times Not present or randomly present units will just have a starting location of 0,0 since they are moved via a warpunit command and then drawn to the map
in a location different from their ENTD location anyway (atleast in vanilla anyway)

@Glain
Awesome job on this man! I'm gonna check it out some more today  :mrgreen: Loving all these updates
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 28, 2012, 06:50:43 pm
Thanks a lot guys!

fdc: I changed "Require Sword - Require Weapons" to edit SCUS instead of BATTLE.BIN. We discussed it earlier in the thread here (http://ffhacktics.com/smf/index.php?topic=7163.80#msg171106). I just never did fix it until now.

Eternal: If you show the conflicts even with Randomly Present, you get tons of red even in vanilla ENTDs. I dunno, that just didn't seem right to me.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on April 28, 2012, 07:05:18 pm
I think that Eternal means you display Red if there's a conflict (no "Randomly Present"), and then display another color if they're on the same tile, and there's no conflict - just so he can know the maximum possible number of enemies in a battle.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 29, 2012, 12:30:46 pm
Three Cheers for Glain and Item Defense!

Also, do we know exactly what "Second Table" corresponds to in the patcher? I see that the values correspond to all weapons... all shields... all armors... etc. But I'm wondering what they're actually used for in game.
Clarified by Pride, Thanks!

Also, What are the "Sprite Hacks?"
Title: Re: FFT Patcher .478 Source Code
Post by: LastingDawn on April 29, 2012, 10:29:36 pm
Great work! Everything seems to be working up to code!
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on May 01, 2012, 12:53:01 am
not sure if this one fell through the cracks, but i think its worth putting in there for the next build. Death to monk over-poweredness.

Martial arts is 25% PA boost instead of 50%

<Patch name="Martial arts is 25% instead of 50%">
    <Description>
     
    </Description> 
    <Location offset="0011F128" file="BATTLE_BIN">
      80   
    </Location>
<Location offset="0011F138" file="BATTLE_BIN">
      82   
    </Location>
<Location offset="0011F1e0" file="BATTLE_BIN">
      80   
    </Location>
<Location offset="0011F1f0" file="BATTLE_BIN">
      82   
    </Location>
  </Patch>


Not sure if you saw my question earlier but i'll re-ask it because i dont want it to be lost in the mix, what exactly do the "Sprite Hacks" do?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 01, 2012, 08:09:52 pm
Were the sprite hacks added into the default XML for FFTorgASM recently? If so, I think fdc might know what they are, but I'm not sure.
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on May 02, 2012, 06:55:07 am
I think they're the ones made by Xif that let you use all 8 palettes.
Title: Re: FFT Patcher .478 Source Code
Post by: Pickle Girl Fanboy on May 02, 2012, 05:53:27 pm
Off-Topic: Do those hacks work, bug-free?  Because that's awesome.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on May 03, 2012, 09:32:30 pm
AFAIK the palette hack works, since I use it in events to make 2 versions of the same non-generic sprite have different palettes, but if this is the
one I'm thinking of, it caused bugs when picking up the crystals/chests of the higher numbered palettes (6-8 ?)
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 06, 2012, 11:00:41 am
Pride pointed out a problem with the ASM encoder in MHA; since the one in FFTorgASM uses the same one, I'm also patching it here. I'm just calling this 482 v2.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on August 05, 2012, 02:49:06 am
Getting some serious bugs with the FFTacText.  I need to do further investigation tomorrow, but it seems that the Ability Names that are supposed to display overhead are being written as blank text data and the Ability Name list is being written to the Post Action Battle Messages because I'm getting things like Brave Up displaying "Death" after use and Break skills displaying "Slow", etc.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on August 15, 2012, 03:05:42 pm
Can we come up with a reproducible scenario for this?
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on August 15, 2012, 03:50:47 pm
For reference, I fixed this by patching the same .ffttext file with FFTacText .457.  I can edit in .482 but it seems I need to use .457 to patch things after I finish doing my edits.  Either my FFTacText glitched the fuck out from the fact I'd basically rewritten everything inside it, or there's an error in the writing-to-game procedure.

Also, unrelated, not sure if this is true for other versions of OrgASM, but with .482 OrgASM, once I apply ASMs to an ISO, it won't allow me to choose new ASMs and apply them to the ISO without restarting the program.  Visually, I can click the boxes, choose a new ISO to patch, etc., so it looks like it works... but if you actually check the ISO, no edit has been made with your new choices.
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on August 15, 2012, 04:24:41 pm
Glain, could you tell me how to setup my Windows to edit FFTP's source? I want to add the MON SHP + SEQ to finally allow spriters to test their monster sprites in shishi. I have already messed with those file format in the past btw.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on August 15, 2012, 11:32:13 pm
I just uploaded the current FFTP source to the Google code page I made for it (I have a separate one from melonhead's original) at http://code.google.com/p/fftpatcher-mod/downloads/list

You basically just need to open the .sln file with a C# IDE. I'm using SharpDevelop, as it's open source. When you compile the project, it builds all the EXEs at once (Patcher, Tactext, FFTorgASM, Shishi), and you navigate to that folder into the bin/ directory to find it. Generally it's bin/x86/Debug in each project folder, I believe.

In theory, you should be able to use source control like SVN to check out all the source code, but I'm having some issues with that, because I used SVN to check out from melonhead's project when I started updating FFTP, and I think SVN still thinks the two are tied together even though I've separated them. So anyway, for now I just uploaded the source as a zip file.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on August 17, 2012, 01:23:10 am
Quote from: RavenOfRazgriz on August 15, 2012, 03:50:47 pm
For reference, I fixed this by patching the same .ffttext file with FFTacText .457.  I can edit in .482 but it seems I need to use .457 to patch things after I finish doing my edits.  Either my FFTacText glitched the fuck out from the fact I'd basically rewritten everything inside it, or there's an error in the writing-to-game procedure.

Also, unrelated, not sure if this is true for other versions of OrgASM, but with .482 OrgASM, once I apply ASMs to an ISO, it won't allow me to choose new ASMs and apply them to the ISO without restarting the program.  Visually, I can click the boxes, choose a new ISO to patch, etc., so it looks like it works... but if you actually check the ISO, no edit has been made with your new choices.


I've heard .457 is the only one that does the PSP changes correctly, too. Maybe there was something changed between .457 and .478 that did something weird when you have large amounts of text changed? The only thing I really changed in the later versions of Tactext was QuickEdit, and that just tells TacText what to change without modifying the patching process, so if that part works I would assume it's a problem from before I started doing anything with it, though I haven't really done all that much testing myself.

That's interesting about orgASM too. I'm not sure I noticed, but then again, I usually just open, select ASMs, patch ISO, and close...
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on September 20, 2012, 08:36:28 pm
So, random thought. Is there any way we could get a Copy Item function in the next update, if/when that happens?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on September 21, 2012, 10:29:32 am
Probably! Copy/pasting one item over another, with ctrl+c/ctrl+v support, like in other sections?

Sounds good.  I haven't edited FFTP code in a while but this certainly sounds doable.  If I get a few more feature suggestions I could make a sizable update out of this; otherwise I guess I could do an update with just this in it (I don't really know of anything else to put in... maybe I just need more suggestions).
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on September 21, 2012, 03:59:09 pm
Exactly that. I know it'd save me a lot of time, at least.
Title: Re: FFT Patcher .478 Source Code
Post by: Desocupado on September 21, 2012, 09:22:22 pm
We really could use a rename feature for stuff inside the patcher.
(i.e. let me rename the displayed name on the patcher, so skill 002 isn't referenced as "Cure 2/Cura")
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on September 21, 2012, 10:22:32 pm
Export Resources.zip and edit the files inside it.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 18, 2013, 11:43:09 am
Apparently the unknown flag under hit allies is "Top down targeting" as referenced by SA:

00179360: 10c00006 beq r6,r0,0x 0017937c      Branch if Top-down Targeting = False
00179364: 00e4102a slt r2,r7,r4
00179368: 14400003 bne r2,r0,0x 00179378      Branch if Low Height < High Height
0017936c: 00000000 nop            (basically target from top down)

Although i'm not exactly sure what this does, just figured i'd make a note of it. It's in the "Check vertical tolerance and if tiles can be chosen" routine: http://ffhacktics.com/wiki/Check_Vert_Tolerance_and_if_Tiles_can_be_Chosen
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 26, 2013, 01:02:29 pm
Working list for the next version:

More copy/paste functionality (Items, Animations, Monster Skills, Action Menus, Status Effects, Inflict Statuses, Poaching, Move-Find Item, Propositions)
Rename flag under Hit Allies? (Need to trace routine / decipher what it really does)
Label/group AI bytes in ENTD based on Raven's post (http://ffhacktics.com/smf/index.php?topic=9618.0)
Add one to IDs in Shishi sprite dropdown
Display Shishi frame/animation number in hex
ASM patcher offset mode attribute
Add Effect dropdown to more abilities (Items, Other?)
Fix Proposition default values for level bonuses
Proposition Entries should display * next to name if changed

That's actually still not too much stuff.  I guess "Fix TacText" would be pretty high up on the list, but I'm not really sure what its deal is.  My best bet might be to just try to analyze what was changed in TacText between .457 and .479.  Also, the PSP apparently has problems with everything past .457?

Edit: Updating this post to make my list into a working list for the next version.  I'll update it periodically and bold things that (I think) I have working in my local build.
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on April 26, 2013, 01:41:00 pm
IIRC, I used the latest Tactext for KO PSP, and it worked fine. You just need to cut away a ton of Kanji and shorten some text in certain files.

Can we incorporate Raven's AI findings into the next version somehow?
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 26, 2013, 03:16:59 pm
Quote from: Glain on April 26, 2013, 01:02:29 pm
Should we add one to all the IDs in Shishi so they match the ones in FFTP?



YES. This would actually be supremely helpful to the stuff i'm decoding right now :)
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 27, 2013, 05:25:12 pm
pardon the doublepost, just wanted to make sure you saw it :P.

One more request to make the frame/animation numbers display in hex instead of decimal. It would also help with the misc data/animation stuff i'm looking into. I won't be heartbroken if it's not implemented though.. Thanks!

Edit: I mean in ShiShi, not FFTP
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 28, 2013, 01:21:10 am
I've updated my previous post to make it a working list based on the items mentioned here that I'll update as I do things.  Displaying the frame/animation numbers in hex sounds fine, as I imagine nobody relies on those numbers being base 10?
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 28, 2013, 12:21:57 pm
Just out of curiousity, what would it take to put weapon sheet frames and animations in there? How do they do it for Type 1 and type 2?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 28, 2013, 02:38:38 pm
Those sound like good questions... I really don't know much of anything about how that works.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 30, 2013, 02:00:26 pm
Just to pack more onto your workload :P The effects tied to item abilities could be added in a drop down menu for their respective abilities like the rest of them. They're actually in the same table of effect ID values. Those would be good to include. Here's my hack that edits those values for referece:

Note: There's an extra 0x0800 flag set with the effect ID for item abilities. There's a routine that checks the flag and returns wether or not it's present in the effect.. so it must serve some kind of function for item abilities.



<Patch name="Item Effect Hack">
<Variable file="BATTLE_BIN" offset="14f6d0" default="0409" name="Potion"/>
<Variable file="BATTLE_BIN" offset="14f6d2" default="0709" name="Hi-Potion"/>
<Variable file="BATTLE_BIN" offset="14f6d4" default="0a09" name="X-Potion"/>
<Variable file="BATTLE_BIN" offset="14f6d6" default="0d09" name="Ether"/>
<Variable file="BATTLE_BIN" offset="14f6d8" default="1009" name="Hi-Ether"/>
<Variable file="BATTLE_BIN" offset="14f6da" default="1109" name="Elixir"/>
<Variable file="BATTLE_BIN" offset="14f6dc" default="0509" name="Antidote"/>
<Variable file="BATTLE_BIN" offset="14f6de" default="0609" name="Eye Drop"/>
<Variable file="BATTLE_BIN" offset="14f6e0" default="0909" name="Echo Grass"/>
<Variable file="BATTLE_BIN" offset="14f6e2" default="0f09" name="Maiden's Kiss"/>
<Variable file="BATTLE_BIN" offset="14f6e4" default="0b09" name="Soft"/>
<Variable file="BATTLE_BIN" offset="14f6e6" default="0e09" name="Holy Water"/>
<Variable file="BATTLE_BIN" offset="14f6e8" default="0809" name="Remedy"/>
<Variable file="BATTLE_BIN" offset="14f6ea" default="0c09" name="Pheonix Down"/> 
</Patch>
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 30, 2013, 06:45:03 pm
I don't think I understand the difference between this and changing the value of the Effect dropdown in the Abilities tab for those abilities.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on April 30, 2013, 06:47:24 pm
Those Abilities don't have an Effect dropdown in the Abilities tab, just an "Item Use" dropdown that says which Item slot each ability is tied to.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 30, 2013, 07:02:41 pm
Ah, I see!  The Effect doesn't seem to be editable for the entire ability range from 0x170 - 0x1A5.  Should it be added for all of them, or is there some reason to restrict it to just item abilities?
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on April 30, 2013, 07:12:24 pm
None of the other skills actually have an animation.

Charge is a weapon attack, Jump is basically a weapon attack with a different string of animation bytes for the unit in question, same with Throw except it animates the item being Thrown as a projective, Math Skill calls entire different abilities and uses those animations.  I'm not sure changing their animations would even DO anything other than maybe crash the game horrifically?  You'd probably want to do a lot of testing with that before making them editable in FFTPatcher.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 30, 2013, 10:07:32 pm
All of those abilities are actually part of the same big table referenced by ability ID. So you can give any ability up to the first support ability an effect. Charge, Jump, etc. are all FFFF. At the end of the table after reaction abilities is actually some event effects.. perhaps those abilities are called in events or something to play the effect. I'm sure they behave in some funny ways though. Like I know all jump abilities default to a certain one regardless of the distance. Items should be safe though =)
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 01, 2013, 07:00:47 pm
Is that portion of the effects table (for item abilities) the same in PSP as it is in PSX?  I'm currently operating under the assumption that it is.

Edit: I found the same sequence in the PSP version's EBOOT.BIN.  It looks like they're identical.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 02, 2013, 11:56:02 pm
How's this for the ENTD unit view with some new labels/organization?


(http://img607.imageshack.us/img607/9404/fftpentdnew.png)
Title: Re: FFT Patcher .478 Source Code
Post by: Eternal on May 03, 2013, 03:08:11 am
I love you, Glain.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on May 03, 2013, 05:30:20 am
Needs better space management.

Move the Equipment section under the Skills section.  Move the AI section to the right of the Abilities and Equipment sections, so that the bottom of the AI box is in-line with the bottom of the Equipment box.  Move the Spoils and Unknown boxes into the now-empty space above the AI box.

This would conserve a lot of vertical space on-screen (good for people with small monitors) and minimize the amount of wasted "white" space on the interface.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 03, 2013, 08:39:44 am
Something like so?

Edit: It looks like the AI box has some blank space at the bottom, so I'd probably shrink it a bit and move Spoils/Unknown down slightly so the top of those boxes match vertically with Skills.


(http://img834.imageshack.us/img834/8739/fftpentdnew2.png)
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 07, 2013, 11:08:39 pm
Quote from: RavenOfRazgriz on August 15, 2012, 03:50:47 pm
Also, unrelated, not sure if this is true for other versions of OrgASM, but with .482 OrgASM, once I apply ASMs to an ISO, it won't allow me to choose new ASMs and apply them to the ISO without restarting the program.  Visually, I can click the boxes, choose a new ISO to patch, etc., so it looks like it works... but if you actually check the ISO, no edit has been made with your new choices.


9 month old quote \o/

I just failed to reproduce this.  Do you have a specific case?
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on May 08, 2013, 01:48:11 am
That quote doesn't quite describe it properly.

I can USE the program correctly, but when I re-apply the ASMs, nothing actually HAPPENS on the ISO.  It's like once I choose ASMs and apply to ISO once, those settings become "locked" and nothing I change on the Interface seems to matter.  I had it happen a lot when working with the Journey of the Five ISO and trying to debug various versions of custom ASMs we have.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on May 08, 2013, 08:46:07 am
I can vouch for this happening too. Pick ASM --> patch ASM--> pick new ASM --> patch new ASM --> new ASM's no work.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 08, 2013, 09:59:26 am
You wouldn't happen to remember specific hacks that cause it to happen? :D

I only tried it on two simple hacks (apply one, then the other), but both of the hacks seemed to be applied when I tried it.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on May 31, 2013, 07:29:37 pm
2 things, I tried recreating that bug but I couldn't either.. maybe it got fixed inadvertently between versions or something?

Also, could you send me the updated source code for FFTP? I decided to switch my project to C# as it seems alot easier to work with in terms of syntax and... the set of commands.. whatever you would call it lol. Thanks!
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on June 16, 2013, 01:38:58 am
Since I've effectively frozen the feature list for the next version, I figure I can upload my current version as a release candidate.  This hasn't been tested extensively, so use at your own risk, but testing is, of course, welcome.  The changelog is this post (http://ffhacktics.com/smf/index.php?topic=7163.msg187642#msg187642), earlier in the thread.

I've uploaded the current .483 release candidate source to the Google code page at: http://code.google.com/p/fftpatcher-mod/downloads/list.

(Oops, didn't see your post until now, Choto)

Bugs so far
Faith in spell damage calculations becomes XX% hack with default (Glain.xml) writes to wrong battle.bin location (ack) (Should be 1201F8, not 1201F9).
Shishi form size is too small and you can't scroll down to edit the dropdowns, etc.!
Offset mode attribute in ASM patcher wasn't having any effect

Edit - Uploading my latest version that should fix all the bugs above.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on August 23, 2013, 10:14:56 pm
I've edited the latest post with my latest version that should fix the bugs discovered so far.  Has there been anything else?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on August 31, 2013, 04:44:24 pm
This is my post for laying out progress/strategies/notes for fixing FFTactext to work like .457 does.

My idea is to find the revision that broke FFTactext, figure out what's different between it and the previous version, and reverse those changes in the current version to end up with the correct logic.

I should be able to find all the changes to FFTP between .457 and .478 by looking at melonhead's revisions on his Google code page for FFTP (http://code.google.com/p/lioneditor/source/list)

These are the revisions that seem relevant so far:
r467 "Change EventUnit initial facings to N-S-E-W" (Changes DTE-related FFTactext logic)
r468 "Write DTE Charmap directly to PSX ISO" (Lots of FFTactext changes) (Doesn't seem to compile)
r469 "Fix some bugs in TextCompression" (Many FFTactext changes)
r470 "bunch crap" (Lots of changes in general, including to FFTactext) (Crash seems to happen in this revision)
r477 "Upgrade solution to vs2010" (Contains various FFTactext changes)

Here's my current strategy for finding the revision that broke FFTactext:

Verify that I can get a specific revision of the code from SVN (Command is: svn checkout http://lioneditor.googlecode.com/svn/branches/imageEditorv2@revision)
Get an ISO that requires [.457?] TacText to patch properly (Jot5)
Compute hash value (MD5) of the ISO (Also do binary diffs)
Get the .ffttext file that works in [.457?], but not .478
Make two copies of the ISO, and patch one with .457, then the other with .478
Verify that the .457-patched ISO has same hash values as original ISO, and that the .478-patched ISO doesn't (No hash values are ever the same.)
Delete the .478-patched version and re-copy the original

For each revision being inspected:
  Get the revision from SVN
  Patch the copy with this revision's version of FFTactext
  Check to see if the produced ISO is different
  Delete the newly patched version and re-copy the original


Current Status
I can't get a version that patches into a working ISO, or anything resembling the original.  Tactext from SVN revision 457 causes the same problem (at least if the DLL I'm copying is right) and so does the "457" that I downloaded (and they produce different ISOs...)

Update: Raven's version of .457 is the same .457 that I already had (which isn't the same as revision 457), and also produces a bad ISO.  It seems as if there must be something wrong with my bin/cue files, but all I did was apply the Jot5 PPF... unless my original image is bad. (But why does the "original" PPF-patched Jot5 work for me then?)



(9/5)
I've managed to cause the .478-patched game to crash by attempting to equip a Movement ability.  Yes!
...Unfortunately, this happens in the .457-patched version as well.  Is my version really .457?

Revision 457 from SVN requires copying an FFTTextCompression.dll file into the FFTactext folder to patch.  It also reports itself as .453.
ISO generated with SVN revision 457 also crashes when attempting to equip a movement ability.

There is a "build.bat" packaged with the solution that's supposed to update version numbers for the programs, but melonhead didn't update the assembly info for the revisions since 459, so this script would have to run to update them.  The batch script errs out for me, so the version numbers don't update...

EVERY version from 459 onwards will say it's .457 (including 478) unless build.bat manages to run successfully, and it won't for me.  Yikes.

I'm now scanning revisions for something that will generate the same ISO as original Jot5, or at least not crash.  Hrm.

(9/4)
The reason why so many bytes are changed between "original" Jot5 and .457 Jot5 seems to be because strings of hex are being offset by a few bytes, resulting in huge swaths of bytes being different by position.  There probably aren't really that many differences logically.  The new .ffttext that I received from Raven seems to be the same as the one I had created, except everything was shifted a few bytes.  Patching with the new file also shifts things a bit, but otherwise everything seems to be analogous.  I'll try .457 vs .478 with some scenarios mentioned by Raven and see if I can find the broken behavior in .478.  If so, I can move to other revisions between the two.

(9/1)
Patching with .457 generates different MD5 than original version!
Every version seems to create an ISO with a different MD5 hash.  Very odd... I might have to try full diffs to see what's different...
Regardless of which version I patch with, nothing is obviously wrong with the ISO.  I'll need a more concrete case to reproduce.

There are differences in every version, but biggest differences are:
Original to being patched with .457
.457 to .478

.478 and the newer versions differ by 50 or so bytes.

MD5s computed thus far:

Jot5 orig 928eff13372df32a32d851c1040e1a09
Jot5 .457 448bb624c0518e90ed47073dcaccd73c
Jot5 .478 2235f91c90a0c6040fd3503eecf13f84
Jot5 .482 4a90820989252b992a63d6cf3a394624
Jot5 .483 1c6f1b456de4fddfa265cd9b63abbea9

Title: Re: FFT Patcher .478 Source Code
Post by: Glain on December 26, 2013, 03:00:19 pm
If 483 RC v2 is working we can probably just release it as 483 and worry about Tactext later (484 perhaps).  I think 483 v2 is the latest of what I've got, I don't think I've had any other bug reports on it that I can remember, and it's been long enough since I looked at it that trying to figure out what's wrong with Tactext again would require me to basically look at it from the start anyhow
Title: Re: FFT Patcher .478 Source Code
Post by: formerdeathcorps on January 12, 2014, 10:11:51 pm
Glain, some of the hacks currently in development will involve FFTPatcher as an editing tool for their custom hacks.  IN other words, someone may want to use FFTPatcher, but change X and Y to be a list of flags rather than unsigned bytes.  Another example would be someone wanting WotL's job requirement table in vanilla (which would require you to have the offset of said table be variable).  In other words, can you increase the flexibility of FFTPatcher's editing abilities (by adding more things editable in resources.zip) for the next version of the program?
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on February 03, 2014, 06:24:35 pm
I've rewritten the EventNames.xml for the Resources.zip

This will give the ENTD's the correct names based on their Event Names. I've also labeled
the Bravestory events as BS, as the Bravestory uses sometimes different ENTD's when re-watching
scenes. You will notice either "and BS" which means that the ENTD is the same for the Event and
Bravestory, or "BS" which means that the ENTD is for Bravestory only. If you see one without BS,
it means that that ENTD is not linked to the Bravestory.

Title: Re: FFT Patcher .478 Source Code
Post by: Angel on February 03, 2014, 06:54:58 pm
This is fantastically wonderful! Thank you so much for this~
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on February 06, 2014, 07:01:43 pm
I'm uploading the latest version of the 483 RC 2 source with Elric's event name edit baked in.  (That was for the PSX version, right?)
Apparently I can't use the Google code page to create downloads anymore, so I added it here...
https://docs.google.com/file/d/0B2RNjWD9GTwlOXFDODdqN0pER28/edit?pli=1
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on February 06, 2014, 08:45:11 pm
It is indeed for the PSX :P
Title: Re: FFT Patcher .478 Source Code
Post by: A Blood Red Fox on March 13, 2014, 12:57:58 pm
Using version 482_V2 of Shishi, it is impossible to view the third image in "Other Images", and gives this error: http://i.imgur.com/S5u9LGC.jpg

It is also impossible to "Dump all images". The program will dump the first two, then when it gets to the third image it spits out the error and hangs up on it. So it never progresses beyond the third image.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on March 13, 2014, 01:20:04 pm
Correct, this has been an error for a long time.

A lot of the other images that aren't viewable are winning conditions
which is explained in my tutorial.

One of them is also the worldmap Ramza.
Title: Re: FFT Patcher .478 Source Code
Post by: Grond on March 27, 2014, 07:24:15 pm
Great job on keeping the patcher suite maintained, but there are a few things in FFTPatcher that I think need addressing:

The "Ability Animations" (middle option) in the BATTLE.BIN patching subsection in the Patch PSX ISO dialog erroneously reverts the data at 0x2d3e6-2d40f (at least) back to vanilla defaults. This is actually the first few lines of the in-battle weapon & shield graphics & palette data and should not be overwritten. Please fix this if possible.

Also, could the deep blue "changes highlighting" in the program be made a bit less dark/intense (or make the color user-selectable)? It's too heavily contrasting IMO.

One last thing: would it be too much trouble to add an extra confirmation step (that defaults to No/Cancel) when saving a .fftpatch in a different format (PSX vs PSP) than the format it currently is in?

Thanks in advance.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 24, 2014, 11:25:53 am
Grond - late response but I'm doing some work on the FFTP tools, i'll try to address the things that you mentioned. The data being overwritten is kind of a big deal so i'll try to fix that.

Elric/SA - Do you know where worldmap Ramza is in the iso? I'd like to see if I can get him viewable in ShiShi. Also if there's any other images that shishi won't load, I can try to add these into it.
Title: Re: FFT Patcher .478 Source Code
Post by: Celdia on April 24, 2014, 12:57:29 pm
If you could find a way to make Shishi load FRAME.BIN, that would be amazing. Sadly I have fuck-all to give you towards finding useful data in there that isn't already in some tutorial thread I made for it.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on April 24, 2014, 01:41:00 pm
@ Choto, worldmap Ramza is located in WLDMES.BIN. Secondadvent has more info on that.

Also, in case you see this before I talk to you,

[10:15] <Elric> [06:03] <Chotokumaro> apparently he started making an EVTCHR viewer/editor in ShiShi
[10:15] <Elric> I've totally mentioned that a ton of times :(
[10:15] <Elric> no one ever listens to the Elric
[10:16] <Elric> also
[10:16] <Elric> [07:37] <Chotokumaro> I changed it to false and the shit loads
[10:16] <Elric> i know hes not here, but i can paste this back to him later
[10:17] <Elric> there is a version of shishi floating around with that enabled, problem is, when you import the bonus.bin stuff through shishi, it gets fucked
Title: Re: FFT Patcher .478 Source Code
Post by: Darkholme on April 30, 2014, 03:17:09 pm
Alrighty.

So, I've just downloaded the newest source code, 0.483RC2, which was posted recently in the thread. Up until now I've been working with the 0.478 with WoTL names copy, which I'm not entirely sure where I downloaded.

I find myself wanting to familiarize myself with the project and get involved. I've got a BSC in Computer Science, and I've been working in the industry for 2 years, during which experience my has been largely in PHP, C#, and Java.

I've been an infrequent user of this forum, but I have contributed a few things here and there.


That said:
Can I get a bit of a summary of how FFTPatcher works? I know you have indexed much of FFT, and that FFTPatcher makes ASM changes to the program.


That said, I'm also looking for a to-do-list for FFTPatcher. Does one exist?


I have some ideas of things that I think could make FFTPatcher better, but depending on the current to do list, they may not be what I would want to work on first.

Do you have a functional code library that can do gets and pulls? like an SVN or Github type of setup?
@Glain: Actually, I would love to sit down and talk to you about some of this stuff in a quicker fashion than on the forum. Could you PM me an alternate means of contact? Skype would be good. I can also do SMS (I use an Android Phone with DeskSMS installed, so I can send texts from my PC).
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on April 30, 2014, 09:02:07 pm
I don't really have much time to go into detail, my schedule is crazy atm with finals coming up other fun RL stuff. I have been playing with the source code for the past couple of weeks though. Glain is more knowledgeable than me with it, and tbh if you have alot of experience in C# you could probably figure the code out better than I could.

Our main form of real-time communication is IRC. Like I said I have barely any time to go into detail right now but pop on and maybe I can fill you in on a couple of things.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on May 01, 2014, 07:42:59 pm
Yeah, I'll try to jump on IRC more regularly so we can discuss.  It's nice to see more interest in maintaining FFTP!  Since more people are starting to work on it, we need to figure out what we're going to do for source control.  Melonhead (the original author) had it on SVN, but since then I've basically just been making modifications on my local machine and uploading the source as a zip file or what have you as necessary.  So yes, we'll need to come up with a solution for that.

That random gear hack (http://ffhacktics.com/smf/index.php?topic=6971.0) that you helped with the concept for was my first ASM hack for the site (and my first post here).  It's been a while!

FFTPatcher (the program itself) doesn't edit ASM; it's more for editing static data in the ISO, and it does use hardcoded addresses.  I'm not entirely sure how it handles different kinds of disc images.  That said, the entire FFTPatcher source includes several different editing programs, including the ASM patcher.

There have been some ideas floating around here for features; there are also a few times I've raised some questions about what would be useful.  Mostly I've been using this thread to keep track of requests, etc.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on July 10, 2014, 11:43:19 pm
I took what I have for 483 R2 and put it out on github here (https://github.com/Glain/FFTPatcher).  I was able to set up Visual Studio to work with it by installing update 4 for VS2012 and the git tools for visual studio, then played around with it a bit and got it to work with my repository.

We should be able to use this for source control.  I spent a while clearing out all the files we didn't need for source control (bin/obj folders, the old .svn folders, and the resources archives), and I think we should avoid committing those files.  If you want to make edits, I think you'll have to make a github account and I can add it as a contributor, and you can link that to your IDE when you connect to the repository.

It would be good if we could get the latest changes into the repository (Choto's edits, once they're working, and maybe lirmont's font updates?) and then use that as a base going forward so we can keep things organized and potentially work on things at the same time.

Maybe play around with it and see if you can connect to the repository from your IDE, and if so I can set it up so your accounts are contributors on the project and we can try getting the edits in there!
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on July 11, 2014, 08:19:08 pm
Thanks much for doing that Glain. I may not get to it for a little while though. Summer job is keeping me busy and the fall looks even busier. But once I get through with the JoT5 hacks i'll move to this!
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on July 27, 2014, 12:15:52 pm
Ok Glain, I was doing some work with the effects editor and I wound up having to update to visual studio 2013 anyway, so now I just need to find out how to connect to git and I should be good to go. I read into it a little bit but again, time is not on my side. Hopefully I'll be able to do this soon and we can get to work :)

Note to self/Glain: Make a note about not being able to switch the skillset of generic human jobs. Rufio said it breaks stuff.
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on November 16, 2014, 11:21:06 am
Triple post like a boss.

Glain! I managed to connect to GIT finally. I uploaded a commented change to the beginning of FFTPatcher -->Editors-->AllAbilitiesEditor

So I guess now it's just... make your changes and make sure they work before pushing to the repository? Anything else I should be aware of?
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on November 28, 2014, 08:58:13 pm
Looks like I successfully got your changes.  I went into the git shell and just ran "git pull" from my local FFTP project directory and it got your change.  I'm not sure how to do a pull from visual studio... it looks like you can commit from there though.

From what I can tell, "pull" is supposed to get the latest changes from the repository and merge them into your local workspace.  So I'd say that when you're ready to make changes to the repository, do a pull to make sure you have the latest version of everything, and resolve any conflicts that may arise (there probably won't be any most of the time, but when two users edit the same file it can get a bit interesting) before doing the commit.

I think that's about it.
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on December 13, 2014, 11:56:37 am
Does this thing even read FileList.txt?

I tried adding new files to it:
[indent=2]0001685 , >:\EVENT\UNIT2.BIN
0001717 , >:\EVENT\UNIT3.BIN
0001749 , >:\EVENT\WLDFACE2.BIN
0001813 , >:\EVENT\WLDFACE3.BIN[/indent]

Saved, imported the file back... and nothing. FFTOrgASM was completely ignoring the new settings. I also tried changing the offset of an existing file, and the data was still written at the old offset.

I tried editing Jobs.xml and imported that; it worked just fine.

I really wish I could add my own files... this would save me a lot of trouble. Then again I guess I can write past an file up to my new files. Not the best, but could work.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on December 13, 2014, 10:55:56 pm
It doesn't look like anything in FFTP actually reads FileList.txt, no.  I did find a constant in the code for it (in Resources.cs), but nothing seems to reference the constant.
FFTorgASM seems to translate what's in the File attribute of the <Location> tag by parsing the value to a constant in the Sectors enum:


sector = (PsxIso.Sectors)Enum.Parse( typeof( PsxIso.Sectors ), fileAttribute.InnerText )


If we wanted new files to be recognized, I suppose we'd have to modify the Sectors enum, or change the code to look at the text file (if it couldn't find the file in the enum?).  I actually wasn't even aware that the text file existed.

And yeah, I doubt anything would stop you from just writing past the end of a file into another file, although it seems the positions of sectors in the ISO may change based on the ISO type... (see IsoPatch.cs)
Title: Re: FFT Patcher .478 Source Code
Post by: Grond on May 14, 2015, 09:17:00 pm
Posting these two patches in here as requested.
<Patch name="Half of MP multiplies MP cost by XX / 128">
<Description>Make sure to fill in both X values for the drop-down box below
(with the same value; one affects displayed MP cost and the other affects actual MP cost).

90% is X = 74
83% is X = 6B
80% is X = 67
75% is X = 60
70% is X = 5A
66% is X = 56
60% is X = 4D
50% is X = 40 (default)
40% is X = 34
33% is X = 2B
30% is X = 27
25% is X = 20
20% is X = 1A
17% is X = 16
10% is X = 0D
If you want the multiplier to be greater than 100%, add 0x80 to the above number.</Description>
<Location file="BATTLE_BIN" offset="f2f90">
f800a88f
0d009190
05000011
</Location>
<Variable name="X" file="BATTLE_BIN" offset="f2f9c"/>
<Location file="BATTLE_BIN" offset="f2f9d">
  000234
19005100
00000000
12100000
c2890200
92060608
00000000
</Location>
<Location file="BATTLE_BIN" offset="f3000">
80004230
06004010
00000000
</Location>
<Variable name="X" file="BATTLE_BIN" offset="f300c"/>
<Location file="BATTLE_BIN" offset="f300d">
  000234
00000000
19004400
12100000
c2210200
dcf60508
00000000
</Location>
<Location file="BATTLE_BIN" offset="116b60">
00680508
00000000
00000000
00000000
</Location>
<Location file="BATTLE_BIN" offset="11aa34">
e4670508
00000000
00000000
00000000
00000000
</Location>
</Patch>


<Patch name="Short Charge multiplies ability CT by XX / 128">
<Description>Make sure to fill in both X values for the drop-down box below
(with the same value; one affects displayed CT and the other affects actual CT).

90% is X = 74
83% is X = 6B
80% is X = 67
75% is X = 60
70% is X = 5A
66% is X = 56
60% is X = 4D
50% is X = 40 (default)
40% is X = 34
33% is X = 2B
30% is X = 27
25% is X = 20
20% is X = 1A
17% is X = 16
10% is X = 0D
If you want the multiplier to be greater than 100%, add 0x80 to the above number.</Description>
<Location file="BATTLE_BIN" offset="f3028">
f000a98f
01000234
05002215
</Location>
<Variable name="X" file="BATTLE_BIN" offset="f3034"/>
<Location file="BATTLE_BIN" offset="f3035">
  000234
19005000
00000000
12100000
c2810200
9d060608
00000000
</Location>
<Location file="BATTLE_BIN" offset="f3050">
05004010
</Location>
<Variable name="X" file="BATTLE_BIN" offset="f3054"/>
<Location file="BATTLE_BIN" offset="f3055">
  000234
19005200
00000000
12100000
c2910200
1cf20508
00000000
</Location>
<Location file="BATTLE_BIN" offset="115864">
14680508
00000000
00000000
</Location>
<Location file="BATTLE_BIN" offset="11aa6c">
0a680508
00000000
00000000
00000000
00000000
</Location>
</Patch>
Title: Re: FFT Patcher .478 Source Code
Post by: Choto on December 13, 2015, 10:50:01 pm
Okay, been a long time. I've been playing with the patcher source code over the past year or so and added some stuff. I'm hoping there aren't too many issues and please let me know if there are, and I will fix them up if possible. I don't have an extensive changelog but here's the general rundown:

FFTOrgASM
-The program now loads all files into a listbox on the left hand side. There's also an "All" option to view a master list of all patches in all files. When the patch button is clicked, it will patch whatever patches are selected in the right hand side listbox. This means if you select patches in "All" and then switch to a specific file and patch from there, only the patches from that file will be applied.
-The program now reports any file that did not load correctly because of formatting errors. It also tells you generally where the error is, but in a dumb way unfortunately.
-The program now patches to savestates. It won't patch to any file that's not loaded into the RAM of the savestate already though. You have to patch iso for that.
-The conflict checker is built in just for convenience.
-I've tried to compile all the ASM's i could into the default hacks, so there should be some more in there along with fixed versions.

FFTPatcher
-Now Patches to SaveState same as FFTorgASM
-Item Effects are now editable.. I can't remember if they were or not in the last version.

ShiShiSpriteEditor
-MON, RUKA, and both of Altima's forms animations are viewable.
-WEP frames and animations are viewable... but I'm pretty sure they don't load correctly.

FFTacText
-I think I messed with this a little bit looking for the .dte error but didn't get anywhere. I recommend using the last known working version which I think is the one included in .457?

I think that's all. May not be perfect or have bugs but I hope it helps. I didn't want it to continue sitting on my hard drive out of reach of people who could use it. Let me know if you encounter bugs and I'll try to list them and fix them.

Edits: Seems like Jumza is having trouble opening them. I should mention that you need to update your .net framework to 4.5 for the new FFTorgASM.
Title: Re: FFT Patcher .478 Source Code
Post by: Jumza on December 13, 2015, 11:13:42 pm
That's totally sick dude! I'll try this out ASAP and let you know what I find!
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on December 14, 2015, 08:34:10 am
Really nice stuff, although I wish you would've also included Throw/Jump/Math Skill Effects as those are still useable in events without sacrificing an active ability slot. :p

Omg @ Shishi: How the hell did you figure out the SEQ format? I was never able to.
Spriters gonna be happy!
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on December 14, 2015, 08:37:39 am
Dat Choto though <3
Title: Re: FFT Patcher .478 Source Code
Post by: Valkirst on December 14, 2015, 11:39:59 pm
These are fantastic updates, I really could use the animations for those other sprites.  :mrgreen:
Title: Re: FFT Patcher .478 Source Code
Post by: Argy on December 15, 2015, 12:31:18 pm
Great work Choto!! Choto, is there anything he can't do!! Keep up the great work.
Title: Re: FFT Patcher .478 Source Code
Post by: nitwit on July 20, 2016, 10:20:58 pm
Necrobump, but could someone put this link in the first post?

https://github.com/Glain/FFTPatcher

@Maintainers: if I were to add an optional frame for previewing ability damage and hit percentage as you modify the x/y values for it, and a frame that previews stats at specific levels you can choose as you modify growth and multipliers, how would you prefer it done?  Not saying that I'll do it, but I've been thinking about it.
Title: Re: FFT Patcher .478 Source Code
Post by: Darkholme on July 31, 2016, 06:02:41 pm
FFTPatcher is now on GitHub.

Nice, about time!

I see some updates have been made, So, when is the next release going to be? And where are the compiled uploads on there like most other GitHub repos?

The newest one I've got a is 0.489
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on July 31, 2016, 09:36:57 pm
It's been on github for over 2 years.
Title: Re: FFT Patcher .478 Source Code
Post by: Darkholme on August 02, 2016, 11:28:42 pm
Oh. I remember people talking about it a few years back (probably 2011 or so), and then I thought nothing came of it.
Title: Re: FFT Patcher .478 Source Code
Post by: Emmy on September 18, 2016, 03:53:20 pm
Reporting a bug with FFTorgasm's Conflict Checker.  I had 2 hacks that were written to the same location that the program didn't pick up on.  Any chance of a fix of this?

Here's an example of 2 conflicting hacks it doesn't pick up on:


<Patch name="Blank Support after No charge gives unit 50% bonus damage on units that are Hasted or Reraised">
    <Description>Affects damage done by anything boosted by ATK or MATK Up</Description>
    <Location file="BATTLE_BIN" offset="11f054">
80420508
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11f204">
A8420508
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="e9a00">
1980013C
942D218C
00000000
92002390
00000000
02006330
18006010
00000000
1980043C
982D848C
00000000
5A008390
00000000
20006330
06006014
00000000
5B008390
00000000
08006330
0B006010
00000000
1980033C
CE386384
00000000
40200300
21208300
C21F0400
21208300
43200400
1980013C
CE3824A4
1980033C
FF386390
17180608
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="e9aa0">
1980023C
942D428C
00000000
92004390
00000000
02006330
18006010
00000000
1980043C
982D848C
00000000
5A008390
00000000
20006330
06006014
00000000
5B008390
00000000
08006330
0B006010
00000000
1980033C
CE386384
00000000
40200300
21208300
C21F0400
21208300
43200400
1980023C
CE3844A4
1980023C
942D428C
17180608
00000000
    </Location>
  </Patch>



<Patch name="Monster Talk = 2x damage in critical 2.0">
    <Description>Use this version instead of my old version.  No longer partially breaks Pride's defense hack.</Description>
    <Location file="BATTLE_BIN" offset="11f14c">
15180608
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11f154">
1980023C
942D428C
1980033C
CE386394
91004490
00000000
10008430
08000410
00000000
5A004490
00000000
01008430
03000410
00000000
40180300
CE3823A4
84180608
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11f204">
55180608
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11f0a0">
68180608
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="11f1a0">
1980023C
942D428C
1980033C
CE386394
91004490
00000000
10008430
08000410
00000000
5A004490
00000000
01008430
03000410
00000000
40180300
CE3823A4
2B180608
00000000
    </Location>
  </Patch>



Note how they both write to 0x11f204
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 02, 2016, 03:24:37 pm
*Whistles*
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on October 02, 2016, 05:08:45 pm
Whoa great job Glain! Are you planning to make anything else avaliable in shishi, and when can we expect the next update?
Title: Re: FFT Patcher .478 Source Code
Post by: Argy on October 03, 2016, 02:29:12 pm
Wow Glain. That is brilliant. Keep up the good work. The amount of time that this will save will be brilliant!!
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 03, 2016, 09:13:25 pm
I can see what other files I may be able to add in there... I'm currently experimenting with EVTCHR and EVTFACE, which would have to be split into sections in Shishi. Are there any specific files that we want to see added in there?

I should mention that I changed the way Shishi deals with 4bpp (16 color) paletted bitmaps in the Other Images section, because the way it was working before was... strange, to say the least. (Exporting the images as GIFs, getting the background color wrong, saving the palette in an arbitrary/random order, oh my!) 

You'll see in the screenshots that there's a "Palette" dropdown for FRAME.BIN and ITEM.BIN. Shishi now imports or exports those images into 4bpp paletted bitmaps with whatever palette you selected, and the imported/exported file should only have that one palette in it. I experimented with allowing an option that would allow you to have all the palette data in one bitmap, but there's really no way to specify multiple palettes in a bitmap as far as I'm aware. We could provide an option to download as an 8bpp (256 color) paletted bitmap, which would allow you to cram all the colors of 16 palettes into one huge 256-color palette, but the image would always display in the first palette, the exported image data would be double the size, and you're still out of luck if you go beyond 16 palettes (FRAME.BIN, for example, has 22), so I didn't want to go there.

As for an update, I've already updated the Git repository, so in theory anyone could check it out whenever, but you may have to compile the code first.  I could do a local build and release it whenever, really.
Title: Re: FFT Patcher .478 Source Code
Post by: Argy on October 09, 2016, 05:41:30 am
Glain, a local build would be absolutely brilliant. (I was looking for it on GitHub and couldn't find it. It's just me!!) I have been using Tilemolester for a while and its hard playing with the palettes).

The beautiful thing will be, being able to use Graphics Gale and change the type of sword for example and then recolor it to suit. I am sure this is true for quite a few people. Also being able to make quick changes in the FRAME.BIN as well, will be nice.

Once again, well done on this. :) 
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 16, 2016, 02:14:50 pm
All right, so I'm now releasing FFTPatcher suite v0.491, which includes all my recent changes to Shishi, as well as a few other changes! I made a release for it on the online repository here (https://github.com/Glain/FFTPatcher/releases/tag/v0.491), which also includes the release notes. Tell me what you think and let me know if you find anything wrong with it!
Title: Re: FFT Patcher .478 Source Code
Post by: Argy on October 16, 2016, 02:34:25 pm
Argy quietly downloads......
Title: Re: FFT Patcher .478 Source Code
Post by: Emmy on October 16, 2016, 03:21:04 pm
QuoteRemoved the checkboxes. They had no purpose (and took a long time to render when switching tabs!)


Thank you for this! :)

QuoteFixed various issues with the ASM encoder.


Does this include the bug that I found where 2 hacks that are incompatible with each other might not be found by the Conflict checker?

Anyway thank you for the new Patcher! :)
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on October 16, 2016, 03:37:52 pm
The conflict checker was made by Choto. The encoder is what turns ASM into hex. If you look at Glain's xml file you'll see all his hacks are stored as ASM in it. He coded that feature entirely on his own as melonhead did not.

*checks out the new shishi*

EDIT: ALL the new features! I really love the ability to easily individually import/export EVTCHRs, BONUS.BINs, And the option to import individual UNIT.BIN frames is pretty awesome too. It all seems to work very well.   :mrgreen:
And I'm really REALLY happy that you separated the ITEM.BIN "Orbonne Monastery" from the maps list. We could never tell which one was which and that was really annoying. (And I do like that ITEM.BIN still has the Orbonne Monastery part since it's part of the same image, and that suits my purposes)

I'm surprised some old issues still persist though:


Those improvements really kick ass though. We've been wanting for them for a long time. \o/
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 16, 2016, 06:14:56 pm
Thanks! Glad to hear it's working for you!

Thanks for the feedback as well about some problems with the OPNTEX and OPNBK images. I hadn't looked at some of that image data closely. I've updated the release to fix those issues!
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on October 19, 2016, 06:25:43 am
Great job Glain, I tested it with WotL (for some ungodly reason) and it turns out you are missing a few EVTCHR, there are 2 or 3 more sheets that extend past the PSX version of EVTCHR.BIN which are used for Luso and Balthier.

Also there seems to be a lot of blank space in many of the images for the PSP version.
Title: Re: FFT Patcher .478 Source Code
Post by: CONMAN on October 19, 2016, 05:38:24 pm
Just wanted to say thanks a bunch Glain!  This update makes modding a lot easier!
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 19, 2016, 06:11:55 pm
Thanks, glad to hear it!

I added the additional EVTCHRs to the PSP version and updated the release... I think there were six additional EVTCHRs.  And yeah... I noticed that about the image sizes too, where the images had a lot of blank space, but it was that way in the older versions of Shishi as well, and I assume that's just the way those images are in the PSP version for whatever reason.  Some of the PSP images also use a different transparent color and even different color depth than the PSX version.
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on October 19, 2016, 06:23:51 pm
I'm not one who's really using FFTPatcher all that much, but I know that looking at a heavily altered mod's FFTP data, such as JotF, there's blue everywhere... it's pointless and irritating. In fact, I'm not even sure why the "blueing" is there to start with, and I kinda wish it were gone?

And a personal request: in the credits, edit this appropriately >_>; "ZodiacFFTM: For his awesome Excel spreadsheets on which this application was based"
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 21, 2016, 09:32:51 pm
All right, so I've updated the release yet again with those changes as well.

The way I handled the colors for modified values was to make them configurable by adding a Settings.xml.  Set the UseModifiedColor node Value attribute to false if you don't want the colors changed at all, or you can configure the foreground and background colors used by editing the RGB values.  I also changed the default color to be lighter and hopefully not contrast as much.
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on October 21, 2016, 09:44:02 pm
Hell yeah Glain, you're the best! :D
That bothered me for years!
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on October 22, 2016, 03:48:51 am
One small issue with this new feature; FFTOrgASM tries to parse Settings.xml. Might want to have FFTPatcher parse it as xml while the extension isn't xml? Idunno.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 22, 2016, 12:42:56 pm
Thanks! :D
Okay, so I dealt with the new issue by moving all the XML patches to their own XmlPatches directory, and that's the directory that gets scanned now.  New release up yet again!
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on October 22, 2016, 12:58:51 pm
Actually, I think I prefer it that way. Less clutter. Good idea Glain!
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on October 23, 2016, 09:27:07 am
Actually, while we're on the subject of improving FFTPatcher...
Abilities 0x017E to 0x01A5 are missing the ability to edit their effect
The 0x0800 flag is "animate effect on item impact". I can't put it in a better way... it's used by chemist items and Ninja balls, yet just makes the game hang if you try to get it to work with anything that doesn't use an item.

Otherwise you already fixed the animation tab...

The "Monster Skills" tab says "Beastmaster" in the PSX version

On the "Move-Find Item" tab, looking at the code, the first flag 0x80 would be "Higher Elevation" not "No Activation"
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on October 26, 2016, 07:00:55 am
A couple more things Glain,

1) Are you sure that WLDFACE4.BIN holds the images you have associated with it in Shishi? From my understanding WLDFACE4 is unused, and EVGRP doesn't even require you to load WLDFACE4 to see those images IIRC.

2) While I can add in different memory card images now, they don't seem to work. If I load from one of my saves, I can save all 15 slots on the memory card (or even a new memory card) but in the memory card screen after ejecting the disc (I'm using pSX) it still shows all the old images?

Hoping you can get that fixed since Twin just spent a bunch of time making our new memory card icons for Jot5 :(
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 26, 2016, 07:22:11 pm
1) Yeah, I mean, the image data in the WLDFACE4.BIN section is pulling from there. And yeah, it's duplicate data. It's just a copy of the final 40 entries of WLDFACE.BIN, and probably doesn't get used for anything. But yes, Shishi is pulling that image data from the sector enumerated as EVENT_WLDFACE4_BIN (6314), which to my understanding is where WLDFACE4.BIN is. (WLDFACE.BIN is at sector 6330, so it's not just looking at the end of that file.)

2) I... am not sure why that doesn't work. I mean, if you open your disc image in Shishi and it pulls in the new memcard images, they must have been changed in your disc image's CARD.OUT file (you could verify this by exporting the file and checking the differences with the original). Why that wouldn't correspond to the images actually changing in the memory card screen is another question... do we know when the image to be saved to the memcard is loaded from the disc image? Could it be saving an image that it already loaded before the change was made in Shishi?
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on January 01, 2017, 10:03:46 am
I was wondering... what is DefaultHacks.xml?

One of Razele's hacks is present in DefaultHacks.xml, but not Razele.xml.
One of Razele's hacks has the same hack in DefaultHacks.xml AND Razele.xml, but they're different versions and there's no way to tell which is the good one!

I'm just trying to make some sense out of all this because I think ASM hacks in FFTOrgASM requires one hell of a makeover. I really, really want to be able to group hacks by category, such as [Formula], [QoL] (Quality of Life), [RSM] and so on.

I was thinking of either manually adding those tags in the patch name and have the "All" section automatically reorganize in alphabetical order, or implement a tag feature.

I was also thinking about adding an Author tag, but that's not as important.

<Patch name="Cross Skip v3" tags="Quality of Life, SpeedUp" authors="Xifanie">
<Description>Holding X (Cross button), will fly you through dialog text as if you were mashing the button.&#13;&#10;&#13;&#10;by Xifanie</Description>
<Location file="BATTLE_BIN" offset="CA6C4">
1780023C
D097428C
CE400508
0480033C
</Location>
<Location file="BATTLE_BIN" offset="CA33C">
D3400508
</Location>
<Location file="BATTLE_BIN" offset="C8BC8">
EC400508
0480023C
</Location>
<Location file="BATTLE_BIN" offset="CB6F0">
DC400508
032C0500
40000831
02000015
25400000
A800A897
1780013C
D4DA37A4
D6DA3EA4
D8DA30A4
E0DA22A4
E2DA23A4
</Location>
<Location file="EVENT_ETC_OUT" offset="210">
E040050C
1780013C
</Location>
<Location file="EVENT_ETC_OUT" offset="258">
E040050C
1780013C
</Location>
<Location file="EVENT_ETC_OUT" offset="2A0">
E040050C
1780013C
</Location>
<Location file="EVENT_ETC_OUT" offset="2E4">
E040050C
1780013C
</Location>
<Location file="EVENT_ETC_OUT" offset="320">
E040050C
1780013C
</Location>
<Location file="BATTLE_BIN" offset="E9338">
4459638C
20014230
40006330
B5C50408
25104300
0480023C
4459428C
6400278D
40004230
02004010
FC00E230
03004734
D1C40408
00000000
0480083C
4459088D
BEC90408
00000000
54E4238C
00000000
07006014
0480023C
4459428C
00000000
40004230
02004010
00000000
FF7F1026
0800E003
3840228C
4459428C
00000000
40004230
04004010
1680023C
25A80000
1780013C
04A420A4
F4BE0408
885F428C
</Location>
</Patch>
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 02, 2017, 02:24:37 am
Yeah, I don't really know what's going on with the organization of the hacks.  Not sure about DefaultHacks.xml either.  I basically just left it using the same scheme it already was.

I suppose the hacks could be organized however; a tag system could be a good idea, although I wonder how it would work in the interface.  Would there be a pre-set list of tags you could select?  Maybe you could search by tag?  Would the left menu be a list of tags instead of file names?

Since we're working with XML files here, in true XML fashion, when you have more than one element that can be specified in a category, instead of doing something like tags="Quality of Life, SpeedUp" it would probably be this sort of thing as a child node:

<Tags>
  <Tag>QoL</Tag>
  <Tag>SpeedUp</Tag>
</Tags>

Same for authors, if you wanted to support specifying more than one.
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on January 02, 2017, 02:46:44 am
I suppose we should go with standard XML, yeah. Just never been a fan of the format. :p
I don't think I'd have too much trouble adding Tags/Authors support to my hack spreadsheet in that format, thankfully.

I was thinking of grouping by tags, and leaving the option to view individual files at the bottom... although I don't see how it would be all that useful after everything would be ordered by tags. It could be useful until we manage to more or less implement and standardize the tag system, so that everything is finally nicely ordered.

I also had another silly thought: adding a credits generator button. Copying to clipboard the list of authors and their relevant hacks so that you can easily copy/paste into your mod's main topic.
But you know, that would just be giving in to human laziness. :/
Using a hack is not nearly as hard as making it... you'd think people would at least try to properly credit people for their work, but instead it's only a minority that does. Sad.

Which makes me think: prior to the current release, my XML had Choto's Mime hack in it, and fdc completely removed my Weapon Strike Fix hack (which was a misnomer, I'll admit), to replace it with his Elemental Fix hack thing, which COMPLETELY disables the features that I've built in MY hack (which allows to choose between weapon/ability elementals). Yeah, when I learned that, I was pretty fucking pissed. So I bet people have not used my hack in years because it was gone.

Thanks a lot fdc :|
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 08, 2017, 10:12:50 pm
Hmm... yeah :/  ASM hacks shouldn't be disappearing like that.

I have a feeling that most people just wouldn't press the credits generator button if it existed :D although who knows.

Are the XML patch files that are in the current release the right ones or are there some updated ones that I should replace in the source?
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on January 09, 2017, 02:15:21 pm
They probably wouldn't press the button; just wishful thinking.

The xml files are fine AFAIK. I just don't know where DefaultHacks.xml came from; it wasn't there in .489.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 09, 2017, 07:52:29 pm
I think I know what happened with DefaultHacks.xml.  It's been in the source forever, but it wasn't being included in the released builds because it was set to not copy to the output directory.  At some point, perhaps around the .491 release, I probably noticed it wasn't being copied and figured it was supposed to be, so it was included in 491.

DefaultHacks.xml seems like mostly an old version of Razele.xml, but there are a few (broken with load delay issues) hacks in DefaultHacks.xml that don't seem to have an equivalent in Razele.xml, namely:

Defending reduces physical damage by 25%
Float weak against Wind; Oil weak against Fire
Formula 4E hack

That said, they'd have to be rewritten anyway to work correctly.  I suppose they could either be fixed and included in Razele.xml or just deleted from the source.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 11, 2017, 07:29:37 pm
I'm now releasing FFTPatcher suite v0.492! It includes... mostly a bunch of changes to FFTorgASM, but I think I've fixed some pretty signficant things with it, including the intermittent problem where it sometimes wouldn't patch, the problem with variable values sometimes being wrong, and the form resizing problem.  It also now checks for potential ASM hazards within patches and highlights ones that have them in red.  I also included a few other small changes. 

I added another release on the online repository for 0.492 here (https://github.com/Glain/FFTPatcher/releases/tag/v0.492), which also includes the release notes!  Let me know what you think and/or if you find any bugs!

(Edit: MassHexASM (http://ffhacktics.com/smf/index.php?topic=7130.0) has also been updated with the latest ASM encoder/decoder changes.)
Title: Re: FFT Patcher .478 Source Code
Post by: Emmy on February 02, 2017, 01:10:58 pm
So I'm confused.. Don't see any reason why these 2 hacks would conflict unless I'm looking over something incredibly dumb, but conflict checker has them marked as conflict:

http://i.imgur.com/ksvtv5d.jpg

http://pastebin.com/Uquz01eP
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on February 02, 2017, 07:09:47 pm
They don't.

It's probably checking:
[116B6C - 116B70] VS [116B70 - 116B78]

instead of:
[116B6C - 116B6F] VS [116B70 - 116B77].

Thus creating an imaginary conflict.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on March 31, 2017, 08:39:24 pm
Since Glain develops this from time to time, here's some requests/suggestions for whatever future updates may come:

FFT OrgASM:
The left window which lists the .xml files - please make this control behave more like its counterpart on the right - a checkbox where you can click to show the contents of every .xml you're interested in on the right, with an "All" option that checks all the options for you.  The current method is nice but also a bit obnoxious at times - especially because it doesn't default to "All" being loaded, nor can you load an option by clicking the white space next to the .xml's name.  A checkbox setup similar to the method used to choose which hacks are going to be applied would streamline what you've done greatly.

ShiShi:
I know this one's probably obnoxious, but at some point, can the default resources for ShiShi use base-0 for the listings of Character Sprites, Formation Sprites, etc.?  Not only are things like UWEntries base-0, but even the values shown in FFTPatcher are base-0, as one might expect the game data itself to be, etc.  ShiShi is the odd exception that indexes all these things in base-1 and it requires constant mental conversion if you're, say, debugging a list of changes to UWEntries.  It's not a big deal for a user only making one or two changes but its obnoxious for anyone attempting anything on a larger scale.

Otherwise I really like what I've seen from .492 so far.  Good work.  Both of my suggestions are mainly just usability quibbles, really.
Title: Re: FFT Patcher .478 Source Code
Post by: Raijinili on March 31, 2017, 08:44:40 pm
Quote from: Glain on January 02, 2017, 02:24:37 am
I suppose the hacks could be organized however; a tag system could be a good idea, although I wonder how it would work in the interface.  Would there be a pre-set list of tags you could select?  Maybe you could search by tag?  Would the left menu be a list of tags instead of file names?

Since we're working with XML files here, in true XML fashion, when you have more than one element that can be specified in a category, instead of doing something like tags="Quality of Life, SpeedUp" it would probably be this sort of thing as a child node:

<Tags>
  <Tag>QoL</Tag>
  <Tag>SpeedUp</Tag>
</Tags>

Same for authors, if you wanted to support specifying more than one.


I had the same thoughts (about authors and tags), but why is a <Tags> wrapper needed? Is this some XML style thing I'll regret asking about?

Another feature I wanted was `endian="little"` (or "big" or "auto") for the locations.
Title: Re: FFT Patcher .478 Source Code
Post by: Emmy on April 19, 2017, 12:34:41 pm
Suggestion: Any chance that you can make Patcher more consistent with its use of hex and decimal values?  Ideal: an option to toggle between use of hex/decimal values for all boxes under "file" (where the program will convert between them if you click the other option).  If that's not possible, make it only use hex?
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on April 19, 2017, 01:31:05 pm
Quote from: Emmy on April 19, 2017, 12:34:41 pm
Suggestion: Any chance that you can make Patcher more consistent with its use of hex and decimal values?  Ideal: an option to toggle between use of hex/decimal values for all boxes under "file" (where the program will convert between them if you click the other option).  If that's not possible, make it only use hex?


Standard form for tools like FFTPatcher is to use Decimal for known values (ie Multipliers and Growths on jobs, X/Y tile locations, etc.) and Hex for index values (Sprite ID, Unit ID, Job ID, Skillset ID, Item ID, Ability ID, etc.).  The problem with FFTPatcher is that it isn't always consistent even on these rules.  It's been a long time since I've reached my fist into the guts, so I can't think of examples off the top of my head, but I remember it having issues in not always consistently casting data types in the GUI following this rule.  If those could get fixed, it would be nice, but someone would have to dig through FFTPatcher and find all the examples of stuff that needs fixing since Glain just inherited Melonhead's mess.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 25, 2017, 11:45:40 am
Quote from: RavenOfRazgriz on March 31, 2017, 08:39:24 pm
I know this one's probably obnoxious, but at some point, can the default resources for ShiShi use base-0 for the listings of Character Sprites, Formation Sprites, etc.?  Not only are things like UWEntries base-0, but even the values shown in FFTPatcher are base-0, as one might expect the game data itself to be, etc.  ShiShi is the odd exception that indexes all these things in base-1 and it requires constant mental conversion if you're, say, debugging a list of changes to UWEntries.  It's not a big deal for a user only making one or two changes but its obnoxious for anyone attempting anything on a larger scale.


I took a look at this - to be clear, this is for the dropdown in the Other Images section where you select a specific image inside a category?

The general format of an entry in that dropdown is "{LeadingNumber} - {Name}".  If {Name} isn't specified for a specific entry in the source XML file, then {Name} uses the format "{CategoryName} ({TrailingNumber})"

I could change {LeadingNumber} to two-digit hex starting at 0, which would be more in line with what FFTP does (and UWEntries, for that matter).  As for {TrailingNumber}, I could also change that to start at 0, but maybe leave it decimal.

Some directly specified {Name} values within the input XML contain their own specific numbers starting at 1 (e.g. WLDTEX1).  Not sure if those would be worth changing.

To be consistent, I could also use base-0 for the Palette dropdown in the same section.

Quote from: RavenOfRazgriz on April 19, 2017, 01:31:05 pm
Standard form for tools like FFTPatcher is to use Decimal for known values (ie Multipliers and Growths on jobs, X/Y tile locations, etc.) and Hex for index values (Sprite ID, Unit ID, Job ID, Skillset ID, Item ID, Ability ID, etc.).  The problem with FFTPatcher is that it isn't always consistent even on these rules.  It's been a long time since I've reached my fist into the guts, so I can't think of examples off the top of my head, but I remember it having issues in not always consistently casting data types in the GUI following this rule.  If those could get fixed, it would be nice, but someone would have to dig through FFTPatcher and find all the examples of stuff that needs fixing since Glain just inherited Melonhead's mess.


Right, this is how I understand the general idea as well.  I don't like the idea of having a universal toggle. (IDs in decimal are fine, but why display something like Evade % in hex?) If it's not consistent in places, we can change specific values as they come up.  I don't know of any off the top of my head, so as you've said, somebody would have to find the values they want changed and list them out.

Quote from: Raijinili on March 31, 2017, 08:44:40 pm
Another feature I wanted was `endian="little"` (or "big" or "auto") for the locations.


Is there a practical application behind this?

This would require some way to separate the bytes into groups to then apply the byte ordering on.  We could either use a delimiter between groups (the delimiter could just be a newline), or require a specified, uniform number of bytes per group.

If implemented, the only thing this would do is check for endian="big" and if so, reverse the bytes in each group.

Quote from: Raijinili on March 31, 2017, 08:44:40 pm
I had the same thoughts (about authors and tags), but why is a <Tags> wrapper needed? Is this some XML style thing I'll regret asking about?


It's just standard XML format.  It would allow for more information to be added to the tags per item if necessary, although maybe that isn't needed.
It could be done as CSV (comma separated) within an attribute as well, as was first suggested.  That can get dicey if you want to put a comma inside a tag name, but the same can be said for < and > characters inside XML tags (although you can escape those using CDATA).
Title: Re: FFT Patcher .478 Source Code
Post by: RavenOfRazgriz on April 25, 2017, 01:21:53 pm
Quote from: Glain on April 25, 2017, 11:45:40 am
I took a look at this - to be clear, this is for the dropdown in the Other Images section where you select a specific image inside a category?

Actually, never mind this one.  I was talking about the main Sprite page, but I apparently still had a .482 FFTPatcher loaded when posting this.  I just checked and it's fixed in both .491 and .492.
Title: Re: FFT Patcher .478 Source Code
Post by: secondadvent on May 08, 2017, 07:53:20 pm
The unknown flags in shishi are actually for the sprite's "height" value - most units are 36 (3 tiles), Altima 1 is 60 (5 tiles) and Altima 2 is 120 (10 tiles) tall. This affects things like arrow arcing and deciding where a unit can pass on the map if there's a spot where there's a higher tile on the same X/Y (like in the cases of bridges).
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on May 08, 2017, 09:17:29 pm
Quote from: secondadvent on May 08, 2017, 07:53:20 pm
The unknown flags in shishi are actually for the sprite's "height" value - most units are 36 (3 tiles), Altima 1 is 60 (5 tiles) and Altima 2 is 120 (10 tiles) tall. This affects things like arrow arcing and deciding where a unit can pass on the map if there's a spot where there's a higher tile on the same X/Y (like in the cases of bridges).


You always know when SA makes it post it's gonna be good. He's almost up to 20! That's almost 2.25 per year! Woo!
Title: Re: FFT Patcher .478 Source Code
Post by: RavenCurow on April 25, 2018, 12:05:17 am
Should I post anything I find wrong with the FFTPatcher in here or is that somewhere else now? I know this page is almost a year old, but it seems to be the continued thread for it. I just noticed a couple things in the patcher that are incorrect and may be confusing to new people using it that wouldn't otherwise know.

1. Formula 1F for Malak's Un-Truth skills shows an incorrect formula. In patch it shows,
1F Dmg_((100-CasF)*(100-TarF)*(MA+Y)*Ma/2)

which is incorrect and Malak would be breaking all kinds of damage limits if it were correct lol. The correct formula is as follows,

1F Dmg_((1-CasF/100)*(1-TarF/100)*((MA+Y)*Ma/2).

2. I've found that in the tips box for the Faith forumla it lists F as F=CasF*TarF/100^2 which is also incorrect.
The faith formula is actually F=(CasF/100)*(TarF/100)

I'm not sure if someone has already pointed this out somewhere in here as I didn't thoroughly look through the other pages. I just figured I wouldn't mention it in case it hadn't. If it has then you can ignore this.
Title: Re: FFT Patcher .478 Source Code
Post by: Xifanie on April 25, 2018, 05:49:59 am
I mean, you're not wrong, but you're also not right...

In PSX games and thus FFT, floating points do not exist. So 99/100 (or 0.99) is 0.

I know that the faith formula is wrong in that regard, but from a mathematical perspective, your "correct" formula is the same thing as mine... Maybe you forgot about the priority of operations that you learned in school? Exponents come before nearly much anything else.

The issue is that I never based the formulas off actual code. Someone would really need to go through all the documented code and properly document all the ability/weapon formulas, but no one has ever done it in the 10 years FFH has existed, so I doubt it will ever happen.
Title: Re: FFT Patcher .478 Source Code
Post by: RavenCurow on April 25, 2018, 06:49:21 am
You are right! Haha! Don't I look the fool now. I forgot to do the exponent on the faith formula first. So the only one wrong is the un-truth formula, and since floating points don't work then my formula probably isn't correct from a code stand point either.

I understand where you are coming from. I didn't make the post as a criticism, but rather a bug report. Just a small thing that is easily fixed through the resources.zip for one that knows what they are doing. I already corrected it for my download, but thought I'd throw it out there for a future update if and when that happens.
Title: Re: FFT Patcher .478 Source Code
Post by: Raijinili on June 02, 2018, 01:05:11 am
As far as I know, continued development on FFTPatcher (if any) will be at the GitHub repo (https://github.com/Glain/FFTPatcher). Bug reports should probably go on the bug tracker there (https://github.com/Glain/FFTPatcher/issues).
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on September 13, 2018, 10:20:41 am
I'm not git savy.

Anyway, there appears to be another issue. In the Bonus.bin, in shishi, in Number 2, for Elidibs, it has the "This Game is Complete!" instead of "This Battle is Complete!" I'm 99% certain that the former is supposed to be on the Altima one, not Elidibs.

Edit: Another issue. Map 120 doesn't show up in the list for the other images in shishi. In previous versions it was called "(Garbled name) -- Sloped Checkboard" which came after Checkboard Wall Waterland. In the newer shishi, Checkboard Wall Waterland is the last one displayed to edit. This is an issue since we use a ASM for TLW to copy another map onto this location so that we can have it show a different name due to how one of the battles in TLW was done.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on September 13, 2018, 02:21:23 pm
Regarding BONUS.BIN: All the images in that file are found by Shishi using the same procedure; there's nothing different about image number 2.  Seems farfetched that part of the image would be right and another part wouldn't.

As for maps, it appears that the number is off by one in the XML file.  Try finding /Resources/PSXFiles.xml within the FFTP directory, and edit this line (line 2439):
<Repeat Number="119" Offset="2560"> and change the Number from 119 to 120.


EDIT: Apparently I'm full of it and that file is compiled directly into the Shishi EXE so you can't edit it! Here's an updated EXE.
EDIT: It's also stored as plain ASCII text in the EXE so you could hex edit it.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on September 14, 2018, 12:32:28 am
Thank you!
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on September 14, 2018, 08:51:45 am
As for the bonus.bin thing, i found it weird as well, but during my last playthru, i noticed that it didnt say "this game is complete" as it should, and instead says "this battle is complete" am i mistaken that it should be at the end of the altima battle and not the DD?

I watched some LPs that show that is should show on the Altima battle, but on the old winningconditions.bmp file i had from Xif, it shows the same way it does in shishi, so I'm going to assume I derped something in the displayed conditions at the end of the altima battle and that this has nothing to do with shishi
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on September 20, 2019, 03:49:03 am
Just did a lot of testing to confirm a weird thing, and after eliminating all variables i could think of, i even got to exporting a clean tactext file from a vanilla image file, and then repatching the same vanilla tactext back to the same vanilla image and the results are consistent every time. Something about tactext is either exporting or importing this bit from WORLD.LZW, incorrectly and causing us to lose some words in the end screen for propositions.


(https://www.dropbox.com/s/dracghajbmnbmwo/Tactext%20Derp.png?raw=1)
Title: Re: FFT Patcher .478 Source Code
Post by: Squaresoft on March 13, 2020, 09:37:24 am
Hello there.
How comes there is a version v0.492 and this "STICKY" only links to older versions?,
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on March 14, 2020, 02:22:28 am
Quote from: Squaresoft on March 13, 2020, 09:37:24 amHello there.
How comes there is a version v0.492 and this "STICKY" only links to older versions?,

Because we have a tools section, and when I'm not made aware of a new release, or asked to update the link, it doesn't happen.

Glain is the one who currently works with FFTP and he is not the OP of this thread, so he is unable to update the OP...
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on April 08, 2020, 10:44:53 am
Here's my latest version of the FFTPatcher suite including a version of Shishi that can edit the extra palettes in WLDFACE.BIN. The new entries are just added at the end of the list. They're annoyingly arranged in the file, so if modifying one of these entries, both the original and new entries should be updated.

I also separated out the XML files that define what goes in the Other Images section so that they can be updated without needing to recompile the Shishi EXE.

There are also a few convenience changes to the ASM patcher added in here.

Shishi

    * In the Other Images section, WLDFACE.BIN now has extra sections for units with extra palettes.  If changing one of these units, both the original and new entries should be changed.
    * The PSXFiles.xml and PSPFiles.xml files that define the entries in the Other Images section are now external files rather than being compiled into the program. This enables custom entries to be added into Shishi by adding them to the appropriate XML file(s)! Just an example...
        <Section Filename="E173.BIN" Filesize="48304">
            <PalettedImage8bpp>
                <Name>Night Sword</Name>
                <Width>128</Width>
                <Height>256</Height>
                <Sector>EFFECT_E173_BIN</Sector>
                <ColorDepth>_16bit</ColorDepth>
                <PalettePosition>
                    <Offset>14508</Offset>
                    <Length>512</Length>
                </PalettePosition>
                <Position>
                    <Offset>15536</Offset>
                    <Length>32768</Length>
                </Position>
            </PalettedImage8bpp>
        </Section>
   
FFTorgASM

    * ASM checker no longer shows a warning if a stack pointer offset is not a multiple of 8 (but will if the offset is not a multiple of 4).
    * Multiple offsets can now be specified in one Location tag using comma separated values. 
        Example:
            <Location file="EFFECT_E137_BIN" offset="AAB,923,E7F,B6F,C33,9E7,CF7,DBB,85F,10CB,F43" mode="DATA">
                02
            </Location>
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on June 04, 2020, 06:42:01 pm
I'm now ready to release the FFTPatcher .493 beta!  This contains a LOT of new features and fixes and is probably the biggest release I've done!

Special thanks to the following for their contributions which helped make this release possible (as well as others!):

Raijinili: Feature requests (including ENTD unit table changes and the concept for View Stats), convenience feature ideas, labeling fixes, team color research, etc.
Xifanie: Reference data, Gameshark conditionals, FFTText Editor concepts (including Altima font), Ideas around consolidating/repointing duplicate entries, etc.
Elric: Ideas for improving several of the tools, including FFTPatcher defaults, separating the two UNIT/WLDFACE entries, fixing Proposition text, changing around Shishi sections, and adding functionality to Shishi
RetroTypes: Consolidating patch XMLs, ideas for Shishi features (including Zoom and other images entry numbers), discussions about labeling
Raven: Ideas around consolidating Item Attributes and Inflict Status, General ideas, labeling discussions
Choto: Effect notes
FFMaster: Idea about supporting more pseudoinstructions with non-specified source operand for ALU commands
Jumza: Team color information
Emmy: Information about FFTPatcher labeling, especially in the Propositions section
cadence: Idea for showing information about Item Attributes and Inflict Status, and pointing out some ASM hacks
Title: Re: FFT Patcher .478 Source Code
Post by: botik on June 08, 2020, 12:50:29 pm
In new beta FFTOrgASM selection menu does not appear for changes
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on June 09, 2020, 05:05:25 pm
Hmm.  It was counting variables wrong.  A simple fix, but that's a pretty fundamental thing that blocks testing, so it's going to require another beta version.  Here it is, attached (Beta v2).  This also includes ctrl + mouse wheel functionality for Shishi zoom and the problem with the cut-off Shishi text about duplicate sprites should also be fixed.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on July 01, 2020, 03:55:47 pm
Some fixes and features later, another beta...

FFTPatcher 0.493 Beta v3:

FFTorgASM:
    * Added and modified some patch XMLs (Dokurider.xml added).
    * Fixed issues with Free Space viewer and Conflict Checker.
    * "Complete!" message no longer appears when Canceling an action.
    * Now supports <Include> tags with a "patch" attribute to include another patch (by name).
    * Reload button now reloads the currently selected file.  Select All in the file list before pressing Reload to reload all the files.

This also includes the latest version of my XML file (including the unit bench hack).
EDIT - Updated attachment to include latest fix for bench hack.
Title: Re: FFT Patcher .478 Source Code
Post by: Ansehelm on July 11, 2020, 09:27:23 pm
This looks awesome, especially the ability to set formation sprites in FFTPatcher, and the conflict checker and free space viewers.

I have a question about how to use the free space viewer and the "move" option for best results, since in my hack I have a conflict between Special Snowflakes and Pride's Item Attribute rewrite, which is causing bugs.  The conflict checker reveals that they overlap in SCUS, and the free space viewer in SCUS shows this: https://ibb.co/86RfGp4

And this may be a silly question, but I'm not sure how to interpret what is shown here in order to know how much to move the hack by.  Does "length" refer to the length of the overlap/conflict, or the length of the highlighted hack?  If it's the length of the whole hack, would I subtract [hack] "length" from "Space to the Next Patch" to know how much to add to the address?  I'm obviously not very knowledgeable about ASMs, but I'd appreciate any guidance you could provide.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on July 12, 2020, 02:36:36 am
Each entry in the free space viewer refers to one section of a patch. 
Length refers to the length (in bytes) of that section.

Address + Length = Next Address
Next Address + Space To Next Patch = Address of next entry in the list (or the end of the free space block, if there isn't one)

If the Space To Next Patch is negative, it will be colored red, and indicate a conflict with the next entry in the list.

In the screenshot, the free space viewer is only showing one entry, so no conflict is shown.

I took a look at Pride's Item Attribute rewrite patch (v1.1), and it doesn't appear to use free space at all... 

When you saw the conflict in the conflict checker, was the background color red or white?  If it was red, that conflict was not in free space and cannot be resolved with a move.
Title: Re: FFT Patcher .478 Source Code
Post by: Ansehelm on July 12, 2020, 04:18:15 am
Ok, that makes some sense.  I imagine the conflict is not in the free space then, since it looks like this: https://ibb.co/WVf53gm

I don't really get how free space works, much less why ASMS are written in anything that's not the free space (unless it's prohibitively small).  All that's kind of over my head right now, but it seems like the conflicting data could just be moved if there's space, even if it's done manually.  I'll probably reach out to Pride, and see if he can look into moving that section if it's possible, unless you're familiar with how that might be done.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on July 12, 2020, 05:07:28 am
Quote from: Ansehelm on July 12, 2020, 04:18:15 amOk, that makes some sense.  I imagine the conflict is not in the free space then, since it looks like this: https://ibb.co/WVf53gm

I don't really get how free space works, much less why ASMS are written in anything that's not the free space (unless it's prohibitively small).  All that's kind of over my head right now, but it seems like the conflicting data could just be moved if there's space, even if it's done manually.  I'll probably reach out to Pride, and see if he can look into moving that section if it's possible, unless you're familiar with how that might be done.

Because sometimes it makes more sense to edit the data directly. Depending on exactly what the asm is trying to accomplish
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on July 12, 2020, 01:52:51 pm
The conflict is not in data.  It arises because the two hacks are editing program code in the same routine: https://ffhacktics.com/wiki/Equipment_Attribute_Setting

Those hacks rewrite that routine in different ways, so they are not compatible.  There's no way to get around that by moving anything (indeed, there is nothing to move).

(Writing only to free space would be useless because the new code or data would never be referenced by the game.  Other changes are needed to change the behavior of the game.  Some hacks don't need or use free space at all.)
Title: Re: FFT Patcher .478 Source Code
Post by: Ansehelm on July 12, 2020, 04:15:41 pm
Alright, that clears it up.  Bummer about the incompatibility, but at least the way forward is clear, as I can make do without SS.  Thanks for looking into that and explaining it. 
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on August 26, 2020, 10:47:13 am
Beta v4 release:

FFTPatcher:
    * Fixed bug in ability editor where it could try to update the "inflict status" values for abilities without attributes
    * Fix for ampersands inside certain controls that use TextRenderer.DrawText() (Includes ENTD unit area)

FFTactext:
    * Made PSXText.xml and PSPText.xml external files that can be used to configure section entries, DTE, compression, etc.  These were previously the internal psx.xml and psp.xml files.
    * Text sections now have at least the number of entries specified in the appropriate XML file, even if text is loaded from a file without those entries listed.
    * Corrected number of entries for Diary of Nanai and Wyuvle.

FFTorgASM:
    * Moving ASM blocks also updates loads/stores and address references!

ASM Encoder/Decoder:
    * No longer flags load delay on writeback registers.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on October 09, 2020, 04:40:15 pm
Beta v5!

Introducing EntryEdit!
    * Edits Battle Conditionals, World Conditionals, and Events.  Loads/saves to patch files, script files, disc images, and pSX save states!
    * Customizable by editing EntryEdit.exe.config and associated XML files.  Defaults are vanilla, but has pre-built support for Event Instruction Upgrade by setting "ModSuffix" to "Upgrade" in the config file.

FFTP suite now includes MassHexASM.

FFTPatcher, FFTactext, and EntryEdit can open patch files directly (.fftpatch, .ffttext, .eepatch) via command line.  Also works with file association in the file explorer.
Icons added for FFTPatcher, FFTactext, and FFTorgASM.
Version number of the FFTP suite now displayed in the title bar.

FFTactext:
    * When importing ISO, no longer loads additional entries per section.
    * When importing ISO, uses non-DTE character map for sections with DTE disabled (such as all OPEN.LZW sections by default).

ASM Encoder/Decoder:
    * Now replaces labels and equivalences in reverse order of name length to avoid replacing partial names.
Title: Re: FFT Patcher .478 Source Code
Post by: darkskyx on December 20, 2020, 12:58:27 am
I have this error everytime I try to patch: "An error of type System.UnauthorizedAccessException occurred: Incorrect permissions".
I think the problem is from the new Windows 10 update, specifically Windows Defender. I know it because on my PC I couldn't use some program functions but when I disabled it on the registry I started to be able to use them. But with the new update version I can no longer do that. Do you know a fix for this?
Title: Re: FFT Patcher .478 Source Code
Post by: EnderC on December 30, 2020, 04:45:50 pm
Quote from: darkskyx on December 20, 2020, 12:58:27 amI have this error everytime I try to patch: "An error of type System.UnauthorizedAccessException occurred: Incorrect permissions".

This is speculation, but make sure you've placed the tools in a location where your user has full control over the contents in Windows' Properties > Security tab under Permissions.

I would expect to see something like this if you unzipped the tools into a protected folder like, say C:\Program Files.
Title: Re: FFT Patcher .478 Source Code
Post by: darkskyx on December 31, 2020, 05:37:37 am
Quote from: EnderC on December 30, 2020, 04:45:50 pmThis is speculation, but make sure you've placed the tools in a location where your user has full control over the contents in Windows' Properties > Security tab under Permissions.

I would expect to see something like this if you unzipped the tools into a protected folder like, say C:\Program Files.
It was not placed in a protected folder, I have it on a folder on my Desktop. Anyway, I "fixed" it by not installing the new update.

P.S: Maybe someone wants a solution for problems like the file not opening, but if you have problems with that, it can be your antivirus. Just add as exception in the folder and the files.
Title: Re: FFT Patcher .478 Source Code
Post by: nitwit on January 02, 2021, 06:08:19 am
Quote from: darkskyx on December 31, 2020, 05:37:37 amIt was not placed in a protected folder, I have it on a folder on my Desktop. Anyway, I "fixed" it by not installing the new update.
In my experience, anything outside of the system and program files folders gives me a warning when I try to execute it.

I use this to add apps to the Windows start menu:
https://www.windowscentral.com/add-app-shortcuts-start-menu-manually-windows-10

I also use Open-Shell as a replacement for the Windows start menu.
Title: Re: FFT Patcher .478 Source Code
Post by: 3lric on January 02, 2021, 11:48:26 pm
I've never had an issue with FFTP on Vista, 7 or 10, in any folder, regardless of UAC settings...
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on January 07, 2021, 12:37:26 pm
Beta v6:


Command line patching is now supported for FFTPatcher, FFTactext, FFTorgASM, and EntryEdit by using command line arguments "-patch" and then specifying the patch file and disc image (or pSX savestate).  There is generally no output on a successful run (unless FFTorgASM is warning that files appearing in patches are either unsupported or not present in the specified savestate), and an error message can appear in the console if there is a problem.  If the program opens up its normal window, then there was something wrong with the passed arguments (file(s) not found, etc.) 
    By default, the console does not wait for the program(s) to finish, because they aren't configured as console applications.  Using "start /wait" will make the console wait.
   
    Examples:
        start /wait "Patch" FFTPatcher -patch patchfile.fftpatch fft.iso
        start /wait "Patch" FFTactext -patch patchfile.ffttext fft.iso
        start /wait "Patch" FFTorgASM -patch patchfile.xml fft.iso
        start /wait "Patch" EntryEdit -patch patchfile.eepatch fft.iso

FFTPatcher:
    *  Enabled editing ability effects for all applicable abilities.
    *  View stat form now uses correct Monster average Raw MP.

FFTorgASM:
    *  Now displays patch descriptions in a more natural way, with better handling of whitespace.
    *  Persistent labels can now be referenced anywhere in a patch, even if they are defined in later Location tags.
    *  Save Patch XML option now updates variable values and doesn't write out blank Location tags.
    *  Spacebar can check/uncheck patches again, if the selection cache for the type ahead is empty (ESC to clear).
    *  Variables can now be declared with symbol="true" and no accompanying file, sector, or offset.  These variables would then only be referenced as macros in ASM blocks.
    *  Added a "hidden" attribute for patches (true or false, default false).

ASMEncoder:   
    *  Added support for .if, .else, .endif preprocessing commands.  Skips lines if condition is not met.  Blocks can contain multiple lines, and nesting is possible.
        Example:
            .if    >, %ChangePartyLevelRandom, 0
                srl    t3, t2, 4
            .else
                move    t3, t1
            .endif

    *  Fixed an issue where using the "load immediate" pseudo (li) with a label could cause addresses to be calculated incorrectly.  Using li with a label will now always cause it to expand to two instructions.


** Updated with additional fixes (thanks Cerabow and EnderC for reporting issues):

    FFTPatcher:
        *  Fixed context menu exception when clicking out of bounds in a data grid view (Action Menus, Monster Skills, Poaching tabs)
        *  Fixed an exception that occurred when setting an item to use an ability with an ID > 0x7F, where the ID would erroneously be used in a reference to the Status Infliction list.
        *  Selected entries for Inflict Status and Item Attributes tabs refresh when the tabs are clicked, so that they display the current correct information for which Items or Abilities are linked to each.
Title: Re: FFT Patcher .478 Source Code
Post by: Squaresoft on January 20, 2021, 08:44:56 pm
Quote from: Glain on January 07, 2021, 12:37:26 pmBeta v6:
Amazing work! the Stat Viewer is a life saver.

Minor things I noticed in V6:
•Equip Katana says "Equip Knife". A Samurai is  performing a Seppuku right now with that knife, haha.
Title: Re: FFT Patcher .478 Source Code
Post by: darkskyx on January 21, 2021, 08:01:14 pm
Quote from: Glain on January 07, 2021, 12:37:26 pmBeta v6:


The stat scaling viewer is so good! But I have a question, because I'm not sure if it's a bug or not:

How do the Growth HP/MP/etc works? For example, if I use 9 HP growth I got better late game result than using 11 (397 HP at lvl 99 vs 468 HP). And that's weird because I remember to test that down a little and the scaling was not like this. But if this is correct, I have been using wrong the growth stat. And that is not very intuitive... I'm so confused.

Also, I didn't knew the multiplier also affected basic stats (I though it was only for items, skills...), but it makes sense for Speed and others. A mini-explanation in that part of the program would be grateful.
Title: Re: FFT Patcher .478 Source Code
Post by: Nyzer on January 21, 2021, 11:33:16 pm
For that, it'd be best to refer to GameFAQs' battle mechanics guide. The short version of the stat growth rating is that that number is not how much the growth rate has added to it, or is multiplied by - it's a divisor for the growth formula.

The higher it is, the more the number is divided, the less there is added to the Raw Stat total, the longer it takes to reach the next breakpoint for a +1 in the stat.
Title: Re: FFT Patcher .478 Source Code
Post by: Squaresoft on January 22, 2021, 01:09:55 pm
BTW, is there an option to export/import specific tab changes? Like items/skills.

Or any method where I could do it with an excel and the patch file or something.

Would really appreciate that information.
Title: Re: FFT Patcher .478 Source Code
Post by: Raijinili on February 13, 2021, 04:39:11 pm
Quote from: darkskyx on January 21, 2021, 08:01:14 pmHow do the Growth HP/MP/etc works?

I call it growth impedance, because higher values REDUCE growth. Also, you should know that job multipliers ONLY work on naked stats, not gear stats.

Let's take two jobs:
Thief: 50 MAC (MA impedance), 60% MA multiplier.
Mime: 40 MAC, 115% MA multiplier.
Check these in FFTPatcher.

A level 1 Female unit has 5.0 MA, and level 1 Male has 4.0 MA. These are the internal raw values, before considering job multiplier and equipment. (Technically, it's stored as a fraction over 2^14. This method of storing a non-whole number is called fixed-point notation (https://en.wikipedia.org/wiki/Fixed-point_arithmetic).)

Here are the MA values at level 1:
Thief-F: floor(5.0 * 60%) = 3 MA
Mime-F: floor(5.0 * 115%) = floor(5.75) = 5 MA
Thief-M: floor(4.0 * 60%) = floor(2.4) = 2 MA
Mime-M: floor(4.0 * 115%) = floor(4.6) = 4 MA


If you know the rawMA at level 1, here's how you calculate the rawMA at any level LVL, given the MAC. (There is a slight overestimate here due to rounding.)
rawMA_LVL = rawMA_1 * (1 + (LVL-1)/(MAC+1))

Here are the raw MA values at level 99 (ignoring job multiplier):
Thief-F: 5.0 * (1 + 98/51) = ~14.61
Mime-F: 5.0 * (1 + 98/41) = ~16.95
Thief-M: 4.0 * (1 + 98/51) = ~11.69
Mime-M: 4.0 * (1 + 98/41) = ~13.56



But here's a more intuitive way of working with it: You gain your level 1 rawMA every MAC+1 levels.

Mime-F has 5.0 MA and 40 MAC, so every 41 levels, it gains another 5.0 MA (minus a bit, due to rounding):
lv=1: 5.0 rawMA
lv=42: 10.0
lv=83: 15.0

Thief-F has 50 MAC, so it takes 51 levels to double MA:
lv=1: 5.0 rawMA
lv=52: 10.0
lv=103: 15.0

Red Dragon has 6 MAC, so it gains its level 1 MA every 7 levels (1, 8, 15, etc.). Since Monsters have randomized stats, I can't calculate the exact raw MA values.


It's important to know that raw stat, job growth, and job multiplier are all multiplicative, so you can calculate each one independent of the other two. That means the Male will ALWAYS have 80% (before the final rounding) of the Female's MA, as long as they have the same job growth history.
Title: Re: FFT Patcher .478 Source Code
Post by: nitwit on February 15, 2021, 07:09:05 am
Bug report for FFTPatcher v0.493.

In Gameshark tab of same, checkmarking all of item 0x00's shop availability flags displays the following code:
"Store Inventories
D0067000 8A44
8018D840 FFFF

While gathering addresses of FFTPatcher's data tables, I attempted to verify the shop inventory by editing it in the pSXfin memory viewer. On testing the shop inventory data does not start at 0x8018d840. Instead it starts at 0x8018d844. You can verify this in anywhere (I tested it in Igros) with the following code, which unchecks all the shop availability checkboxes for "0x01 Dagger", making it unavailable.
D0067000 8A44
8018d846 0000

Or you can go into a shop, verify a dagger appears, go to addresses 8018d846 and 8018d847, set their values to zero, and then press left or right until you return the weapon purchase submenu to find that daggers aren't available for purchase.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on February 15, 2021, 02:04:02 pm
Quote from: nitwit on February 15, 2021, 07:09:05 amOn testing the shop inventory data does not start at 0x8018d840. Instead it starts at 0x8018d844.

Good catch.  It was writing to the correct location when patching the ISO (0xAD844 in WORLD.BIN) but to the wrong corresponding RAM location for Gameshark codes.  I've checked in a fix to the source control to correct the offset.
Title: Re: FFT Patcher .478 Source Code
Post by: nitwit on February 15, 2021, 09:08:47 pm
Quote from: Glain on February 15, 2021, 02:04:02 pmGood catch.  It was writing to the correct location when patching the ISO (0xAD844 in WORLD.BIN) but to the wrong corresponding RAM location for Gameshark codes.  I've checked in a fix to the source control to correct the offset.
I saw your revision and can now more easily grab gameshark/RAM addresses for everything FFTPatcher edits, but where can I find the disc files/addresses for the same? A search of 0xAD844 and it's base 10 equivalent in the FFTPatcher suite repo returns nothing.
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on February 15, 2021, 09:39:01 pm
Quote from: nitwit on February 15, 2021, 09:08:47 pmI saw your revision and can now more easily grab gameshark/RAM addresses for everything FFTPatcher edits, but where can I find the disc files/addresses for the same? A search of 0xAD844 and it's base 10 equivalent in the FFTPatcher suite repo returns nothing.

I don't know what the GitHub search is doing or why it doesn't return results, but this (https://github.com/Glain/FFTPatcher/blob/master/PatcherLib/ISOPatching/PsxIso.cs) is the file.
Title: Re: FFT Patcher .478 Source Code
Post by: ---HattoriIga--- on February 25, 2021, 06:31:15 pm
Hello, this Entry Edit tool is very good, I liked it a lot. magnificent work, just not being able to open battle conditionals of the path of the elric TLW 1.06 of the error stating: the key provided was not present in the dictionary.

Again thanks for that wonderful tool good job  :D
Title: Re: FFT Patcher .478 Source Code
Post by: Glain on February 26, 2021, 01:51:09 am
Thanks! Glad to hear you like the tool!

In the case of TLW, it looks like the battle conditionals and scenarios were rearranged, and EntryEdit's XML files are based on vanilla's order. This error is happening because the program is trying to look up the names of battle conditional sets that don't exist in vanilla. I've put in a patch that will fix that particular problem in the next version.

In the meantime, the simplest fix is probably to take the ConditionalSets.xml file in the EntryData subfolder of the application directory, copy it into the same directory, name the copy ConditionalSetsTLW.xml, and add a bunch of entries to the end of the new XML file, like so:

    <Entry hex="0092" name="New Set" />
    <Entry hex="0093" name="New Set" />
    <Entry hex="0094" name="New Set" />
    <Entry hex="0095" name="New Set" />
    <Entry hex="0096" name="New Set" />
    <Entry hex="0097" name="New Set" />
    <Entry hex="0098" name="New Set" />
    <Entry hex="0099" name="New Set" />
    <Entry hex="009A" name="New Set" />
    <Entry hex="009B" name="New Set" />
    <Entry hex="009C" name="New Set" />
    <Entry hex="009D" name="New Set" />
    <Entry hex="009E" name="New Set" />
    <Entry hex="009F" name="New Set" />
    <Entry hex="00A0" name="New Set" />
    <Entry hex="00A1" name="New Set" />
    <Entry hex="00A2" name="New Set" />
    <Entry hex="00A3" name="New Set" />
    <Entry hex="00A4" name="New Set" />
    <Entry hex="00A5" name="New Set" />

Then open the EntryEdit.exe.config file and change the ModSuffix value to TLW.  The new line would look like this:

<add key="ModSuffix" value="TLW" />

With that, the data should load and the program shouldn't crash... but the names of the scenarios and conditionals won't make much sense like this. Ideally we would create a separate set of XML files that would contain the correct names for TLW.
Title: Re: FFT Patcher (.492 Release, .493 Beta)
Post by: Dokurider on May 31, 2021, 01:28:45 pm
I'm gonna post this here so Glain doesn't forget again.
In Ability Flags 1, 0x80/0x40 are actually Target All Allies and Target All Enemies respectively...but both are bugged. Actually they're disabled on purpose and you can reenable both of them with a single line edit. I made a video showing off what it was supposed to do.


And here's the hack if you need to test it.
https://ffhacktics.com/smf/index.php?topic=10381.msg218982#msg218982
Title: Re: FFT Patcher (.492 Release, .493 Beta)
Post by: nitwit on May 31, 2021, 07:48:31 pm
Quote from: Dokurider on May 31, 2021, 01:28:45 pmI'm gonna post this here so Glain doesn't forget again.
In Ability Flags 1, 0x80/0x40 are actually Target All Allies and Target All Enemies respectively...but both are bugged. Actually they're disabled on purpose and you can reenable both of them with a single line edit. I made a video showing off what it was supposed to do.

And here's the hack if you need to test it.
https://ffhacktics.com/smf/index.php?topic=10381.msg218982#msg218982
Isn't that just... maximum range, and the flags for only target allies and self-target allowed? Perhaps they disabled it because it's redundant (while also ignoring all the other redundancies and hard-coded behaviors)? Am I mistaken?

It's still cool though.
Title: Re: FFT Patcher (.492 Release, .493 Beta)
Post by: Glain on June 09, 2021, 04:59:09 pm
Version 0.493 (previously Beta v7):

General:

    *   File operations that open the disc image now open the file only for reading where appropriate.

Shishi:

    *   Now shows entries for the entire sprite table, including for sprite IDs 0x00, 0x9B, 0x9C, 0x9D, and 0x9E.  These are blank and unusable with a size of 0 unless ISO is expanded.
    *   The internal sprite entries have been adjusted to be numbered accurately, so that 01 Ramza is actually the second entry, with the new 00 entry being first.  If using custom sprite names in a Resources.zip file, the corresponding SpriteFiles.xml entries will need to be updated accordingly.
    *   Sprite entry IDs are now displayed accurately instead of being increased by one. 
    *   The default entry has been changed from 00 (displaying as "01 - Ramza") to the real 01 Ramza entry (second in the list).
    *   Can now handle showing blank entries, with the Sprite menu actions disabled.
    *   Any sprite can now have an SP2 entry if the appropriate association is made in the correct table in the disc image. (PSX: BATTLE.BIN 0x2E1CC, RAM 0x800951CC)
    *   There is now a FOUR option for SEQ and SHP values because that is the default for sprite entries 0x9B, 0x9C, 0x9D, and 0x9E.  It's treated the same as TYPE1.
   
    *   Fixed an issue where transparency values could be set to the wrong values when importing bitmaps.
    *   Fixed an issue where an imported bitmap could be saved incorrectly to the disc image if the bitmap's width was not a multiple of 8 (this seemed to only affect OPNTEX12 in Other Images with its size of 258x180).
    *   Adjusted compression data for some sprites to import into the disc image accurately.
    *   Fixed an issue where monster sprites could import into the disc image incorrectly if a 4bpp image was used.
    *   Now pads monster sprites appropriately with zero data if they are too short.  This allows sprite 0x5D (BATTLE_DAMI_SPR) to be imported without error (yay for technicolor goop)!
   
    *   Expand ISO has been reworked.  No longer increases the size of the disc image, but instead expands the sprite data and moves it into empty sectors.  (This seems to fix the sector read errors that would appear in the pSX emulator in certain circumstances.)

FFTPatcher:

    *   Can now patch PSP version slowdown fix.
    *   Corrected PSX RAM offset for Store Inventory data (for Gameshark section).
    *   Updated some formula labels.
    *   Updated some default labels for sprite files.
   
FFTactext:
   
    *   Generate Resources XML menu option now generates more accurate skillset names, sprite file names, special names, and placed unit names.
   
FFTorgASM:
   
    *   Added "align" attribute for <Location> tags.  This will align the offset to the specified multiple.  For example, align="4" will cause an offset that isn't a multiple of 4 to advance to the next multiple of 4.  Using mode="ASM" also automatically uses an align of 4.
    *   Updated some patch XMLs.

EntryEdit:

    *   Fixed an issue where a set name lookup could cause an error if there were more sets than known set names.
   
ASM Encoder/Decoder:

    *   Now reports errors translating pseudoinstructions.  Errors should be visible where appropriate in both FFTorgASM and MassHexASM.
Title: Re: FFT Patcher (.494)
Post by: Glain on November 24, 2021, 02:29:42 pm
FFTPatcher 0.494 released!

Release page here (https://github.com/Glain/FFTPatcher/releases/tag/v0.494.2) with patch notes! (Direct download (https://github.com/Glain/FFTPatcher/releases/download/v0.494.2/FFTPatcher_494.rar))

Edit - There was an issue where the Settings.xml wasn't being loaded.  Redownload 494 at the link above for the fix.
Edit - There was another issue where ASM patches that include other patches weren't copying variables correctly, causing a crash in FFTorgASM when selecting the patch.  Once again, redownload 494 at the link above for the fix.
Title: Re: FFT Patcher (.494)
Post by: alonerfeumuno on January 24, 2022, 08:17:31 pm
I'll go mad with this error DTE for Boot.bin ""[29e334]"" failed
i ve tried everything to fix it ... i want to change Ramzas Squire class (chapter 4) for Knight Errant but i cant...
Title: Re: FFT Patcher (.494)
Post by: 3lric on February 02, 2022, 12:19:29 am
Quote from: alonerfeumuno on January 24, 2022, 08:17:31 pmI'll go mad with this error DTE for Boot.bin ""[29e334]"" failed
i ve tried everything to fix it ... i want to change Ramzas Squire class (chapter 4) for Knight Errant but i cant...

Because you are trying to change it to something longer and dont have the space to do so.
Title: Re: FFT Patcher (.494)
Post by: ---HattoriIga--- on February 02, 2022, 02:08:59 pm
@Glain as resources from 2.02 were posted to use then I am in doubt. is it possible to use EntryEdit: to make edits of events. I say this because when I try to open the events part of an error does not appear script to make change put event command as it appears in vanilla. the battle conditions and world conditions error more just change size when loading iso that goes more I do not know if this is 100% do this.

will be impossible to mess in a clean rom using resource TLW 2.02 and try to use EntryEdit for editing. I enter this key even with tuto spreadsheet TLW - FFT Conditionals v4 do not understand me mexe this spreadsheet where Var even with tuto that I saw was always at 0% of understanding

Sorry for my English I am using my translator (https://www.deepl.com/)


Title: Re: FFT Patcher (.494)
Post by: 3lric on February 02, 2022, 05:31:12 pm
Quote from: ---HattoriIga--- on February 02, 2022, 02:08:59 pm@Glain as resources from 2.02 were posted to use then I am in doubt. is it possible to use EntryEdit: to make edits of events. I say this because when I try to open the events part of an error does not appear script to make change put event command as it appears in vanilla. the battle conditions and world conditions error more just change size when loading iso that goes more I do not know if this is 100% do this.

will be impossible to mess in a clean rom using resource TLW 2.02 and try to use EntryEdit for editing. I enter this key even with tuto spreadsheet TLW - FFT Conditionals v4 do not understand me mexe this spreadsheet where Var even with tuto that I saw was always at 0% of understanding

Sorry for my English I am using my translator (https://www.deepl.com/)




FFTP is not going to understand the conditionals sheet, and likely not the events either. TLW events and conditions are setup much different from vanilla.
Title: Re: FFT Patcher (.494)
Post by: bee on April 21, 2022, 05:08:41 pm
**Edit:** I just discovered the fftpatcher help thread, and took my question there. Oops! Sorry for the unnecessary post in this thread, please feel free to delete.
Title: Re: FFT Patcher (.494)
Post by: Bora on July 05, 2022, 09:55:39 am
Hi awesome people!

Just wondering what's this yellow colored thingy  on FFTPatcher?

Thanks.
Title: Re: FFT Patcher (.494)
Post by: Jumza on July 05, 2022, 11:58:15 am
In something like the Inflict Statuses tab, you've pressed on something under one of the entries that says (for example) In use by X items/abilities: (ability / item using it). Clicking on the X, which is the number of things that use it will highlight those entries in yellow on the list. It doesn't effect anything other than showing you those entries in yellow!
Title: Re: FFT Patcher (.494)
Post by: Bora on July 05, 2022, 02:20:29 pm
Quote from: Jumza on July 05, 2022, 11:58:15 amIn something like the Inflict Statuses tab, you've pressed on something under one of the entries that says (for example) In use by X items/abilities: (ability / item using it). Clicking on the X, which is the number of things that use it will highlight those entries in yellow on the list. It doesn't effect anything other than showing you those entries in yellow!

Gotcha! Saw the effect. :lol:

Thanks.
Title: Re: FFT Patcher (.494)
Post by: darkskyx on February 18, 2023, 07:20:00 am
It could be possible to make that yellow box for abilities? I really like that option to find statuses in .494 but it isn't available for skills... Everytime I want to find who uses a skills (in skillset/monster skill) I lose a lot of time. Thanks for your time.
Title: Re: FFT Patcher (.494)
Post by: Orkney on February 20, 2023, 01:27:04 am
There is this tool that already exists to know what is being used and where it is being used :

FFT MOD HELPER (https://ffhacktics.com/smf/index.php?topic=11357.0)

Requires Excel
Title: Re: FFT Patcher (.494)
Post by: Neonseraphim on April 26, 2023, 07:59:43 am
Two years later, hope it is not an abandoned project, but EntryEdit is awesome, any plans of making it able to load and patch PSP ISO?  I would really love this feature. 
Title: Re: FFT Patcher (.497)
Post by: Glain on May 15, 2023, 06:06:43 pm
FFTPatcher suite 0.497 released!

Release page here (https://github.com/Glain/FFTPatcher/releases/tag/v0.497) with patch notes! (Direct download (https://github.com/Glain/FFTPatcher/releases/download/v0.497/FFTPatcher_497.7z))
(Patch notes are from 0.494 forward)
Title: Re: FFT Patcher (.497)
Post by: darkskyx on June 21, 2023, 09:58:30 pm
Mistake that I found:

When rebuilding a fftpack.bin, FFTPatcher .497 creates a wrong 71k KB file.
When rebuilding a fftpack.bin, FFTPatcher .494 creates a right 215k KB file.

(I didn't test other releases post .494) Tested for the PSP version of FFT.
Title: Re: FFT Patcher (.497)
Post by: Glain on July 07, 2023, 12:58:48 am
Quote from: darkskyx on June 21, 2023, 09:58:30 pmMistake that I found:

When rebuilding a fftpack.bin, FFTPatcher .497 creates a wrong 71k KB file.
When rebuilding a fftpack.bin, FFTPatcher .494 creates a right 215k KB file.

(I didn't test other releases post .494) Tested for the PSP version of FFT.


The discrepancy here is the naming of the file OPEN\OPNBK.BIN within the fftpack directory.  If you change it to OPNBK.BIN (instead of OPENBK.BIN), then it should be able to rebuild the fftpack correctly.

I've pushed a change to the source control to give a more descriptive error message for this case.