• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 26, 2024, 04:41:09 pm

News:

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


Modifying CT, exp, etc (ASM help)

Started by Emmy, October 15, 2016, 03:12:42 pm

Emmy

October 15, 2016, 03:12:42 pm Last Edit: October 16, 2016, 01:11:45 pm by Emmy
1.  I can't figure out what is wrong with this ability. :'(  It is meant to replace jump +3, with an ability that reduces CT of a move to 1 if it uses a specific formula (formula 0B). (code to disable jump +3 not included here) Code:


Fft orgasm version:

  <Patch name="Jump +3: Formula 0B = 1 CT">
    <Description>Doesn't work :'(</Description>
    <Location file="BATTLE_BIN" offset="115854">
04005730
0900E016
00000000
404E0508
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="ec900">
0C004012
00000000
93006392
00000000
20006230
07004010
00000000
1980033C
F838638C
0B000234
02006214
00000000
01001234
92006392
00000000
08006230
03004010
00000000
1AF20508
00000000
1CF20508
00000000
    </Location>
  </Patch>


ASM of code:

[0x00000000] beq r18,r0,0x00000034
[0x00000004] nop
[0x00000008] lbu r3,0x0093(r19)
[0x0000000c] nop
[0x00000010] andi r2,r3,0x0020
[0x00000014] beq r2,r0,0x00000034
[0x00000018] nop
[0x0000001c] lui r3,0x8019
[0x00000020] lw r3,0x38f8(r3)
[0x00000024] ori r2,r0,0x000b
[0x00000028] bne r3,r2,0x00000034
[0x0000002c] nop
[0x00000030] ori r18,r0,0x0001
[0x00000034] lbu r3,0x0092(r19)
[0x00000038] nop
[0x0000003c] andi r2,r3,0x0008
[0x00000040] beq r2,r0,0x00000050
[0x00000044] nop
[0x00000048] j 0x0017c868
[0x0000004c] nop
[0x00000050] j 0x0017c870
[0x00000054] nop


Relevant routine in wiki:
http://ffhacktics.com/wiki/Attack_Preparation


2.  I'd like to modify the code used in Egcc to give out xp at the end of battles.  It needs to be modified though because I still want the player to get gil; and if it's possible, to reduce xp given out per battle such that players gain 1 lv every 2 battles.  However my attempts to recode this haven't worked. :'(

Original (Egcc) code:


  <Patch name="Rewards Hack">

  <Description>This makes it so LVL/JP gain occurs at the end of any mission, and makes bonus gil from enemy levels 0. This hack also makes it so only enemies with KO statii will yield after battle trophies/gil. To be used with hacks that disallow random battles, JP/EXP Gain, Spillover JP.</Description>

  <Location file="BATTLE_BIN" offset="119E00">
21400000
21480000
21280000
21388000
1980063C
CC08C624
8301C390
0500C290
16006010
FF000B34
14006B10
30004230
03004014
80000A34
D6400508
00000000
04006A10
5800C294
60C50A34
24104A00
0A004010
6301C390
6401C290
04006010
64000A34
0000E3A0
0100E724
01000825
18004A00
12180000
21482301
0100A524
1500A228
E4FF4014
C001C624
21280001
1500A228
07004010
150088A0
2118A400
000060A0
0100A524
1500A22C
FCFF4014
01006324
180089AC
1C0080AC
0800E003
200080AC
</Location>

  <Location file="BATTLE_BIN" offset="E9358">
0600C190
0300C390
20002130
0C002014
B6FF6324
1400612C
03002010
DC00C124
40180300
21082300
00002A94
28002B94
4B004A25
4B006B25
00002AA4
28002BA4
64000B34
9F030608
2100CBA0
</Location>

</Patch>



My attempt at writing this:


  <Patch name="XP gain change">
    <Description>TEST</Description>
    <Location file="BATTLE_BIN" offset="119e14">
08610508
00000000
    </Location>
    <Location file="BATTLE_BIN" offset="f1420">
1980063C
CC08C624
0600CC90
0300CD90
20008C31
0C008015
B6FFAD25
1400AC2D
03008011
DC00CC24
40680D00
21608D01
00008E95
28008F95
4B00CE25
4B00EF25
00008EA5
28008FA5
64000F34
87030608
2100CFA0
    </Location>
  </Patch>

ASM of routine:

[0x00000000] lui r6,0x8019
[0x00000004] addiu r6,r6,0x08cc
[0x00000008] lbu r12,0x0006(r6)
[0x0000000c] lbu r13,0x0003(r6)
[0x00000010] andi r12,r12,0x0020
[0x00000014] bne r12,r0,0x00000048
[0x00000018] addiu r13,r13,-0x004a
[0x0000001c] sltiu r12,r13,0x0014
[0x00000020] beq r12,r0,0x00000030
[0x00000024] addiu r12,r6,0x00dc
[0x00000028] sll r13,r13,0x01
[0x0000002c] addu r12,r12,r13
[0x00000030] lhu r14,0x0000(r12)
[0x00000034] lhu r15,0x0028(r12)
[0x00000038] addiu r14,r14,0x004b
[0x0000003c] addiu r15,r15,0x004b
[0x00000040] sh r14,0x0000(r12)
[0x00000044] sh r15,0x0028(r12)
[0x00000048] ori r15,r0,0x0064
[0x0000004c] j 0x00180e1c
[0x00000050] sb r15,0x0021(r6)


3.  Does anyone know/have any documentation on the actual code that pieces together event instructions? Specifically the code behind this one: http://ffhacktics.com/wiki/Event_Instruction_92  I'd like to know where in the code it links together 0x02 = Poison/Critical, for the purpose of potentially changing that to something else.  **Edit**  Found this routine with the debugger: http://ffhacktics.com/wiki/001488a8_-_00148cd4  I have no idea what 0x80173c78 is though, it's not in data locations. :(
  • Modding version: PSX