Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to FFH, where all your dreams come true!

FFT Patcher .478 Source Code  (Read 13390 times)
Pages: [1] 2 3 ... 12
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1307] Logged
  • View Profile
  • share
  • [May 14, 2011, 07:57:55 AM]
FFT Patcher .478 Source Code
« on: May 14, 2011, 07:57:55 AM »
I know everyone's been waiting forever for this, so here it is.

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

The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
Pride [Posts: 715] Logged
  • View Profile
  • share
  • [May 14, 2011, 08:30:57 AM]
Re: FFT Patcher .478 Source Code
« Reply #1 on: May 14, 2011, 08:30:57 AM »
What are some errors in .478? I heard that the propositions don't work but is there anything else?

My Youtube account. Doesn't have much yet >.<
despa [Posts: 4] Logged
  • View Profile
  • share
  • [May 14, 2011, 09:35:57 AM]
Re: FFT Patcher .478 Source Code
« Reply #2 on: May 14, 2011, 09:35:57 AM »
thanks for posting this, fdc! :)
SaGa Frontier Hacker
Pickle Girl Fanboy [Posts: 1482] Logged
  • View Profile
  • Bio Research Lab
  • share
  • [May 16, 2011, 06:33:44 PM]
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1307] Logged
  • View Profile
  • share
  • [May 16, 2011, 11:42:42 PM]
Re: FFT Patcher .478 Source Code
« Reply #4 on: May 16, 2011, 11:42:42 PM »
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.
« Last Edit: May 16, 2011, 11:43:17 PM by formerdeathcorps »
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
SaGa Frontier Hacker
Pickle Girl Fanboy [Posts: 1482] Logged
  • View Profile
  • Bio Research Lab
  • share
  • [May 16, 2011, 11:44:20 PM]
Re: FFT Patcher .478 Source Code
« Reply #5 on: May 16, 2011, 11:44:20 PM »
Did you do this manually, or with Subversion?  Can we download specific builds with Subversion?
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1307] Logged
  • View Profile
  • share
  • [May 16, 2011, 11:46:09 PM]
Re: FFT Patcher .478 Source Code
« Reply #6 on: May 16, 2011, 11:46:09 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.

The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
SaGa Frontier Hacker
Pickle Girl Fanboy [Posts: 1482] Logged
  • View Profile
  • Bio Research Lab
  • share
  • [May 16, 2011, 11:49:49 PM]
Re: FFT Patcher .478 Source Code
« Reply #7 on: May 16, 2011, 11: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.
Glain [Posts: 405] Logged
  • View Profile
  • share
  • [September 10, 2011, 01:51:47 PM]
Re: FFT Patcher .478 Source Code
« Reply #8 on: September 10, 2011, 01:51:47 PM »
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:
Code: [Select]
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.
« Last Edit: September 10, 2011, 03:49:00 PM by Glain »
Cheetah [Posts: 3643] Logged
  • View Profile
  • share
  • [September 10, 2011, 04:03:31 PM]
Re: FFT Patcher .478 Source Code
« Reply #9 on: September 10, 2011, 04: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?

Current Projects:
Glain [Posts: 405] Logged
  • View Profile
  • share
  • [September 10, 2011, 05:01:36 PM]
Re: FFT Patcher .478 Source Code
« Reply #10 on: September 10, 2011, 05: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
« Last Edit: September 10, 2011, 06:37:54 PM by Glain »
Cheetah [Posts: 3643] Logged
  • View Profile
  • share
  • [September 11, 2011, 04:19:13 PM]
Re: FFT Patcher .478 Source Code
« Reply #11 on: September 11, 2011, 04: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.

Current Projects:
ALL THE THINGS Official Caretaker.
RavenOfRazgriz (Global Moderator) [Posts: 2956] Logged
  • View Profile
  • Universal Century Gundam Online "Project Icarus" Private Server
  • share
  • [September 11, 2011, 04:44:42 PM]
Re: FFT Patcher .478 Source Code
« Reply #12 on: September 11, 2011, 04:44:42 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?
SaGa Frontier Hacker
Pickle Girl Fanboy [Posts: 1482] Logged
  • View Profile
  • Bio Research Lab
  • share
  • [September 14, 2011, 06:15:20 PM]
Re: FFT Patcher .478 Source Code
« Reply #13 on: September 14, 2011, 06:15:20 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?
Glain [Posts: 405] Logged
  • View Profile
  • share
  • [September 16, 2011, 01:59:21 AM]
Re: FFT Patcher .478 Source Code
« Reply #14 on: September 16, 2011, 01:59:21 AM »
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.
« Last Edit: March 25, 2012, 09:10:39 PM by Glain »
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1307] Logged
  • View Profile
  • share
  • [December 07, 2011, 04:05:06 PM]
Re: FFT Patcher .478 Source Code
« Reply #15 on: December 07, 2011, 04: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.

The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1307] Logged
  • View Profile
  • share
  • [December 30, 2011, 06:02:39 AM]
Re: FFT Patcher .478 Source Code
« Reply #16 on: December 30, 2011, 06: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.

The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
Glain [Posts: 405] Logged
  • View Profile
  • share
  • [December 30, 2011, 06:54:28 AM]
Re: FFT Patcher .478 Source Code
« Reply #17 on: December 30, 2011, 06: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.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1307] Logged
  • View Profile
  • share
  • [December 30, 2011, 07:44:38 AM]
Re: FFT Patcher .478 Source Code
« Reply #18 on: December 30, 2011, 07: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?
« Last Edit: December 30, 2011, 09:04:23 AM by formerdeathcorps »
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
Glain [Posts: 405] Logged
  • View Profile
  • share
  • [December 30, 2011, 03:05:47 PM]
Re: FFT Patcher .478 Source Code
« Reply #19 on: December 30, 2011, 03:05:47 PM »
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.
Pages: [1] 2 3 ... 12