• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 24, 2024, 12:06:29 am

News:

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


Razele's ASM Hacks

Started by Razele, January 01, 2009, 02:08:08 pm

formerdeathcorps

No, I got oil to work fine.  I had a chemist potion add oil 100%, which caused archer fire shot to deal 200% damage.

EDIT: I checked the hex of BATTLE.BIN.  The orgASM hack was added correctly.
EDIT2: I even double-checked this against Razele's posted offsets on this thread.  Everything matches.
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.

Vanya

Then there has to be a flaw with the hack itself.

@Atma: Oil is a fix 'cause it never worked. Float/Wind was an extra hack that Square never intended.
  • Modding version: Other/Unknown
¯\(°_0)/¯

Atma

i knew Oil was a fix and float/wind was new.  hmm, maybe i should try a different formula  :P
My name is Atma... I am pure energy... and as ancient as the cosmos.

formerdeathcorps

Sword attacks of a given element never trigger this stuff the same way you can't have a Coral Sword boosted by heavy rain.

Posting this for reference (with my wild guesses on meaning--Vanya, Zodiac, please help here):
BATTLE.BIN at 0ec6dc:
1) 982D438C 5A006390 40006430 05008014 80006430 09008014 00000000 CF4D0508 00000000
2) F7384490 10008430 09008014 00000000 CF4D0508 00000000
3) F7384490 80008430 03008014 00000000 CF4D0508 00000000
4) CE384384 40180300 CE3843A4 982D428C 1B190608 00000000

I'm not sure what the first 4 bytes do, but I'm guessing it's something about calling the list of status effects.  5A006390 is probably saying for the first byte to be 5A, 40006430 is probably saying for the second byte to be 40 (so 5A40 corresponds to float) with 05008014 probably something about storage to variable 05?  Similarly, 80006430 with 09008014 means that the second byte 80 (oil corresponds to status effect 5A80) corresponds to variable 09?  CFD00508 corresponds to a code jump (though I'm not sure if it's a re-pointer or a section jump).
F7384490 appears in 2) and 3).  I suspect this is the code that calls for setting something as weak to a given element.  10008430 specifies it as wind (the 4th element corresponds to 10); 80008430 specifies it as fire (the 1st element corresponds to 80).  Again, CFD00508 is a code jump.
I have no clue what 4) means, though it's notable that you have CE3843_4 (8 and A are very similar) and 982D4_8C (2 is here; 3 was in the beginning).  1B190608, I assume, is a jump back to the part of BATTLE.BIN that Razele referenced?

As for the source of error, we know that using a wind elemental attack has no extra effect on damage with float, but that oil works with fire.  Thus, we can reasonably assume statement 2) is not actually being referenced.  I suspect this is because the CFD00508 is skipping that section, 09008014 conflicts with the earlier designation, or we need to repeat 5A006390 after 05008014.
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.

Xifanie

001536dc: 8c432d98 lw r3,0x2d98(r2)
001536e0: 9063005a lbu r3,0x005a(r3)
001536e4: 30640040 andi r4,r3,0x0040
001536e8: 14800005 bne r4,r0,0x00153700
001536ec: 30640080 andi r4,r3,0x0080
001536f0: 14800009 bne r4,r0,0x00153718
001536f4: 00000000 nop
001536f8: 08054dcf j 0x0015373c
001536fc: 00000000 nop
00153700: 904438f7 lbu r4,0x38f7(r2)
00153704: 30840010 andi r4,r4,0x0010
00153708: 14800009 bne r4,r0,0x00153730
0015370c: 00000000 nop
00153710: 08054dcf j 0x0015373c
00153714: 00000000 nop
00153718: 904438f7 lbu r4,0x38f7(r2)
0015371c: 30840080 andi r4,r4,0x0080
00153720: 14800003 bne r4,r0,0x00153730
00153724: 00000000 nop
00153728: 08054dcf j 0x0015373c
0015372c: 00000000 nop
00153730: 844338ce lh r3,0x38ce(r2)
00153734: 00031840 sll r3,r3,0x01
00153738: a44338ce sh r3,0x38ce(r2)
0015373c: 8c422d98 lw r2,0x2d98(r2)
00153740: 0806191b j 0x0018646c
00153744: 00000000 nop

Learn to use a debugger or something. You can't get anything done by just looking a numbers.
pSX and pcsxe (sp?) both have one. Everyone I know on FFH uses the first one though.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Cheetah

Quote from: "Zodiac"Learn to use a debugger or something. You can't get anything done by just looking a numbers.
pSX and pcsxe (sp?) both have one. Everyone I know on FFH uses the first one though.

I have managed quite a bit by just looking at numbers, but knowing ASM is obviously much more productive.
Current Projects:

formerdeathcorps

For those of you who didn't like the float weak to wind part, here is a revised hack:

BATTLE.BIN
0x11F464 change 982D428C to B74D0508

0xEC6DC
982D438C
5A006390
80006430
03008014
00000000
C74D0508
00000000
F7384490
80008430
03008014
00000000
C74D0508
00000000
CE384384
40180300
CE3843A4
982D428C
1B190608
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000

This incidentally also fixes the bug that a unit who has both float and oil won't take 2x damage from fire.
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.

Cheetah

Thanks FDC this is great. This will definitely be going into FFT:C.
Current Projects:

SilvasRuin

So does it make all sources of Float weak to Wind, or do I misunderstand?

formerdeathcorps

Yes, the original made all sources of float weak to only some sources of wind (only some formulas will allow double damage).
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.

SilvasRuin

I thought the problem was that only the movement ability Float was weak to Wind.  Huh...

Vanya

There is no differentiation between float as a support or a status because in fact the support skill simply grants the float status on a permanent basis.
I'm betting it was the original code that wasn't handling the 2x damage correctly or Razele's code didn't completely fix the problem or both.
  • Modding version: Other/Unknown
¯\(°_0)/¯

Skip Sandwich

There is a difference between float movement and float status, float status wont let you stop over lava or depth 3+ water (not even with items like feather boots that grant a continuous effect), the reason for this probably so that if the status is removed, either by wearing off or form the granting item being stolen/broken, you won't end up standing on unwalkable terrain, you can't push people into lava either.
"Dave?  Are you there?"
"Yeah.  I can't get you through the cell now."
"You have to talk through the bratwurst from now on. I'm sorry. I didn't know it would do that."
http://www.johndiesattheend.com

formerdeathcorps

This code works properly against both.

Zodiac noted in Eternal's patch, which used this, that aero spells did double damage against floating bombs.  I then tested air render (wind elemental flagged wave fist), which didn't work, but also tested my aero spell against TM induced float, which did work.  This implies some formulas aren't covered by the variable Razele chose to double.
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.

formerdeathcorps

OK, the original Razele hack had the tiny problem that when a unit with both float and oil is attacked by fire, he will not take 2x damage from fire.  There is a way to fix this (with changes in bold):

Method 1 (Oil + Float unit will take 2x damage if hit by a fiery wind.)

BATTLE.BIN
0x11F464 change 982D428C to B74D0508

0xEC6DC
98 2D 43 8C
5A 00 63 90
40 00 64 30
05 00 80 14
80 00 64 30
09 00 80 14
00 00 00 00
CF 4D 05 08
00 00 00 00
F7 38 44 90
10 00 84 30
09 00 80 14
00 00 00 00
BB 4D 05 08
00 00 00 00
F7 38 44 90
80 00 84 30
03 00 80 14
00 00 00 00
CF 4D 05 08
00 00 00 00
CE 38 43 84
40 18 03 00
CE 38 43 A4
98 2D 42 8C
1B 19 06 08
00 00 00 00

EDIT: Razele's Item Limitation Hack  (Attempt 1)

This still may not work, but I'm fairly certain I fixed the original problem.  Changes are in bold.

xEC5BC
21 90 00 00
05 80 01 3C
D0 97 21 34
15 80 02 3C
AC 35 42 34
00 00 23 90
YY  00 64 2C
05 00 80 14
00 00 00 00
ZZ FF 63 24
XX 00 04 24
80 4D 05 08
00 00 00 00
21 20 03 00
21 18 00 00
80 4D 05 08
00 00 00 00
00 00 24 A0
00 00 43 A0
01 00 21 24
01 00 42 24
01 00 52 26
0E 00 44 2E
ED FF 80 14
00 00 00 00
15 80 03 3C
BB 35 63 34
00 00 60 A0
19 80 01 3C
21 90 00 00
1A 0A 06 08
00 00 00 00
15 80 02 3C
BB 35 42 90
21 00 40 14
00 00 00 00
15 80 02 3C
00 34 42 34
00 00 44 AC
04 00 45 AC
08 00 46 AC
21 30 00 00
05 80 02 3C
D0 97 42 34
15 80 03 3C
AC 35 63 34
00 00 44 90
00 00 65 90
21 20 85 00
64 00 85 2C
02 00 A0 14
00 00 00 00
63 00 04 24
00 00 44 A0
01 00 42 24
01 00 63 24
01 00 C6 24
0E 00 C4 2C
F3 FF 80 14
00 00 00 00
01 00 04 24
15 80 02 3C
BB 35 44 A0
15 80 02 3C
00 34 42 34
00 00 44 8C
04 00 45 8C
08 00 46 8C
19 80 02 3C
44 38 42 94
B7 03 06 08
00 00 00 00

OK, variable Z's relation to X is that X+Z in unsigned 4-byte addition must equal 0.

[s:94go4l5i]Also, I highly suspect these lines are also causing problems:

00153664: 3c028005 lui r2,0x8005
00153668: 344297d0 ori r2,r2,0x97d0
0015366c: 3c038015 lui r3,0x8015
00153670: 346335ac ori r3,r3,0x35ac
00153674: 90440000 lbu r4,0x0000(r2)
00153678: 90650000 lbu r5,0x0000(r3)
0015367c: 00852021 addu r4,r4,r5
00153680: 2c850064 sltiu r5,r4,0x0064
00153684: 14a00002 bne r5,r0,0x00153690
00153688: 00000000 nop
0015368c: 24040063 addiu r4,r0,0x0063
00153690: a0440000 sb r4,0x0000(r2)
00153694: 24420001 addiu r2,r2,0x0001
00153698: 24630001 addiu r3,r3,0x0001
0015369c: 24c60001 addiu r6,r6,0x0001
001536a0: 2cc4000e sltiu r4,r6,0x000e
001536a4: 1480fff3 bne r4,r0,0x00153674
001536a8: 00000000 nop

Regardless of the initial values of r2 and r3, this is an iterative loop that will continue until all the item types are exhausted, but because both r2 and r3 are being incremented, r4 is growing non-linearly.  Is this correct?[/s:94go4l5i]

EDIT: Tested my revision for a maximum of 5 items.  There are no bugs anywhere.
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.

Zozma

Btw, Razele had made a fix for formula 2E that it can hit monsters and non equipped humans for the damage portion, however "maintenance" status blocks it, is there a way to make it ignore maintenance for the damage portion so that it hits EVERYTHING and isnt rendered completely useless for the mighty sword skillset?

also, this isnt really a request at this time but:

I was wondering if its easily possible to create a weapon formula similar to formula 2, except
it completely ignores the primary attack and executes the indexed spell at 100% chance.
For example: if i created a bow that used this formula, say "cupid bow" and idexed the spell "allure"
when you shoot a unit with the bow, there is no damage, or even a 0 displayed for no damage, but only the skill goes off instead. i know this was possible by writing over existing weapon formulas, but id rather have it as something additional.
  • Modding version: Other/Unknown
Wiegraf: Draw your sword Ramza!
Ramza: But im a monk!!

formerdeathcorps

Quote from: "Zozma"Btw, Razele had made a fix for formula 2E that it can hit monsters and non equipped humans for the damage portion, however "maintenance" status blocks it, is there a way to make it ignore maintenance for the damage portion so that it hits EVERYTHING and isnt rendered completely useless for the mighty sword skillset?

also, this isnt really a request at this time but:

I was wondering if its easily possible to create a weapon formula similar to formula 2, except
it completely ignores the primary attack and executes the indexed spell at 100% chance.
For example: if i created a bow that used this formula, say "cupid bow" and idexed the spell "allure"
when you shoot a unit with the bow, there is no damage, or even a 0 displayed for no damage, but only the skill goes off instead. i know this was possible by writing over existing weapon formulas, but id rather have it as something additional.

First request: Yes, but I think maintenance should block it.  That support is hardly ever used, and hardly needs to be weaker.  Just give Meliadoul some other skills too.
Second request: Yes, we already can do that on FFTPatcher.  Just use the 100% formula on weapons.
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.

Timbo

Quote from: "formerdeathcorps"
Quote from: "Zozma"Btw, Razele had made a fix for formula 2E that it can hit monsters and non equipped humans for the damage portion, however "maintenance" status blocks it, is there a way to make it ignore maintenance for the damage portion so that it hits EVERYTHING and isnt rendered completely useless for the mighty sword skillset?

also, this isnt really a request at this time but:

I was wondering if its easily possible to create a weapon formula similar to formula 2, except
it completely ignores the primary attack and executes the indexed spell at 100% chance.
For example: if i created a bow that used this formula, say "cupid bow" and idexed the spell "allure"
when you shoot a unit with the bow, there is no damage, or even a 0 displayed for no damage, but only the skill goes off instead. i know this was possible by writing over existing weapon formulas, but id rather have it as something additional.

First request: Yes, but I think maintenance should block it.  That support is hardly ever used, and hardly needs to be weaker.  Just give Meliadoul some other skills too.
Second request: Yes, we already can do that on FFTPatcher.  Just use the 100% formula on weapons.
I for one have to disagree.  Maintenance may not be a "powerful" support skill, but its not intended to be.  The idea is to prevent items from being stolen or broken, not to prevent damage.  Mighty Sword is not anywhere near as powerful as Holy Sword, even the WotL developers thought that it needed an upgrade and v1.3 added Crush Punch to Mighty Sword add a permanent source of damage.
  • Modding version: PSX
  • Discord username: Timbo

R999

Well, there's two problems with 100% formula on weapons.  

1. AI completely ignores it, regarldess if it adds instant Crystal+Death Sentence + Dead + Frog + Charm or whatever you try to throw at it.
 2. I think Zozma wants to make a weapon fire off the indexed spell not a status. Unless you mean the 100% formula can reference an ability slot?  I know Formula 4 does though.

Zozma

R999 said what i meant

i want an asm that makes a weapon instantly fire off an indexed spell instead of the physical attack or, an added status effect

kind of like how the magic guns fire off their element of spells, however, being able to specifically select the spell i want to fire off instead.
----

the same thing with the maintenance issue, i like that it blocks mighty sword from breaking the item, but i would still be happier if it still inflicted the physical damage, as those 4 skills are the only thing unique about the unit that is able to use them and they still dull in comparison to say a holy knight or dark knight. at the very least, it provides a physical attack that has a 100% success rate, (and is flashy as well)
  • Modding version: Other/Unknown
Wiegraf: Draw your sword Ramza!
Ramza: But im a monk!!