Final Fantasy Hacktics

Modding => Help! => Topic started by: Ruinom on February 01, 2014, 09:27:49 am

Title: Question about ability "Control"
Post by: Ruinom on February 01, 2014, 09:27:49 am
I want to change "Invite" to "Control". This ability is known as blue mage's one.
To realise the skill, there are two requirements.

When an enemy is invited,
1)the unit is controllable.
:v/: 2)the unit does not join.

I have a patched data so I searched codes and addresses.
But I could not find it.
Does somebody know that?
please help me. :)
Title: Re: Question about ability "Control"
Post by: Choto on February 01, 2014, 01:34:23 pm
Do you want to use Control as a status effect to replace Invite?

If so, there is a file called Require.Out that should have the routine that makes units join after battle. You would have to find and edit that routine. I could tell you how but it would take some ASM work and a debugger.
Title: Re: Question about ability "Control"
Post by: Ruinom on February 01, 2014, 08:42:19 pm
Thank you so much!! :mrgreen:

Actually I have file changed from Invite to Control, but It is hardcoded.
So, I'll analyse it. If I succeed ASM work, I would reply again.
Title: Re: Question about ability "Control"
Post by: Choto on February 02, 2014, 11:15:53 pm
Do you know how to do ASM work? If so, 0x801924cc is unit data in battle, if you set a breakpoint on the group of status that has invite and end a battle with an invited enemy, the debugger should show you where the routine is in require.out. I think in RAM its around 0x1c0000 or higher, I could be wrong though.
Title: Re: Question about ability "Control"
Post by: Ruinom on February 03, 2014, 06:51:20 am
How kind you are!! :)
Thank you for replying regardless of my smattering of English!!
Maybe no one explain that for me in japanese comunication site.

Certainly I know how to do ASM work just a little.  But I'll serch the code from patched require.out.
I want to reproduce it in WOTL.
Title: Re: Question about ability "Control"
Post by: Choto on February 03, 2014, 09:05:45 am
I know going between japanese and english is quite difficult, so no worries :P

Instead of searching, i just used the debugger real quick since it's much easier to do. The breakpoint hit at 0x1c4978. If you make the branch command after that function unconditionally it should do the trick. To get the Require.out location you do 0x1c4978 - 0x1bf000 = 0x5979.
Title: Re: Question about ability "Control"
Post by: Ruinom on February 04, 2014, 09:18:52 am
Sorry I ask a rudimentary question.
What is debugger? Is it debug mode?

And now I have only Japanese ver. so please let me confirm ASM.
I will write an ASM list tomorrow.
Today I don't have enough time.
See you.
Title: Re: Question about ability "Control"
Post by: Angel on February 04, 2014, 11:29:02 am
A debugger is a tool that shows things like what code is being run, what's being stored, etc.
pSX 1.13 (psxfin.exe) has a decent debugger available.
Title: Re: Question about ability "Control"
Post by: Xifanie on February 05, 2014, 12:04:36 am
I might be able to help with converting code offsets from the US to Japanese version (v1.1) since I own both versions.

It shouldn't be anything difficult, just hex search for the same exact codes except for j/jal.
Title: Re: Question about ability "Control"
Post by: Ruinom on February 06, 2014, 05:36:58 am
Sorry for the late relpy.
I found changes between FFT and patched FFT handy for 0x5979.
So I think that there is the answer in following changes.
Is there a code that Choto found?

1)
00005060   00021040   sll      v0,v0,$1

00005060   00021043   sra      v0,v0,$1

2)
000050B0   00021040   sll      v0,v0,$1

000050B0   00021043   sra      v0,v0,$1

3)
00005134   10400042   beq      v0,zero,$5240

00005134   10000042   beq      zero,zero,$5240

4)
00005248   10400045   beq      v0,zero,$5360

00005248   10000045   beq      zero,zero,$5360

5)
00005490   1040004B   beq      v0,zero,$55c0

00005490   1000004B   beq      zero,zero,$55c0

6)
000055C4   14400045   bne      v0,zero,$56dc

000055C4   10000045   beq      zero,zero,$56dc

To Toshiko
Thanks telling me about a debugger.
I'll introduce it right away!

To Xifanie
Thank you for repiying.
I post several codes. So we can know offsets.


I think this forum are much friendlier than people in 2ch.
Thank everyone!
Title: Re: Question about ability "Control"
Post by: Choto on February 06, 2014, 09:34:03 am
I'm a bit confused on what you posted Ruinom.. what patched FFT are you referring to?

Lets try this, open up a hex editor like HxD and open the Require.out file. Press control F for the search window and search for this hex:

59 00 02 92 00 00 00 00 40 00 42 30 3E 00 40 10

Make sure you're searching for Hex Values instead of Text or anything else. If you find it, awesome. Then replace it with this:

59 00 02 92 00 00 00 00 40 00 42 30 3E 00 00 10  (you'll notice only one of the last bytes changed)

And that should be step one of your hack. Otherwise, if Xiffy could find this string of commands:

00005978: 92020059 lbu r2,0x0059(r16)      load status
0000597c: 00000000 nop
00005980: 30420040 andi r2,r2,0x0040
00005984: 1040003e beq r2,r0,0x00005a84      branch if not invite
Title: Re: Question about ability "Control"
Post by: Xifanie on February 06, 2014, 11:59:48 am
I guess the branches ARE different.

I hope this isn't bad news, but I forgot this was about WotL... I only have the PSX version. Toshiko said that the game is simply being emulated on ports, so I'm betting on that and hoping the data didn't move.

REQUIRE.OUT
0x80005954
3B004010 → 3B000010

String of hex for reference:
5900029200000000400042303B004010
Title: Re: Question about ability "Control"
Post by: Angel on February 06, 2014, 01:08:18 pm
Yeah, WotL has a complete ROM image of the Japanese (I think 1.1) version of FFT in it. I'm not sure if editing that image will produce the desired effects, though, since it's still treated as a PSP game and not run on the POPS emulator. Likely needs completely different ASM.
Title: Re: Question about ability "Control"
Post by: Choto on February 06, 2014, 03:31:04 pm
Weeell shit lol... i didn't realize it was WOTL. I have no clue then.. I haven't touched wotl at all.
Title: Re: Question about ability "Control"
Post by: Glain on February 06, 2014, 10:12:39 pm
I'm pretty sure they recompiled most of the PSP version code into BOOT.BIN/EBOOT.BIN.  It contains lots of PSP commands that the PSX can't support (Newer CPU instructions up to MIPS32R2, FPU calls, PSP VFPU calls).  I think some of the data is still in the same place within fftpack, but code is a different story... even similar algorithms use different compiler conventions, not to mention nothing's in the same place!
Title: Re: Question about ability "Control"
Post by: 3lric on February 06, 2014, 11:01:50 pm
Quote from: Glain on February 06, 2014, 10:12:39 pm
I'm pretty sure they recompiled most of the PSP version code into BOOT.BIN/EBOOT.BIN.


This is correct, Xif had to crack open BOOT.BIN to find the new worldmap instructions used for things
like the Agrias BDay event, as they were not in the WLDCORE.BIN used in WotL. BOOT.BIN also contains
some ATTACK.OUT stuff as well.

I'm assuming there is something graphic related stored here as well, since in the .ini file for the Japanese
version of FFTEVGRP you can see that it was originally supposed to include BOOT.BIN. However the new
WotL EVTCHR are still in EVTCHR.BIN, which was just expanded slightly.

Strange Square is strange.
Title: Re: Question about ability "Control"
Post by: Ruinom on February 08, 2014, 06:43:26 am
To Choto
Sorry I mistook. The patch I said didn't have desired function.
And it is Japanese patch so you can't use it. I'm so sorry!! :oops:
But I could find Choto's code.

Well... I think it is too difficult for me to reflect the code to WOTL. :cry:
I do not give up.

To Xifanie
Thank you for translating.

To Toshiko
Your support was very good. And is your icon Sailor Jupiter?
It's cool!

To Glain
Thanks for commentary about EBOOT/BOOT.BIN.
From now on I'll try searching the code in boot.bin.

To Elric
Are you YoungMaster McDohl? I love Suikoden.
Changing graphic file can reflect the game play.

Thank you very much.
Title: Re: Question about ability "Control"
Post by: Angel on February 08, 2014, 04:57:54 pm
Quote from: Ruinom on February 08, 2014, 06:43:26 amTo Toshiko
Your support was very good. And is your icon Sailor Jupiter?
It's cool!

It is! I've been watching Sailor Moon recently with Xifanie, and it seemed appropriate. Thank you!
Title: Re: Question about ability "Control"
Post by: 3lric on February 08, 2014, 10:42:45 pm
Quote from: Ruinom on February 08, 2014, 06:43:26 am
To Elric
Are you YoungMaster McDohl? I love the title.


Indeed the port is Tir McDohl. The portrait was wonderfully done by Twinees.
Suikoden is my favorite series of games. :P
Title: Re: Question about ability "Control"
Post by: Timbo on February 09, 2014, 01:09:46 am
Quote from: Elric on February 08, 2014, 10:42:45 pm
Indeed the port is Tir McDohl. The portrait was wonderfully done by Twinees.
Suikoden is my favorite series of games. :P
Mine too!
Title: Re: Question about ability "Control"
Post by: Ruinom on February 09, 2014, 07:10:07 am
Now because of everyone's support, 2) is completed!!

Then I think the answer of 1) is in Battle.BIN subroutine2.

lui   v0, $801a   # 001926e8:3c02801a
lbu   v0, $e189(v0)   # 001926ec:9042e189
addiu   sp, sp, $ffe0   # 001926f0:27bdffe0
sw   s0, $0010(sp)   # 001926f4:afb00010
lui   s0, $801a   # 001926f8:3c10801a
lw   s0, $e184(s0)   # 001926fc:8e10e184
.
.
.
addiu   sp, sp, $0020   # 001928cc:27bd0020
jr   ra   # 001928d0:03e00008
nop      # 001928d4:00000000

First of all I should try learning how to use the debugger.

To Jack
Which number is your favorite one? My favorite title is 2nd.
Title: Re: Question about ability "Control"
Post by: Timbo on February 09, 2014, 07:34:13 am
The first one. It's hard to point out why but it grabs me harder than all of the others.
Title: Re: Question about ability "Control"
Post by: Ruinom on February 14, 2014, 09:29:55 am
It's been quite while.
Lately, I taught myself how to use the debugger by some tutorials.

However, some breakpoints were hit more than necessary.
For example, I set a Unit Data breakpoint (801908cc) then I used invite.
When ally character finished turn, the breakpoint were hit and hit and hit.... :lol:
Which breakpoint is better?

To Jack
I'm looking forward news of 6th.
Title: Re: Question about ability "Control"
Post by: Choto on February 16, 2014, 08:54:40 am
instead of unit data, you want the "current status" byte that holds wether or not the unit has invite. for psx version this is at 0x59 in unit data as you can see here: http://ffhacktics.com/wiki/Battle_Stats

you also want to find the specific unit's data. 801908cc is the start of unit data. Each unit's data is 0x1c0 long. However, we know that allied unit data starts at 0x1924cc. So if you start there and check that unit's job to see which unit it is, then go 0x1c0 further and check the next unit... you can find the specific unit that you want. Then, go to that 0x59 byte and set a breakpoint.

but with that WOTL stuff, it could be different.