• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 25, 2024, 06:28:20 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Weapon Hacking Part I

Started by formerdeathcorps, June 15, 2011, 05:22:11 pm

formerdeathcorps

June 15, 2011, 05:22:11 pm Last Edit: June 17, 2011, 08:51:09 am by formerdeathcorps
OK, I just rewrote the weapon XA routine because it was a mess.

XA can be:
PA
MA
(PA+SP)*.5
(PA+MA)*.5
[PA*Br*.01]
RN{1+[PA/2], PA+[PA/2]} (yes, before you ask, I did hack that last one in to replace the old RN{1...PA} formula because nobody liked the axe/bag/flail formula)
It also leaves some extra space for people who want to hack new formulas/make older ones more complex.   For anyone interested, you can now make a quick spreadsheet that can make any weapon type use any existing formula type.  All you have to do is change the branch offsets to the start of the appropriate formula type.

The following documentation is mostly SA's, though I fixed a few bits (code is now in little-endian).  All the offsets posted are RAM so you must subtract 0x67000 to get the BATTLE.BIN offset (which is 0x11EA9C).


00185a9c: 1980023C lui r2,0x8019
00185aa0: D8384290 lbu r2,0x38d8(r2)                Load Used Weapon ID
00185aa4: E8FFBD27 addiu r29,r29,0xffe8
00185aa8: 1400BFAF sw r31,0x0014(r29)
00185aac: 1000B0AF sw r16,0x0010(r29)
00185ab0: 40180200 sll r3,r2,0x01                      ID * 2
00185ab4: 21186200 addu r3,r3,r2                      ID * 3
00185ab8: 80180300 sll r3,r3,0x02                      ID * 12
00185abc: 0680013C lui r1,0x8006
00185ac0: 21082300 addu r1,r1,r3                      80060000 + ID * 12
00185ac4: BD2E2390 lbu r3,0x2ebd(r1)                Load Used Weapon Item Type
00185ac8: 1980023C lui r2,0x8019
00185acc: 942D428C lw r2,0x2d94(r2)                 Load Attacker's Data Pointer
00185ad0: 1980013C lui r1,0x8019      
00185ad4: 36005090 lbu r16,0x0036(r2)              Load Attacker's PA
00185ad8: 37004690 lbu r6,0x0037(r2)                Load Attacker's MA
00185adc: 24004590 lbu r5,0x0024(r2)                Load Attacker's Brave
00185ae0: 38004490 lbu r4,0x0038(r2)                Load Attacker's SP
00185ae4: 32006010 beq r3,r0,0x00185bb0          Branch if bare-fisted
00185ae8: 01000234 ori r2,r0,0x0001                  r2 = 1
00185aec: 2A006210 beq r3,r2,0x00185b98         Branch if Used Weapon is a Knife
00185af0: 02000234 ori r2,r0,0x0002                   r2 = 2
00185af4: 28006210 beq r3,r2,0x00185b98          Branch if Used Weapon is a Ninjato
00185af8: 03000234 ori r2,r0,0x0003                   r2 = 3
00185afc: 29006210 beq r3,r2,0x00185ba4          Branch if Used Weapon is a Sword
00185b00: 04000234 ori r2,r0,0x0004                  r2 = 4
00185b04: 34006210 beq r3,r2,0x00185bd8         Branch if Used Weapon is a Knight Sword
00185b08: 05000234 ori r2,r0,0x0005                  r2 = 5
00185b0c: 32006210 beq r3,r2,0x00185bd8         Branch if Used Weapon is a Katana
00185b10: 06000234 ori r2,r0,0x0006                  r2 = 6
00185b14: 3B006210 beq r3,r2,0x00185c04         Branch if Used Weapon is a Axe
00185b18: 07000234 ori r2,r0,0x0007                  r2 = 7
00185b1c: 21006210 beq r3,r2,0x00185ba4         Branch if Used Weapon is a Rod
00185b20: 08000234 ori r2,r0,0x0008                  r2 = 8
00185b24: 1E006210 beq r3,r2,0x00185ba0         Branch if Used Weapon is a Staff
00185b28: 09000234 ori r2,r0,0x0009                  r2 = 9
00185b2c: 35006210 beq r3,r2,0x00185c04         Branch if Used Weapon is a Flail
00185b30: 0A000234 ori r2,r0,0x000a                  r2 = 10
00185b34: 15006210 beq r3,r2,0x00185b8c         Branch if Used Weapon is a Gun
00185b38: 0B000234 ori r2,r0,0x000b                  r2 = 11
00185b3c: 19006210 beq r3,r2,0x00185ba4         Branch if Used Weapon is a Crossbow
00185b40: 0C000234 ori r2,r0,0x000c                  r2 = 12
00185b44: 14006210 beq r3,r2,0x00185b98         Branch if Used Weapon is a Bow
00185b48: 0D000234 ori r2,r0,0x000d                  r2 = 13
00185b4c: 0D006210 beq r3,r2,0x00185b84         Branch if Used Weapon is a Instrument
00185b50: 0E000234 ori r2,r0,0x000e                  r2 = 14
00185b54: 0B006210 beq r3,r2,0x00185b84         Branch if Used Weapon is a Book
00185b58: 0F000234 ori r2,r0,0x000f                   r2 = 15
00185b5c: 11006210 beq r3,r2,0x00185ba4         Branch if Used Weapon is a Spear
00185b60: 10000234 ori r2,r0,0x0010                  r2 = 16
00185b64: 0E006210 beq r3,r2,0x00185ba0         Branch if Used Weapon is a Stick
00185b68: 11000234 ori r2,r0,0x0011                  r2 = 17
00185b6c: 25006210 beq r3,r2,0x00185c04         Branch if Used Weapon is a Bag
00185b70: 12000234 ori r2,r0,0x0012                  r2 = 18
00185b74: 03006210 beq r3,r2,0x00185b84         Branch if Used Weapon is a Veil
00185b78: 00000000 nop
00185b7c: 1F170608 j 0x00185c7c                     Jump to WP = YA
00185b80: 00000000 nop
00185b84: 1D170608 j 0x00185c74                     Jump to Halving
00185b88: 21100602 addu r2,r16,r6                    PA + MA if Veil, Book, or Instrument
00185b8c: 02392290 lbu r2,0x3902(r1)                Load WP
00185b90: 1F170608 j 0x00185c7c                     Jump to WP = YA
00185b94: CE3822A4 sh r2,0x38ce(r1)                XA = WP, if Gun
00185b98: 1D170608 j 0x00185c74                     Jump to Halving
00185b9c: 21100402 addu r2,r16,r4                    PA + SP if Knife, Ninjato, or Bow
00185ba0: 1F170608 j 0x00185c7c                      Jump to WP = YA
00185ba4: CE3826A4 sh r6,0x38ce(r1)                  XA = MA, if Staff, Stick
00185ba8: 1F170608 j 0x00185c7c                      Jump to WP = YA
00185bac: CE3830A4 sh r16,0x38ce(r1)                XA = PA, if Sword, Rod, Crossbow, Spear
00185bb0: 1800B000 mult r5,r16                         Brave * PA
00185bb4: 12180000 mflo r3                               r3 = Brave * PA
00185bb8: 8F02023C lui r2,0x028F
00185bbc: 285C4234 ori r2,r2,0x5C28
00185bc0: 19006200 multu r3,r2                         Brave * PA * 0.01
00185bc4: 10100000 mfhi r2                               r2 = Brave * PA * 0.01
00185bc8: 2D004014 bne r2,r0,0x00185c80         Branch if YA > 0
00185bcc: CE3830A4 sh r16,0x38ce(r1)               Store XA = PA            
00185bd0: 20170608 j 0x00185c80                      ELSE, Jump to end
00185bd4: 01000224 addiu r2,r0,0x0001              r2 = 1 (minimum of 1 YA)
00185bd8: 1800B000 mult r5,r16                         Brave * PA
00185bdc: 12180000 mflo r3                               r3 = Brave * PA
00185be0: 8F02023C lui r2,0x028F
00185be4: 285C4234 ori r2,r2,0x5C28
00185be8: 19006200 multu r3,r2                         Brave * PA * 0.01
00185bec: 10100000 mfhi r2                                r2 = Brave * PA * 0.01      
00185bf0: 02004014 bne r2,r0,0x00185bfc          Branch if YA > 0
00185bf4: 00000000 nop      
00185bf8: 01000224 addiu r2,r0,0x0001              ELSE, r2 = 1 (minimum of 1 YA)
00185bfc: 1F170608 j 0x00185c7c                      Jump to set WP
00185c00: CE3822A4 sh r2,0x38ce(r1)                 Store r2 as XA
00185c04: A83B060C jal 0x0018eea0                    Random Process
00185c08: 00000000 nop
00185c0c: 18000202 mult r16,r2                         PA * 0->7fff
00185c10: 12100000 mflo r2                               r2 = PA * Random
00185c14: 02004104 bgez r2,0x00185c2c            Branch if PA * Random >= 0
00185c18: 1980013C lui r1,0x8019
00185c1c: FF7F4224 addiu r2,r2,0x7fff                  Make result positive
00185c20: C3130200 sra r2,r2,0x0f                      PA * 0->7fff / 8000h (0->PA - 1)
00185c24: 01004224 addiu r2,r2,0x0001               r2 = (1->PA)
00185c28: 42181000 srl r3,r16,0x01                     r3 = [PA / 2]
00185c2c: 21104300 addu r2,r2,r3                       r2 = {1 + [PA / 2]->PA + [PA / 2]}
00185c30: 1F170608 j 0x00185c7c                      Jump to WP = YA
00185c34: CE3822A4 sh r2,0x38ce(r1)                 Store r2 as XA

0x185c38-0x185c73 can be used for new formulas.

00185c74: 43100200 sra r2,r2,0x01                    PA + ?? / 2 (MA or SP, depending on Weapon)
00185c78: CE3822A4 sh r2,0x38ce(r1)                Store XA = PA + ?? / 2
00185c7c: 02392290 lbu r2,0x3902(r1)                Load WP
00185c80: 1400BF8F lw r31,0x0014(r29)
00185c84: D03822A4 sh r2,0x38d0(r1)                YA = WP
00185c88: 1000B08F lw r16,0x0010(r29)
00185c8c: 0800E003 jr r31
00185c90: 1800BD27 addiu r29,r29,0x0018


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

June 16, 2011, 09:01:29 am #1 Last Edit: June 17, 2011, 12:27:01 pm by formerdeathcorps
All right, here's another variant of the above routine.  This one, unfortunately, has no free-space, but it consolidates both the routines from http://ffhacktics.com/smf/index.php?topic=6548.0 without any more writes to Kanji space.

Given below is just the code in ASM and hex, so it is easy to C/P or analyze this.


BATTLE.BIN
0x11EA9C
1980023C
D8384290
E8FFBD27
1400BFAF
1000B0AF
40180200
21186200
80180300
0680013C
21082300
BD2E2390
1980023C
942D428C
1980013C
36005090
37004690
24004590
38004490
32006010
01000234
2A006210
02000234
28006210
03000234
29006210
04000234
34006210
05000234
32006210
06000234
3B006210
07000234
21006210
08000234
1E006210
09000234
35006210
0A000234
15006210
0B000234
19006210
0C000234
14006210
0D000234
0D006210
0E000234
0B006210
0F000234
11006210
10000234
0E006210
11000234
25006210
12000234
03006210
00000000
1F170608
00000000
1D170608
21100602
02392290
1F170608
CE3822A4
1D170608
21100402
1F170608
CE3826A4
1F170608
CE3830A4
1800B000
12180000
8F02023C
285C4234
19006200
10100000
2D004014
CE3830A4
20170608
01000224
1800B000
12180000
8F02023C
285C4234
19006200
10100000
02004014
00000000
01000224
1F170608
CE3822A4
A83B060C
00000000
18000202
12100000
02004104
1980013C
FF7F4224
C3130200
01004224
42181000
21104300
1F170608
CE3822A4
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
43100200
CE3822A4
02392290
1400BF8F
D03822A4
1000B08F
0800E003
1800BD27



RAM Offset: 0x185A9C
lui r2,0x8019
lbu r2,0x38d8(r2)
addiu r29,r29,0xffe8
sw r31,0x0014(r29)
sw r16,0x0010(r29)
sll r3,r2,0x01
addu r3,r3,r2
sll r3,r3,0x02
lui r1,0x8006
addu r1,r1,r3
lbu r3,0x2ebd(r1)
lui r2,0x8019
lw r2,0x2d94(r2)
lui r1,0x8019
lbu r16,0x0036(r2)
lbu r6,0x0037(r2)
lbu r5,0x0024(r2)
lbu r4,0x0038(r2)
beq r3,r0,0x00185bb0
ori r2,r0,0x0001
beq r3,r2,0x00185b98
ori r2,r0,0x0002
beq r3,r2,0x00185b98
ori r2,r0,0x0003
beq r3,r2,0x00185ba4
ori r2,r0,0x0004
beq r3,r2,0x00185bd8
ori r2,r0,0x0005
beq r3,r2,0x00185bd8
ori r2,r0,0x0006
beq r3,r2,0x00185c04
ori r2,r0,0x0007
beq r3,r2,0x00185ba4
ori r2,r0,0x0008
beq r3,r2,0x00185ba0
ori r2,r0,0x0009
beq r3,r2,0x00185c04
ori r2,r0,0x000a
beq r3,r2,0x00185b8c
ori r2,r0,0x000b
beq r3,r2,0x00185ba4
ori r2,r0,0x000c
beq r3,r2,0x00185b98
ori r2,r0,0x000d
beq r3,r2,0x00185b84
ori r2,r0,0x000e
beq r3,r2,0x00185b84
ori r2,r0,0x000f
beq r3,r2,0x00185ba4
ori r2,r0,0x0010
beq r3,r2,0x00185ba0
ori r2,r0,0x0011
beq r3,r2,0x00185c04
ori r2,r0,0x0012
beq r3,r2,0x00185b84
nop
j 0x00185c7c
nop
j 0x00185c74
addu r2,r16,r6
lbu r2,0x3902(r1)
j 0x00185c7c
sh r2,0x38ce(r1)
j 0x00185c74
addu r2,r16,r4
j 0x00185c7c
sh r6,0x38ce(r1)
j 0x00185c7c
sh r16,0x38ce(r1)
mult r5,r16
mflo r3
lui r2,0x028f
ori r2,r2,0x5c28
multu r3,r2
mfhi r2
bne r2,r0,0x00185c80
sh r16,0x38ce(r1)
j 0x00185c80
addiu r2,r0,0x0001
mult r5,r16
mflo r3
lui r2,0x028f
ori r2,r2,0x5c28
multu r3,r2
mfhi r2
bne r2,r0,0x00185bfc
nop
addiu r2,r0,0x0001
j 0x00185c7c
sh r2,0x38ce(r1)
jal 0x0018eea0
nop
mult r16,r2
mflo r2
bgez r2,0x00185c20
lui r1,0x8019
addiu r2,r2,0x7fff
sra r2,r2,0x0f
addiu r2,r2,0x0001
srl r3,r16,0x01
addu r2,r2,r3
j 0x00185c7c
sh r2,0x38ce(r1)
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sra r2,r2,0x01
sh r2,0x38ce(r1)
lbu r2,0x3902(r1)
lw r31,0x0014(r29)
sh r2,0x38d0(r1)
lw r16,0x0010(r29)
jr r31
addiu r29,r29,0x0018



BATTLE.BIN
0x11EA9C
1980033C
D6386194
D8386290
0A002010
C4386394
00000000
07006010
FF006230
02004010
7A00412C
03002014
021A0300
AC160608
00000000
E8FFBD27
1400BFAF
1000B0AF
40180200
21186200
80180300
0680013C
21082300
BD2E2390
1980023C
942D428C
1980013C
36005090
37004690
24004590
38004490
32006010
01000234
2A006210
02000234
28006210
03000234
29006210
04000234
34006210
05000234
32006210
06000234
3B006210
07000234
21006210
08000234
1E006210
09000234
35006210
0A000234
15006210
0B000234
19006210
0C000234
14006210
0D000234
0D006210
0E000234
0B006210
0F000234
11006210
10000234
0E006210
11000234
25006210
12000234
03006210
00000000
1F170608
00000000
1D170608
21100602
02392290
1F170608
CE3822A4
1D170608
21100402
1F170608
CE3826A4
1F170608
CE3830A4
1800B000
12180000
8F02023C
285C4234
19006200
10100000
2D004014
CE3830A4
20170608
01000224
1800B000
12180000
8F02023C
285C4234
19006200
10100000
02004014
00000000
01000224
1F170608
CE3822A4
A83B060C
00000000
18000202
12100000
02004104
1980013C
FF7F4224
C3130200
01004224
42181000
21104300
1F170608
CE3822A4
00000000
00000000
00000000
43100200
CE3822A4
02392290
1400BF8F
D03822A4
1000B08F
0800E003
1800BD27



RAM Offset: 0x185A9C
lui r3,0x8019
lhu r1,0x38d6(r3)
lbu r2,0x38d8(r3)
beq r1,r0,0x00185ad4
lhu r3,0x38c4(r3)
nop
beq r3,r0,0x00185ad4
andi r2,r3,0x00ff
beq r2,r0,0x00185ac8
sltiu r1,r2,0x007a
bne r1,r0,0x00185ad4
srl r3,r3,0x08
j 0x00185ab0
nop
addiu r29,r29,0xffe8
sw r31,0x0014(r29)
sw r16,0x0010(r29)
sll r3,r2,0x01
addu r3,r3,r2
sll r3,r3,0x02
lui r1,0x8006
addu r1,r1,r3
lbu r3,0x2ebd(r1)
lui r2,0x8019
lw r2,0x2d94(r2)
lui r1,0x8019
lbu r16,0x0036(r2)
lbu r6,0x0037(r2)
lbu r5,0x0024(r2)
lbu r4,0x0038(r2)
beq r3,r0,0x00185be0
ori r2,r0,0x0001
beq r3,r2,0x00185bc8
ori r2,r0,0x0002
beq r3,r2,0x00185bc8
ori r2,r0,0x0003
beq r3,r2,0x00185bd4
ori r2,r0,0x0004
beq r3,r2,0x00185c08
ori r2,r0,0x0005
beq r3,r2,0x00185c08
ori r2,r0,0x0006
beq r3,r2,0x00185c34
ori r2,r0,0x0007
beq r3,r2,0x00185bd4
ori r2,r0,0x0008
beq r3,r2,0x00185bd0
ori r2,r0,0x0009
beq r3,r2,0x00185c34
ori r2,r0,0x000a
beq r3,r2,0x00185bbc
ori r2,r0,0x000b
beq r3,r2,0x00185bd4
ori r2,r0,0x000c
beq r3,r2,0x00185bc8
ori r2,r0,0x000d
beq r3,r2,0x00185bb4
ori r2,r0,0x000e
beq r3,r2,0x00185bb4
ori r2,r0,0x000f
beq r3,r2,0x00185bd4
ori r2,r0,0x0010
beq r3,r2,0x00185bd0
ori r2,r0,0x0011
beq r3,r2,0x00185c34
ori r2,r0,0x0012
beq r3,r2,0x00185bb4
nop
j 0x00185c7c
nop
j 0x00185c74
addu r2,r16,r6
lbu r2,0x3902(r1)
j 0x00185c7c
sh r2,0x38ce(r1)
j 0x00185c74
addu r2,r16,r4
j 0x00185c7c
sh r6,0x38ce(r1)
j 0x00185c7c
sh r16,0x38ce(r1)
mult r5,r16
mflo r3
lui r2,0x028f
ori r2,r2,0x5c28
multu r3,r2
mfhi r2
bne r2,r0,0x00185cb0
sh r16,0x38ce(r1)
j 0x00185c80
addiu r2,r0,0x0001
mult r5,r16
mflo r3
lui r2,0x028f
ori r2,r2,0x5c28
multu r3,r2
mfhi r2
bne r2,r0,0x00185c2c
nop
addiu r2,r0,0x0001
j 0x00185c7c
sh r2,0x38ce(r1)
jal 0x0018eea0
nop
mult r16,r2
mflo r2
bgez r2,0x00185c50
lui r1,0x8019
addiu r2,r2,0x7fff
sra r2,r2,0x0f
addiu r2,r2,0x0001
srl r3,r16,0x01
addu r2,r2,r3
j 0x00185c7c
sh r2,0x38ce(r1)
nop
nop
nop
sra r2,r2,0x01
sh r2,0x38ce(r1)
lbu r2,0x3902(r1)
lw r31,0x0014(r29)
sh r2,0x38d0(r1)
lw r16,0x0010(r29)
jr r31
addiu r29,r29,0x0018


Known bugs:
1) Displayed pre-attack damage on flails/axes/bags is still normal
2) Guns now take evasion if you use Formula 01
3) Revised routine cannot use Formula 01 for damage on non-attack skills correctly if setup is RH: Nothing/LH: Shield (this I'll try to fix)
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.

FFMaster

The revised version should be a grab for anyone planning to use formula 01 or 02 for abilities. It fixes the Gun bug, meaning no abuse for 999 damage anymore.
  • Modding version: Other/Unknown
☢ CAUTION CAUTION ☢ CAUTION CAUTION ☢

FFMaster

June 25, 2011, 08:19:30 am #3 Last Edit: June 25, 2011, 08:27:18 am by FFMaster
Running it in Arena, it seems to be causing some crashes. Happened twice so far, once for a Gobbledeguck, and once for a Mime. It has not happen to player controlled units yet. Not sure about vanilla though.
  • Modding version: Other/Unknown
☢ CAUTION CAUTION ☢ CAUTION CAUTION ☢

FFMaster

June 27, 2011, 02:46:48 am #4 Last Edit: June 28, 2011, 02:33:27 am by FFMaster
OK, FDC and I have managed to fix the crashing. Here is another revised code!

BATTLE.BIN - 0x11EA9C
1980033C
D6386194
D8386290
0A002010
C4386394
00000000
07006010
FF006230
02004010
7A00412C
03002014
021A0300
AC160608
00000000
E8FFBD27
1400BFAF
1000B0AF
40180200
21186200
80180300
0680013C
21082300
BD2E2390
1980023C
942D428C
1980013C
36005090
37004690
24004590
38004490
32006010
01000234
2A006210
02000234
28006210
03000234
29006210
04000234
34006210
05000234
32006210
06000234
3B006210
07000234
21006210
08000234
1E006210
09000234
35006210
0A000234
15006210
0B000234
19006210
0C000234
14006210
0D000234
0D006210
0E000234
0B006210
0F000234
11006210
10000234
0E006210
11000234
25006210
12000234
03006210
00000000
1F170608
00000000
1D170608
21100602
02392290
1F170608
CE3822A4
1D170608
21100402
1F170608
CE3826A4
1F170608
CE3830A4
1800B000
12180000
8F02023C
285C4234
19006200
10100000
21004014
CE3830A4
20170608
01000224
1800B000
12180000
8F02023C
285C4234
19006200
10100000
02004014
00000000
01000224
1F170608
CE3822A4
A83B060C
00000000
18000202
12100000
02004104
1980013C
FF7F4224
C3130200
01004224
42181000
21104300
1F170608
CE3822A4
00000000
00000000
00000000
43100200
CE3822A4
02392290
1400BF8F
D03822A4
1000B08F
0800E003
1800BD27
  • Modding version: Other/Unknown
☢ CAUTION CAUTION ☢ CAUTION CAUTION ☢

LastingDawn

Now This needs a spreadsheet! But would it really be easy to make a spreadsheet of this? Hmm... all in all it seems a bit... complex for ordinary people to easily use, any thoughts to making this into a spreadsheet Raven by chance?

All in all great work there fellows!
"Moment's anger can revert to joy,
sadness can be turned to delight.
A nation destroyed cannot be restored,
the dead brought back to life."

Art of War

Beta & Gretchen Forever!!!!

formerdeathcorps

June 27, 2011, 10:50:21 pm #6 Last Edit: June 28, 2011, 10:26:20 pm by formerdeathcorps
Quote from: LastingDawn on June 27, 2011, 10:46:34 am
Now This needs a spreadsheet! But would it really be easy to make a spreadsheet of this? Hmm... all in all it seems a bit... complex for ordinary people to easily use, any thoughts to making this into a spreadsheet Raven by chance?


It's complex because I don't have a data table.  What you want to edit are where the beq commands are branching to.


1980033C
D6386194
D8386290
0A002010
C4386394
00000000
07006010
FF006230
02004010
7A00412C
03002014
021A0300
AC160608
00000000
E8FFBD27
1400BFAF
1000B0AF
40180200
21186200
80180300
0680013C
21082300
BD2E2390
1980023C
942D428C
1980013C
36005090
37004690
24004590
38004490
32006010
01000234
2A006210
02000234
28006210
03000234
29006210
04000234
34006210
05000234
32006210
06000234
3B006210
07000234
21006210
08000234
1E006210
09000234
35006210
0A000234
15006210
0B000234
19006210
0C000234
14006210
0D000234
0D006210
0E000234
0B006210
0F000234
11006210
10000234
0E006210
11000234
25006210
12000234
03006210
00000000
1F170608
00000000
1D170608
21100602
02392290
1F170608
CE3822A4
1D170608
21100402
1F170608
CE3826A4
1F170608
CE3830A4
1800B000
12180000
8F02023C
285C4234
19006200
10100000
21004014
CE3830A4
20170608
01000224
1800B000
12180000
8F02023C
285C4234
19006200
10100000
02004014
00000000
01000224
1F170608
CE3822A4
A83B060C
00000000
18000202
12100000
02004104
1980013C
FF7F4224
C3130200
01004224
42181000
21104300
1F170608
CE3822A4
00000000
00000000
00000000
43100200
CE3822A4
02392290
1400BF8F
D03822A4
1000B08F
0800E003
1800BD27
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.

FFMaster

June 28, 2011, 07:46:38 pm #7 Last Edit: June 29, 2011, 02:45:40 am by FFMaster
Hack is still crashing for fists on ePSXe. Doesn't happen on the exact same ISO for psxfin. Not sure about pSX.

And it only happens for fist attacks.

EDIT: Seems like it only happens in my Arena ISO. I'll work out what is wrong later. The hack works fine in a vanilla ISO.
  • Modding version: Other/Unknown
☢ CAUTION CAUTION ☢ CAUTION CAUTION ☢

formerdeathcorps

June 29, 2011, 09:02:25 am #8 Last Edit: August 13, 2011, 01:38:58 am by formerdeathcorps
FFM noticed that Martial Arts boosts all attacks other than weapon attacks using 01.  Here's a fix.

NOTE: This overrides every single existing hack that addresses 2 Hands, Martial Arts, or ATTACK UP.  This also overrides the ability for martial arts to boost STEAL, PUNCH ART, or Throw Stone if you are equipping a weapon.


BATTLE.BIN
0x11F054
1980013C
FF382290
D9382390
01004430
0A008014
04004430
08008010
CE382284
06006010
00000000
00000000
00000000
00000000
21104200
CE3822A4
942D238C
CE382284
90006390
00000000
10006330
06006010
5555043C
56558424
19008200
10200000
21104400
CE3822A4
D6382394
D8382290
0A006010
C4382494
00000000
08008010
FF008230
02004010
7A00432C
17006014
02220400
35180608
00000000
13004014
942D238C
CE382284
91006390
00000000
20006330
0D006010
0080043C
00000000
19008200
10200000
21104400
CE3822A4
00000000
00000000
00000000
00000000
00000000
00000000
00000000
0800E003
00000000



RAM Offset: 0x186054
lui r1,0x8019
lbu r2,0x38ff(r1)   
lbu r3,0x38d9(r1)
andi r4,r2,0x0001
bne r4,r0,0x00186090
andi r4,r2,0x0004
beq r4,r0,0x00186090
lh r2,0x38ce(r1)
beq r3,r0,0x00186090
nop
nop
nop
nop
addu r2,r2,r2
sh r2,0x38ce(r1)
lw r3,0x2d94(r1)
lh r2,0x38ce(r1)
lbu r3,0x0090(r3)
nop
andi r3,r3,0x0010
beq r3,r0,0x001860c0
lui r4,0x5555
addiu r4,r4,0x5556
multu r4,r2
mfhi r4
addu r2,r2,r4
sh r2,0x38ce(r1)
lhu r3,0x38d6(r1)
lbu r2,0x38d8(r1)
beq r3,r0,0x001860f4
lhu r4,0x38c4(r1)
nop
beq r4,r0,0x001860f8
andi r2,r4,0x00ff
beq r2,r0,0x001860e8
sltiu r3,r2,0x007a
bne r3,r0,0x00186144
srl r4,r4,0x08
j 0x001860d4
nop
bne r2,r0,0x00186144   
lw r3,0x2d94(r1)
lh r2,0x38ce(r1)
lbu r3,0x0091(r3)
nop
andi r3,r3,0x0020
beq r3,r0,0x00186144
lui r4,0x8000
nop
multu r4,r2
mfhi r4
addu r2,r2,r4
sh r2,0x38ce(r1)
nop
nop
nop
nop
nop
nop
nop
jr r31
nop


I deliberately coded the above hack with free-space so for those of you who want to write routines that allow for 2 Hands/Martial Arts/ATKUP having different multipliers, there's plenty of space for you to do so.  There's also enough space at the end to write a check for a new physical support ability.
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.

RavenOfRazgriz

Quote from: formerdeathcorps on June 29, 2011, 09:02:25 amThis also overrides the ability for martial arts to boost STEAL, PUNCH ART, or Throw Stone if you are equipping a weapon.


This bit kinda sucks, you lose a noteable bit of character customization with it.  (Mostly, the choice to go random dipshit with Ice Brand / Ice Shield / etc... Primary Skillset / Punch Art or Steal / etc... for the higher Punch Art boost over Attack UP or the choice to for whatever reason use an Equip X Monk, etc.)  Is there no particular way to fix it without over 9000 headaches?

This looks like it's near the point I can finally begin putting it to spreadsheet though.


Pride

June 29, 2011, 07:13:27 pm #10 Last Edit: June 29, 2011, 07:23:32 pm by Pride
FDC.... Punch Art, Steal, Throw Stone, and a few other formulas aren't checked in that section for Martial Arts. They are checked in the second section for Martial Arts at ram 0018614c.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?