Please login or register.

Login with username, password and session length
Advanced search  

News:

[2014/08/29] New steam profile field added. Add your steam ID now. Join the FFHacktics steam group.

Recompilation  (Read 10582 times)
Pages: [1] 2 3 4
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1317] Logged
  • View Profile
  • share
  • [February 28, 2011, 07:51:15 PM]
Recompilation
« on: February 28, 2011, 07:51:15 PM »
Here's an idea Wasabi got me started on.  I'm just posting here to see how many people would be interested in helping (testing, decompiling/interpretation, ASM hack writing) because it's a massive idea.  Personally, I have my formula/AI hacks to finish first, but I'd still like to gauge the general level of interest and support in this idea.

1) Compare all the primary differences between WoTL's and FFT's code (on the major battle files like WORLD.BIN/SCUS/BATTLE.BIN)  Since most of WoTL's files are smaller than FFT's, the goal is to port WoTL's features into FFT, while simultaneously expanding the free space of each of the three aforementioned files by 2-20 KB in FFT.
2) Figure out how to insert ASM hacks into WoTL (at last) by correctly identifying the Kanji section in BATTLE/WORLD.BIN.
3) Delete the slowdown on PSP by reinserting the recompiled FFT code into the PSP.
4) Delete stupid hard-code features FFT didn't have (Malak/Rafa formulas having a hard-coded max hit of 10, for example).
5) Add in PSP features (not the movies, but the sound novels, extra battles/maps [just find a way to read the PSP's larger TEST.EVT and map folder], minigames [I'm not sure on this one])
6) Bonus feature: Replace Tutorial mode with Debug mode, allowing PvP and PvAI in one game.
7) Bonus feature: Make all maps in both versions selectable (without bugs) in Debug mode, at least.
« Last Edit: February 28, 2011, 07:51:58 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
  • [February 28, 2011, 08:54:27 PM]
Re: Recompilation
« Reply #1 on: February 28, 2011, 08:54:27 PM »
This is insane.  Documenting an entire game in ASM?  You might as well rewrite the whole thing in a high-level programming language and make it open source.  That said, this is still an awesome idea.  Impractical, but awesome.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1317] Logged
  • View Profile
  • share
  • [February 28, 2011, 09:00:18 PM]
Re: Recompilation
« Reply #2 on: February 28, 2011, 09:00:18 PM »
This is insane.  Documenting an entire game in ASM?  You might as well rewrite the whole thing in a high-level programming language and make it open source.  That said, this is still an awesome idea.  Impractical, but awesome.

It's only insane if I do all of it.  Hence why I'm gauging interest before I start.
I'm willing to bet most of the sound/sprite/map files are the same, though, so most of the real changes are in WORLD.BIN/SCUS/BATTLE.BIN/ATTACK.OUT/TEST.EVT.  That's only tens of MB put together; if that's split between 3-4 disciplined ASM hackers, that can be done within a year.
« Last Edit: February 28, 2011, 09:01:32 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
  • [February 28, 2011, 09:05:01 PM]
Re: Recompilation
« Reply #3 on: February 28, 2011, 09:05:01 PM »
I'm interested, but can't contribute much.  If you can't garner enough interest, maybe you could interest people in investigating individual files, one at a time?
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1317] Logged
  • View Profile
  • share
  • [February 28, 2011, 09:58:29 PM]
Re: Recompilation
« Reply #4 on: February 28, 2011, 09:58:29 PM »
All right...FONT.BIN is approximately the same size in both (~0x13000).  Hence, the Kanji table is the same size, just in different places between the PSP ISO and the PSX ISO.

PSX ISO
BATTLE.BIN
0xE7614 is the beginning of FONT.BIN duplicate.
According to the Wiki, 0xE92AC is the start of the Kanji.
0xFA2DC is the end.

PSP ISO
BATTLE.BIN
0xE6CCC is the beginning of FONT.BIN's duplicate.
By extrapolation, 0xE8964 is the start of the Kanji.
0xF998C is the end.

As for why ASM made by Razele/Xif doesn't work in WoTL, it's because offset 0xXXYYZZ in BATTLE.BIN for whatever routine in PSX is probably at 0xXXYYZZ - 0xWWVV on the PSP.
« Last Edit: February 28, 2011, 11:54:55 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.
pokeytax [Posts: 515] Logged
  • View Profile
  • share
  • [February 28, 2011, 10:16:49 PM]
Re: Recompilation
« Reply #5 on: February 28, 2011, 10:16:49 PM »
Not being a WotL player, I just don't see the percentage in it, fdc. All of the hacks ever created still fit in the kanji table, and I can't conceive of a patch so big that it can't cram everything it needs in there. Some SCUS space would be great, but is it worth two years of work?
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1317] Logged
  • View Profile
  • share
  • [February 28, 2011, 11:11:29 PM]
Re: Recompilation
« Reply #6 on: February 28, 2011, 11:11:29 PM »
Not being a WotL player, I just don't see the percentage in it, fdc. All of the hacks ever created still fit in the kanji table, and I can't conceive of a patch so big that it can't cram everything it needs in there. Some SCUS space would be great, but is it worth two years of work?

1) The PSP players (as well as people who play on real PSX machines) are complaining they can't use most ASM hacks.  They also complain of more hard-coding and FPS slowdown.  At the least, the source of this problem should be found, if not resolved.
2) Doing this project would be the first step to learning to how to ROM expand any arbitrary file in FFT.
3) Let's say you wanted to make a whole new class of mechanics (like additional status/weather/terrain effects, generic jobs, or combat paradigm systems).  Similarly, if you want the AI to be smarter, you may need it to store more information about each unit.  Either hack, if made to their full extent, would require many more tables and/or expansion of the unit/AI RAM space (marked as zero in BATTLE.BIN), which would then require the repointing of BATTLE.BIN.  In making it, it would be helpful to at least compare with WoTL, which added more stuff in less space (giving us more space to write PSX hacks in).  Even if we chose instead to save space by making routines more efficient, we'd still need to track down most of BATTLE.BIN to do so (without fear of unintended errors), which doesn't invalidate the argument of having at least having another version to compare with/copy from.
4) Let's say you want a multi-pathed storyline like the kind Tactics Ogre had (or at the least, more units in the formation screen).  If you don't want to compromise, you need to expand TEST.EVT and ATTACK.OUT, which WoTL did.  Learning how to correctly transfer files of different sizes then becomes useful.
5) WoTL's multiplayer had a lot of crude features, but it's still a step up from Debug mode.  If possible, both should be incorporated as one PvP feature (in place of tutorial in FFT and tutorial/co-op in WoTL).
« Last Edit: February 28, 2011, 11:13:05 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
  • [February 28, 2011, 11:33:34 PM]
Re: Recompilation
« Reply #7 on: February 28, 2011, 11:33:34 PM »
It would really help this project is pSX_author would release the source code to pSX.

Remember that guy who wanted to remake FFT using C++ or something?  He asked a lot of questions about AI, and I sent him my idea for subclasses and a bunch of other things.  What FDC proposes will make FFT completely hackable.  I want this to happen, but I doubt it will within the next five years, unless six or seven more ASM hackers pop up, or this project is organized so the casual ASM hacker with a bunch of mods on his hands can contribute.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1317] Logged
  • View Profile
  • share
  • [March 01, 2011, 12:11:04 AM]
Re: Recompilation
« Reply #8 on: March 01, 2011, 12:11:04 AM »
Pickle, that would help, but I also intend to teach more people ASM on here, so we can raise more talent.  In fact, given how conversant you and Vanya are at hex-editing, you two probably should try to learn it.

I'm not sure what you mean by
Quote
this project is organized so the casual ASM hacker with a bunch of mods on his hands can contribute.
What would such a project look like?  I suspect the idea is to divide the work on the basis of skill level without giving any one person/type of person "grunt work", but I'm not sure how to do that fairly.

PSP Formula Offset Table (sadly, it's only the first 0x64...the WoTL exclusive ones are elsewhere)
BATTLE.BIN
0x1265E0 - 0x126770

Just for comparison, the PSX Formula Offset Table is at
BATTLE.BIN
0x128614 - 0x1287A4

EDIT: With just the above two bits of information and some routine tracking patience, it should now be possible to make at least 50% of all current ASM hacks (for the PSX) work for WoTL.
« Last Edit: March 01, 2011, 12:29:15 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.
Pride [Posts: 725] Logged
  • View Profile
  • share
  • [March 01, 2011, 01:15:45 AM]
Re: Recompilation
« Reply #9 on: March 01, 2011, 01:15:45 AM »
I really don't support the idea besides figuring out where the Kanji section for wotl players and the last two options. I just don't think the majority of it is worth the time and effort to be honest.

My Youtube account. Doesn't have much yet >.<
Mega_Tyrant [Posts: 87] Logged
  • View Profile
  • share
  • [March 01, 2011, 02:01:02 AM]
Re: Recompilation
« Reply #10 on: March 01, 2011, 02:01:02 AM »
I support this idea, if only to increase interest in the PSP version.  So many people have abandoned WOTL simply because there is so little that can be done to it.  It doesn't even have full shishi support.  If it were possible to remove the framerate limit, fix the issue with the spitesheets being joined on multiple characters so that ISO can be expanded to allow for more sprite inserts, and more information were available on the structure of its files so that the ARH, ALMA, and FFTorgASM could be applied, it's multiplayer mode could be made so much better.  WOTL has 2 advantages over basic FFT in having multiplayer and the expanded roster already.  However I do think that this may be more than the current staff of ASMers could handle.

If that post on FuSa SD removing the slowdown on WOTL is true, that might be a lead right there on how the get the framerate back to how it should be.
« Last Edit: March 01, 2011, 02:09:27 AM by Mega_Tyrant »
RAWR!
Mediator
Eternal [Posts: 2618] Logged
  • View Profile
  • share
  • [March 01, 2011, 02:55:36 AM]
Re: Recompilation
« Reply #11 on: March 01, 2011, 02:55:36 AM »
I have no idea what this is honestly, but I'm always for more documentation. Even if nobody here will really use it, someone else might be interested in it later on.

Here dying, join my legion of undeath. Your blood, the roses on unhallow'd graves!
ALL THE THINGS Official Caretaker.
RavenOfRazgriz (Global Moderator) [Posts: 2958] Logged
  • View Profile
  • Universal Century Gundam Online "Project Icarus" Private Server
  • share
  • [March 01, 2011, 03:45:58 AM]
Re: Recompilation
« Reply #12 on: March 01, 2011, 03:45:58 AM »
I have no idea what this is honestly, but I'm always for more documentation. Even if nobody here will really use it, someone else might be interested in it later on.

It means more space to write hacks and the ability to port over as many of the PSP's changes that are compatible with the PSX's hardware / limitations as possible.  This may or may not include more room on the Formation Screen, expanded Equipment tables (possibly more than even the PSP added), the added maps/Event/Attack.Out space, and a synching up of sorts between PSX and PSP to make hacks more easily compatible with both versions, as well as the removal of WotL exclusive hardcoding like the slowdown, Rafa/Malak, and other shit.  It all depends exactly what changes rely on Square using more competent coding methods and which ones rely on upgraded software or use of a better version of MIPs than the PSX used, which is the point of this thread - finding which changes can be ported onto the PSX hardware/copied or otherwise replicated in the MIPs used by the PSX version.  It's just a task only one person can sanely do, but a coordinated group of say 3-5 competent people could handle depending on dedication.  I know I want the extra Formation Screen space and gear slots, don't know about anyone else.

We all know you'd be little help for this T, because it involves knowing how to code.  :p

Same here, really, because I know fuck all when it comes to MIPs.
SaGa Frontier Hacker
Pickle Girl Fanboy [Posts: 1482] Logged
  • View Profile
  • Bio Research Lab
  • share
  • [March 01, 2011, 09:26:32 PM]
Re: Recompilation
« Reply #13 on: March 01, 2011, 09:26:32 PM »
I'm reading some books on Common Lisp.

This language is so painless to learn.  Oh my god, it is, it is.  Compared to C++ (which I tried for two weeks last year), Common Lisp is like a warm shower on a cool spring morning.  This is what Java wishes it was.  Anyone who wants to learn more about it should PM me, and some PDFs will find their way into their inbox.

You should talk to Gemini over at http://www.romhacking.net.  That guy knows his ASM.  He got the SNES Star Ocean to play on PS1 hardware, and he has the source for pSX 1.14, straight from pSX_Author, though he says he won't release it, or a binary, unless pSX_Author tells him to.

Quote
or this project is organized so the casual ASM hacker with a bunch of mods on his hands can contribute.
Organize it so every file you're hacking has it's own topic and wiki page, regularly updated with new discoveries, so if, say, Sentinal Blade is working on something for his mod and it's relevant to your investigations, he can pop into the relevant thread, post it, and go his merry way.  If someone's interested in a particular functionality, they can investigate the relevant file without having to deal with things they're not interested in or equipped to deal with.

Note: If you do make separate wiki pages for PSP and PS1 game files, make sure they're labeled as such.  Ditto on topics/threads.

Why don't you go find DarthPaul and see if he wants to come back?  He might like the way the community is organized now.
Kourama [Posts: 382] Logged
  • View Profile
  • share
  • [March 03, 2011, 04:25:31 AM]
Re: Recompilation
« Reply #14 on: March 03, 2011, 04:25:31 AM »
I would definitely be interested in this being a successful project, but I'm not sure if I could be helpful with this. I know very basic hex editing and don't usually have a lot of time on my hands.
Wasabi [Posts: 187] Logged
  • View Profile
  • share
  • [March 05, 2011, 01:44:40 AM]
Re: Recompilation
« Reply #15 on: March 05, 2011, 01:44:40 AM »
Thanks fdc for making this topic. I'm part of the majority that has zero coding or hexing experience (aside from simple adjustments and/or allocations from playing around with GameShark codes in the past), but I do truly want to see this project progress towards its optimal course so that more flexiblehacks can be applied for either the PSX or PSP version of FFT (or both). I'm all for a larger formation screen and additional gear slots, and would like to see some ASM hacks applicable for both versions of the game. If the framerate lag could be fixed and an upgraded shishi program could be made for the PSP, I'm all for this project to be realized.

I'm willing to beta test whatever is given to me involving this project, within fdc's or any ASMer's convenience. So far I'm able to run ISOs under ePSXe on my netbook, and play patched PSP ISOs and PSX eboots on my PSP. Just throwing that info out there in case anyone wants feedback on how certain changes appear from this project's progression.
Queen of Palemoon
Celdia [Posts: 1594] Logged
  • View Profile
  • http://steamcommunity.com/profiles/76561198029710324/
  • share
  • [March 05, 2011, 03:14:47 PM]
Re: Recompilation
« Reply #16 on: March 05, 2011, 03:14:47 PM »
Quote
like a warm shower on a cool spring morning.

How poetic, PGF. That said, I support the intent behind this idea. It would be great to have the extra space all tagged out and labeled for use. But potentially years of work (depending on contributers) for fuck-all knows what will come of it? I just don't know if I can get behind the actual project. Feels like a big pile of diminishing returns there.
SaGa Frontier Hacker
Pickle Girl Fanboy [Posts: 1482] Logged
  • View Profile
  • Bio Research Lab
  • share
  • [March 07, 2011, 07:15:40 PM]
Re: Recompilation
« Reply #17 on: March 07, 2011, 07:15:40 PM »
Quote from: Celdia
I support the intent behind this idea. It would be great to have the extra space all tagged out and labeled for use. But potentially years of work (depending on contributers) for fuck-all knows what will come of it? I just don't know if I can get behind the actual project. Feels like a big pile of diminishing returns there.
Right now, two months after one hacker started on formulas in BATTLE.BIN, we are about two months away from fully modifiable formulas.  One hacker, that's all it took.  Now, imagine if we brought the full power of social media to bear on this problem?  A hundred small contributers can be as good as one big contributer, if there is no duplication of effort.

Although I'm busy learning something else, this is still interesting, because someone could use the information discovered to make an open source clone of FFT, which uses the same data formats as FFT (though I'd prefer more detailed sprites).

http://www.purezc.com/index.php?page=home&section=history
^This is a site that features spritesheets for a Legend of Zelda clone.

Anyone know what language FFT was written in?  Are there any patterns common to, say, C programs that are sitting in the game?  Is there any uncompiled code sitting in there somewhere?  Can we research the programmers from the credits of FFT and find out more about them, where they went to school, what they studied, what other games they worked on, what development group they were a part of at Square, where they are now?

@fdc: What tools do you use?  pSX 1.13, a hex editor, and renegade64, I assume.

What tools do you need to make your work easier?

http://en.wikipedia.org/wiki/PlayStation_%28console%29#Technical_specifications

crasm
http://crasm.sourceforge.net/crasm.html
Assemble a microprocessor program and produce output file in Intel HEX or Motorola S Code from source for 6800/6801/6803/6502/65C02/Z80 processors. A program listing and a symbol table are also produced on the standard output.
^Could this help you?

I wonder if it's possible to reverse engineer source code, if we know what implementation of which language it was written in and what it was compiled on?  This sort of reverse engineering is fair use, I believe.
Atma [Posts: 210] Logged
  • View Profile
  • share
  • [March 10, 2011, 08:17:59 AM]
Re: Recompilation
« Reply #18 on: March 10, 2011, 08:17:59 AM »
Hmm, very ambitious undertaking... but the results could be phenomenal!  I've been wanting to make a mod for WotL, but there just isn't nearly the same amount of customization that the PSX version has.  This would definitely be something i'd love to see getting more attention.

My name is Atma... I am pure energy... and as ancient as the cosmos.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1317] Logged
  • View Profile
  • share
  • [March 14, 2011, 07:46:12 AM]
Re: Recompilation
« Reply #19 on: March 14, 2011, 07:46:12 AM »
PGF:

FFT was written in C.  Release date is 1997 (there was nothing better then) and towards the end of BATTLE.BIN, you see non-ASM ASCII comments detailing files (.C) and folders.  I also found stuff about data heaps (which apparently the coder must explicitly mention in C).  I'm sure stuff like this exists in other files too and I'm sure anyone with a hex editor can do this to find out more about the large-scale file organization of any other important file (WORLD.BIN, SCUS...).

As for code that's never checked in FFT?  We already know that DEBUG mode and Sound Novels are in the English ISO, but not called during normal game procedures.  I strongly suspect there's stuff like this in BATTLE.BIN, especially on some of the longer routines I've seen (like knockback).

I use pSXrel, WinHex or HxD (depending on the computer), as well as the tools downloaded from this site.  I didn't need Renegade up to now, but I might get it to type up the hex for my massive formula hack.
At this point, I'm not exactly sure what other tools I need, though a map of PSX data sections would be nice (e.g. 0x80000000 is ROM, 0xA0000000 is something to do with the system [RNG is called there, as is system time?]...)

Reverse Engineering Source Code...you mean turning Hex back into C?  I know there's commercial programs that do stuff like that (I have some freeware on my laptop that converted EXEs to C#/Java), but it's not 100% and in general, there's no perfect re-engineering software algorithm that can work on any piece of ASM, even for hex code that's simply a compilation of a C program (and even if it did, there's no guarantee the resulting program would be readable or efficient).  Considering also that I intend to ASM hack a lot of the resulting code while under space constraints (and most compilers from any language to ASM use space inefficient algorithms because most of those tend to optimize runtime and minimize the chance for variable misuse/error), it'll be likely that any ASM code I write will yield gibberish when fed through a cheap reverse compiler (because I don't follow conventions that restrict "free" register use).

As for the duplication of effort, that's one of the major barriers in this project (the other being not enough ASM hackers).  I don't know how to split the work that doesn't either result in that or someone doing boring grunt work.

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.
Pages: [1] 2 3 4