• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 26, 2024, 06:32:54 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Code for modifying "Fly" ability using MassHexASM

Started by Thorronn, January 28, 2022, 09:11:12 am

Thorronn

Hey all.  I am an ASM hacking newbie and I have greatly benefitted from the wisdom of people on this site.

I am currently playing WOTL using the PPSSPP emulator.  I have beat the game many times and I am now trying to modify lesser used abilities for kicks and giggles on my 5th playthrough.  I would like to modify the "Fly" ability from the Bard job to have the same range as "Master Teleportation" or at least an increased range.

I have tried Googling, but the best I have been able to discover is that I need to use ASM hacking to do this, and that modifying this ability would require some lines of actual code.  Does anyone know what that code would be?  Bonus if someone would walk me through the steps to modify this ability and patch the new version into my game file.
  • Modding version: WotL

nitwit

February 03, 2022, 11:02:49 am #1 Last Edit: February 03, 2022, 02:12:16 pm by nitwit
There aren't a lot of resources available for the PSP version. IIRC there's a team doing a mod loader and various other very impressive things for the PSP on github, but I don't know where to find them, if their disassembly plugin is up to date, or whether hassling them to update it is possible. Here are all their github repositories:
https://github.com/orgs/FFT-Hackers/repositories

This seems especially relevant:
https://github.com/FFT-Hackers/TacticsCrafter

I do know that some of them are working on disassemblies of FF7 or FF8 over at Qhimm forums and their discord, so you could try there.



I don't know how useful the existing comments on disassembled routines and data structures for the PS1 version on the wiki here would be. Some might be useful as a rough outline if you are very technically adept and can locate similar routines in the PSP version, but first you need to figure out how to extract game files from the PSP version. I don't know how to do that, but it should be your first priority as it's necessary to do anything else.

Here's probably the most relevant page on the wiki, judging from a quick search:
https://ffhacktics.com/wiki/Float/Float/Fly_movements

On the PSP, everything that is a jump or branch will almost certainly jump/branch to a different address, so identifying this chunk of code in the PSP can't be done by searching for any line that is a jump or branch.

Both the PS1 and the PSP are little endian, and they have the same word size, so it may be possible to locate things with a bit of searching.

0017f020: 9086005a lbu r6,0x005a(r4)        |r6 = Unit's 3rd set of Current Status
0017f024: 90850095 lbu r5,0x0095(r4)        |r5 = Unit's 3rd set of Movements
0017f028: 90840094 lbu r4,0x0094(r4)        |r4 = Unit's 2nd set of Movements

I would try searching for these 3 lines, which are 12 bytes.

90 86 00 5a
90 85 00 95
90 84 00 94

Or
90 86 00 5a 90 85 00 95 90 84 00 94

If the data structure for each unit is the same size in the PS1 and the PSP, then this may work. If it doesn't, try replacing the fourth byte of each with the wildcard character (I assume you're using XVI32 hex editor).

90 86 00 ** 90 85 00 ** 90 84 00 **

However note that this is just assembly for loading 3 different things into registers 6, 5, and 4 so there will probably be multiple hits on your search.

Note that this is a very, very long shot and probably won't work.



Google isn't as useful a search engine as it previously was; sometimes it lets you use certain search tools, sometimes it doesn't, and sometimes it treats advanced search queries at 133t h4xx0r1ng and prevents you from using google for the rest of the day. Anyways, try Bing, DuckDuckGo, and any other search engine you find and use keywords such as:
in-url:fft
"romhack"
... and others that let you be very specific with your results.