• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 30, 2024, 03:14:09 pm

WOTL asm?

Started by drbretto, January 30, 2012, 01:18:08 pm

drbretto

I know that you can't use the fftorgasm or whatever on a WOTL iso because the values are in different places and whatnot, but has anyone gone in and manually edited the values for making oil and float give fire and wind vulnerability?

And if so, if you could point me to a resource to figure out how to make that happen, I would be very appreciative. I would literally make you, personally, like my 5th or 6th best friend in the whole wide world. Just think about it, walking hand-in-hand in the park, whistling the tune of that "people, let me tell you 'bout my BEST friend" song...

RavenOfRazgriz

It's actually a simple and uniform offset conversion to find the right locations in War of the Lions.  I don't know it offhand, but I know Formerdeathcorps does.  If I dig, I /might/ be able to find it, but no promises.

drbretto

January 30, 2012, 01:46:50 pm #2 Last Edit: January 30, 2012, 02:07:23 pm by drbretto
I've never done anything with ASM, so I would either need instructions made for a 2-year-old or if someone is willing, make me a ppf with just those changes or me to apply my patch to. All credit will be given in BIG BOLD LETTERS.

However, if that's too much to ask, I am also an extremely fast learner, so even just a good old fashioned pointing in the right direction would be incredibly helpful.

Pride

This is the most I could find about PSX --> PSP

Quote from: formerdeathcorps on February 28, 2011, 08:11:04 pm
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 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.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?


RavenOfRazgriz

January 30, 2012, 03:08:20 pm #5 Last Edit: January 30, 2012, 03:39:11 pm by RavenOfRazgriz
I did some poking around, also found this:

Quote from: formerdeathcorps on February 28, 2011, 05: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.


E92AC - E8964 = -948h conversion for anything using the Kanji Table.  

Based on what you found, Pride, anything Formula-related seems to be:

128614 - 1265E0 = -2034h

That means, if I adjust the locations that the Patch is written to based on the above and a bit of guesswork, we get...

Quote from: Maybe works?
<Patch name="Float weak against Wind; Oil weak against Fire">
   <Location file="BATTLE_BIN" offset="11D430">B74D0508</Location>
   <Location file="BATTLE_BIN" offset="0EBD94">
     982D438C
     5A006390
     40006430
     05008014
     80006430
     09008014
     00000000
     CF4D0508
     00000000
     F7384490
     10008430
     09008014
     00000000
     CF4D0508
     00000000
     F7384490
     80008430
     03008014
     00000000
     CF4D0508
     00000000
     CE384384
     40180300
     CE3843A4
     982D428C
     1B190608
     00000000
   </Location>


(I based the location of the Shell routine based on the difference between Formula locations.  Total guesswork, but I get the odd feeling that's probably correct unless someone wants to whip out a PSX and PSP BATTLE.BIN and compare their Shell Routines to get a guaranteed offset.)

I'm unsure if any Jump commands contained in the code need to be edited, but you can test this and see if it works.  Someone who actually knows how to ASM hack will need to take over if more needs to be done.

drbretto

Thanks for all the effort guys.

drbretto

Ok, learning a lot today.

I'll leave the rest of the discussion on the topic to this thread. To fill you guys in, RoR's code worked! Well, at the very least, the oil portion of it worked. I haven't been able to properly test the float part but using a fire and wind elemental attack that I created to test it, float did not work but oil did. I haven't gone back to test whether or not it was my ability that I was testing with or if the float portion isn't working.

Based on what RoR did there with the offsets, I'd find it hard to believe that the oil would work and not the float portion, UNLESS the first block of code is for oil and the larger second block is for float and maybe should have just used the same -2034h on both offsets.

Question for the experts here: Would this suggest that anything in battle.bin would work with the -2034h or is there some other factor involved?

I ask because if this one works, I can try to apply the same sort of adjustments on some of the other previously done ASM hacks to try to import them into WOTL. I'm sure they won't all work just as easily but it's worth a shot for a few of them.

RavenOfRazgriz

Reposting here.

If one's working, the other should be working unless the hack doesn't work.  Again, test with magic, like some of 1.3's Wizard skills or Wind Anima.  This is written in the Shell routine, and the fact this even triggers Oil's half off the Punch Art formula is astounding, to the point I say go make sure you're not testing on something already weak to Fire. 

You subtract -948h from parts of the hacks written into the Kanji Table.  The Kanji Table is a portion of FONT.BIN that's duped into BATTLE.BIN for various reasons, but contains nothing but Kanji the game never actually uses.  This is where the majority of code for most ASM hacks is written.  If the Offset of part of an ASM comes within the listed values for the PSX Kanji table, you subtract -948h.  Subtract anything else, you might break shit, especially when using multiple ASM hacks.  On the PSX, as I posted in the other thread, the Kanji table stretches from 0xE92AC to 0xFA2DC, so if your PSX hack has a portion that falls within these offsets, you need to subtract 948h.

The -2034h is subtracted because that's the difference between the Formula Tables in a PSX BATTLE.BIN and a PSP BATTLE.BIN.  My guess on routines such as the Shell routine, etc. also being -2048h away was really just that - an educated guess based on the fact the Shell routine is part of the Formula routines.  You'd use this conversion for things like Formula Edits, the Oil/Float fix, etc. The Formula Table in the PSX stretches from 0x128614 to 0x1287A4, so if your PSX hack has a portion that falls within these offsets, you need to subtract 2034h.  You'll notice part of your hack actually doesn't fall in this range, but is a bit before.  This is where my educated guess came in.  It was /close/ to the Formula Table, and I knew it was editing the Shell routine from past experience, and since the Shell routine is involved in Formula... assuming the conversion in where things is in BATTLE.BIN on the PSP was done competently, it seems most prudent to shift everything Formula-related the same amount of space and minimize how much code needs rewriting.  I could have easily been wrong, and knowing Squaresoft / Square-Enix, expected to be, hence why I was surprised when it worked.

Tl;dr: test v Float with a formula that's affected by Shell and not the Punch Art formula, it'll probably work.

drbretto

Yeah, it's quarter to 4, so I'll retest more tomorrow (as well as read your whole post). I can say with 100% certainty that the cyclone formula worked vs. oil, tested in like 700 different ways on my own teammates, both before and after applying oil status.

Glain

About whether or not you can just subtract offsets for everything between the two versions... no, and I'm actually amazed that any of the offset conversion from PSX to PSP works at all. It relies on blocks of code being the same and being in the same place, which is not something you can assume, especially when the code is changed. I suppose they must have used the same compiler for both PSX and PSP. Anyway, unless you know that the PSX and PSP versions use the same code for specific functions, you can't really assume offset conversion is going to work at all.

Nothing wrong with experimenting, though.
  • Modding version: Other/Unknown

RavenOfRazgriz

January 31, 2012, 10:53:18 am #11 Last Edit: January 31, 2012, 11:09:08 am by RavenOfRazgriz
Except, Glain, if you look at FDC's research on the matter along with the fact FDC has done the exact same thing I did here to get people functional hacks on War of the Lions... the BATTLE.BIN code is almost 100% the same.  The game was not recoded outside of the new content added.  At all.  War of the Lions is a straight rip-and-repackage of the PSX game with some bugfixes and new content.  Things were shuffled around a bit due to what was added, but the code is almost entirely the same, which is backed from both posts by FDC here, conversations I had with him on the matter in private, and the fact that again I've seen him pull this exact thing before, at least as far as BATTLE.BIN is concerned.  Most of WORLD, SCUS, etc. is likely also the same, with edits only where new things were added.  If you can figure out the offset conversions and such needed, shit will work in both versions.  I said the exact same thing you said here, Glain, and FDC swooped in with this kind of bullshit magic and made me put my foot in my mouth.

In all honesty, War of the Lions isn't a "remake" so much as it's a Shakespearean patch to Vanilla with some new content, bugfixes, and routines shifted around.  The code is honestly pretty much identical, Failsoft coding and all.  Grab yourself a PSX and PSP set of BATTLE.BINs and compare stuff using the offset conversions I just gave you.  You will weep at the sheer levels of fucks ungiven as far as the "remake" aspect of War of the Lions is concerned.

Glain

That's pretty funny. fdc doesn't even seem to think it's strange but I honestly don't even know how Square managed it. Maybe just dumb luck.

Still, there have to be SOME edits. Like Mighty Sword hitting monsters. And if that routine is bigger, then that would shift offsets further, wouldn't it? At the very least it wouldn't be the same difference in offsets for each location in BATTLE.BIN.
  • Modding version: Other/Unknown

drbretto

So... and please forgive my complete ignorance on the matter, I'm learning as I go... if some of these blocks of data are in the same order, but the offsets for where they begin might be different from block to block (and some might be the same), then theoretically:

I could open a vanilla psx ISO and an ASM patched ISO into a hex editor and compare to find the original blocks of data, then open a vanilla PSP ISO to find a similar block of data to figure out the difference on the offsets, then I should be able to use that number to edit the pre-existing asm hacks for the psp?

RavenOfRazgriz

January 31, 2012, 12:37:45 pm #14 Last Edit: January 31, 2012, 01:41:48 pm by RavenOfRazgriz
Quote from: Glain on January 31, 2012, 11:39:51 am
That's pretty funny. fdc doesn't even seem to think it's strange but I honestly don't even know how Square managed it. Maybe just dumb luck.

Still, there have to be SOME edits. Like Mighty Sword hitting monsters. And if that routine is bigger, then that would shift offsets further, wouldn't it? At the very least it wouldn't be the same difference in offsets for each location in BATTLE.BIN.


It sounds more like Square-Enix being the lazy fuckbags they are.

Length of the Formula Offset Table in Vanilla is 190h, length of the Formula Offset Table in War of the Lions is... 190h.  Unless I'm derping, they're the same length.  Sounds like Square-Enix did the exact same thing we do - replaced ELSE Miss with a Jump command and coded the rest of it elsewhere!  Derp.

Quote from: drbretto on January 31, 2012, 11:59:57 am
So... and please forgive my complete ignorance on the matter, I'm learning as I go... if some of these blocks of data are in the same order, but the offsets for where they begin might be different from block to block (and some might be the same), then theoretically:

I could open a vanilla psx ISO and an ASM patched ISO into a hex editor and compare to find the original blocks of data, then open a vanilla PSP ISO to find a similar block of data to figure out the difference on the offsets, then I should be able to use that number to edit the pre-existing asm hacks for the psp?


Short version: If you can find which routines each ASM hack is written into and the offset conversion between PSX and PSP for said routine, then yes you should be able to run the ASM hack on the PSP.



As for Punch Art working with Oil, I think I found your derptastic reason why - Oil works properly in War of the Lions.  Herp!  I recommend testing with magic such as Fire against an Oiled opponent and making sure you don't hit them for 4x damage.

Pride

The formula table is.... very strange since WOTL added new formulas. It also added new area of effects for some of those abilities. So there has to be changes in the code somewhere, but who knows where.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

drbretto

QuoteAs for Punch Art working with Oil, I think I found your derptastic reason why - Oil works properly in War of the Lions.  Herp!  I recommend testing with magic such as Fire against an Oiled opponent and making sure you don't hit them for 4x damage.


For the millionth time, I used magic as well as the punch art formula and both worked perfectly fine. So if oil works properly in WOTL, the only thing that didn't work is the ASM offset you provided. Which explains why the wind elemental part wasn't working.

But, all is not lost because this experience taught me enough that I can poke around for a bit over the next few days and update a couple of the readily compatible hacks for the psp and they might just work.


drbretto

Yeah, I'm off to work myself. I'll start poking around as well when I get home.

Glain

Quote from: RavenOfRazgriz on January 31, 2012, 12:37:45 pm
It sounds more like Square-Enix being the lazy fuckbags they are.

Length of the Formula Offset Table in Vanilla is 190h, length of the Formula Offset Table in War of the Lions is... 190h.  Unless I'm derping, they're the same length.  Sounds like Square-Enix did the exact same thing we do - replaced ELSE Miss with a Jump command and coded the rest of it elsewhere!  Derp.


Well... we're hacking and Square isn't. I mean, they wouldn't be writing ASM or creating offset tables. They have the C source code. So I imagine they changed the source code, and then the compiler generated the exact same ASM blocks, offset tables, etc., by some stroke of coincidence (or maybe because Square just didn't change much of the original source and they used the same compiler). Either that or they're insane enough to hack assembly when they have source code, but I doubt they're that nuts. Who knows?
  • Modding version: Other/Unknown