• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

ASM Collective BATTLE.BIN Map

Started by formerdeathcorps, January 06, 2011, 05:09:33 am

formerdeathcorps

This thread is intended to essentially function as a collaborative thread for completely decompiling essential files into the requisite subroutines.  Eventually, we'll put this all on the Wiki.

We need to organize a group ASM decompilation of all of BATTLE.BIN.  There's enough people here who know how to do this and we all know Square's coding is horridly inefficient.  Doing this should open up more space for hacks, and will allow us to finally get a grip on how the AI works.
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.

secondadvent

http://www.filefront.com/17756931/New-Folder.rar/

I should have had a bit more done with this, but i jump around WAY too much :P. Maybe once we get a group together to work on stuff, i will be more motivated to stick with it.

I will continue to work towards cleaning up my data locations file a bit, and updating the pointers to the many sections of the formula data, which i started on but didn't finish :/.

formerdeathcorps

January 06, 2011, 08:45:00 am #2 Last Edit: January 13, 2011, 11:10:27 am by formerdeathcorps
Here are my corrections to SA's work.  Anything slashed out means redundant routines by Square.  Underlined is anything stupid that not only takes up space, but removes features from certain formulas.  Bold means bugs unintended by the game.  Since the spoiler is massive and I had to edit my own notes, I'll post the first 0x1F formulas first.


To get Battle.bin offset, subtract 0x67000

Main formula data:

[01]
00188b64: 27bdffe8 addiu r29,r29,0xffe8
00188b68: afbf0010 sw r31,0x0010(r29)
00188b6c: 0c062144 jal 0x00188510      Physical Evade Calculation
00188b70: 00000000 nop
00188b74: 14400007 bne r2,r0,0x00188b94      Branch if attack is evaded
00188b78: 00000000 nop
00188b7c: 0c06218e jal 0x00188638      Physical Damage Calculation (Weapons)
00188b80: 00000000 nop
00188b84: 14400003 bne r2,r0,0x00188b94      Branch if no damage is dealt
00188b88: 00000000 nop
00188b8c: 0c061fad jal 0x00187eb4      Status Calculation
00188b90: 00000000 nop
00188b94: 8fbf0010 lw r31,0x0010(r29)
00188b98: 27bd0018 addiu r29,r29,0x0018
00188b9c: 03e00008 jr r31
00188ba0: 00000000 nop

[02]
00188ba4: 27bdffe8 addiu r29,r29,0xffe8
00188ba8: afbf0010 sw r31,0x0010(r29)
00188bac: 0c062144 jal 0x00188510      Physical Evade Calculation
00188bb0: 00000000 nop
00188bb4: 14400007 bne r2,r0,0x00188bd4      Branch if attack is evaded
00188bb8: 00000000 nop
00188bbc: 0c06218e jal 0x00188638      Physical Damage Calculation (Weapons)
00188bc0: 00000000 nop
00188bc4: 14400003 bne r2,r0,0x00188bd4      Branch if no damage is dealt
00188bc8: 00000000 nop
00188bcc: 0c061db9 jal 0x001876e4      Spell Proc
00188bd0: 00000000 nop
00188bd4: 8fbf0010 lw r31,0x0010(r29)
00188bd8: 27bd0018 addiu r29,r29,0x0018
00188bdc: 03e00008 jr r31
00188be0: 00000000 nop

[03]
00188be4: 3c028019 lui r2,0x8019
00188be8: 90423902 lbu r2,0x3902(r2)      Load WP
00188bec: 27bdffe8 addiu r29,r29,0xffe8
00188bf0: afbf0010 sw r31,0x0010(r29)
00188bf4: 3c018019 lui r1,0x8019
00188bf8: a42238ce sh r2,0x38ce(r1)      XA = WP
00188bfc: 3c018019 lui r1,0x8019
00188c00: a42238d0 sh r2,0x38d0(r1)      YA = WP
00188c04: 0c0617e0 jal 0x00185f80      Charge Calculation
00188c08: 00000000 nop
00188c0c: 0c0621a9 jal 0x001886a4      Physical Damage Calculation
00188c10: 00000000 nop
00188c14: 8fbf0010 lw r31,0x0010(r29)
00188c18: 27bd0018 addiu r29,r29,0x0018
00188c1c: 03e00008 jr r31
00188c20: 00000000 nop

[04]
00188c24: 27bdffe8 addiu r29,r29,0xffe8
00188c28: afbf0010 sw r31,0x0010(r29)
00188c2c: 0c061dcc jal 0x00187730      Magic Gun Ability Decision
00188c30: 00000000 nop
00188c34: 3c028019 lui r2,0x8019
00188c38: 90423902 lbu r2,0x3902(r2)      Load WP
00188c3c: 3c038019 lui r3,0x8019
00188c40: 906338fa lbu r3,0x38fa(r3)      Load Ability Power
00188c44: 3c018019 lui r1,0x8019
00188c48: a42238ce sh r2,0x38ce(r1)      XA = WP
00188c4c: 3c018019 lui r1,0x8019
00188c50: a42338d0 sh r3,0x38d0(r1)      YA = Ability Power
00188c54: 0c0617e0 jal 0x00185f80      Charge Calculation
00188c58: 00000000 nop
00188c5c: 0c0617e9 jal 0x00185fa4      Element Strengthen Calculation
00188c60: 00000000 nop
00188c64: 0c0621d1 jal 0x00188744      Magic XA Modifications
00188c68: 00000000 nop
00188c6c: 0c0621df jal 0x0018877c      Magic Damage Calculation
00188c70: 00000000 nop
00188c74: 14400005 bne r2,r0,0x00188c8c      Branch if element was nullified
00188c78: 00000000 nop
00188c7c: 0c061c54 jal 0x00187150      Faith Calculation
00188c80: 00000000 nop
00188c84: 0c061c3f jal 0x001870fc      Elemental Absorption
00188c88: 00000000 nop
00188c8c: 8fbf0010 lw r31,0x0010(r29)
00188c90: 27bd0018 addiu r29,r29,0x0018
00188c94: 03e00008 jr r31
00188c98: 00000000 nop

[05]
00188c9c: 27bdffe8 addiu r29,r29,0xffe8
00188ca0: afbf0010 sw r31,0x0010(r29)
00188ca4: 0c06215a jal 0x00188568      Physical Evade Calculation
00188ca8: 00000000 nop
00188cac: 1440000d bne r2,r0,0x00188ce4      Branch if attack was evaded
00188cb0: 00000000 nop
00188cb4: 0c0616a7 jal 0x00185a9c      Weapon XA Calculation
00188cb8: 00000000 nop
00188cbc: 0c0617e0 jal 0x00185f80      Charge Calculation
00188cc0: 00000000 nop
00188cc4: 0c0621a9 jal 0x001886a4      Physical Damage Calculation
00188cc8: 00000000 nop
00188ccc: 0c062130 jal 0x001884c0      ?
00188cd0: 00000000 nop
00188cd4: 14400003 bne r2,r0,0x00188ce4
00188cd8: 00000000 nop
00188cdc: 0c061fad jal 0x00187eb4      Status Calculation
00188ce0: 00000000 nop
00188ce4: 8fbf0010 lw r31,0x0010(r29)
00188ce8: 27bd0018 addiu r29,r29,0x0018
00188cec: 03e00008 jr r31
00188cf0: 00000000 nop


[06]
00188cf4: 27bdffe8 addiu r29,r29,0xffe8
00188cf8: afbf0010 sw r31,0x0010(r29)
00188cfc: 0c062144 jal 0x00188510      Physical Evade Calculation
00188d00: 00000000 nop
00188d04: 14400009 bne r2,r0,0x00188d2c      Branch if attack was evaded
00188d08: 00000000 nop
00188d0c: 0c0616a7 jal 0x00185a9c      Weapon XA Calculation
00188d10: 00000000 nop
00188d14: 0c0617e0 jal 0x00185f80      Charge Calculation
00188d18: 00000000 nop
00188d1c: 0c0621a9 jal 0x001886a4      Physical Damage Calculation Essentially, this is the same coding as the subroutine in 0x188638 but missing the weapon elemental routine.
00188d20: 00000000 nop
00188d24: 0c061c92 jal 0x00187248      HP Absorb Calculation
00188d28: 00000000 nop
00188d2c: 8fbf0010 lw r31,0x0010(r29)
00188d30: 27bd0018 addiu r29,r29,0x0018
00188d34: 03e00008 jr r31
00188d38: 00000000 nop

[07]
00188d3c: 27bdffe8 addiu r29,r29,0xffe8
00188d40: afbf0010 sw r31,0x0010(r29)
00188d44: 0c0616a7 jal 0x00185a9c      Weapon XA Calculation
00188d48: 00000000 nop
00188d4c: 0c061259 jal 0x00184964      Zodiac Calculation Already covered under weapon XA.
00188d50: 00000000 nop
00188d54: 0c0617e0 jal 0x00185f80      Charge Calculation
00188d58: 00000000 nop
00188d5c: 0c06217e jal 0x001885f8      Zodiac Calculation Already covered under weapon XA.
00188d60: 00000000 nop
00188d64: 0c06195a jal 0x00186568      Healing (Weapon) Potency Calculation Essentially, this is the same coding as the subroutine in 0x188638 but missing the weapon elemental routine.
00188d68: 00000000 nop
00188d6c: 0c061cd4 jal 0x00187350      Healing Calculation
00188d70: 00000000 nop
00188d74: 8fbf0010 lw r31,0x0010(r29)
00188d78: 27bd0018 addiu r29,r29,0x0018
00188d7c: 03e00008 jr r31
00188d80: 00000000 nop

[08]
00188d84: 27bdffe8 addiu r29,r29,0xffe8
00188d88: afbf0010 sw r31,0x0010(r29)
00188d8c: 0c06216e jal 0x001885b8      Magic Evade
00188d90: 00000000 nop
00188d94: 14400013 bne r2,r0,0x00188de4
00188d98: 00000000 nop
00188d9c: 0c061725 jal 0x00185c94      Get Ability Power
00188da0: 00000000 nop
00188da4: 0c0617ff jal 0x00185ffc      Get Elemental Boost
00188da8: 00000000 nop
00188dac: 0c0621d1 jal 0x00188744      Magic XA Modifications
00188db0: 00000000 nop
00188db4: 0c0621df jal 0x0018877c      Magic Damage Calculation
00188db8: 00000000 nop
00188dbc: 14400009 bne r2,r0,0x00188de4
00188dc0: 00000000 nop
00188dc4: 0c061c54 jal 0x00187150      Faith Calculation
00188dc8: 00000000 nop
00188dcc: 0c0621c7 jal 0x0018871c      Elemental Absorption
00188dd0: 00000000 nop
00188dd4: 14400003 bne r2,r0,0x00188de4
00188dd8: 00000000 nop
00188ddc: 0c061fad jal 0x00187eb4      Status
00188de0: 00000000 nop
00188de4: 8fbf0010 lw r31,0x0010(r29)
00188de8: 27bd0018 addiu r29,r29,0x0018
00188dec: 03e00008 jr r31
00188df0: 00000000 nop

[09]
00188df4: 27bdffe8 addiu r29,r29,0xffe8
00188df8: afbf0010 sw r31,0x0010(r29)
00188dfc: 0c06216e jal 0x001885b8      Magic Evade
00188e00: 00000000 nop
00188e04: 14400018 bne r2,r0,0x00188e68
00188e08: 00000000 nop
00188e0c: 0c062289 jal 0x00188a24               Calculate (MA + X)*Faith%?
00188e10: 00000000 nop
00188e14: 14400014 bne r2,r0,0x00188e68
00188e18: 00000000 nop
00188e1c: 0c061989 jal 0x00186624       Calculate damage as % of HP      
00188e20: 00000000 nop
00188e24: 0c061bb4 jal 0x00186ed0       Elemental Weak
00188e28: 00000000 nop
00188e2c: 0c061bfe jal 0x00186ff8      Elemental Cancel
00188e30: 00000000 nop
00188e34: 3c028019 lui r2,0x8019
00188e38: 8c422d90 lw r2,0x2d90(r2)
00188e3c: 00000000 nop
00188e40: 90420000 lbu r2,0x0000(r2)
00188e44: 00000000 nop
00188e48: 10400007 beq r2,r0,0x00188e68
00188e4c: 00000000 nop
00188e50: 0c0621c7 jal 0x0018871c      Elemental Absorb
00188e54: 00000000 nop
00188e58: 14400003 bne r2,r0,0x00188e68
00188e5c: 00000000 nop
00188e60: 0c061fad jal 0x00187eb4      Status
00188e64: 00000000 nop
00188e68: 8fbf0010 lw r31,0x0010(r29)
00188e6c: 27bd0018 addiu r29,r29,0x0018
00188e70: 03e00008 jr r31
00188e74: 00000000 nop

[0a]
00188e78: 27bdffe8 addiu r29,r29,0xffe8
00188e7c: afbf0010 sw r31,0x0010(r29)
00188e80: 0c06216e jal 0x001885b8    Magic Evade
00188e84: 00000000 nop
00188e88: 14400007 bne r2,r0,0x00188ea8
00188e8c: 00000000 nop
00188e90: 0c062289 jal 0x00188a24    Calculates (MA+X)*Faith%?
00188e94: 00000000 nop
00188e98: 14400003 bne r2,r0,0x00188ea8
00188e9c: 00000000 nop
00188ea0: 0c061fc9 jal 0x00187f24     Add Status at (MA+X)*Faith%
00188ea4: 00000000 nop
00188ea8: 8fbf0010 lw r31,0x0010(r29)
00188eac: 27bd0018 addiu r29,r29,0x0018
00188eb0: 03e00008 jr r31
00188eb4: 00000000 nop

[0b]
00188eb8: 27bdffe8 addiu r29,r29,0xffe8
00188ebc: afbf0010 sw r31,0x0010(r29)
00188ec0: 0c061760 jal 0x00185d80   Get X and MA
00188ec4: 00000000 nop
00188ec8: 0c0617ff jal 0x00185ffc      Elemental Boost
00188ecc: 00000000 nop
00188ed0: 0c062200 jal 0x00188800   Calculate (MA + X)*Faith%
This is essentially the same routine as 0x188a24 except without MADEF and Shell.
00188ed4: 00000000 nop
00188ed8: 14400003 bne r2,r0,0x00188ee8
00188edc: 00000000 nop
00188ee0: 0c061fc9 jal 0x00187f24     Add Status at (MA+X)*Faith%
00188ee4: 00000000 nop
00188ee8: 8fbf0010 lw r31,0x0010(r29)
00188eec: 27bd0018 addiu r29,r29,0x0018
00188ef0: 03e00008 jr r31
00188ef4: 00000000 nop

[0c]
00188ef8: 27bdffe8 addiu r29,r29,0xffe8
00188efc: afbf0010 sw r31,0x0010(r29)
00188f00: 0c061725 jal 0x00185c94               Get Ability Power
00188f04: 00000000 nop
00188f08: 0c0617ff jal 0x00185ffc                  Get Elemental Boost
00188f0c: 00000000 nop
00188f10: 0c062216 jal 0x00188858                Healing Calculation This is essentially the same routine as 0x188744 and 0x18877C except without MADEF/Shell/Elemental, even though elemental boost is allowed.
00188f14: 00000000 nop
00188f18: 0c061c54 jal 0x00187150      Faith Calculation
00188f1c: 00000000 nop
00188f20: 0c061cd4 jal 0x00187350      Undead Reversal
00188f24: 00000000 nop
00188f28: 8fbf0010 lw r31,0x0010(r29)
00188f2c: 27bd0018 addiu r29,r29,0x0018
00188f30: 03e00008 jr r31
00188f34: 00000000 nop

[0d]
00188f38: 27bdffe8 addiu r29,r29,0xffe8
00188f3c: afbf0010 sw r31,0x0010(r29)
00188f40: 0c061760 jal 0x00185d80        Get X and MA
00188f44: 00000000 nop
00188f48: 0c0617ff jal 0x00185ffc          Elemental Boost
00188f4c: 00000000 nop
00188f50: 0c062200 jal 0x00188800       Calculate (MA + X)*Faith%
This is essentially the same routine as 0x188a24 except without MADEF and Shell.
00188f54: 00000000 nop
00188f58: 14400009 bne r2,r0,0x00188f80
00188f5c: 00000000 nop
00188f60: 0c062b37 jal 0x0018acdc       Add Status at (MA+X)*Faith%; must add or spell fails.
00188f64: 00000000 nop
00188f68: 10400005 beq r2,r0,0x00188f80
00188f6c: 00000000 nop
00188f70: 0c061989 jal 0x00186624             Calculate damage as % of HP
00188f74: 00000000 nop
00188f78: 0c061cd4 jal 0x00187350             Undead Reversal (Heal = Damage)
00188f7c: 00000000 nop
00188f80: 8fbf0010 lw r31,0x0010(r29)
00188f84: 27bd0018 addiu r29,r29,0x0018
00188f88: 03e00008 jr r31
00188f8c: 00000000 nop

[0e]
00188f90: 3c028019 lui r2,0x8019
00188f94: 8c422d98 lw r2,0x2d98(r2)
00188f98: 27bdffe8 addiu r29,r29,0xffe8
00188f9c: afbf0010 sw r31,0x0010(r29)
00188fa0: 90420058 lbu r2,0x0058(r2)
00188fa4: 00000000 nop
00188fa8: 30420010 andi r2,r2,0x0010
00188fac: 10400005 beq r2,r0,0x00188fc4       Undead Check
00188fb0: 34020001 ori r2,r0,0x0001
00188fb4: 3c018019 lui r1,0x8019
00188fb8: a02238e6 sb r2,0x38e6(r1)             Undead Reverse Flag; target is undead.
00188fbc: 080623f7 j 0x00188fdc
00188fc0: 00000000 nop
00188fc4: 3c018019 lui r1,0x8019
00188fc8: a02038e6 sb r0,0x38e6(r1)             Undead Reverse Flag; target is not undead
00188fcc: 0c06216e jal 0x001885b8               Magic Evade
00188fd0: 00000000 nop
00188fd4: 14400027 bne r2,r0,0x00189074
00188fd8: 00000000 nop
00188fdc: 0c061760 jal 0x00185d80               Get X and MA
00188fe0: 00000000 nop
00188fe4: 0c0617ff jal 0x00185ffc                  Elemental Boost
00188fe8: 00000000 nop
00188fec: 0c061881 jal 0x00186204                MATUP Bonus
00188ff0: 00000000 nop
00188ff4: 3c028019 lui r2,0x8019
00188ff8: 904238e6 lbu r2,0x38e6(r2)
00188ffc: 00000000 nop
00189000: 14400005 bne r2,r0,0x00189018       Branch only if not against undead
00189004: 00000000 nop
00189008: 0c0618c7 jal 0x0018631c                ?
0018900c: 00000000 nop
00189010: 0c061918 jal 0x00186460                ?
00189014: 00000000 nop
00189018: 0c061259 jal 0x00184964                Zodiac Calculation
0018901c: 00000000 nop
00189020: 0c061967 jal 0x0018659c               Sets MA + X as X
00189024: 00000000 nop
00189028: 0c061c54 jal 0x00187150      Faith Calculation
0018902c: 00000000 nop
00189030: 0c061d44 jal 0x00187510               Total Accuracy Check?
00189034: 00000000 nop
00189038: 3c028019 lui r2,0x8019
0018903c: 8c422d90 lw r2,0x2d90(r2)
00189040: 00000000 nop
00189044: 90420000 lbu r2,0x0000(r2)
00189048: 00000000 nop
0018904c: 10400009 beq r2,r0,0x00189074
00189050: 00000000 nop
00189054: 0c062b37 jal 0x0018acdc        Add Status at (MA+X)*Faith%; must add or spell fails.
00189058: 00000000 nop
0018905c: 10400005 beq r2,r0,0x00189074
00189060: 00000000 nop
00189064: 0c061989 jal 0x00186624           Calculate Damage as % of HP
00189068: 00000000 nop
0018906c: 0c061cf6 jal 0x001873d8           Undead Reversal (Damage = Healing)
00189070: 00000000 nop
00189074: 8fbf0010 lw r31,0x0010(r29)
00189078: 27bd0018 addiu r29,r29,0x0018
0018907c: 03e00008 jr r31
00189080: 00000000 nop

[0f]
00189084: 27bdffe8 addiu r29,r29,0xffe8
00189088: afbf0010 sw r31,0x0010(r29)
0018908c: 0c06216e jal 0x001885b8            Magic Evade
00189090: 00000000 nop
00189094: 1440000d bne r2,r0,0x001890cc
00189098: 00000000 nop
0018909c: 0c062273 jal 0x001889cc           Calculate (MA + X)*Faith% This is essentially the same routine as 0x188a24 except without elemental boosting.
001890a0: 00000000 nop
001890a4: 14400009 bne r2,r0,0x001890cc
001890a8: 00000000 nop
001890ac: 0c0619a3 jal 0x0018668c           MP Damage
001890b0: 00000000 nop
001890b4: 3c038019 lui r3,0x8019
001890b8: 8c632d90 lw r3,0x2d90(r3)
001890bc: 00000000 nop
001890c0: 94620008 lhu r2,0x0008(r3)
001890c4: 0c061d1b jal 0x0018746c           MP Healing
001890c8: a4620004 sh r2,0x0004(r3)
001890cc: 8fbf0010 lw r31,0x0010(r29)
001890d0: 27bd0018 addiu r29,r29,0x0018
001890d4: 03e00008 jr r31
001890d8: 00000000 nop

[10]
001890dc: 27bdffe8 addiu r29,r29,0xffe8
001890e0: afbf0010 sw r31,0x0010(r29)
001890e4: 0c06216e jal 0x001885b8            Magic Evade
001890e8: 00000000 nop
001890ec: 14400009 bne r2,r0,0x00189114
001890f0: 00000000 nop
001890f4: 0c062273 jal 0x001889cc            Calculate (MA + X)*Faith% This is essentially the same routine as 0x188a24 except without elemental boosting.
001890f8: 00000000 nop
001890fc: 14400005 bne r2,r0,0x00189114
00189100: 00000000 nop
00189104: 0c061989 jal 0x00186624     Calculate damage as % of HP  
00189108: 00000000 nop
0018910c: 0c061c92 jal 0x00187248     Absorption Calculation
00189110: 00000000 nop
00189114: 8fbf0010 lw r31,0x0010(r29)
00189118: 27bd0018 addiu r29,r29,0x0018
0018911c: 03e00008 jr r31
00189120: 00000000 nop

[11]
00189124: 03e00008 jr r31
00189128: 00000000 nop
 Does not work.

[12]
0018912c: 27bdffe8 addiu r29,r29,0xffe8
00189130: afbf0010 sw r31,0x0010(r29)
00189134: 0c061760 jal 0x00185d80   Get X and MA
00189138: 00000000 nop
0018913c: 0c062200 jal 0x00188800   Calculate (MA + X)*Faith%
This is essentially the same as 0x188a24 except without elemental boosting, shell, or MADEF.
00189140: 00000000 nop
00189144: 14400003 bne r2,r0,0x00189154
00189148: 00000000 nop
0018914c: 0c061e0f jal 0x0018783c   Quick Effect
00189150: 00000000 nop
00189154: 8fbf0010 lw r31,0x0010(r29)
00189158: 27bd0018 addiu r29,r29,0x0018
0018915c: 03e00008 jr r31
00189160: 00000000 nop

[13]
00189164: 03e00008 jr r31
00189168: 00000000 nop
 Doesn't work.

[14]
0018916c: 27bdffe8 addiu r29,r29,0xffe8
00189170: afbf0010 sw r31,0x0010(r29)
00189174: 0c062222 jal 0x00188888     Calculate Accuracy as User Faith * (MA + X)%
00189178: 00000000 nop
0018917c: 14400007 bne r2,r0,0x0018919c
00189180: 34030001 ori r3,r0,0x0001
00189184: 3c028019 lui r2,0x8019
00189188: 8c422d90 lw r2,0x2d90(r2)
0018918c: 00000000 nop
00189190: a4430010 sh r3,0x0010(r2)   Set status as golem
00189194: 34030001 ori r3,r0,0x0001
00189198: a0430025 sb r3,0x0025(r2)    Set damage type to Pseudo-Status
0018919c: 8fbf0010 lw r31,0x0010(r29)
001891a0: 27bd0018 addiu r29,r29,0x0018
001891a4: 03e00008 jr r31
001891a8: 00000000 nop

[15]
001891ac: 27bdffe8 addiu r29,r29,0xffe8
001891b0: afbf0010 sw r31,0x0010(r29)
001891b4: 0c06216e jal 0x001885b8      Magic Evade
001891b8: 00000000 nop
001891bc: 1440000d bne r2,r0,0x001891f4
001891c0: 00000000 nop
001891c4: 0c062273 jal 0x001889cc      Calculate (MA + X)*Faith% This is essentially the same routine as 0x188a24 except without elemental boosting.
001891c8: 00000000 nop
001891cc: 14400009 bne r2,r0,0x001891f4
001891d0: 3402007f ori r2,r0,0x007f
001891d4: 3c038019 lui r3,0x8019
001891d8: 8c632d90 lw r3,0x2d90(r3)
001891dc: 00000000 nop
001891e0: a0620013 sb r2,0x0013(r3)  Set target CT to -127.
001891e4: 3c038019 lui r3,0x8019
001891e8: 8c632d90 lw r3,0x2d90(r3)
001891ec: 34020001 ori r2,r0,0x0001
001891f0: a0620025 sb r2,0x0025(r3)  Set damage type to Pseudo-Status
001891f4: 8fbf0010 lw r31,0x0010(r29)
001891f8: 27bd0018 addiu r29,r29,0x0018
001891fc: 03e00008 jr r31
00189200: 00000000 nop

[16]
00189204: 27bdffe8 addiu r29,r29,0xffe8
00189208: afbf0010 sw r31,0x0010(r29)
0018920c: 0c06216e jal 0x001885b8  Magic Evade
00189210: 00000000 nop
00189214: 1440000d bne r2,r0,0x0018924c
00189218: 00000000 nop
0018921c: 0c062273 jal 0x001889cc  Calculate (MA + X)*Faith% This is essentially the same routine as 0x188a24 except without elemental boosting.
00189220: 00000000 nop
00189224: 14400009 bne r2,r0,0x0018924c
00189228: 00000000 nop
0018922c: 3c028019 lui r2,0x8019
00189230: 8c422d98 lw r2,0x2d98(r2)
00189234: 3c038019 lui r3,0x8019
00189238: 8c632d90 lw r3,0x2d90(r3)
0018923c: 9444002c lhu r4,0x002c(r2)  Load CurMP
00189240: 34020020 ori r2,r0,0x0020
00189244: a0620025 sb r2,0x0025(r3)  Set damage type as MP Damage
00189248: a4640008 sh r4,0x0008(r3)  Load as MP damage
0018924c: 8fbf0010 lw r31,0x0010(r29)
00189250: 27bd0018 addiu r29,r29,0x0018
00189254: 03e00008 jr r31
00189258: 00000000 nop

[17]
0018925c: 27bdffe8 addiu r29,r29,0xffe8
00189260: afbf0010 sw r31,0x0010(r29)
00189264: 0c06216e jal 0x001885b8   Magic Evade
00189268: 00000000 nop
0018926c: 14400007 bne r2,r0,0x0018928c
00189270: 00000000 nop
00189274: 0c062273 jal 0x001889cc    Calculate (MA + X)*Faith% This is essentially the same routine as 0x188a24 except without elemental boosting.
00189278: 00000000 nop
0018927c: 14400003 bne r2,r0,0x0018928c
00189280: 00000000 nop
00189284: 0c0619bb jal 0x001866ec  Gravi2 Damage Routine
00189288: 00000000 nop
0018928c: 8fbf0010 lw r31,0x0010(r29)
00189290: 27bd0018 addiu r29,r29,0x0018
00189294: 03e00008 jr r31
00189298: 00000000 nop

[18]
0018929c: 03e00008 jr r31
001892a0: 00000000 nop
Doesn't work

[19]
001892a4: 03e00008 jr r31
001892a8: 00000000 nop
Doesn't work

[1a]
001892ac: 27bdffe8 addiu r29,r29,0xffe8
001892b0: afbf0010 sw r31,0x0010(r29)
001892b4: 0c06216e jal 0x001885b8    Magic Evade
001892b8: 00000000 nop
001892bc: 1440001b bne r2,r0,0x0018932c
001892c0: 00000000 nop
001892c4: 0c061725 jal 0x00185c94    Get Ability Power
001892c8: 00000000 nop
001892cc: 0c0617ff jal 0x00185ffc       Elemental Boost
001892d0: 00000000 nop
001892d4: 0c0621d1 jal 0x00188744      Magic XA Modifications
001892d8: 00000000 nop
001892dc: 0c061967 jal 0x0018659c               Set MA + X as X
001892e0: 00000000 nop
001892e4: 0c061c54 jal 0x00187150      Faith Calculation
001892e8: 00000000 nop
001892ec: 0c061d44 jal 0x00187510               Total Accuracy Calculation?
001892f0: 00000000 nop
001892f4: 3c038019 lui r3,0x8019
001892f8: 8c632d90 lw r3,0x2d90(r3)
001892fc: 00000000 nop
00189300: 90620000 lbu r2,0x0000(r3)
00189304: 00000000 nop
00189308: 14400006 bne r2,r0,0x00189324
0018930c: 00000000 nop
00189310: 94620010 lhu r2,0x0010(r3)
00189314: 00000000 nop
00189318: 3042fffb andi r2,r2,0xfffb
0018931c: 080624cb j 0x0018932c
00189320: a4620010 sh r2,0x0010(r3)   Do not allow absorption.
00189324: 0c061e18 jal 0x00187860     Determine which stat (PA/MA/SP) is reduced, Spell Slot Hard-Code Routine
00189328: 00000000 nop
0018932c: 8fbf0010 lw r31,0x0010(r29)
00189330: 27bd0018 addiu r29,r29,0x0018
00189334: 03e00008 jr r31
00189338: 00000000 nop

[1b]
0018933c: 27bdffe8 addiu r29,r29,0xffe8
00189340: afbf0010 sw r31,0x0010(r29)
00189344: 0c06216e jal 0x001885b8    Magic Evade
00189348: 00000000 nop
0018934c: 14400007 bne r2,r0,0x0018936c
00189350: 00000000 nop
00189354: 0c062289 jal 0x00188a24   (MA + X)*Faith%
00189358: 00000000 nop
0018935c: 14400003 bne r2,r0,0x0018936c
00189360: 00000000 nop
00189364: 0c0619a3 jal 0x0018668c   MP Damage
00189368: 00000000 nop
0018936c: 8fbf0010 lw r31,0x0010(r29)
00189370: 27bd0018 addiu r29,r29,0x0018
00189374: 03e00008 jr r31
00189378: 00000000 nop

[1c]
0018937c: 27bdffe8 addiu r29,r29,0xffe8
00189380: afbf0010 sw r31,0x0010(r29)
00189384: 0c061d7f jal 0x001875fc   Sleep Check
00189388: 00000000 nop
0018938c: 3c028019 lui r2,0x8019
00189390: 8c422d90 lw r2,0x2d90(r2)
00189394: 00000000 nop
00189398: 90420000 lbu r2,0x0000(r2)
0018939c: 00000000 nop
001893a0: 10400009 beq r2,r0,0x001893c8
001893a4: 00000000 nop
001893a8: 0c0610d8 jal 0x00184360    Skill-Set Hard Coding
001893ac: 00000000 nop
001893b0: 14400005 bne r2,r0,0x001893c8
001893b4: 00000000 nop
001893b8: 0c061725 jal 0x00185c94    Get Ability Power
001893bc: 00000000 nop
001893c0: 0c061a7b jal 0x001869ec    Magic/Angel Song
001893c4: 00000000 nop
001893c8: 8fbf0010 lw r31,0x0010(r29)
001893cc: 27bd0018 addiu r29,r29,0x0018
001893d0: 03e00008 jr r31
001893d4: 00000000 nop

[1d]
001893d8: 27bdffe8 addiu r29,r29,0xffe8
001893dc: afbf0010 sw r31,0x0010(r29)
001893e0: 0c061d7f jal 0x001875fc    Sleep Check
001893e4: 00000000 nop
001893e8: 3c028019 lui r2,0x8019
001893ec: 8c422d90 lw r2,0x2d90(r2)
001893f0: 00000000 nop
001893f4: 90420000 lbu r2,0x0000(r2)
001893f8: 00000000 nop
001893fc: 10400009 beq r2,r0,0x00189424
00189400: 00000000 nop
00189404: 0c0610d8 jal 0x00184360       Skill-Set Hard Coding
00189408: 00000000 nop
0018940c: 14400005 bne r2,r0,0x00189424
00189410: 00000000 nop
00189414: 0c0616a7 jal 0x00185a9c      Weapon XA Calculation
00189418: 00000000 nop
0018941c: 0c061abe jal 0x00186af8                Wiznaibus/Witch Hunt Formula
00189420: 00000000 nop
00189424: 8fbf0010 lw r31,0x0010(r29)
00189428: 27bd0018 addiu r29,r29,0x0018
0018942c: 03e00008 jr r31
00189430: 00000000 nop

[1e]
00189434: 27bdffe8 addiu r29,r29,0xffe8
00189438: afbf0010 sw r31,0x0010(r29)
0018943c: 0c06216e jal 0x001885b8   Magic Evade
00189440: 00000000 nop
00189444: 14400003 bne r2,r0,0x00189454
00189448: 00000000 nop
0018944c: 0c062269 jal 0x001889a4   Truth Formula
00189450: 00000000 nop
00189454: 8fbf0010 lw r31,0x0010(r29)
00189458: 27bd0018 addiu r29,r29,0x0018
0018945c: 03e00008 jr r31
00189460: 00000000 nop

[1f]
00189464: 27bdffe8 addiu r29,r29,0xffe8
00189468: afbf0010 sw r31,0x0010(r29)
0018946c: 0c06216e jal 0x001885b8   Magic Evade
00189470: 00000000 nop
00189474: 1440004f bne r2,r0,0x001895b4
00189478: 00000000 nop
0018947c: 0c061730 jal 0x00185cc0               Set (MA + Y) / 2 as Y
00189480: 00000000 nop
00189484: 0c0617ff jal 0x00185ffc                 Elemental Boost
00189488: 00000000 nop
0018948c: 0c0621d1 jal 0x00188744      Magic XA Modifications
00189490: 00000000 nop
00189494: 0c0621df jal 0x0018877c      Magic Damage Calculation
00189498: 00000000 nop
0018949c: 14400045 bne r2,r0,0x001895b4
001894a0: 00000000 nop
001894a4: 3c028019 lui r2,0x8019
001894a8: 8c422d94 lw r2,0x2d94(r2)
001894ac: 00000000 nop
001894b0: 9042005c lbu r2,0x005c(r2)
001894b4: 00000000 nop
001894b8: 30420080 andi r2,r2,0x0080
001894bc: 10400003 beq r2,r0,0x001894cc
001894c0: 00000000 nop
001894c4: 3c018019 lui r1,0x8019
001894c8: a02038d3 sb r0,0x38d3(r1)          Faith sets your faith to 0. (Bug)
001894cc: 3c028019 lui r2,0x8019
001894d0: 8c422d94 lw r2,0x2d94(r2)            
001894d4: 00000000 nop
001894d8: 9042005c lbu r2,0x005c(r2)
001894dc: 00000000 nop
001894e0: 30420040 andi r2,r2,0x0040
001894e4: 10400003 beq r2,r0,0x001894f4
001894e8: 34020064 ori r2,r0,0x0064
001894ec: 3c018019 lui r1,0x8019
001894f0: a02238d3 sb r2,0x38d3(r1)         Innocent sets your faith to 100. (Bug)
001894f4: 3c028019 lui r2,0x8019
001894f8: 8c422d98 lw r2,0x2d98(r2)
001894fc: 00000000 nop
00189500: 9042005c lbu r2,0x005c(r2)
00189504: 00000000 nop
00189508: 30420080 andi r2,r2,0x0080
0018950c: 10400003 beq r2,r0,0x0018951c
00189510: 00000000 nop
00189514: 3c018019 lui r1,0x8019
00189518: a02038d2 sb r0,0x38d2(r1)         Faith sets enemy faith to 0. (Bug)
0018951c: 3c028019 lui r2,0x8019
00189520: 8c422d98 lw r2,0x2d98(r2)
00189524: 00000000 nop
00189528: 9042005c lbu r2,0x005c(r2)
0018952c: 00000000 nop
00189530: 30420040 andi r2,r2,0x0040
00189534: 10400004 beq r2,r0,0x00189548
00189538: 34030064 ori r3,r0,0x0064
0018953c: 34020064 ori r2,r0,0x0064
00189540: 3c018019 lui r1,0x8019
00189544: a02238d2 sb r2,0x38d2(r1)          Innocent sets enemy faith to 100.  (Bug)
00189548: 3c058019 lui r5,0x8019               If no one has status...begin here.
0018954c: 8ca52d90 lw r5,0x2d90(r5)
00189550: 3c028019 lui r2,0x8019
00189554: 904238d2 lbu r2,0x38d2(r2)
00189558: 84a40004 lh r4,0x0004(r5)
0018955c: 00621023 subu r2,r3,r2
00189560: 00820018 mult r4,r2
00189564: 3c028019 lui r2,0x8019
00189568: 904238d3 lbu r2,0x38d3(r2)
0018956c: 00002012 mflo r4
00189570: 00621823 subu r3,r3,r2
00189574: 00000000 nop
00189578: 00830018 mult r4,r3          
0018957c: 00001812 mflo r3            
00189580: 3c0268db lui r2,0x68db
00189584: 34428bad ori r2,r2,0x8bad
00189588: 00620018 mult r3,r2
0018958c: 00031fc3 sra r3,r3,0x1f
00189590: 00001010 mfhi r2
00189594: 00021303 sra r2,r2,0x0c
00189598: 00431023 subu r2,r2,r3
0018959c: 0c0621c7 jal 0x0018871c          Elemental Absorption
001895a0: a4a20004 sh r2,0x0004(r5)        Final Damage
001895a4: 14400003 bne r2,r0,0x001895b4
001895a8: 00000000 nop
001895ac: 0c061fad jal 0x00187eb4            Status Calculation
001895b0: 00000000 nop
001895b4: 8fbf0010 lw r31,0x0010(r29)
001895b8: 27bd0018 addiu r29,r29,0x0018
001895bc: 03e00008 jr r31
001895c0: 00000000 nop
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

January 06, 2011, 06:59:53 pm #3 Last Edit: January 06, 2011, 07:16:25 pm by Vanya
So 05 is a duplicate of 01?
And what about 00 is that also the same as 01 or is it empty?
0E? Seriously? There HAS got to be a more efficient way of applying a Death status.
Not to mention that no other ability uses this formula, so did it really need to be that complex?
  • Modding version: Other/Unknown
¯\(°_0)/¯

formerdeathcorps

05 is not only a duplicate of 01, but is missing features, like elemental, and is redundant (Charge is added when it's already considered under physical damage).
Formula 00 is not actually listed in the offset table, so I presume the game auto-loads 01 if you select 00, but I haven't tested it.
As for 0E, let's remember that it can apply any status; the reason for the large space is because SQUARE decided to add everything from a standard (MA+X)*Faith% routine, a % Damage routine, and a must cast status or fail routine, while interspersing in special routines that run only when undead.  However, this is still unacceptable coding, considering that a similar routine for Life Drain exists, reverses against the undead, and wastes far less space.

I'll soon post the next 0x20 formulas or so.
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.

pokeytax

This is a good plan, I will help out.

As far as space goes, I don't know how much we have - for all I know my learning hack is in the middle of game code. But a high priority would be rewriting FFTorgASM so that jumps are dynamic - count the lines in allocated space for each hack and write the jumps accordingly. Right now every hack ever written is effectively taking up ASM space...
  • Modding version: PSX

formerdeathcorps

January 10, 2011, 07:04:02 am #6 Last Edit: January 17, 2011, 05:25:18 pm by formerdeathcorps
There was no need to delete Vanya's request for a customizable CT function.  That's actually a very good idea and would save the space of two other functions.  We'll reintroduce the idea, but in spoilers, since this isn't the main focus of this thread:

Change Formula 15 to Set CT to Y, at (MA + X)*Faith% chance


Pokeytax, I'm not so sure that's as easy as it sounds; last I remember, Razele and Xifanie said that there wasn't much free memory to begin with.  Pretty much every data file with ASM commands without a Japanese Character map (everything but BATTLE.BIN and WORLD.BIN, I think) have no free space unless you reorganize the file.  Potentially, there are sections of "free space" in unit data, but unless you're going to write in delete routines for entire custom functions, it's not really worth it (nor even predictable what will and won't be zero).
We currently also a face an understanding problem.  We don't know where in the overall battle loop data is added and specific data erased and rewritten yet (especially involving offsets outside of BATTLE.BIN).  Hence, we don't want to jump stuff to "free space" only to find that it's part of the sound file or something like that.
Most of our mechanics hacks will involve BATTLE.BIN.  Reorganizing BATTLE.BIN would free up space as well, so I'd rather exhaust that before we think about this.

Oh, and before I forget, here's some more general locations.  In general, everything after unit RAM is instructions for FFT's AI.  Again, this is RAM, so subtract 0x67000 for BATTLE.BIN offsets.  Note, the following is not tested or documented very well.

Table of Offsets from 0x193D48-E4F
1959D4 (Throw Item)
195A30 (Something to do with moving?)
195BBC (?)
195C00 (?)
195A24 (?)
195944 (?)
195A90 (CTR calculation for spells)
195BA0 (?)
198578 (?)
1985F8 (?)
19870C (Checks r2 for 1 or -1 at beginning, ELSE, proceed to bottom routines...stuff for positive or negative status, maybe?)
198748 (?)
198788 (?...very similar to above...one's for damage, the other healing?)
1987C0 (?...very similar to above...this one's for pseudo-status?)
1986A0 (Goes into routine 0x19870C but inputs different variables)
1992E8 (Blood Suck)
199240 (All routines that go to the same place as Blood Suck...telling the AI know unit is KO'd?)
199288 (Check something?  Increment r18 by 1 to check 21 times.)
1992FC (AI Routine for crystal/treasure?)
1992A0 (More routines that go to the same place as Blood Suck)
199214 (Check something different?  Increment r18 by 1 to check 21 times.)
19B0B8 (?)
19B100 (?...very similar to above...again, there's a check for -1 that voids the routine)
19B160 (?...very similar to above...again, there's a check for -1 that voids the routine)
19B1CC (?)
19B240 (?)
19B2C0 (?)
19B068 (?...leads into 0x190B8 but with 2 extra checks, with a check for -1 that voids the routine)
19AF74 (?...leads into previous routine but loads a random number...something to do with decision making?)
19B094 (The second check of 0x19B068)
19D8EC (Multiplies X? with r4 for CT?)
19D91C (AI on CT effects like slow/stop and sleep/don't move/don't act)
19D8F8 (Multiplies Y? with r4 for CT?)
19D978 (CT effects' AI)
19D950 (AI for control effects like Blood Suck/Confuse/Charm...my AI hack for Invite probably also needs to edit this or the AI won't use invite the way he uses charm...0x19D974 touches something important?)


Here's the next 0x20 formulas.  I have finally finished documenting [38].


[20]
001895c4: 27bdffe8 addiu r29,r29,0xffe8
001895c8: afbf0010 sw r31,0x0010(r29)
001895cc: 0c061e44 jal 0x00187910      Katana Break Calculation
001895d0: 00000000 nop
001895d4: 0c061725 jal 0x00185c94      Load Ability Power
001895d8: 00000000 nop
001895dc: 0c062259 jal 0x00188964      Calculate MA*Y Damage
001895e0: 00000000 nop
001895e4: 8fbf0010 lw r31,0x0010(r29)
001895e8: 27bd0018 addiu r29,r29,0x0018
001895ec: 03e00008 jr r31
001895f0: 00000000 nop

[21]
001895f4: 27bdffe8 addiu r29,r29,0xffe8
001895f8: afbf0010 sw r31,0x0010(r29)
001895fc: 0c061e44 jal 0x00187910      Katana Break Calculation
00189600: 00000000 nop
00189604: 0c061725 jal 0x00185c94      Load Ability Power
00189608: 00000000 nop
0018960c: 0c0621d1 jal 0x00188744      Magic XA Modifications
00189610: 00000000 nop
00189614: 3c038019 lui r3,0x8019
00189618: 946338ce lhu r3,0x38ce(r3)
0018961c: 3c028019 lui r2,0x8019
00189620: 944238d0 lhu r2,0x38d0(r2)
00189624: 00000000 nop
00189628: 00620018 mult r3,r2
0018962c: 3c038019 lui r3,0x8019
00189630: 8c632d90 lw r3,0x2d90(r3)
00189634: 34020020 ori r2,r0,0x0020      Set as MP Damage
00189638: a0620025 sb r2,0x0025(r3)
0018963c: 00001012 mflo r2
00189640: a4620008 sh r2,0x0008(r3)      Load MP Damage
00189644: 8fbf0010 lw r31,0x0010(r29)
00189648: 27bd0018 addiu r29,r29,0x0018
0018964c: 03e00008 jr r31
00189650: 00000000 nop

[22]
00189654: 27bdffe8 addiu r29,r29,0xffe8
00189658: afbf0010 sw r31,0x0010(r29)
0018965c: 0c061e44 jal 0x00187910      Katana Break Calculation
00189660: 00000000 nop
00189664: 0c061fc9 jal 0x00187f24      Proc Status at 100% since there's no accuracy modifier
00189668: 00000000 nop
0018966c: 8fbf0010 lw r31,0x0010(r29)
00189670: 27bd0018 addiu r29,r29,0x0018
00189674: 03e00008 jr r31
00189678: 00000000 nop

[23]
0018967c: 27bdffe8 addiu r29,r29,0xffe8
00189680: afbf0010 sw r31,0x0010(r29)
00189684: 0c061e44 jal 0x00187910      Katana Break Calculation
00189688: 00000000 nop
0018968c: 0c061725 jal 0x00185c94      Load Ability Power
00189690: 00000000 nop
00189694: 0c06195a jal 0x00186568      Calculate Healing (Use standard weapon formula instead)
00189698: 00000000 nop
0018969c: 0c061cd4 jal 0x00187350      Undead Reversal
001896a0: 00000000 nop
001896a4: 8fbf0010 lw r31,0x0010(r29)
001896a8: 27bd0018 addiu r29,r29,0x0018
001896ac: 03e00008 jr r31
001896b0: 00000000 nop

[24]
001896b4: 27bdffe8 addiu r29,r29,0xffe8
001896b8: afbf0010 sw r31,0x0010(r29)
001896bc: 0c06216e jal 0x001885b8      Magic Evade
001896c0: 00000000 nop
001896c4: 14400005 bne r2,r0,0x001896dc
001896c8: 00000000 nop
001896cc: 0c061750 jal 0x00185d40      Set (PA + Y ) / 2 as Y
001896d0: 00000000 nop
001896d4: 0c062259 jal 0x00188964      Calculate MA*Y with status.
001896d8: 00000000 nop
001896dc: 8fbf0010 lw r31,0x0010(r29)
001896e0: 27bd0018 addiu r29,r29,0x0018
001896e4: 03e00008 jr r31
001896e8: 00000000 nop

[25]
001896ec: 27bdffe8 addiu r29,r29,0xffe8
001896f0: afbf0010 sw r31,0x0010(r29)
001896f4: 0c061e72 jal 0x001879c8      Skill Slot Hard-Coding BREAK/STEAL/MIGHTY SWORD
001896f8: 00000000 nop
001896fc: 10400007 beq r2,r0,0x0018971c
00189700: 34020001 ori r2,r0,0x0001
00189704: 3c018019 lui r1,0x8019
00189708: a02238e9 sb r2,0x38e9(r1)
0018970c: 0c062b56 jal 0x0018ad58      Double WP if has TWO HANDS
00189710: 00000000 nop
00189714: 080625e1 j 0x00189784
00189718: 00000000 nop
0018971c: 3c018019 lui r1,0x8019
00189720: a02038e9 sb r0,0x38e9(r1)
00189724: 0c062144 jal 0x00188510      Physical Evade Calculation
00189728: 00000000 nop
0018972c: 14400015 bne r2,r0,0x00189784
00189730: 00000000 nop
00189734: 0c061797 jal 0x00185e5c      Load WP + Y as Y
00189738: 00000000 nop
0018973c: 0c0621b5 jal 0x001886d4      Load (PA + Y)%
00189740: 00000000 nop
00189744: 10400005 beq r2,r0,0x0018975c
00189748: 00000000 nop
0018974c: 3c028019 lui r2,0x8019
00189750: 8c422d90 lw r2,0x2d90(r2)
00189754: 080625e1 j 0x00189784
00189758: a4400010 sh r0,0x0010(r2)
0018975c: 0c061d8e jal 0x00187638      Maintenance Check
00189760: 00000000 nop
00189764: 3c038019 lui r3,0x8019
00189768: 8c632d90 lw r3,0x2d90(r3)
0018976c: 00000000 nop
00189770: 90620000 lbu r2,0x0000(r3)
00189774: 00000000 nop
00189778: 10400002 beq r2,r0,0x00189784
0018977c: 34020004 ori r2,r0,0x0004
00189780: a4620010 sh r2,0x0010(r3)
00189784: 8fbf0010 lw r31,0x0010(r29)
00189788: 27bd0018 addiu r29,r29,0x0018
0018978c: 03e00008 jr r31
00189790: 00000000 nop

[26]
00189794: 27bdffe8 addiu r29,r29,0xffe8
00189798: afbf0010 sw r31,0x0010(r29)
0018979c: 0c061e72 jal 0x001879c8      Skill Slot Hard-Coding BREAK/STEAL/MIGHTY SWORD
001897a0: 00000000 nop
001897a4: 10400008 beq r2,r0,0x001897c8
001897a8: 00000000 nop
001897ac: 0c061390 jal 0x00184e40      If fail, set stuff to 0 (Made redundant by above branch statement.)
001897b0: 00000000 nop
001897b4: 3c038019 lui r3,0x8019
001897b8: 8c632d90 lw r3,0x2d90(r3)
001897bc: 34020007 ori r2,r0,0x0007
001897c0: 08062606 j 0x00189818
001897c4: a0620002 sb r2,0x0002(r3)
001897c8: 0c062144 jal 0x00188510      Physical Evade Calculation
001897cc: 00000000 nop
001897d0: 14400011 bne r2,r0,0x00189818
001897d4: 00000000 nop
001897d8: 0c06178c jal 0x00185e30      Load SP and X
001897dc: 00000000 nop
001897e0: 0c0622c5 jal 0x00188b14      Hit Chance Calculation (Contains superfluous checks for berserk and frog on the user when the user can't use this while berserk or frogged.)
001897e4: 00000000 nop
001897e8: 1440000b bne r2,r0,0x00189818
001897ec: 00000000 nop
001897f0: 0c061d8e jal 0x00187638      Maintenance Check
001897f4: 00000000 nop
001897f8: 3c038019 lui r3,0x8019
001897fc: 8c632d90 lw r3,0x2d90(r3)
00189800: 00000000 nop
00189804: 90620000 lbu r2,0x0000(r3)
00189808: 00000000 nop
0018980c: 10400002 beq r2,r0,0x00189818
00189810: 34020010 ori r2,r0,0x0010
00189814: a4620010 sh r2,0x0010(r3)
00189818: 8fbf0010 lw r31,0x0010(r29)
0018981c: 27bd0018 addiu r29,r29,0x0018
00189820: 03e00008 jr r31
00189824: 00000000 nop

[27]
00189828: 27bdffe8 addiu r29,r29,0xffe8
0018982c: afbf0010 sw r31,0x0010(r29)
00189830: 0c062144 jal 0x00188510      Physical Evade Calculation
00189834: 00000000 nop
00189838: 14400009 bne r2,r0,0x00189860
0018983c: 00000000 nop
00189840: 0c06178c jal 0x00185e30      Load SP and X
00189844: 00000000 nop
00189848: 0c0622c5 jal 0x00188b14      Hit Chance Calculation (Contains superfluous checks for berserk and frog on the user when the user can't use this while berserk or frogged.)
0018984c: 00000000 nop
00189850: 14400003 bne r2,r0,0x00189860
00189854: 00000000 nop
00189858: 0c0619d1 jal 0x00186744      Steal Gil Effect
0018985c: 00000000 nop
00189860: 8fbf0010 lw r31,0x0010(r29)
00189864: 27bd0018 addiu r29,r29,0x0018
00189868: 03e00008 jr r31
0018986c: 00000000 nop

[28]
00189870: 27bdffe8 addiu r29,r29,0xffe8
00189874: afbf0010 sw r31,0x0010(r29)
00189878: 0c062144 jal 0x00188510      Physical Evade Calculation
0018987c: 00000000 nop
00189880: 1440001f bne r2,r0,0x00189900
00189884: 00000000 nop
00189888: 0c06178c jal 0x00185e30      Load SP and X
0018988c: 00000000 nop
00189890: 0c061853 jal 0x0018614c      ATTACK UP/Martial Arts Check
00189894: 00000000 nop
00189898: 0c061895 jal 0x00186254      Berserk/Frog Check
0018989c: 00000000 nop
001898a0: 0c0618b3 jal 0x001862cc      Defense UP Check
001898a4: 00000000 nop
001898a8: 0c0618db jal 0x0018636c      Protect Check
001898ac: 00000000 nop
001898b0: 0c061259 jal 0x00184964      Zodiac Calculation
001898b4: 00000000 nop
001898b8: 0c061967 jal 0x0018659c      (SP + X)% Hit
001898bc: 00000000 nop
001898c0: 0c061d44 jal 0x00187510      Total Accuracy Check
(Exactly the same as jal 0x188b14.)
001898c4: 00000000 nop
001898c8: 3c028019 lui r2,0x8019
001898cc: 8c422d90 lw r2,0x2d90(r2)
001898d0: 00000000 nop
001898d4: 90420000 lbu r2,0x0000(r2)
001898d8: 00000000 nop
001898dc: 14400006 bne r2,r0,0x001898f8
001898e0: 00000000 nop
001898e4: 3c028019 lui r2,0x8019
001898e8: 8c42f5fc lw r2,-0x0a04(r2)
001898ec: 00000000 nop
001898f0: 10400003 beq r2,r0,0x00189900      STatus Inflict Check
(The previous branch statement is an evasion check.  If this branch is not an evasion check, it can circumvent the previous one.  If it checks evasion, it is redundant.)
001898f4: 00000000 nop
001898f8: 0c061a05 jal 0x00186814      Set EXP Stolen
001898fc: 00000000 nop
00189900: 8fbf0010 lw r31,0x0010(r29)
00189904: 27bd0018 addiu r29,r29,0x0018
00189908: 03e00008 jr r31
0018990c: 00000000 nop

[29]
00189910: 27bdffe8 addiu r29,r29,0xffe8
00189914: afbf0010 sw r31,0x0010(r29)
00189918: 0c061760 jal 0x00185d80      Load MA and X
0018991c: 00000000 nop
00189920: 0c061259 jal 0x00184964      Zodiac Calculation
00189924: 00000000 nop
00189928: 0c061967 jal 0x0018659c      (MA + X)% Hit
0018992c: 00000000 nop
00189930: 0c061d44 jal 0x00187510      Final Accuracy Check
00189934: 00000000 nop
00189938: 3c028019 lui r2,0x8019
0018993c: 8c422d90 lw r2,0x2d90(r2)
00189940: 00000000 nop
00189944: 90420000 lbu r2,0x0000(r2)
00189948: 00000000 nop
0018994c: 10400011 beq r2,r0,0x00189994
00189950: 00000000 nop
00189954: 3c028019 lui r2,0x8019
00189958: 8c422d98 lw r2,0x2d98(r2)
0018995c: 3c048019 lui r4,0x8019
00189960: 8c842d94 lw r4,0x2d94(r4)
00189964: 90430006 lbu r3,0x0006(r2)
00189968: 90820006 lbu r2,0x0006(r4)
0018996c: 306300e0 andi r3,r3,0x00e0
00189970: 304200e0 andi r2,r2,0x00e0
00189974: 14620005 bne r3,r2,0x0018998c
00189978: 00000000 nop
0018997c: 0c0610c3 jal 0x0018430c      ELSE, MISS Routine (Except for graphics, this just wastes space.)
00189980: 00000000 nop
00189984: 08062665 j 0x00189994
00189988: 00000000 nop
0018998c: 0c061fc9 jal 0x00187f24      Inflict Status at (MA + X)%
00189990: 00000000 nop
00189994: 8fbf0010 lw r31,0x0010(r29)
00189998: 27bd0018 addiu r29,r29,0x0018
0018999c: 03e00008 jr r31
001899a0: 00000000 nop

[2a]
001899a4: 27bdffe8 addiu r29,r29,0xffe8
001899a8: afbf0010 sw r31,0x0010(r29)
001899ac: 0c061d7f jal 0x001875fc      Sleep Check
001899b0: 00000000 nop
001899b4: 3c028019 lui r2,0x8019
001899b8: 8c422d98 lw r2,0x2d98(r2)
001899bc: 00000000 nop
001899c0: 90420006 lbu r2,0x0006(r2)
001899c4: 00000000 nop
001899c8: 30420020 andi r2,r2,0x0020
001899cc: 1040000b beq r2,r0,0x001899fc      Monster Check
001899d0: 00000000 nop
001899d4: 3c028019 lui r2,0x8019
001899d8: 8c422d94 lw r2,0x2d94(r2)
001899dc: 00000000 nop
001899e0: 90420091 lbu r2,0x0091(r2)
001899e4: 00000000 nop
001899e8: 30420010 andi r2,r2,0x0010
001899ec: 14400003 bne r2,r0,0x001899fc      Monster Talk Check
001899f0: 00000000 nop
001899f4: 0c0610c3 jal 0x0018430c      ELSE MISS Routine
001899f8: 00000000 nop
001899fc: 3c028019 lui r2,0x8019
00189a00: 8c422d90 lw r2,0x2d90(r2)
00189a04: 00000000 nop
00189a08: 90420000 lbu r2,0x0000(r2)
00189a0c: 00000000 nop
00189a10: 1040001b beq r2,r0,0x00189a80
00189a14: 00000000 nop
00189a18: 0c0620be jal 0x001882f8      Finger Guard Check?
00189a1c: 00000000 nop
00189a20: 3c028019 lui r2,0x8019
00189a24: 8c422d90 lw r2,0x2d90(r2)
00189a28: 00000000 nop
00189a2c: 90420000 lbu r2,0x0000(r2)
00189a30: 00000000 nop
00189a34: 10400012 beq r2,r0,0x00189a80      Evasion Check

00189a38: 00000000 nop
00189a3c: 0c061760 jal 0x00185d80      Load MA and X
00189a40: 00000000 nop
00189a44: 0c061259 jal 0x00184964      Zodiac Calculation
00189a48: 00000000 nop
00189a4c: 0c061967 jal 0x0018659c      (MA + X)% Hit
00189a50: 00000000 nop
00189a54: 0c061d44 jal 0x00187510      Total Accuracy Check
00189a58: 00000000 nop
00189a5c: 3c028019 lui r2,0x8019
00189a60: 8c422d90 lw r2,0x2d90(r2)
00189a64: 00000000 nop
00189a68: 90420000 lbu r2,0x0000(r2)
00189a6c: 00000000 nop
00189a70: 10400003 beq r2,r0,0x00189a80
00189a74: 00000000 nop
00189a78: 0c061b01 jal 0x00186c04      Skill Set Hard-Coding
00189a7c: 00000000 nop
00189a80: 8fbf0010 lw r31,0x0010(r29)
00189a84: 27bd0018 addiu r29,r29,0x0018
00189a88: 03e00008 jr r31
00189a8c: 00000000 nop

[2b]
00189a90: 27bdffe8 addiu r29,r29,0xffe8
00189a94: afbf0010 sw r31,0x0010(r29)
00189a98: 0c062144 jal 0x00188510      Physical Evade Calculation
00189a9c: 00000000 nop
00189aa0: 14400009 bne r2,r0,0x00189ac8
00189aa4: 00000000 nop
00189aa8: 0c061781 jal 0x00185e04      Loads PA and Y
00189aac: 00000000 nop
00189ab0: 0c0621b5 jal 0x001886d4      Load (PA + Y)%
00189ab4: 00000000 nop
00189ab8: 14400003 bne r2,r0,0x00189ac8
00189abc: 00000000 nop
00189ac0: 0c061e18 jal 0x00187860   Determine which stat (PA/MA/SP) is reduced, Spell Slot Hard-Code Routine
00189ac4: 00000000 nop
00189ac8: 8fbf0010 lw r31,0x0010(r29)
00189acc: 27bd0018 addiu r29,r29,0x0018
00189ad0: 03e00008 jr r31
00189ad4: 00000000 nop

[2c]
00189ad8: 27bdffe8 addiu r29,r29,0xffe8
00189adc: afbf0010 sw r31,0x0010(r29)
00189ae0: 0c062144 jal 0x00188510      Physical Evade Calculation
00189ae4: 00000000 nop
00189ae8: 14400009 bne r2,r0,0x00189b10
00189aec: 00000000 nop
00189af0: 0c061781 jal 0x00185e04      Loads PA and Y
00189af4: 00000000 nop
00189af8: 0c0621b5 jal 0x001886d4      Load (PA + Y)%
00189afc: 00000000 nop
00189b00: 14400003 bne r2,r0,0x00189b10
00189b04: 00000000 nop
00189b08: 0c0619a3 jal 0x0018668c      MP Damage Routine (Uses Y instead of X.)
00189b0c: 00000000 nop
00189b10: 8fbf0010 lw r31,0x0010(r29)
00189b14: 27bd0018 addiu r29,r29,0x0018
00189b18: 03e00008 jr r31
00189b1c: 00000000 nop

[2d]
00189b20: 27bdffe8 addiu r29,r29,0xffe8
00189b24: afbf0010 sw r31,0x0010(r29)
00189b28: 0c062144 jal 0x00188510      Physical Evade Calculation
00189b2c: 00000000 nop
00189b30: 14400014 bne r2,r0,0x00189b84
00189b34: 00000000 nop
00189b38: 0c061797 jal 0x00185e5c      Load WP + Y as Y
00189b3c: 00000000 nop
00189b40: 0c0617e9 jal 0x00185fa4      Element Strengthen Calculation
00189b44: 00000000 nop
00189b48: 0c0621a9 jal 0x001886a4      Physical Damage Calculation
00189b4c: 00000000 nop
00189b50: 0c061bf4 jal 0x00186fd0      Weapon Elemental = Swordskill Routine (Fixed by Xifanie.)
00189b54: 00000000 nop
00189b58: 3c028019 lui r2,0x8019
00189b5c: 8c422d90 lw r2,0x2d90(r2)
00189b60: 00000000 nop
00189b64: 90420000 lbu r2,0x0000(r2)
00189b68: 00000000 nop
00189b6c: 10400005 beq r2,r0,0x00189b84
00189b70: 00000000 nop
00189b74: 0c061c3f jal 0x001870fc      Elemental Absorption
00189b78: 00000000 nop
00189b7c: 0c061fad jal 0x00187eb4      Status Proc
00189b80: 00000000 nop
00189b84: 8fbf0010 lw r31,0x0010(r29)
00189b88: 27bd0018 addiu r29,r29,0x0018
00189b8c: 03e00008 jr r31
00189b90: 00000000 nop

[2e]
00189b94: 27bdffe8 addiu r29,r29,0xffe8
00189b98: afbf0010 sw r31,0x0010(r29)
00189b9c: 0c062144 jal 0x00188510      Physical Evade Calculation
00189ba0: 00000000 nop
00189ba4: 14400026 bne r2,r0,0x00189c40
00189ba8: 00000000 nop
00189bac: 0c061e72 jal 0x001879c8      Skill Slot Hard-Coding BREAK/STEAL/MIGHTY SWORD
00189bb0: 00000000 nop
00189bb4: 10400008 beq r2,r0,0x00189bd8
00189bb8: 00000000 nop
00189bbc: 0c061390 jal 0x00184e40      If fail, set stuff to 0. (Made obsolete by previous branch statement)      
00189bc0: 00000000 nop
00189bc4: 3c038019 lui r3,0x8019
00189bc8: 8c632d90 lw r3,0x2d90(r3)
00189bcc: 34020007 ori r2,r0,0x0007
00189bd0: 08062710 j 0x00189c40
00189bd4: a0620002 sb r2,0x0002(r3)
00189bd8: 0c061d8e jal 0x00187638      Maintanence Check
00189bdc: 00000000 nop
00189be0: 3c038019 lui r3,0x8019
00189be4: 8c632d90 lw r3,0x2d90(r3)
00189be8: 00000000 nop
00189bec: 90620000 lbu r2,0x0000(r3)
00189bf0: 00000000 nop
00189bf4: 10400012 beq r2,r0,0x00189c40
00189bf8: 34020004 ori r2,r0,0x0004
00189bfc: 0c061776 jal 0x00185dd8      Load WP and PA
00189c00: a4620010 sh r2,0x0010(r3)
00189c04: 0c0617e9 jal 0x00185fa4      Element Strengthen Calculation
00189c08: 00000000 nop
00189c0c: 0c0621a9 jal 0x001886a4      Physical Damage Calculation
00189c10: 00000000 nop
00189c14: 0c061bf4 jal 0x00186fd0      Weapon Elemental = Swordskill Routine (Fixed by Xifanie.)
00189c18: 00000000 nop
00189c1c: 3c028019 lui r2,0x8019
00189c20: 8c422d90 lw r2,0x2d90(r2)
00189c24: 00000000 nop
00189c28: 90420000 lbu r2,0x0000(r2)
00189c2c: 00000000 nop
00189c30: 10400003 beq r2,r0,0x00189c40
00189c34: 00000000 nop
00189c38: 0c061c3f jal 0x001870fc      Elemental Absorption
00189c3c: 00000000 nop
00189c40: 8fbf0010 lw r31,0x0010(r29)
00189c44: 27bd0018 addiu r29,r29,0x0018
00189c48: 03e00008 jr r31
00189c4c: 00000000 nop

[2f]
00189c50: 27bdffe8 addiu r29,r29,0xffe8
00189c54: afbf0010 sw r31,0x0010(r29)
00189c58: 0c062144 jal 0x00188510      Physical Evade Calculation
00189c5c: 00000000 nop
00189c60: 14400007 bne r2,r0,0x00189c80
00189c64: 00000000 nop
00189c68: 0c061776 jal 0x00185dd8      Load WP and PA
00189c6c: 00000000 nop
00189c70: 0c0621a9 jal 0x001886a4      Physical Damage Calculation (Does not allow elemental.)
00189c74: 00000000 nop
00189c78: 0c061d1b jal 0x0018746c      MP Healing
00189c7c: 00000000 nop
00189c80: 8fbf0010 lw r31,0x0010(r29)
00189c84: 27bd0018 addiu r29,r29,0x0018
00189c88: 03e00008 jr r31
00189c8c: 00000000 nop

[30]
00189c90: 27bdffe8 addiu r29,r29,0xffe8
00189c94: afbf0010 sw r31,0x0010(r29)
00189c98: 0c062144 jal 0x00188510      Physical Evade Calculation
00189c9c: 00000000 nop
00189ca0: 14400007 bne r2,r0,0x00189cc0
00189ca4: 00000000 nop
00189ca8: 0c061776 jal 0x00185dd8      Load WP and PA
00189cac: 00000000 nop
00189cb0: 0c0621a9 jal 0x001886a4      Physical Damage Calculation (Does not allow elemental.)
00189cb4: 00000000 nop
00189cb8: 0c061c92 jal 0x00187248      HP Absorb
00189cbc: 00000000 nop
00189cc0: 8fbf0010 lw r31,0x0010(r29)
00189cc4: 27bd0018 addiu r29,r29,0x0018
00189cc8: 03e00008 jr r31
00189ccc: 00000000 nop

[31]
00189cd0: 27bdffe8 addiu r29,r29,0xffe8
00189cd4: afbf0010 sw r31,0x0010(r29)
00189cd8: 0c062144 jal 0x00188510      Physical Evade Calculation
00189cdc: 00000000 nop
00189ce0: 14400020 bne r2,r0,0x00189d64
00189ce4: 00000000 nop
00189ce8: 0c061740 jal 0x00185d00      Load (PA + Y) / 2
00189cec: 00000000 nop
00189cf0: 0c0617ff jal 0x00185ffc      Get Elemental Boost
00189cf4: 00000000 nop
00189cf8: 0c061853 jal 0x0018614c      Get ATTACK UP/Martial Arts Check
00189cfc: 00000000 nop
00189d00: 0c0622b7 jal 0x00188adc      Damage Modifiers (Includes berserk and frog checks on user.)
00189d04: 00000000 nop
00189d08: 0c06193e jal 0x001864f8      Critical HIt Routine
00189d0c: 00000000 nop
00189d10: 0c06195a jal 0x00186568      Damage Routine
00189d14: 00000000 nop
00189d18: 0c061bb4 jal 0x00186ed0      Elemental Weak
00189d1c: 00000000 nop
00189d20: 0c061bfe jal 0x00186ff8      Elemental Cancel
00189d24: 00000000 nop
00189d28: 3c028019 lui r2,0x8019
00189d2c: 8c422d90 lw r2,0x2d90(r2)
00189d30: 00000000 nop
00189d34: 90420000 lbu r2,0x0000(r2)
00189d38: 00000000 nop
00189d3c: 10400009 beq r2,r0,0x00189d64
00189d40: 00000000 nop
00189d44: 0c061c3f jal 0x001870fc      Elemental Absorption
00189d48: 00000000 nop
00189d4c: 0c062130 jal 0x001884c0
00189d50: 00000000 nop
00189d54: 14400003 bne r2,r0,0x00189d64
00189d58: 00000000 nop
00189d5c: 0c061fad jal 0x00187eb4      Status
00189d60: 00000000 nop
00189d64: 8fbf0010 lw r31,0x0010(r29)
00189d68: 27bd0018 addiu r29,r29,0x0018
00189d6c: 03e00008 jr r31
00189d70: 00000000 nop

[32]
00189d74: 27bdffe8 addiu r29,r29,0xffe8
00189d78: afbf0010 sw r31,0x0010(r29)
00189d7c: 0c062144 jal 0x00188510      Physical Evade Calculation
00189d80: 00000000 nop
00189d84: 14400024 bne r2,r0,0x00189e18
00189d88: 00000000 nop
00189d8c: 0c061740 jal 0x00185d00      Load (PA + Y) / 2 as Y
00189d90: 00000000 nop
00189d94: 0c061853 jal 0x0018614c      ATTACK UP/Martial Arts Check
00189d98: 00000000 nop
00189d9c: 0c0622b7 jal 0x00188adc      Damage Modifiers (Contains checks for frog and berserk for the caster.)
00189da0: 00000000 nop
00189da4: 0c06193e jal 0x001864f8      Critical HIt Routine
00189da8: 00000000 nop
00189dac: 0c061967 jal 0x0018659c      Load PA + Y
00189db0: 00000000 nop
00189db4: 0c063ba8 jal 0x0018eea0      Load RN between 0 and 1 to r2
00189db8: 00000000 nop
00189dbc: 3c038019 lui r3,0x8019
00189dc0: 906338f9 lbu r3,0x38f9(r3)      Load X
00189dc4: 00000000 nop
00189dc8: 00430018 mult r2,r3         
00189dcc: 3c058019 lui r5,0x8019
00189dd0: 24a538ea addiu r5,r5,0x38ea
00189dd4: 00001012 mflo r2                 X * RN
00189dd8: 04410002 bgez r2,0x00189de4
00189ddc: 00000000 nop
00189de0: 24427fff addiu r2,r2,0x7fff
00189de4: 000213c3 sra r2,r2,0xf
00189de8: 3c048019 lui r4,0x8019
00189dec: 8c842d90 lw r4,0x2d90(r4)
00189df0: 24420001 addiu r2,r2,0x0001
00189df4: a0a20000 sb r2,0x0000(r5)      
00189df8: 90a20000 lbu r2,0x0000(r5)      
(Replace with  AND r2, r2, 0x00FF)
00189dfc: 84830004 lh r3,0x0004(r4)      Load PA + (PA + Y) / 2
00189e00: 00000000 nop
00189e04: 00620018 mult r3,r2
00189e08: 34020080 ori r2,r0,0x0080
00189e0c: a0820025 sb r2,0x0025(r4)      Set as HP Damage
00189e10: 00001012 mflo r2                 Damage = {1...X} * [PA + (PA + Y) / 2]
00189e14: a4820004 sh r2,0x0004(r4)      Store Damage
00189e18: 8fbf0010 lw r31,0x0010(r29)
00189e1c: 27bd0018 addiu r29,r29,0x0018
00189e20: 03e00008 jr r31
00189e24: 00000000 nop


[33]
00189e28: 27bdffe8 addiu r29,r29,0xffe8
00189e2c: afbf0010 sw r31,0x0010(r29)
00189e30: 0c06176b jal 0x00185dac      Load PA and X
00189e34: 00000000 nop
00189e38: 0c061853 jal 0x0018614c      ATTACK UP/Martial Arts Check
00189e3c: 00000000 nop
00189e40: 0c061895 jal 0x00186254      Berserk/Frog Check (Dumb idea)
00189e44: 00000000 nop
00189e48: 0c061259 jal 0x00184964      Zodiac Calculation
00189e4c: 00000000 nop
00189e50: 0c061967 jal 0x0018659c      (PA + X)%
00189e54: 00000000 nop
00189e58: 0c061d44 jal 0x00187510      Total Accuracy Check
00189e5c: 00000000 nop
00189e60: 3c028019 lui r2,0x8019
00189e64: 8c422d90 lw r2,0x2d90(r2)
00189e68: 00000000 nop
00189e6c: 90420000 lbu r2,0x0000(r2)
00189e70: 00000000 nop
00189e74: 10400003 beq r2,r0,0x00189e84
00189e78: 00000000 nop
00189e7c: 0c061fc9 jal 0x00187f24      Cast Status at (PA + X)%
00189e80: 00000000 nop
00189e84: 8fbf0010 lw r31,0x0010(r29)
00189e88: 27bd0018 addiu r29,r29,0x0018
00189e8c: 03e00008 jr r31
00189e90: 00000000 nop

[34]
00189e94: 27bdffe8 addiu r29,r29,0xffe8
00189e98: afbf0010 sw r31,0x0010(r29)
00189e9c: 0c061781 jal 0x00185e04      Loads PA and Y
00189ea0: 00000000 nop
00189ea4: 0c061853 jal 0x0018614c      Attack UP/Martial Arts Check
00189ea8: 00000000 nop
00189eac: 0c061259 jal 0x00184964      Zodiac Calculation
00189eb0: 00000000 nop
00189eb4: 0c06195a jal 0x00186568      Damage Calculation (Forbids elemental.)
00189eb8: 00000000 nop
00189ebc: 3c048019 lui r4,0x8019
00189ec0: 8c842d90 lw r4,0x2d90(r4)
00189ec4: 00000000 nop
00189ec8: 94820004 lhu r2,0x0004(r4)
00189ecc: a4800004 sh r0,0x0004(r4)
00189ed0: a4820006 sh r2,0x0006(r4)      Set HP Healing
00189ed4: 94830006 lhu r3,0x0006(r4)
00189ed8: 34020050 ori r2,r0,0x0050
00189edc: a0820025 sb r2,0x0025(r4)
00189ee0: 00031c00 sll r3,r3,0x10      
00189ee4: 00031403 sra r2,r3,0x10      
00189ee8: 00031fc2 srl r3,r3,0x1f      
00189eec: 00431021 addu r2,r2,r3
00189ef0: 00021043 sra r2,r2,0x01
00189ef4: a482000a sh r2,0x000a(r4)      SEt MP Healing as half of HP
00189ef8: 8fbf0010 lw r31,0x0010(r29)
00189efc: 27bd0018 addiu r29,r29,0x0018
00189f00: 03e00008 jr r31
00189f04: 00000000 nop

[35]
00189f08: 27bdffe8 addiu r29,r29,0xffe8
00189f0c: afbf0010 sw r31,0x0010(r29)
00189f10: 0c06176b jal 0x00185dac      Loads PA and X
00189f14: 00000000 nop
00189f18: 0c061853 jal 0x0018614c      Attack UP/Martial Arts Check
00189f1c: 00000000 nop
00189f20: 0c061259 jal 0x00184964      Zodiac Calculation
00189f24: 00000000 nop
00189f28: 0c061967 jal 0x0018659c      (PA + X)%
00189f2c: 00000000 nop
00189f30: 0c061d44 jal 0x00187510      Total Accuracy Check
00189f34: 00000000 nop
00189f38: 3c028019 lui r2,0x8019
00189f3c: 8c422d90 lw r2,0x2d90(r2)
00189f40: 00000000 nop
00189f44: 90420000 lbu r2,0x0000(r2)
00189f48: 00000000 nop
00189f4c: 10400009 beq r2,r0,0x00189f74
00189f50: 00000000 nop
00189f54: 0c062b37 jal 0x0018acdc      Add Status at (PA+X)%; must add or spell fails.
00189f58: 00000000 nop
00189f5c: 10400005 beq r2,r0,0x00189f74
00189f60: 00000000 nop
00189f64: 0c061989 jal 0x00186624      Inflict Y% Damage
00189f68: 00000000 nop
00189f6c: 0c061cd4 jal 0x00187350      Undead Reversal
00189f70: 00000000 nop
00189f74: 8fbf0010 lw r31,0x0010(r29)
00189f78: 27bd0018 addiu r29,r29,0x0018
00189f7c: 03e00008 jr r31
00189f80: 00000000 nop

[36]
001868f0: 3c028019 lui r2,0x8019
001868f4: 904238fa lbu r2,0x38fa(r2)      Load Y
001868f8: 3c038019 lui r3,0x8019
001868fc: 8c632d90 lw r3,0x2d90(r3)
00186900: 34420080 ori r2,r2,0x0080      Make Negative
00186904: a0620014 sb r2,0x0014(r3)      Load as 0x80 + PA decrement (bonus)
00186908: 3c038019 lui r3,0x8019
0018690c: 8c632d90 lw r3,0x2d90(r3)
00186910: 34020001 ori r2,r0,0x0001      Load as Psuedo-Status
00186914: 03e00008 jr r31
00186918: a0620025 sb r2,0x0025(r3)

[37]
00189f84: 27bdffe8 addiu r29,r29,0xffe8
00189f88: afbf0010 sw r31,0x0010(r29)
00189f8c: 0c062144 jal 0x00188510      Physical Evade Calculation
00189f90: 00000000 nop
00189f94: 14400009 bne r2,r0,0x00189fbc
00189f98: 00000000 nop
00189f9c: 0c061781 jal 0x00185e04      Load PA and Y
00189fa0: 00000000 nop
00189fa4: 0c061853 jal 0x0018614c      Attack UP/Martial Arts Check
00189fa8: 00000000 nop
00189fac: 0c0622b7 jal 0x00188adc      Damage Modifiers (Berserk and Frog check on user, though I suspect dragons may use this, so it's not entirely dumb.)
00189fb0: 00000000 nop
00189fb4: 0c061a47 jal 0x0018691c      Damage and Knockback Routine
00189fb8: 00000000 nop
00189fbc: 8fbf0010 lw r31,0x0010(r29)
00189fc0: 27bd0018 addiu r29,r29,0x0018
00189fc4: 03e00008 jr r31
00189fc8: 00000000 nop

[38]
00187f24: 3c038019 lui r3,0x8019
00187f28: 90633906 lbu r3,0x3906(r3)
00187f2c: 27bdff38 addiu r29,r29,0xff38
00187f30: afbf00c0 sw r31,0x00c0(r29)
00187f34: afb300bc sw r19,0x00bc(r29)
00187f38: afb200b8 sw r18,0x00b8(r29)
00187f3c: afb100b4 sw r17,0x00b4(r29)
00187f40: 30620020 andi r2,r3,0x0020      Check for 'Separate'
00187f44: 1040000b beq r2,r0,0x00187f74
00187f48: afb000b0 sw r16,0x00b0(r29)
00187f4c: 3c048019 lui r4,0x8019
00187f50: 8c842d90 lw r4,0x2d90(r4)
00187f54: 00000000 nop
00187f58: 8482002a lh r2,0x002a(r4)
00187f5c: 00000000 nop
00187f60: 04410002 bgez r2,0x00187f6c       (Always true)
00187f64: 00000000 nop
00187f68: 24420003 addiu r2,r2,0x0003
00187f6c: 00021083 sra r2,r2,0x02
00187f70: a482002a sh r2,0x002a(r4)      If Separate, store maximum accuracy as 1/4.
00187f74: 30620060 andi r2,r3,0x0060      Check for 'Random' or "Separate"
00187f78: 10400008 beq r2,r0,0x00187f9c
00187f7c: 30620080 andi r2,r3,0x0080       Useless command.  
00187f80: 3c028019 lui r2,0x8019
00187f84: 8c42f5fc lw r2,-0x0a04(r2)
00187f88: 00000000 nop
00187f8c: 10400003 beq r2,r0,0x00187f9c      If attack not flagged as status, do not check all or nothing.
00187f90: 30620080 andi r2,r3,0x0080      Check for 'All or Nothing'
00187f94: 34030080 ori r3,r0,0x0080      
00187f98: 30620080 andi r2,r3,0x0080      
(Repeats)
00187f9c: 10400010 beq r2,r0,0x00187fe0
00187fa0: 00008021 addu r16,r0,r0
00187fa4: 3c038019 lui r3,0x8019
00187fa8: 8c632d90 lw r3,0x2d90(r3)
00187fac: 3c018019 lui r1,0x8019
00187fb0: 00300821 addu r1,r1,r16      
00187fb4: 90243907 lbu r4,0x3907(r1)      Load status copied from SCUS
00187fb8: 00701821 addu r3,r3,r16      
00187fbc: 9062001b lbu r2,0x001b(r3)      
00187fc0: 26100001 addiu r16,r16,0x0001
00187fc4: 00441025 or r2,r2,r4
00187fc8: a062001b sb r2,0x001b(r3)      Store Status to inflict
00187fcc: 2a020005 slti r2,r16,0x0005
00187fd0: 1440fff4 bne r2,r0,0x00187fa4      Loop
00187fd4: 00002021 addu r4,r0,r0
00187fd8: 08062070 j 0x001881c0         Inflict Status Routine
00187fdc: 00000000 nop
00187fe0: 30620040 andi r2,r3,0x0040      Check for "Random"
00187fe4: 10400030 beq r2,r0,0x001880a8
00187fe8: 00008821 addu r17,r0,r0
00187fec: 00008021 addu r16,r0,r0
00187ff0: 34050080 ori r5,r0,0x0080
00187ff4: 27a40010 addiu r4,r29,0x0010
00187ff8: 06010002 bgez r16,0x00188004
00187ffc: 02001021 addu r2,r16,r0
00188000: 26020007 addiu r2,r16,0x0007
00188004: 000210c3 sra r2,r2,0x03      
00188008: 3c018019 lui r1,0x8019
0018800c: 00220821 addu r1,r1,r2
00188010: 90233907 lbu r3,0x3907(r1)
00188014: 32020007 andi r2,r16,0x0007
00188018: 00451007 srav r2,r5,r2
0018801c: 00621824 and r3,r3,r2
00188020: 10600004 beq r3,r0,0x00188034
00188024: 00000000 nop
00188028: ac900000 sw r16,0x0000(r4)      Store value if status can be hit
0018802c: 24840004 addiu r4,r4,0x0004
00188030: 26310001 addiu r17,r17,0x0001
00188034: 26100001 addiu r16,r16,0x0001
00188038: 2a020028 slti r2,r16,0x0028      Run checks for each status
0018803c: 1440ffee bne r2,r0,0x00187ff8      Loop
00188040: 00000000 nop
00188044: 0c063ba8 jal 0x0018eea0
00188048: 00000000 nop
0018804c: 00510018 mult r2,r17
00188050: 00001012 mflo r2         Number of statii * Random number
00188054: 04410002 bgez r2,0x00188060
00188058: 00000000 nop
0018805c: 24427fff addiu r2,r2,0x7fff
00188060: 000213c3 sra r2,r2,0x0f      r2 = 1 if was 0x8000, ELSE, r2 = 0.
00188064: 00021080 sll r2,r2,0x02
00188068: 03a21021 add r2,r29,r2
0018806c: 8c450010 lw r5,0x0010(r2)      LOAD first or second status written
00188070: 3c028019 lui r2,0x8019
00188074: 8c422d90 lw r2,0x2d90(r2)
00188078: 04a10002 bgez r5,0x00188084      Always true, r5 = r16 from the last loop
0018807c: 00a02021 addu r4,r5,r0
00188080: 24a40007 addiu r4,r5,0x0007
00188084: 000420c3 sra r4,r4,0x03      r5 / 8
00188088: 00442021 addu r4,r2,r4      r2 + r5 / 8
0018808c: 30a50007 andi r5,r5,0x0007
00188090: 34020080 ori r2,r0,0x0080
00188094: 9083001b lbu r3,0x001b(r4)      Load r3 as r2 + 1b (Inflict Status) + r5 / 8
00188098: 00a21007 srav r2,r2,r5      Load Status
0018809c: 00621825 or r3,r3,r2         
001880a0: 0806206f j 0x001881bc
001880a4: a083001b sb r3,0x001b(r4)      Store First Inflicted Status
001880a8: 30620020 andi r2,r3,0x0020      Check for "Separate"
001880ac: 10400033 beq r2,r0,0x0018817c
001880b0: 00008021 addu r16,r0,r0
001880b4: 34130080 ori r19,r0,0x0080
001880b8: 06010002 bgez r16,0x001880c4
001880bc: 02001021 addu r2,r16,r0
001880c0: 26020007 addiu r2,r16,0x0007
001880c4: 000288c3 sra r17,r2,0x03
001880c8: 3c018019 lui r1,0x8019
001880cc: 00310821 addu r1,r1,r17
001880d0: 90233907 lbu r3,0x3907(r1)      Load Status copied from SCUS
001880d4: 32020007 andi r2,r16,0x0007
001880d8: 00539007 srav r18,r19,r2      
001880dc: 00721824 and r3,r3,r18      Check for equality
(Why wouldn't it be?)
001880e0: 10600012 beq r3,r0,0x0018812c      GOTO end if no status
001880e4: 34040064 ori r4,r0,0x0064
001880e8: 0c017833 jal 0x0005e0cc
001880ec: 34050018 ori r5,r0,0x0018      Separate = innate 25%
001880f0: 14400006 bne r2,r0,0x0018810c
001880f4: 34020002 ori r2,r0,0x0002      
001880f8: 3c038019 lui r3,0x8019
001880fc: 8c63f5fc lw r3,-0x0a04(r3)
00188100: 00000000 nop
00188104: 14620009 bne r3,r2,0x0018812c      GOTO end if no status added
00188108: 00000000 nop
0018810c: 3c018019 lui r1,0x8019      If probability check is successful, GO here.
00188110: 00310821 addu r1,r1,r17
00188114: 90223907 lbu r2,0x3907(r1)
00188118: 00000000 nop
0018811c: 00521026 xor r2,r2,r18      Add status only if target does not already have it.
00188120: 3c018019 lui r1,0x8019
00188124: 00310821 addu r1,r1,r17
00188128: a0223907 sb r2,0x3907(r1)      Store Status
0018812c: 26100001 addiu r16,r16,0x0001      Increment r16
00188130: 2a020028 slti r2,r16,0x0028      Run through all status effects
00188134: 1440ffe0 bne r2,r0,0x001880b8      Loop
00188138: 00000000 nop
0018813c: 00008021 addu r16,r0,r0
00188140: 3c038019 lui r3,0x8019
00188144: 8c632d90 lw r3,0x2d90(r3)
00188148: 3c018019 lui r1,0x8019
0018814c: 00300821 addu r1,r1,r16
00188150: 90243907 lbu r4,0x3907(r1)
00188154: 00701821 addu r3,r3,r16
00188158: 9062001b lbu r2,0x001b(r3)
0018815c: 26100001 addiu r16,r16,0x0001
00188160: 00441025 or r2,r2,r4         
00188164: a062001b sb r2,0x001b(r3)      Load Status effects to be added
00188168: 2a020005 slti r2,r16,0x0005      Run through all status effects to be added
0018816c: 1440fff4 bne r2,r0,0x00188140      Loop
00188170: 00002021 addu r4,r0,r0
00188174: 08062070 j 0x001881c0         Inflict Status Routine
00188178: 00000000 nop
0018817c: 30620010 andi r2,r3,0x0010      Check for "Cancel"
00188180: 1040000f beq r2,r0,0x001881c0
00188184: 00002021 addu r4,r0,r0
00188188: 3c038019 lui r3,0x8019
0018818c: 8c632d90 lw r3,0x2d90(r3)
00188190: 3c018019 lui r1,0x8019
00188194: 00300821 addu r1,r1,r16
00188198: 90243907 lbu r4,0x3907(r1)      Load Status copied from SCUS
0018819c: 00701821 addu r3,r3,r16
001881a0: 90620020 lbu r2,0x0020(r3)
001881a4: 26100001 addiu r16,r16,0x0001
001881a8: 00441025 or r2,r2,r4
001881ac: a0620020 sb r2,0x0020(r3)      Store status to remove      
001881b0: 2a020005 slti r2,r16,0x0005      Go through all status effects
001881b4: 1440fff4 bne r2,r0,0x00188188      Loop
001881b8: 00000000 nop
001881bc: 00002021 addu r4,r0,r0
001881c0: 00008021 addu r16,r0,r0
001881c4: 3c058019 lui r5,0x8019
001881c8: 8ca52d90 lw r5,0x2d90(r5)
001881cc: 00000000 nop
001881d0: 00b01021 addu r2,r5,r16
001881d4: 9043001b lbu r3,0x001b(r2)
001881d8: 90420020 lbu r2,0x0020(r2)
001881dc: 26100001 addiu r16,r16,0x0001
001881e0: 00621825 or r3,r3,r2         Final value of r3 is that of 1f/24
001881e4: 2a020005 slti r2,r16,0x0005      Loop
001881e8: 1440fff8 bne r2,r0,0x001881cc
001881ec: 00832025 or r4,r4,r3
001881f0: 308200ff andi r2,r4,0x00ff      r2 = r4
001881f4: 10400005 beq r2,r0,0x0018820c      
001881f8: 00000000 nop
001881fc: 0c0612c9 jal 0x00184b24      Extra Checks if Status
00188200: 00002021 addu r4,r0,r0
00188204: 14400005 bne r2,r0,0x0018821c
00188208: 00000000 nop
0018820c: 0c0610c3 jal 0x0018430c      Set bytes to zero if no status (Should already be 0.)
00188210: 00000000 nop
00188214: 0806209a j 0x00188268
00188218: 00000000 nop
0018821c: 3c028019 lui r2,0x8019
00188220: 8c422d90 lw r2,0x2d90(r2)
00188224: 00000000 nop
00188228: 90430025 lbu r3,0x0025(r2)
0018822c: 00000000 nop
00188230: 34630008 ori r3,r3,0x0008
00188234: a0430025 sb r3,0x0025(r2)      Set as status infliction
00188238: 3c038019 lui r3,0x8019
0018823c: 8c632d90 lw r3,0x2d90(r3)
00188240: 00000000 nop
00188244: 9062001c lbu r2,0x001c(r3)
00188248: 00000000 nop
0018824c: 30420040 andi r2,r2,0x0040
00188250: 10400005 beq r2,r0,0x00188268      Ignore if target isn't invited
00188254: 00000000 nop
00188258: 94620010 lhu r2,0x0010(r3)
0018825c: 00000000 nop
00188260: 34420040 ori r2,r2,0x0040
00188264: a4620010 sh r2,0x0010(r3)      Change target team
00188268: 8fbf00c0 lw r31,0x00c0(r29)
0018826c: 8fb300bc lw r19,0x00bc(r29)
00188270: 8fb200b8 lw r18,0x00b8(r29)
00188274: 8fb100b4 lw r17,0x00b4(r29)
00188278: 8fb000b0 lw r16,0x00b0(r29)
0018827c: 27bd00c8 addiu r29,r29,0x00c8
00188280: 03e00008 jr r31
00188284: 00000000 nop

[39]
00186d2c: 3c028019 lui r2,0x8019
00186d30: 904238fa lbu r2,0x38fa(r2)
00186d34: 3c038019 lui r3,0x8019
00186d38: 8c632d90 lw r3,0x2d90(r3)
00186d3c: 34420080 ori r2,r2,0x0080
00186d40: a0620012 sb r2,0x0012(r3)      Store Y as 0x80 + SP decrement (boost)
00186d44: 3c038019 lui r3,0x8019
00186d48: 8c632d90 lw r3,0x2d90(r3)
00186d4c: 34020001 ori r2,r0,0x0001
00186d50: 03e00008 jr r31
00186d54: a0620025 sb r2,0x0025(r3)      Store attack type as Pseudo-Status

[3a]
00186d00: 3c028019 lui r2,0x8019
00186d04: 904238fa lbu r2,0x38fa(r2)
00186d08: 3c038019 lui r3,0x8019
00186d0c: 8c632d90 lw r3,0x2d90(r3)
00186d10: 34420080 ori r2,r2,0x0080
00186d14: a0620016 sb r2,0x0016(r3)      Store Y as 0x80 + Br decrement (boost)
00186d18: 3c038019 lui r3,0x8019
00186d1c: 8c632d90 lw r3,0x2d90(r3)
00186d20: 34020001 ori r2,r0,0x0001
00186d24: 03e00008 jr r31
00186d28: a0620025 sb r2,0x0025(r3)      Store attack type as Psuedo-Status

[3b]
00186d58: 3c028019 lui r2,0x8019
00186d5c: 904238f9 lbu r2,0x38f9(r2)
00186d60: 3c038019 lui r3,0x8019
00186d64: 8c632d90 lw r3,0x2d90(r3)
00186d68: 34420080 ori r2,r2,0x0080
00186d6c: a0620016 sb r2,0x0016(r3)      Store X as 0x80 + Br decrement (boost)
00186d70: 3c038019 lui r3,0x8019
00186d74: 906338fa lbu r3,0x38fa(r3)
00186d78: 3c028019 lui r2,0x8019
00186d7c: 8c422d90 lw r2,0x2d90(r2)
00186d80: 34630080 ori r3,r3,0x0080
00186d84: a0430014 sb r3,0x0014(r2)      Store Y as 0x80 + PA decrement (boost)
00186d88: 3c028019 lui r2,0x8019
00186d8c: 8c422d90 lw r2,0x2d90(r2)
00186d90: 00000000 nop
00186d94: a0430015 sb r3,0x0015(r2)      Store Y as 0x80 + MA decrement (boost)
00186d98: 3c028019 lui r2,0x8019
00186d9c: 8c422d90 lw r2,0x2d90(r2)
00186da0: 00000000 nop
00186da4: a0430012 sb r3,0x0012(r2)      Store Y as 0x80 + SP decrement (boost)
00186da8: 3c038019 lui r3,0x8019
00186dac: 8c632d90 lw r3,0x2d90(r3)
00186db0: 34020001 ori r2,r0,0x0001
00186db4: 03e00008 jr r31
00186db8: a0620025 sb r2,0x0025(r3)      Store attack type as Psuedo-Status

[3c]
[3c]
00186dbc: 3c028019 lui r2,0x8019
00186dc0: 8c422d94 lw r2,0x2d94(r2)
00186dc4: 3c03cccc lui r3,0xcccc
00186dc8: 9442002a lhu r2,0x002a(r2)      Set variable as maxHP
00186dcc: 3463cccd ori r3,r3,0xcccd
00186dd0: 00430019 multu r2,r3
00186dd4: 3c038019 lui r3,0x8019
00186dd8: 8c632d8c lw r3,0x2d8c(r3)
00186ddc: 34020080 ori r2,r0,0x0080
00186de0: a0620025 sb r2,0x0025(r3)      Set as HP Healing
00186de4: 00001010 mfhi r2
00186de8: 00021082 srl r2,r2,0x02
00186dec: a4620004 sh r2,0x0004(r3)      Damage is 1/5 of maxHP
00186df0: 3c038019 lui r3,0x8019
00186df4: 8c632d8c lw r3,0x2d8c(r3)
00186df8: 34020001 ori r2,r0,0x0001
00186dfc: a0620000 sb r2,0x0000(r3)      Guarantee Hit
00186e00: 3c028019 lui r2,0x8019
00186e04: 8c422d8c lw r2,0x2d8c(r2)
00186e08: 3c048019 lui r4,0x8019
00186e0c: 8c842d90 lw r4,0x2d90(r4)
00186e10: 84420004 lh r2,0x0004(r2)
00186e14: 34030040 ori r3,r0,0x0040
00186e18: a0830025 sb r3,0x0025(r4)      Add in HP Healing
00186e1c: 00021040 sll r2,r2,0x01      
00186e20: 03e00008 jr r31
00186e24: a4820006 sh r2,0x0006(r4)      Healing is 2/5 of maxHP

[3d]
00189fcc: 27bdffe8 addiu r29,r29,0xffe8
00189fd0: afbf0010 sw r31,0x0010(r29)
00189fd4: 0c06216e jal 0x001885b8      Magic Evade
00189fd8: 00000000 nop
00189fdc: 14400007 bne r2,r0,0x00189ffc
00189fe0: 00000000 nop
00189fe4: 0c0622a1 jal 0x00188a84      Sets (MA + X)% as hit chance
00189fe8: 00000000 nop
00189fec: 14400003 bne r2,r0,0x00189ffc
00189ff0: 00000000 nop
00189ff4: 0c061fc9 jal 0x00187f24      Status Proc
00189ff8: 00000000 nop
00189ffc: 8fbf0010 lw r31,0x0010(r29)
0018a000: 27bd0018 addiu r29,r29,0x0018
0018a004: 03e00008 jr r31
0018a008: 00000000 nop

[3e]
0018a00c: 27bdffe8 addiu r29,r29,0xffe8
0018a010: afbf0010 sw r31,0x0010(r29)
0018a014: 0c0619bb jal 0x001866ec      Gravi2 Damage Routine
0018a018: 00000000 nop
0018a01c: 8fbf0010 lw r31,0x0010(r29)
0018a020: 27bd0018 addiu r29,r29,0x0018
0018a024: 03e00008 jr r31
0018a028: 00000000 nop

[3f]
0018a02c: 27bdffe8 addiu r29,r29,0xffe8
0018a030: afbf0010 sw r31,0x0010(r29)
0018a034: 0c06178c jal 0x00185e30      Loads SP and X
0018a038: 00000000 nop
0018a03c: 0c06217e jal 0x001885f8      Zodiac Calculation
0018a040: 00000000 nop
0018a044: 0c061967 jal 0x0018659c      Loads SP + X as X
0018a048: 00000000 nop
0018a04c: 0c061d44 jal 0x00187510      Total Accuracy Check
0018a050: 00000000 nop
0018a054: 3c028019 lui r2,0x8019
0018a058: 8c422d90 lw r2,0x2d90(r2)
0018a05c: 00000000 nop
0018a060: 90420000 lbu r2,0x0000(r2)
0018a064: 00000000 nop
0018a068: 10400003 beq r2,r0,0x0018a078
0018a06c: 00000000 nop
0018a070: 0c061fc9 jal 0x00187f24      Status Proc      
0018a074: 00000000 nop
0018a078: 8fbf0010 lw r31,0x0010(r29)
0018a07c: 27bd0018 addiu r29,r29,0x0018
0018a080: 03e00008 jr r31
0018a084: 00000000 nop

[40]
0018a088: 27bdffe8 addiu r29,r29,0xffe8
0018a08c: afbf0010 sw r31,0x0010(r29)
0018a090: 0c06178c jal 0x00185e30      Loads SP and X
0018a094: 00000000 nop
0018a098: 0c06217e jal 0x001885f8      Zodiac Calculation
0018a09c: 00000000 nop
0018a0a0: 0c061967 jal 0x0018659c      Loads SP + X as X
0018a0a4: 00000000 nop
0018a0a8: 0c061d44 jal 0x00187510      Total Accuracy Check
0018a0ac: 00000000 nop
0018a0b0: 3c028019 lui r2,0x8019
0018a0b4: 8c422d90 lw r2,0x2d90(r2)
0018a0b8: 00000000 nop
0018a0bc: 90420000 lbu r2,0x0000(r2)
0018a0c0: 00000000 nop
0018a0c4: 1040000f beq r2,r0,0x0018a104
0018a0c8: 00000000 nop
0018a0cc: 3c028019 lui r2,0x8019
0018a0d0: 8c422d98 lw r2,0x2d98(r2)
0018a0d4: 00000000 nop
0018a0d8: 90420058 lbu r2,0x0058(r2)
0018a0dc: 00000000 nop
0018a0e0: 30420010 andi r2,r2,0x0010
0018a0e4: 14400005 bne r2,r0,0x0018a0fc      Zombie Check
0018a0e8: 00000000 nop
0018a0ec: 0c0610c3 jal 0x0018430c      ELSE FAIL routine
0018a0f0: 00000000 nop
0018a0f4: 08062841 j 0x0018a104
0018a0f8: 00000000 nop
0018a0fc: 0c061fc9 jal 0x00187f24      Status Proc
0018a100: 00000000 nop
0018a104: 8fbf0010 lw r31,0x0010(r29)
0018a108: 27bd0018 addiu r29,r29,0x0018
0018a10c: 03e00008 jr r31
0018a110: 00000000 nop


Some other bits:
1) The Truth and Un-Truth formulas [1E/1F] do not have multi-hit routines in them, and likely neither do the ones for Triple Thunder/Holy Breath/Dark Whisper.  However, due to the nature of rerunning the formula, status becomes 6.25% per hit because it is hard-coded into the status application formula (38), rather than 1E/1F.
2) Stat boosts are read by the game as 0x80 + stat decrements, which is hard-coded into the formulas for stat gain.  A similar trick is used by CT, if anyone noticed on the CT00 formula.
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

January 10, 2011, 07:35:40 pm #7 Last Edit: January 10, 2011, 07:49:43 pm by Vanya
Holy Crap! 38 (100)% is a monster!! There's another that probably could and should be deconstructed for efficiency.

Seems like 39 & 3A could be merged by using X as an index for selecting which attribute to modify.

Looks like as long as the zombie check sub-routine in 40 only checks the status it should be easy to edit. And since it doesn't use Y it could probably be made to have the specific status selectable.
  • Modding version: Other/Unknown
¯\(°_0)/¯

formerdeathcorps

January 11, 2011, 11:34:14 pm #8 Last Edit: January 13, 2011, 11:10:44 am by formerdeathcorps
Here's the last 0x24.

[41]
0018a114: 27bdffe8 addiu r29,r29,0xffe8
0018a118: afbf0010 sw r31,0x0010(r29)
0018a11c: 0c0622a1 jal 0x00188a84      Sets (MA + X)% as hit chance
0018a120: 00000000 nop
0018a124: 14400011 bne r2,r0,0x0018a16c
0018a128: 00000000 nop
0018a12c: 3c028019 lui r2,0x8019
0018a130: 8c422d98 lw r2,0x2d98(r2)
0018a134: 3c048019 lui r4,0x8019
0018a138: 8c842d94 lw r4,0x2d94(r4)
0018a13c: 94430008 lhu r3,0x0008(r2)
0018a140: 94820008 lhu r2,0x0008(r4)
0018a144: 3063f000 andi r3,r3,0xf000
0018a148: 3042f000 andi r2,r2,0xf000
0018a14c: 14620005 bne r3,r2,0x0018a164      If target and caster Zodiacs are different, inflict status.
0018a150: 00000000 nop
0018a154: 0c0610c3 jal 0x0018430c      ELSE, MISS Routine (Only graphics are affected here.)
0018a158: 00000000 nop
0018a15c: 0806285b j 0x0018a16c
0018a160: 00000000 nop
0018a164: 0c061fc9 jal 0x00187f24      Inflict status at (MA+X)%
0018a168: 00000000 nop
0018a16c: 8fbf0010 lw r31,0x0010(r29)
0018a170: 27bd0018 addiu r29,r29,0x0018
0018a174: 03e00008 jr r31
0018a178: 00000000 nop

[42]
0018a17c: 27bdffe8 addiu r29,r29,0xffe8
0018a180: afbf0010 sw r31,0x0010(r29)
0018a184: 0c061781 jal 0x00185e04      Loads PA and Y
0018a188: 00000000 nop
0018a18c: 0c061259 jal 0x00184964      Zodiac Calculation
0018a190: 00000000 nop
0018a194: 3c038019 lui r3,0x8019
0018a198: 946338ce lhu r3,0x38ce(r3)      Load PA
0018a19c: 3c028019 lui r2,0x8019
0018a1a0: 944238d0 lhu r2,0x38d0(r2)      Load Y
0018a1a4: 00000000 nop
0018a1a8: 00620018 mult r3,r2
0018a1ac: 3c038019 lui r3,0x8019
0018a1b0: 8c632d90 lw r3,0x2d90(r3)
0018a1b4: 00001012 mflo r2         PA * Y
0018a1b8: a4620004 sh r2,0x0004(r3)      Set PA * Y as HP Damage to enemy
0018a1bc: 00021400 sll r2,r2,0x10
0018a1c0: 3c038019 lui r3,0x8019
0018a1c4: 906338f9 lbu r3,0x38f9(r3)      Load X
0018a1c8: 00021403 sra r2,r2,0x10
0018a1cc: 0043001a div r2,r3
0018a1d0: 00001012 mflo r2         Damage / X
0018a1d4: 3c048019 lui r4,0x8019
0018a1d8: 8c842d8c lw r4,0x2d8c(r4)
0018a1dc: 34030001 ori r3,r0,0x0001
0018a1e0: a0830000 sb r3,0x0000(r4)      Hit Self
0018a1e4: a4820004 sh r2,0x0004(r4)      Damage Self for PA * Y / X
0018a1e8: 3c028019 lui r2,0x8019
0018a1ec: 8c422d90 lw r2,0x2d90(r2)
0018a1f0: 34030080 ori r3,r0,0x0080
0018a1f4: a0430025 sb r3,0x0025(r2)      Load as HP damage to enemy
0018a1f8: 3c028019 lui r2,0x8019
0018a1fc: 8c422d8c lw r2,0x2d8c(r2)
0018a200: 00000000 nop
0018a204: a0430025 sb r3,0x0025(r2)      Load as HP damage to self
0018a208: 8fbf0010 lw r31,0x0010(r29)
0018a20c: 27bd0018 addiu r29,r29,0x0018
0018a210: 03e00008 jr r31
0018a214: 00000000 nop

[43]
00186e28: 3c028019 lui r2,0x8019
00186e2c: 8c422d94 lw r2,0x2d94(r2)
00186e30: 3c058019 lui r5,0x8019
00186e34: 8ca52d90 lw r5,0x2d90(r5)
00186e38: 9443002a lhu r3,0x002a(r2)
00186e3c: 94440028 lhu r4,0x0028(r2)
00186e40: 34020080 ori r2,r0,0x0080
00186e44: a0a20025 sb r2,0x0025(r5)      Set as HP Damage
00186e48: 00641823 subu r3,r3,r4      Damage is Self maxHP - curHP
00186e4c: 03e00008 jr r31
00186e50: a4a30004 sh r3,0x0004(r5)      Store Damage

[44]
00186e54: 3c028019 lui r2,0x8019
00186e58: 8c422d98 lw r2,0x2d98(r2)
00186e5c: 3c038019 lui r3,0x8019
00186e60: 8c632d90 lw r3,0x2d90(r3)
00186e64: 9444002c lhu r4,0x002c(r2)
00186e68: 34020080 ori r2,r0,0x0080
00186e6c: a0620025 sb r2,0x0025(r3)      Set as HP Damage
00186e70: 03e00008 jr r31
00186e74: a4640004 sh r4,0x0004(r3)      Damage is target's curMP

[45]
00186e78: 3c028019 lui r2,0x8019
00186e7c: 8c422d98 lw r2,0x2d98(r2)
00186e80: 3c058019 lui r5,0x8019
00186e84: 8ca52d90 lw r5,0x2d90(r5)
00186e88: 9443002a lhu r3,0x002a(r2)
00186e8c: 94440028 lhu r4,0x0028(r2)
00186e90: 34020080 ori r2,r0,0x0080
00186e94: a0a20025 sb r2,0x0025(r5)      Set as HP Damage
00186e98: 00641823 subu r3,r3,r4      Damage is Target maxHP - curHP
00186e9c: 03e00008 jr r31
00186ea0: a4a30004 sh r3,0x0004(r5)      Store Damage


[46]
0018a218: 03e00008 jr r31         
0018a21c: 00000000 nop
(Does not work)

[47]
0018a220: 27bdffe8 addiu r29,r29,0xffe8
0018a224: afbf0010 sw r31,0x0010(r29)
0018a228: 0c061989 jal 0x00186624      Calculate Damage as Y% of HP
0018a22c: 00000000 nop
0018a230: 0c061c92 jal 0x00187248      Abosrb HP
0018a234: 00000000 nop
0018a238: 0c061fad jal 0x00187eb4      Status Proc
0018a23c: 00000000 nop
0018a240: 8fbf0010 lw r31,0x0010(r29)
0018a244: 27bd0018 addiu r29,r29,0x0018
0018a248: 03e00008 jr r31
0018a24c: 00000000 nop


[48] Healing = Z * 10 (with undead reversal)
0018a250: 3c038019 lui r3,0x8019
0018a254: 906338db lbu r3,0x38db(r3)      Load Used Item ID
0018a258: 27bdffe8 addiu r29,r29,0xffe8
0018a25c: afbf0010 sw r31,0x0010(r29)
0018a260: 00031040 sll r2,r3,0x01      ID * 2
0018a264: 00431021 addu r2,r2,r3      ID * 3
0018a268: 3c018006 lui r1,0x8006
0018a26c: 00220821 addu r1,r1,r2      80060000 + ID * 3 (Secondary Data)
0018a270: 90233f99 lbu r3,0x3f99(r1)      Load Used Item's Z value
0018a274: 00000000 nop
0018a278: 00031080 sll r2,r3,0x02      Z * 4
0018a27c: 00431021 addu r2,r2,r3      Z * 5
0018a280: 3c038019 lui r3,0x8019
0018a284: 8c632d90 lw r3,0x2d90(r3)      Load Current Attack Data Pointer
0018a288: 00021040 sll r2,r2,0x01      Z * 10
0018a28c: 0c061cd4 jal 0x00187350      Undead Reversal
0018a290: a4620004 sh r2,0x0004(r3)      Store HP Damage = Z * 10
0018a294: 8fbf0010 lw r31,0x0010(r29)
0018a298: 27bd0018 addiu r29,r29,0x0018
0018a29c: 03e00008 jr r31
0018a2a0: 00000000 nop

[49] MP Healing = Z * 10
0018a2a4: 27bdffe8 addiu r29,r29,0xffe8
0018a2a8: afbf0010 sw r31,0x0010(r29)
0018a2ac: 0c0620a2 jal 0x00188288      MP Healing Item Formula
0018a2b0: 00000000 nop
0018a2b4: 8fbf0010 lw r31,0x0010(r29)
0018a2b8: 27bd0018 addiu r29,r29,0x0018
0018a2bc: 03e00008 jr r31
0018a2c0: 00000000 nop

[4a] 100% HP/MP Healing
0018a2c4: 27bdffe8 addiu r29,r29,0xffe8
0018a2c8: afbf0010 sw r31,0x0010(r29)
0018a2cc: 0c0620b2 jal 0x001882c8      100% HP/MP Healing (actual calculation)
0018a2d0: 00000000 nop
0018a2d4: 0c061cd4 jal 0x00187350      Undead Reversal
0018a2d8: 00000000 nop
0018a2dc: 8fbf0010 lw r31,0x0010(r29)
0018a2e0: 27bd0018 addiu r29,r29,0x0018
0018a2e4: 03e00008 jr r31
0018a2e8: 00000000 nop

[4b] Remove status and restore Rand(1..(Z-1)) HP
0018a2ec: 27bdffe8 addiu r29,r29,0xffe8
0018a2f0: afbf0010 sw r31,0x0010(r29)
0018a2f4: 0c062b37 jal 0x0018acdc          Add Status at 100%; must add or item fails.
0018a2f8: 00000000 nop
0018a2fc: 10400024 beq r2,r0,0x0018a390
0018a300: 00000000 nop
0018a304: 3c048019 lui r4,0x8019
0018a308: 8c842d98 lw r4,0x2d98(r4)
0018a30c: 00000000 nop
0018a310: 90820058 lbu r2,0x0058(r4)
0018a314: 00000000 nop
0018a318: 30420010 andi r2,r2,0x0010
0018a31c: 10400006 beq r2,r0,0x0018a338
0018a320: 00000000 nop
0018a324: 3c038019 lui r3,0x8019      Run only if undead.
0018a328: 8c632d90 lw r3,0x2d90(r3)
0018a32c: 94820028 lhu r2,0x0028(r4)      Load Target curHP
0018a330: 080628e2 j 0x0018a388         Skip to damage if undead
0018a334: 00000000 nop
0018a338: 0c063ba8 jal 0x0018eea0      Load RN between 0 and 1
0018a33c: 00000000 nop
0018a340: 3c038019 lui r3,0x8019
0018a344: 906338db lbu r3,0x38db(r3)      Load item used
0018a348: 00000000 nop
0018a34c: 00032040 sll r4,r3,0x01      Item ID * 2
0018a350: 00832021 addu r4,r4,r3      ID * 3
0018a354: 3c018006 lui r1,0x8006
0018a358: 00240821 addu r1,r1,r4
0018a35c: 90233f99 lbu r3,0x3f99(r1)      Load Z
0018a360: 00000000 nop
0018a364: 00430018 mult r2,r3
0018a368: 3c038019 lui r3,0x8019
0018a36c: 8c632d90 lw r3,0x2d90(r3)
0018a370: 00001012 mflo r2         Load Z * RN
0018a374: 04410002 bgez r2,0x0018a380
0018a378: 00000000 nop
0018a37c: 24427fff addiu r2,r2,0x7fff
0018a380: 000213c3 sra r2,r2,0x0f
0018a384: 24420001 addiu r2,r2,0x0001
0018a388: 0c061cd4 jal 0x00187350      Undead Reversal
0018a38c: a4620004 sh r2,0x0004(r3)      Store as HP Damage (Changed to healing by above routine)
0018a390: 8fbf0010 lw r31,0x0010(r29)
0018a394: 27bd0018 addiu r29,r29,0x0018
0018a398: 03e00008 jr r31
0018a39c: 00000000 nop

[4c]
0018a3a0: 27bdffe8 addiu r29,r29,0xffe8
0018a3a4: afbf0010 sw r31,0x0010(r29)
0018a3a8: 0c061725 jal 0x00185c94      Get Ability Power
0018a3ac: 00000000 nop
0018a3b0: 0c062216 jal 0x00188858      Healing Calculation
0018a3b4: 00000000 nop
0018a3b8: 0c061cd4 jal 0x00187350      Undead Reversal
0018a3bc: 00000000 nop
0018a3c0: 8fbf0010 lw r31,0x0010(r29)
0018a3c4: 27bd0018 addiu r29,r29,0x0018
0018a3c8: 03e00008 jr r31
0018a3cc: 00000000 nop

[4d]
0018a3d0: 27bdffe8 addiu r29,r29,0xffe8
0018a3d4: afbf0010 sw r31,0x0010(r29)
0018a3d8: 0c062144 jal 0x00188510      Physical Evade Calculation
0018a3dc: 00000000 nop
0018a3e0: 1440000b bne r2,r0,0x0018a410
0018a3e4: 00000000 nop
0018a3e8: 0c061760 jal 0x00185d80      Get MA and X
0018a3ec: 00000000 nop
0018a3f0: 0c0622c5 jal 0x00188b14      Hit Chance Calculation (Has superfluous checks for frog/berserk.)
0018a3f4: 00000000 nop
0018a3f8: 14400005 bne r2,r0,0x0018a410
0018a3fc: 00000000 nop
0018a400: 0c061989 jal 0x00186624      Deal Y% HP Damage
0018a404: 00000000 nop
0018a408: 0c061c92 jal 0x00187248      HP Absorb
0018a40c: 00000000 nop
0018a410: 8fbf0010 lw r31,0x0010(r29)
0018a414: 27bd0018 addiu r29,r29,0x0018
0018a418: 03e00008 jr r31
0018a41c: 00000000 nop

[4e]
0018a420: 27bdffe8 addiu r29,r29,0xffe8
0018a424: afbf0010 sw r31,0x0010(r29)
0018a428: 0c06216e jal 0x001885b8      Magic Evade
0018a42c: 00000000 nop
0018a430: 14400005 bne r2,r0,0x0018a448
0018a434: 00000000 nop
0018a438: 0c061725 jal 0x00185c94      Get Ability Power
0018a43c: 00000000 nop
0018a440: 0c062259 jal 0x00188964      Calculate MA * Y Damage
0018a444: 00000000 nop
0018a448: 8fbf0010 lw r31,0x0010(r29)
0018a44c: 27bd0018 addiu r29,r29,0x0018
0018a450: 03e00008 jr r31
0018a454: 00000000 nop

[4f]
0018a458: 27bdffe8 addiu r29,r29,0xffe8
0018a45c: afbf0010 sw r31,0x0010(r29)
0018a460: 0c062144 jal 0x00188510      Physical Evade Calculation
0018a464: 00000000 nop
0018a468: 14400009 bne r2,r0,0x0018a490
0018a46c: 00000000 nop
0018a470: 0c061760 jal 0x00185d80      Get X and MA
0018a474: 00000000 nop
0018a478: 0c0622c5 jal 0x00188b14      Hit Chance Calculation (Has superfluous checks for frog/berserk.)
0018a47c: 00000000 nop
0018a480: 14400003 bne r2,r0,0x0018a490
0018a484: 00000000 nop
0018a488: 0c061b8a jal 0x00186e28      Damage = Enemy maxHP - Enemy curHP
0018a48c: 00000000 nop
0018a490: 8fbf0010 lw r31,0x0010(r29)
0018a494: 27bd0018 addiu r29,r29,0x0018
0018a498: 03e00008 jr r31
0018a49c: 00000000 nop

[50]
0018a4a0: 27bdffe8 addiu r29,r29,0xffe8
0018a4a4: afbf0010 sw r31,0x0010(r29)
0018a4a8: 0c062144 jal 0x00188510      Physical Evade Calculation
0018a4ac: 00000000 nop
0018a4b0: 14400009 bne r2,r0,0x0018a4d8
0018a4b4: 00000000 nop
0018a4b8: 0c061760 jal 0x00185d80      Get X and MA
0018a4bc: 00000000 nop
0018a4c0: 0c0622c5 jal 0x00188b14      Hit Chance Calculation (Has superfluous checks for frog/berserk.)
0018a4c4: 00000000 nop
0018a4c8: 14400003 bne r2,r0,0x0018a4d8
0018a4cc: 00000000 nop
0018a4d0: 0c061fc9 jal 0x00187f24      Status Proc at (MA + X)%
0018a4d4: 00000000 nop
0018a4d8: 8fbf0010 lw r31,0x0010(r29)
0018a4dc: 27bd0018 addiu r29,r29,0x0018
0018a4e0: 03e00008 jr r31
0018a4e4: 00000000 nop

[51]
0018a4e8: 27bdffe8 addiu r29,r29,0xffe8
0018a4ec: afbf0010 sw r31,0x0010(r29)
0018a4f0: 0c061760 jal 0x00185d80      Get X and MA
0018a4f4: 00000000 nop
0018a4f8: 0c0617ff jal 0x00185ffc      Elemental Boost
0018a4fc: 00000000 nop
0018a500: 0c061881 jal 0x00186204      MATUP bonus
0018a504: 00000000 nop
0018a508: 0c061259 jal 0x00184964      Zodiac Calculation
0018a50c: 00000000 nop
0018a510: 0c061967 jal 0x0018659c      Set MA + X as X
0018a514: 00000000 nop
0018a518: 0c061d44 jal 0x00187510      Total Accuracy Check
0018a51c: 00000000 nop
0018a520: 3c028019 lui r2,0x8019
0018a524: 8c422d90 lw r2,0x2d90(r2)
0018a528: 00000000 nop
0018a52c: 90420000 lbu r2,0x0000(r2)
0018a530: 00000000 nop
0018a534: 10400003 beq r2,r0,0x0018a544
0018a538: 00000000 nop
0018a53c: 0c061fc9 jal 0x00187f24      Status Proc at (MA + X)%
0018a540: 00000000 nop
0018a544: 8fbf0010 lw r31,0x0010(r29)
0018a548: 27bd0018 addiu r29,r29,0x0018
0018a54c: 03e00008 jr r31
0018a550: 00000000 nop

[52]
0018a554: 3c048019 lui r4,0x8019
0018a558: 8c842d98 lw r4,0x2d98(r4)
0018a55c: 3c038019 lui r3,0x8019
0018a560: 8c632d94 lw r3,0x2d94(r3)
0018a564: 27bdffe8 addiu r29,r29,0xffe8
0018a568: 1083000a beq r4,r3,0x0018a594
0018a56c: afbf0010 sw r31,0x0010(r29)
0018a570: 9462002a lhu r2,0x002a(r3)      Damage to others routine
0018a574: 94630028 lhu r3,0x0028(r3)
0018a578: 3c048019 lui r4,0x8019
0018a57c: 8c842d90 lw r4,0x2d90(r4)
0018a580: 00431023 subu r2,r2,r3
0018a584: a4820004 sh r2,0x0004(r4)      Store Damage as Self maxHP - curHP.
0018a588: 34020080 ori r2,r0,0x0080
0018a58c: 0806296c j 0x0018a5b0
0018a590: a0820025 sb r2,0x0025(r4)      Set as HP Damage
0018a594: 3c028019 lui r2,0x8019      Damage to self routine
0018a598: 8c422d90 lw r2,0x2d90(r2)
0018a59c: 94830028 lhu r3,0x0028(r4)
0018a5a0: 00000000 nop
0018a5a4: a4430004 sh r3,0x0004(r2)      Store Damage as Target/Self curHP
0018a5a8: 34030080 ori r3,r0,0x0080
0018a5ac: a0430025 sb r3,0x0025(r2)      Set as HP damage
0018a5b0: 3c038019 lui r3,0x8019
0018a5b4: 8c632d98 lw r3,0x2d98(r3)
0018a5b8: 3c028019 lui r2,0x8019
0018a5bc: 8c422d94 lw r2,0x2d94(r2)
0018a5c0: 00000000 nop
0018a5c4: 10620003 beq r3,r2,0x0018a5d4      Only inflict status to enemies
0018a5c8: 00000000 nop
0018a5cc: 0c061fad jal 0x00187eb4      Inflict status at 100%
0018a5d0: 00000000 nop
0018a5d4: 8fbf0010 lw r31,0x0010(r29)
0018a5d8: 27bd0018 addiu r29,r29,0x0018
0018a5dc: 03e00008 jr r31
0018a5e0: 00000000 nop

[53]
0018a5e4: 27bdffe8 addiu r29,r29,0xffe8
0018a5e8: afbf0010 sw r31,0x0010(r29)
0018a5ec: 0c06216e jal 0x001885b8      Magic Evade
0018a5f0: 00000000 nop
0018a5f4: 14400018 bne r2,r0,0x0018a658
0018a5f8: 00000000 nop
0018a5fc: 0c0622a1 jal 0x00188a84      Sets (MA + X)% as hit chance
0018a600: 00000000 nop
0018a604: 14400014 bne r2,r0,0x0018a658
0018a608: 00000000 nop
0018a60c: 0c061989 jal 0x00186624      Set HP damage as Y%
0018a610: 00000000 nop
0018a614: 0c061bb4 jal 0x00186ed0      Elemental Weak
0018a618: 00000000 nop
0018a61c: 0c061bfe jal 0x00186ff8      Elemental Cancel
0018a620: 00000000 nop
0018a624: 3c028019 lui r2,0x8019
0018a628: 8c422d90 lw r2,0x2d90(r2)
0018a62c: 00000000 nop
0018a630: 90420000 lbu r2,0x0000(r2)
0018a634: 00000000 nop
0018a638: 10400007 beq r2,r0,0x0018a658      HIt Check
0018a63c: 00000000 nop
0018a640: 0c0621c7 jal 0x0018871c      Elemental Absorption
0018a644: 00000000 nop
0018a648: 14400003 bne r2,r0,0x0018a658
0018a64c: 00000000 nop
0018a650: 0c061fad jal 0x00187eb4      Inflict status at (MA + X)%
0018a654: 00000000 nop
0018a658: 8fbf0010 lw r31,0x0010(r29)
0018a65c: 27bd0018 addiu r29,r29,0x0018
0018a660: 03e00008 jr r31
0018a664: 00000000 nop

[54]
0018a668: 27bdffe8 addiu r29,r29,0xffe8
0018a66c: afbf0010 sw r31,0x0010(r29)
0018a670: 0c061725 jal 0x00185c94      Get Ability Power
0018a674: 00000000 nop
0018a678: 0c062216 jal 0x00188858      Healing Calculation
0018a67c: 00000000 nop
0018a680: 0c061d3b jal 0x001874ec      Convert HP Healing to MP Healing
0018a684: 00000000 nop
0018a688: 8fbf0010 lw r31,0x0010(r29)
0018a68c: 27bd0018 addiu r29,r29,0x0018
0018a690: 03e00008 jr r31
0018a694: 00000000 nop

[55]
0018a698: 27bdffe8 addiu r29,r29,0xffe8
0018a69c: afbf0010 sw r31,0x0010(r29)
0018a6a0: 0c06216e jal 0x001885b8      Magic Evade
0018a6a4: 00000000 nop
0018a6a8: 1440000f bne r2,r0,0x0018a6e8
0018a6ac: 00000000 nop
0018a6b0: 0c0622a1 jal 0x00188a84      Sets (MA + X)% as hit chance
0018a6b4: 00000000 nop
0018a6b8: 1440000b bne r2,r0,0x0018a6e8
0018a6bc: 00000000 nop
0018a6c0: 3c028019 lui r2,0x8019
0018a6c4: 904238fa lbu r2,0x38fa(r2)      Load Y
0018a6c8: 3c038019 lui r3,0x8019
0018a6cc: 8c632d90 lw r3,0x2d90(r3)
0018a6d0: 3042007f andi r2,r2,0x007f      Forced as decrement
0018a6d4: a0620014 sb r2,0x0014(r3)      Store PA loss as Y.
0018a6d8: 3c038019 lui r3,0x8019
0018a6dc: 8c632d90 lw r3,0x2d90(r3)
0018a6e0: 34020001 ori r2,r0,0x0001
0018a6e4: a0620025 sb r2,0x0025(r3)      Set Type as Psuedo-Status
0018a6e8: 8fbf0010 lw r31,0x0010(r29)
0018a6ec: 27bd0018 addiu r29,r29,0x0018
0018a6f0: 03e00008 jr r31
0018a6f4: 00000000 nop

[56]
0018a6f8: 27bdffe8 addiu r29,r29,0xffe8
0018a6fc: afbf0010 sw r31,0x0010(r29)
0018a700: 0c06216e jal 0x001885b8      Magic Evade
0018a704: 00000000 nop
0018a708: 1440000f bne r2,r0,0x0018a748
0018a70c: 00000000 nop
0018a710: 0c0622a1 jal 0x00188a84      Sets (MA + X)% as hit chance
0018a714: 00000000 nop
0018a718: 1440000b bne r2,r0,0x0018a748
0018a71c: 00000000 nop
0018a720: 3c028019 lui r2,0x8019
0018a724: 904238fa lbu r2,0x38fa(r2)      Load Y
0018a728: 3c038019 lui r3,0x8019
0018a72c: 8c632d90 lw r3,0x2d90(r3)
0018a730: 3042007f andi r2,r2,0x007f      Forced as decrement
0018a734: a0620015 sb r2,0x0015(r3)      Store MA loss as Y
0018a738: 3c038019 lui r3,0x8019
0018a73c: 8c632d90 lw r3,0x2d90(r3)
0018a740: 34020001 ori r2,r0,0x0001
0018a744: a0620025 sb r2,0x0025(r3)      Set type as Psuedo-status
0018a748: 8fbf0010 lw r31,0x0010(r29)
0018a74c: 27bd0018 addiu r29,r29,0x0018
0018a750: 03e00008 jr r31
0018a754: 00000000 nop

[57]
0018a758: 27bdffe0 addiu r29,r29,0xffe0
0018a75c: afbf0018 sw r31,0x0018(r29)
0018a760: afb10014 sw r17,0x0014(r29)
0018a764: 0c0620b2 jal 0x001882c8      100% HP/MP Healing
0018a768: afb00010 sw r16,0x0010(r29)
0018a76c: 0c061cd4 jal 0x00187350      Healing Calculation
0018a770: 00000000 nop
0018a774: 3c028019 lui r2,0x8019
0018a778: 8c422d98 lw r2,0x2d98(r2)
0018a77c: 00000000 nop
0018a780: 90420022 lbu r2,0x0022(r2)
0018a784: 00000000 nop
0018a788: 2c420063 sltiu r2,r2,0x0063       (Should be 0x64)
0018a78c: 14400007 bne r2,r0,0x0018a7ac
0018a790: 34060001 ori r6,r0,0x0001      Runs if target is level 99+.
0018a794: 3c028019 lui r2,0x8019
0018a798: 8c422d90 lw r2,0x2d90(r2)
0018a79c: 0c0610c3 jal 0x0018430c      ELSE MISS routine
0018a7a0: a0400025 sb r0,0x0025(r2)      Set attack as Miss
0018a7a4: 08062a03 j 0x0018a80c         GOTO end
0018a7a8: 00000000 nop
0018a7ac: 3c058019 lui r5,0x8019      Runs if target < L99.
0018a7b0: 8ca52d90 lw r5,0x2d90(r5)
0018a7b4: 00000000 nop
0018a7b8: a0a60025 sb r6,0x0025(r5)      Set type as Psuedo-Status
0018a7bc: 3c108019 lui r16,0x8019
0018a7c0: 8e102d98 lw r16,0x2d98(r16)
0018a7c4: 3c118019 lui r17,0x8019
0018a7c8: 8e312d90 lw r17,0x2d90(r17)
0018a7cc: 3c048019 lui r4,0x8019
0018a7d0: 8c842d94 lw r4,0x2d94(r4)
0018a7d4: 3c038019 lui r3,0x8019
0018a7d8: 8c632d8c lw r3,0x2d8c(r3)
0018a7dc: 34020080 ori r2,r0,0x0080
0018a7e0: a4a20010 sh r2,0x0010(r5)      +1 Level to target
0018a7e4: 3c018019 lui r1,0x8019
0018a7e8: ac242d98 sw r4,0x2d98(r1)      Set target as self
0018a7ec: 3c018019 lui r1,0x8019
0018a7f0: ac232d90 sw r3,0x2d90(r1)      Set target as self
0018a7f4: 0c061fc9 jal 0x00187f24      Add status at 100%
0018a7f8: a0660000 sb r6,0x0000(r3)      Flag as hit
0018a7fc: 3c018019 lui r1,0x8019
0018a800: ac302d98 sw r16,0x2d98(r1)      Reset target to unit selected
0018a804: 3c018019 lui r1,0x8019
0018a808: ac312d90 sw r17,0x2d90(r1)      Reset caster as caster
0018a80c: 8fbf0018 lw r31,0x0018(r29)
0018a810: 8fb10014 lw r17,0x0014(r29)
0018a814: 8fb00010 lw r16,0x0010(r29)
0018a818: 27bd0020 addiu r29,r29,0x0020
0018a81c: 03e00008 jr r31
0018a820: 00000000 nop

[58]
0018a824: 27bdffe8 addiu r29,r29,0xffe8
0018a828: afbf0010 sw r31,0x0010(r29)
0018a82c: 0c061760 jal 0x00185d80      Get MA and X
0018a830: 00000000 nop
0018a834: 0c0617ff jal 0x00185ffc      Elemental Boost
0018a838: 00000000 nop
0018a83c: 0c061881 jal 0x00186204      MATUP Boost
0018a840: 00000000 nop
0018a844: 0c061259 jal 0x00184964      Zodiac Calculation
0018a848: 00000000 nop
0018a84c: 0c061967 jal 0x0018659c      Set MA + X as X
0018a850: 00000000 nop
0018a854: 0c061d44 jal 0x00187510      Total Evasion Check
0018a858: 00000000 nop
0018a85c: 3c048019 lui r4,0x8019
0018a860: 8c842d90 lw r4,0x2d90(r4)
0018a864: 00000000 nop
0018a868: 90820000 lbu r2,0x0000(r4)
0018a86c: 00000000 nop
0018a870: 10400021 beq r2,r0,0x0018a8f8
0018a874: 00000000 nop
0018a878: 3c038019 lui r3,0x8019
0018a87c: 8c632d98 lw r3,0x2d98(r3)
0018a880: 00000000 nop
0018a884: 90620005 lbu r2,0x0005(r3)
0018a888: 00000000 nop
0018a88c: 30420004 andi r2,r2,0x0004
0018a890: 14400017 bne r2,r0,0x0018a8f0      Immortal Check
0018a894: 00000000 nop
0018a898: 90620182 lbu r2,0x0182(r3)
0018a89c: 00000000 nop
0018a8a0: 14400013 bne r2,r0,0x0018a8f0      Rider/Water Check
0018a8a4: 00000000 nop
0018a8a8: 90620000 lbu r2,0x0000(r3)
0018a8ac: 00000000 nop
0018a8b0: 2442ff80 addiu r2,r2,0xff80
0018a8b4: 304200ff andi r2,r2,0x00ff      Unit Type (8?) + 0x80
0018a8b8: 2c420003 sltiu r2,r2,0x0003
0018a8bc: 1040000c beq r2,r0,0x0018a8f0      
0018a8c0: 00000000 nop
0018a8c4: 90620003 lbu r2,0x0003(r3)      Run only if unit is generic; Loads job class
0018a8c8: 00000000 nop
0018a8cc: 2442007e addiu r2,r2,0x007e
0018a8d0: 304200ff andi r2,r2,0x00ff      r2 = Job Class + 0x7e
0018a8d4: 2c420003 sltiu r2,r2,0x0003      
0018a8d8: 14400005 bne r2,r0,0x0018a8f0      Check if already murbol
0018a8dc: 34020002 ori r2,r0,0x0002
0018a8e0: a4820010 sh r2,0x0010(r4)      Turn unit into murbol
0018a8e4: 34020001 ori r2,r0,0x0001
0018a8e8: 08062a3e j 0x0018a8f8
0018a8ec: a0820025 sb r2,0x0025(r4)      Set as Psuedo-Status
0018a8f0: 0c0610c3 jal 0x0018430c      ELSE MISS Routine
0018a8f4: 00000000 nop
0018a8f8: 8fbf0010 lw r31,0x0010(r29)
0018a8fc: 27bd0018 addiu r29,r29,0x0018
0018a900: 03e00008 jr r31
0018a904: 00000000 nop

[59]
0018a908: 27bdffe8 addiu r29,r29,0xffe8
0018a90c: afbf0010 sw r31,0x0010(r29)
0018a910: 0c06216e jal 0x001885b8      Magic Evade
0018a914: 00000000 nop
0018a918: 14400015 bne r2,r0,0x0018a970
0018a91c: 00000000 nop
0018a920: 0c0622a1 jal 0x00188a84      Set (MA + X)% as evade
0018a924: 00000000 nop
0018a928: 14400011 bne r2,r0,0x0018a970
0018a92c: 00000000 nop
0018a930: 3c028019 lui r2,0x8019
0018a934: 8c422d98 lw r2,0x2d98(r2)
0018a938: 00000000 nop
0018a93c: 90420022 lbu r2,0x0022(r2)      Load Level
0018a940: 00000000 nop
0018a944: 2c420002 sltiu r2,r2,0x0002
0018a948: 10400003 beq r2,r0,0x0018a958      Check to make sure target Lv > 1
0018a94c: 00000000 nop
0018a950: 0c0610c3 jal 0x0018430c      ELSE MISS
0018a954: 00000000 nop
0018a958: 3c028019 lui r2,0x8019
0018a95c: 8c422d90 lw r2,0x2d90(r2)
0018a960: 34030100 ori r3,r0,0x0100
0018a964: a4430010 sh r3,0x0010(r2)      -1 Level
0018a968: 34030001 ori r3,r0,0x0001
0018a96c: a0430025 sb r3,0x0025(r2)      Set as Pseudo-Status
0018a970: 8fbf0010 lw r31,0x0010(r29)
0018a974: 27bd0018 addiu r29,r29,0x0018
0018a978: 03e00008 jr r31
0018a97c: 00000000 nop

[5a]
0018a980: 27bdffe8 addiu r29,r29,0xffe8
0018a984: afbf0010 sw r31,0x0010(r29)
0018a988: 0c061d6f jal 0x001875bc      Dragon Check
0018a98c: 00000000 nop
0018a990: 3c028019 lui r2,0x8019
0018a994: 8c422d90 lw r2,0x2d90(r2)
0018a998: 00000000 nop
0018a99c: 90420000 lbu r2,0x0000(r2)
0018a9a0: 00000000 nop
0018a9a4: 10400003 beq r2,r0,0x0018a9b4      Check if evaded (Already done above)
0018a9a8: 00000000 nop
0018a9ac: 0c061fc9 jal 0x00187f24      Status Proc at 100%
0018a9b0: 00000000 nop
0018a9b4: 8fbf0010 lw r31,0x0010(r29)
0018a9b8: 27bd0018 addiu r29,r29,0x0018
0018a9bc: 03e00008 jr r31
0018a9c0: 00000000 nop

[5b]
0018a9c4: 27bdffe8 addiu r29,r29,0xffe8
0018a9c8: afbf0010 sw r31,0x0010(r29)
0018a9cc: 0c061d6f jal 0x001875bc      Dragon Check
0018a9d0: 00000000 nop
0018a9d4: 3c028019 lui r2,0x8019
0018a9d8: 8c422d90 lw r2,0x2d90(r2)
0018a9dc: 00000000 nop
0018a9e0: 90420000 lbu r2,0x0000(r2)
0018a9e4: 00000000 nop
0018a9e8: 10400005 beq r2,r0,0x0018aa00      Check if evaded
(Already done above)
0018a9ec: 00000000 nop
0018a9f0: 0c061b6f jal 0x00186dbc      Wish Routine
0018a9f4: 00000000 nop
0018a9f8: 0c061fad jal 0x00187eb4      Status Proc at 100%
0018a9fc: 00000000 nop
0018aa00: 8fbf0010 lw r31,0x0010(r29)
0018aa04: 27bd0018 addiu r29,r29,0x0018
0018aa08: 03e00008 jr r31
0018aa0c: 00000000 nop

[5c]
0018aa10: 27bdffe8 addiu r29,r29,0xffe8
0018aa14: afbf0010 sw r31,0x0010(r29)
0018aa18: 0c061d6f jal 0x001875bc      Dragon Check
0018aa1c: 00000000 nop
0018aa20: 3c028019 lui r2,0x8019
0018aa24: 8c422d90 lw r2,0x2d90(r2)
0018aa28: 00000000 nop
0018aa2c: 90420000 lbu r2,0x0000(r2)
0018aa30: 00000000 nop
0018aa34: 10400003 beq r2,r0,0x0018aa44      Check if evaded
(Already done above)
0018aa38: 00000000 nop
0018aa3c: 0c061b56 jal 0x00186d58      Scream Routine
0018aa40: 00000000 nop
0018aa44: 8fbf0010 lw r31,0x0010(r29)
0018aa48: 27bd0018 addiu r29,r29,0x0018
0018aa4c: 03e00008 jr r31
0018aa50: 00000000 nop

[5d]
0018aa54: 27bdffe8 addiu r29,r29,0xffe8
0018aa58: afbf0010 sw r31,0x0010(r29)
0018aa5c: 0c061d6f jal 0x001875bc      Dragon Check
0018aa60: 00000000 nop
0018aa64: 3c028019 lui r2,0x8019
0018aa68: 8c422d90 lw r2,0x2d90(r2)
0018aa6c: 00000000 nop
0018aa70: 90420000 lbu r2,0x0000(r2)
0018aa74: 00000000 nop
0018aa78: 10400003 beq r2,r0,0x0018aa88      Check if evaded
(Already done above)
0018aa7c: 00000000 nop
0018aa80: 0c061e0f jal 0x0018783c      Quick Effect at 100%
0018aa84: 00000000 nop
0018aa88: 8fbf0010 lw r31,0x0010(r29)
0018aa8c: 27bd0018 addiu r29,r29,0x0018
0018aa90: 03e00008 jr r31
0018aa94: 00000000 nop

[5e]
0018aa98: 27bdffe8 addiu r29,r29,0xffe8
0018aa9c: afbf0010 sw r31,0x0010(r29)
0018aaa0: 0c06216e jal 0x001885b8      Magic Evade
0018aaa4: 00000000 nop
0018aaa8: 14400003 bne r2,r0,0x0018aab8
0018aaac: 00000000 nop
0018aab0: 0c062269 jal 0x001889a4      Truth Formula
0018aab4: 00000000 nop
0018aab8: 8fbf0010 lw r31,0x0010(r29)
0018aabc: 27bd0018 addiu r29,r29,0x0018
0018aac0: 03e00008 jr r31
0018aac4: 00000000 nop
(Repeat of 1E)

[5f]
0018aac8: 27bdffe8 addiu r29,r29,0xffe8
0018aacc: afbf0010 sw r31,0x0010(r29)
0018aad0: 0c06216e jal 0x001885b8      Magic Evade
0018aad4: 00000000 nop
0018aad8: 14400003 bne r2,r0,0x0018aae8
0018aadc: 00000000 nop
0018aae0: 0c062269 jal 0x001889a4      Truth Formula
0018aae4: 00000000 nop
0018aae8: 8fbf0010 lw r31,0x0010(r29)
0018aaec: 27bd0018 addiu r29,r29,0x0018
0018aaf0: 03e00008 jr r31
0018aaf4: 00000000 nop
(Repeat of 1E)

[60]
0018aaf8: 27bdffe8 addiu r29,r29,0xffe8
0018aafc: afbf0010 sw r31,0x0010(r29)
0018ab00: 0c062269 jal 0x001889a4      Truth Formula
0018ab04: 00000000 nop
0018ab08: 8fbf0010 lw r31,0x0010(r29)
0018ab0c: 27bd0018 addiu r29,r29,0x0018
0018ab10: 03e00008 jr r31
0018ab14: 00000000 nop

[61]
0018ab18: 27bdffe8 addiu r29,r29,0xffe8
0018ab1c: afbf0010 sw r31,0x0010(r29)
0018ab20: 0c06216e jal 0x001885b8      Magic Evade
0018ab24: 00000000 nop
0018ab28: 14400007 bne r2,r0,0x0018ab48
0018ab2c: 00000000 nop
0018ab30: 0c062289 jal 0x00188a24               Evade = (MA + X)*Faith%      
0018ab34: 00000000 nop
0018ab38: 14400003 bne r2,r0,0x0018ab48
0018ab3c: 00000000 nop
0018ab40: 0c061ba9 jal 0x00186ea4      -Y Brave Routine
0018ab44: 00000000 nop
0018ab48: 8fbf0010 lw r31,0x0010(r29)
0018ab4c: 27bd0018 addiu r29,r29,0x0018
0018ab50: 03e00008 jr r31
0018ab54: 00000000 nop

[62]
0018ab58: 27bdffe8 addiu r29,r29,0xffe8
0018ab5c: afbf0010 sw r31,0x0010(r29)
0018ab60: 0c06216e jal 0x001885b8      Magic Evade
0018ab64: 00000000 nop
0018ab68: 14400007 bne r2,r0,0x0018ab88
0018ab6c: 00000000 nop
0018ab70: 0c0622a1 jal 0x00188a84      Evade = (MA + x)%
0018ab74: 00000000 nop
0018ab78: 14400003 bne r2,r0,0x0018ab88
0018ab7c: 00000000 nop
0018ab80: 0c061ba9 jal 0x00186ea4      -Y Brave Routine
0018ab84: 00000000 nop
0018ab88: 8fbf0010 lw r31,0x0010(r29)
0018ab8c: 27bd0018 addiu r29,r29,0x0018
0018ab90: 03e00008 jr r31
0018ab94: 00000000 nop

[63]
0018ab98: 27bdffe8 addiu r29,r29,0xffe8
0018ab9c: afbf0010 sw r31,0x0010(r29)
0018aba0: 0c0620eb jal 0x001883ac      Throw/Catch Routine
0018aba4: 00000000 nop
0018aba8: 3c028019 lui r2,0x8019
0018abac: 8c422d90 lw r2,0x2d90(r2)
0018abb0: 00000000 nop
0018abb4: 90420000 lbu r2,0x0000(r2)
0018abb8: 00000000 nop
0018abbc: 1040001d beq r2,r0,0x0018ac34      Evasion Check
(Already checked above.)
0018abc0: 00000000 nop
0018abc4: 0c062144 jal 0x00188510      Physical Evasion
0018abc8: 00000000 nop
0018abcc: 14400019 bne r2,r0,0x0018ac34
0018abd0: 00000000 nop
0018abd4: 3c028019 lui r2,0x8019
0018abd8: 8c422d94 lw r2,0x2d94(r2)
0018abdc: 3c038019 lui r3,0x8019
0018abe0: 90633902 lbu r3,0x3902(r3)      Load WP
0018abe4: 90420038 lbu r2,0x0038(r2)      Load SP
0018abe8: 3c018019 lui r1,0x8019
0018abec: a42338d0 sh r3,0x38d0(r1)      Store WP as Y
0018abf0: 3c018019 lui r1,0x8019
0018abf4: a42238ce sh r2,0x38ce(r1)      Store SP as X
0018abf8: 0c0622b7 jal 0x00188adc      Damage Modifiers
0018abfc: 00000000 nop
0018ac00: 0c06195a jal 0x00186568      Damage Calculation (No elemental checks)
0018ac04: 00000000 nop
0018ac08: 0c061bf4 jal 0x00186fd0      Weapon Elemental (Fixed by Xifanie.)
0018ac0c: 00000000 nop
0018ac10: 3c028019 lui r2,0x8019
0018ac14: 8c422d90 lw r2,0x2d90(r2)
0018ac18: 00000000 nop
0018ac1c: 90420000 lbu r2,0x0000(r2)
0018ac20: 00000000 nop
0018ac24: 10400003 beq r2,r0,0x0018ac34
0018ac28: 00000000 nop
0018ac2c: 0c061c3f jal 0x001870fc      Elemental Absorption
0018ac30: 00000000 nop
0018ac34: 8fbf0010 lw r31,0x0010(r29)
0018ac38: 27bd0018 addiu r29,r29,0x0018
0018ac3c: 03e00008 jr r31
0018ac40: 00000000 nop

[64]
0018ac44: 27bdffe8 addiu r29,r29,0xffe8
0018ac48: afbf0010 sw r31,0x0010(r29)
0018ac4c: 0c0617a5 jal 0x00185e94      PA * Brave / 100 = Y (PA * 3/2 if weapon if polearm)
0018ac50: 00000000 nop
0018ac54: 0c0622b7 jal 0x00188adc      Damage Modifiers
0018ac58: 00000000 nop
0018ac5c: 0c06195a jal 0x00186568      Damage Calculation  (No elemental checks)
0018ac60: 00000000 nop
0018ac64: 8fbf0010 lw r31,0x0010(r29)
0018ac68: 27bd0018 addiu r29,r29,0x0018
0018ac6c: 03e00008 jr r31
0018ac70: 00000000 nop


Note:
Figured some things out by looking at Pokeytax's notes
1) +1 Level = 0x80 at 0x10 + 0x192d8c (self) or 0x192d90 (foe)
2) Switch Team = 0x40 at 0x10 + 0x192d8c (self) or 0x192d90 (foe)
3) Steal Item = 0x10 at 0x10 + 0x192d8c (self) or 0x192d90 (foe)
4) Break Item = 0x4 at 0x10 + 0x192d8c (self) or 0x192d90 (foe)
5) Unit is now murbol = 0x2 at 0x10 + 0x192d8c (self) or 0x192d90 (foe)
3) Target has golem = 0x1 at 0x10 + 0x192d8c (self) or 0x192d90 (foe)
6) -1 Level = 0x1 at 0x11 + 0x192d8c (self) or 0x192d90 (foe)

39 and 3A could easily be merged with X.
However, changing 40 is nowhere as easy because to load a status effect, you need to load a byte (5 different options) and each byte could have any value from 0-FF.  Hence, you'd need two variables to be able to check for any status.
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

48, 49, 4B - Perhaps the weapon routine that sets formula 0 for abilities could be used as a base to make these load Y instead of Z if it detects NOT an item ability.

5A ~ 5D - Now having the address of the subroutine that checks for Dragons, I would definitely encourage some enterprising ASM hacker to consider modding it to check for monster type based on the value of Y. This would conflict with some of the existing Dragon formulas, but those can be changed anyway. I think we can all agree that having a double of Shout that only works on Dragons is redundant. I would immediately suggest an attack formula with a power boost so Hunters can have their XX Killer abilities.
  • Modding version: Other/Unknown
¯\(°_0)/¯

formerdeathcorps

January 17, 2011, 07:01:40 am #10 Last Edit: January 17, 2011, 04:47:25 pm by formerdeathcorps
All right: time to post my formula hacks.  Again, this will be done in parts, for it is very large.

Note, the following assumes you are using my gun damage fix.

BATTLE.BIN
0x121B64
E8FFBD27
1000BFAF
4421060C
00000000
16004014
00000000
8E21060C
00000000
12004014
00000000
1980023C
E5384394
00000000
FEFF6224
0A004010
00000000
F9FF6224
03004014
00000000
921C060C
00000000
AD1F060C
00000000
F4220608
00000000
B91D060C
00000000
1000BF8F
1800BD27
0800E003
00000000

BATTLE.BIN
0x128618
64
0x12861C
64
0x128624
648B
0x128628
648B



BATTLE.BIN
0x121BE0
E8 FF BD 27
10 00 BF AF
CC 1D 06 0C
00 00 00 00
19 80 02 3C
02 39 42 90
19 80 03 3C
FA 38 63 90
19 80 01 3C
CE 38 22 A4
19 80 01 3C
D0 38 23 A4
E0 17 06 0C
00 00 00 00
E9 17 06 0C
00 00 00 00
D1 21 06 0C
00 00 00 00
DF 21 06 0C
00 00 00 00
E7 FF 40 14
00 00 00 00
54 1C 06 0C
00 00 00 00
3F 1C 06 0C
00 00 00 00
EE 22 06 08
00 00 00 00

BATTLE.BIN
0x128620
E08B



BATTLE.BIN
0x121C50
E8 FF BD 27
10 00 BF AF
A7 16 06 0C
00 00 00 00
E0 17 06 0C
00 00 00 00
E9 17 06 0C
00 00 00 00
7E 21 06 0C
00 00 00 00
5A 19 06 0C
00 00 00 00
F4 1B 06 0C
00 00 00 00
D4 1C 06 0C
00 00 00 00
EE 22 06 08
00 00 00 00

BATTLE.BIN
0x12862C
508C
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

what do you mean by "allows procs"?

And the "functions like 2d" means that thing you mentioned before about it having 100% Status, right?
  • Modding version: Other/Unknown
¯\(°_0)/¯

formerdeathcorps

"Allows procs" was a feature I didn't add to the weapon formulas because I realized weapon attacks would mess it up.  It will, however, be added to all other formulas.  It allows you to use an unused tab to toggle status/spell procs.  I also intend to use another toggle to which will determine whether P/M-EV is used and whether it's classified as physical or magical damage.
Yes, "functions like 2D" means 100% with All or Nothing, Cancel, or Random and 25% on Separate.  If set to spell procs, they will occur at 100%.

An example of this will be given tonight.
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

January 17, 2011, 06:22:07 pm #13 Last Edit: January 17, 2011, 10:58:31 pm by RavenOfRazgriz
That sounds rather great for consolidating a lot of the damage based formulas and giving them more utility.  Will you also be using those suggestions I gave you for consolidating the various Hit_F(MA+X) formulas, Hit_(MA+X) formulas, (Stat)+(Y) formulas, Hit_(Stat)+/-(Y) formulas, and Hit_F(Stat)+/-(Y) formulas as well?  They'd give full control of all stat and status manipulation centered in a compact 7 formula vs the retardation Square used to get not even half the effect so it seems like a waste not to.

E: In addition to our discussion before, I recommend letting those stat formulas reference CT as well, so skills that boost the current CT of a unit can be made as well, if possible.  More utility is never bad after all.

E2: Is the Cheer Up one even needed?  Can an unevadable Hit_(MA+255) even be dodged?  My memory is flaky as to whether the game treats taking Compat out of 100 or out of the 255+ in that situation.

E3: Actually... couldn't you use a signed byte for the Y value in Hit_(Stat)+(Y) and Hit_F(Stat)+(Y), further reducing it to two formula to control all forms of stat increments and decrements while the two aforementioned Hit_(MA+X) Evade(Y) and Hit_F(MA+X) Evade(Y) controlled all the status related stuff?

When you get to disassembling it's code more, could the third unused flag be used to determine Knockback?  I know I've bugged you on that about probably 3-4 times now but it's one of those things that could actually be used to create huge strategic implications if it could be used on more than one formula outside of Critical Hits.

formerdeathcorps

January 18, 2011, 07:40:16 am #14 Last Edit: January 23, 2011, 01:17:52 pm by formerdeathcorps
E1 and 3: I intend to do all that.
E2: MA + 255 without evasion can miss between shell/MADEF/worst compatibility/elemental half/null.  If it's "curative", then the first two don't apply.
Knock Back: I'm not sure.  I already know how to add it, but I'm not sure knockback's the best use.  Maybe a flag to load healing/cancel status checks to help me save more space while allowing any formula to heal or ignore protect/supports?

Note, my following hack assigns commands to Kanji-space.  This is temporary as I try to fully realize my efficiency gains.  Once all the formulas are coded, I'll likely move this back into the main formula routine space.
Also, the following hack hard-codes the Work formula to deal 25% damage as recoil as default.  It will be noted, so future hackers may freely change it.
Lastly, this hack depends on the other consolidation hack for weapon formulas for certain offsets.


BATTLE.BIN
0xF2098 //Katana Break
E8FFBD27
1000BFAF
1980023C
E5384294
00000000
E0FF4224
0400422C
03004010
00000000
441E060C
00000000
1000BF8F
1800BD27
0800E003
00000000

BATTLE.BIN
0xF20D4 //Toggle for Physical/Magical
E8FFBD27
1000BFAF
1980023C
F3384290
00000000
80004230
05004010 //Toggled means M-EV
00000000
6E21060C
00000000
45640508
01000424
4421060C
00000000
00000424
1000BF8F
1800BD27
0800E003
00000000

BATTLE.BIN
0xF2120 //Toggle for Spell/Status Proc
1980023C
F3384290
00000000
40004230 //Toggled means spell proc.
03004010
00000000
F2220608
00000000
EE220608
00000000

BATTLE.BIN
0x11EC94 //Loads any stat instead of MA, referenced by X.  ASM may fail.
1980023C
942D428C
1980033C
F9386190
21104100 //Fear rides on this line...if fail, move to free space and add nop
00004290
FA386190 //Ditto
00000000
CE3862A4
0800E003
D03861A4

BATTLE.BIN
0x121C98  //Main Routine
E8FFBD27
1000BFAF
2664050C
00000000
3564050C
00000000
C7FF4014
00000000
2517060C
00000000
FF17060C
00000000
19008014
00000000
D121060C
00000000
1980023C
E5384294
00000000
C9FF4224
0100422C
21004014
00000000
DF21060C
00000000
B3FF4014
00000000
1980023C
E5384294
00000000
F8FF4224
0100422C
24004010
00000000
541C060C
00000000
6B230608
00000000
5318060C
00000000
B722060C
00000000
3E19060C
00000000
1980023C
E5384294
00000000
C9FF4224
0100422C
05004010
00000000
471A060C
00000000
60230608
00000000
5A19060C
00000000
B41B060C
00000000
FE1B060C
00000000
1980023C
902D428C
00000000
00004290
00000000
8AFF4010
00000000
C721060C
00000000
86FF4014
00000000
1980043C
902D848C
00000000
04008190
00000000
03002014
00000000
06008194
01000434
1980023C
E5384294
00000000
DFFF4324
0100632C
10006014
00000000
BEFF4324
0100632C
13006010
00000000
1B80023C
8C2D428C
01000334
000043A0
80000334
250043A0
83180100 //Recoil is 25%
040043A4
00000000
9C230608
00000000
1980033C
902D638C
07008014
00000000
20000434
250064A0
040060A4
080061A4
9C230608
00000000
10000434
250064A0
060060A4
0A0061A4
48640508
00000000

BATTLE.BIN
0x128630
988C
0x128690
988C
0x128694
988C
0x1286EC
988C
0x128718
988C
0x128748
988C


The above disables formula 09 (demi).  Until I upload my fixes for that formula, test this at your own risk.
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

January 18, 2011, 02:28:00 pm #15 Last Edit: January 18, 2011, 03:43:16 pm by RavenOfRazgriz
Allowing any formula to heal is as simple as making better use of elements - the only problem in that method is Undead Reverse but I can't imagine that not being something that could be fixed.  Though... are there unused flags in the Inflict Status window?  One could very easily rig one of those to trigger Knockback as well if they exist, though that means any skill that wants to inflict more than just Knockback needs unique Inflict Statuses.  Either that or possibly making use of any empty toggles in the Learn with JP / Learn on Hit / etc boxes?  I'm all for saving as much space as humanly possible, but Knockback needs a huge sum of love too.

I've thought on it more, and I really think you should make a secondary version of this hack with vanilla's Work Formula if you can since your change costs utility to gain it, and I can easily imagine people wanting the old utility more than the new one.  

When your notes say "ASM may fail" does that mean it is imperfect and you still need to update it or that it jumps to a backup that covers it when it fails?  Also, you should probably say which checkboxes on Patcher toggle which item.

E: Is it safe to assume for Steal Equipment / Equipment Break / Mighty Sword, the unused variable will be used to determine which equipment slot is affected?  If so, is it possible to merge this check to incorporate PA / MA / SP / CT / HP / MP / etc. to max out the versatility of all three relevant formula and bomb Formula 2B entirely?  Actually making the game be able to handle what to do if a stat is "stolen" would be another matter, but I'd tell people not to do that for now and call that something for another day since I'd assume they'd all draw from the same X variable.

formerdeathcorps

January 18, 2011, 05:32:36 pm #16 Last Edit: January 18, 2011, 05:33:18 pm by formerdeathcorps
No, if you convert damage to healing, you still run into evasion, defense/magic defense UP, shell/protect, and reaction triggers.  Hence, I actually can't easily consolidate healing spells with damage spells because of the missing checks on the former.

The flags used are the first two blank ability flags, the two above "Ranged Weapon".

E: No, the unused variable does not determine that; the game hard-codes the matter by checking the used ability's number.  Similarly, the game checks ability numbers to determine whether PA/MA/SP is reduced.  Although I can put two hard-code subroutines in one function as long as it's impossible to run both (while having maintenance block both), I won't put the weapon break sequences in the same routine because the formula used will be totally different (the only common check will be maintenance).  I'll likely fuse all the stat/up down formulas (maybe even Demi/Gravi2/Mute) into this instead (and ignore maintenance on HP/MP damage).
However, we still face the classic problem of insufficient variables for full customization:
1) Accuracy is (Stat1 + Y)%  (2 Variables)
2) Effect is +/-(X) to Stat2 (2 more variables...treat X as unsigned% if HP or MP)
The question now really is this....which variable is most important?  I think Square got it right by setting X (which should include boosts and decrements) and Y as the most important, meaning I should hard-code formulas to use different Stat1 depending on the formula (PA/MA/SP + Y and the faith variants of those...so six possibilities) and rework hard-coding to make Stat2 dependent on modular arithmetic (mod 8 since we have CT/maxHP/maxMP/PA/MA/SP/Faith/Brave) based on the ability slot's number.
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 January 18, 2011, 05:32:36 pmThe flags used are the first two blank ability flags, the two above "Ranged Weapon".


This doesn't tell which is which...

Quote from: formerdeathcorps on January 18, 2011, 05:32:36 pmNo, the unused variable does not determine that; the game hard-codes the matter by checking the used ability's number.  Similarly, the game checks ability numbers to determine whether PA/MA/SP is reduced.  Although I can put two hard-code subroutines in one function as long as it's impossible to run both (while having maintenance block both), I won't put the weapon break sequences in the same routine because the formula used will be totally different (the only common check will be maintenance).  I'll likely fuse all the stat/up down formulas (maybe even Demi/Gravi2/Mute) into this instead (and ignore maintenance on HP/MP damage).


I see.  So the garbage hardcoding is going to be maintained currently, but a bunch of stuff is going to be crunched together.  It's a wash, I guess, but still seems rather mediocre.

Quote from: formerdeathcorps on January 18, 2011, 05:32:36 pmThe question now really is this....which variable is most important?  I think Square got it right by setting X (which should include boosts and decrements) and Y as the most important, meaning I should hard-code formulas to use different Stat1 depending on the formula (PA/MA/SP + Y and the faith variants of those...so six possibilities) and rework hard-coding to make Stat2 dependent on modular arithmetic (mod 8 since we have CT/maxHP/maxMP/PA/MA/SP/Faith/Brave) based on the ability slot's number.


I see.  I feel it's worth pointing out though that the changes we discussed to the Beaking and Foxbird formulas basically makes this pointless and lets you just gut all the involved hardcoding related to it though, unless I'm missing something.  Though I realized my previous examples for those formula were a bit flawed.  Using Hit_F(MA+X) (Y), where Y controls the stat and operation done and every increment of 16 (0-255) is the flag.  So say, 0-15 is -1-16 PA, 16-31 is -1-16 MA, 127-143 is +1-16 PA, etc., or possibly use a less "even" version that leaves more space allocated for Br/Fa since most PA/MA reductions never break 5 each anyway.  If you can do this, you can then dupe the two formula with a (PA+X) input and again with a (SP+X) input, avoiding all the hardcoding altogether and possibly dedicating it to other things.

If you don't get what I'm trying to say here, PM me or try to get me on Mibbit, since I think this is probably your best bet for saving fucktons of space and dodging fucktons of hardcoding simultaneously and uses lower net formula slots.

Vanya

Quote from: formerdeathcorps on January 18, 2011, 05:32:36 pm
No, if you convert damage to healing, you still run into evasion, defense/magic defense UP, shell/protect, and reaction triggers.  Hence, I actually can't easily consolidate healing spells with damage spells because of the missing checks on the former.


If you had a flag that marked a skill as healing rather than damaging couldn't you use that same flag to bypass said checks with a simple jump in the main formula?
  • Modding version: Other/Unknown
¯\(°_0)/¯

formerdeathcorps

The upper flag, if flagged, is M-EV and Shell/MADEF.  Otherwise, it defaults to P-EV (works only if evadable is also checked), and will consider Protect/DEFUP/Critical Hits.
The lower flag, if flagged, allows spell procs.  Otherwise, it defaults to status procs.

QuoteIf you had a flag that marked a skill as healing rather than damaging couldn't you use that same flag to bypass said checks with a simple jump in the main formula?

Exactly why I want it.  However, Raven is right; the tactical features wouldn't be too impressive.  Hence why I'm in a quandary.

QuoteWhen your notes say "ASM may fail" does that mean it is imperfect and you still need to update it or that it jumps to a backup that covers it when it fails?

It means that my tests wrote to Kanji-space but I realized I could improve on Square's coding in the original get MA and Y routine without wasting space, but it's untested (and is missing a few of the safety NOP commands I used when I wrote to Kanji-space), and hence, may screw up.

QuoteI see.  So the garbage hardcoding is going to be maintained currently, but a bunch of stuff is going to be crunched together.  It's a wash, I guess, but still seems rather mediocre.

Already addressed this with you in iRC, but for anyone who doesn't understand my post:
Stats lowered will be assigned by applying modular arithmetic to the skill numbers.  This means skill numbers {1, 9, 11, 19...} would lower PA, {2, A, 12, 1A...} would lower MA, and so on, through all 8 stats.
Y influences hit rate.  This can be fixed by FFTP.
X (fixable by FFTP) influences decrement/boost.  Numbers that are less than 0x80 decrement by X.  Numbers that are higher than 0x80 boost by the amount X - 0x80.  Maintenance will void status if X < 0x80.
The status checked by hit rate is fixed and will be determined by the formula.  Since there are lots of formulas that boost/lower stats, we can easily spare 9 of them to check for ({PA, MA, SP, 0} + X)*{Faith, 1} OR (100%).  This means that we should be able to free up formula numbers that are usable for totally new formulas (yes, I'll take suggestions for those now).

To be honest, however, considering how FFT checks for damage, I probably will not lump HP/MP % damage with stat decrements.  It would be too messy.
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.