

 [December 21, 2016, 09:33:38 PM]

« Reply #54 on: December 21, 2016, 09:33:38 PM »
k, I'm back I'll add pictures later on.
Cone AoE (v2) Version 1.09 Creates Cone AoE. Enable this on any skill by flagging both Linear and Tri Direction AoE flags. Uses Kanji Space. Uses lines 0x1557fc  0x155b04. 194 Lines. Does not work with Direct/Stop at Obstacle or Weapon Range, as neither does Linear/Tri AoE. Does not work with Auto Target, so give it a nonzero range. Don't even think about targeting yourselves, you derps. Designed to emulate Linear/Tri's behaviors including being dependent on the caster panel to be generated. 0017bb24: Targeting Routine (0x0017b874)
0017bb24: 06000234 ori r2,r0,0x0006 0017bb28: FF55050C jal 0x001557fc 0017bb2c: 00000000 nop 0017bb30: 02004014 bne r2,r0,0x0017bb3c 0017bb34: 1000A427 addiu r4,r29,0x0010 Needed for Ally/Enemy Targeting Routine 0017bb38: 0C56050C jal 0x00155830 Cone Generation Routine 0017bb3c: 00000000 nop 0017bb40: 0300A010 beq r5,r0,0x0017bb50 Branch if not flagged as Linear/Tri 0017bb44: C0003032 andi r16,r17,0x00c0 0017bb48: 9AEF050C jal 0x0017be68 Linear/Tri Generation Routine 0017bb4c: 00000000 nop
========================================================
Morbol Virus Depth Check (0x00179204)
00179214: 00004126 addiu r1,r18,0x0000 Saves Target Tile Vertical
========================================================
001557fc: Parse Linear AoE Flags Routine
001557fc: 06002632 andi r6,r17,0x0006 False if flagged as Cone (Linear + Tri) 00155800: 09004610 beq r2,r6,0x00155828 Branch if Cone AoE 00155804: 00000234 ori r2,r0,0x0000 r2 = Cone AoE 00155808: 02000234 ori r2,r0,0x0002 0015580c: 0600C210 beq r6,r2,0x00155828 Branch if Tri Linear AoE 00155810: 03000534 ori r5,r0,0x0003 r5 = 3 (Tri Linear Value) 00155814: 04000234 ori r2,r0,0x0004 00155818: 0300C210 beq r6,r2,0x00155828 Branch if Linear AoE 0015581c: 01000534 ori r5,r0,0x0001 r5 = 1 (Linear Value) 00155820: FF000234 ori r2,r0,0x00ff r2 = 1 (No Value) 00155824: 00000534 ori r5,r0,0x0000 00155828: 0800E003 jr r31 0015582c: 00002F24 addiu r15,r1,0x0000 r15 = Target Tile Vertical
========================================================================
00155830: AoE Flagging Routine
r5 = IsLinear/Tri? (1,3,0) r15 = Target Tile Vertical r16 = Unit Y r17 = Unit X r18 = Target X r19 = Direction r20 = Target Y r21 = Vertical
00155830: C0FFBD27 addiu r29,r29,0x0040 Pointer Memory  40 00155834: 1000A527 addiu r5,r29,0x0010 00155838: 3C00BFAF sw r31,0x003c(r29) 0015583c: 3800B4AF sw r20,0x0038(r29) 00155840: 3400B3AF sw r19,0x0034(r29) 00155844: 3000B2AF sw r18,0x0030(r29) 00155848: 2C00B1AF sw r17,0x002c(r29) 0015584c: 8B78010C jal 0x0005e22c Transfer Attacker/Self ID Routine 00155850: 2800B0AF sw r16,0x0028(r29) 00155854: 1000A393 lbu r3,0x0010(r29) Load Attacker/Self ID 00155858: 1C00B287 lh r18,0x001c(r29) Load Target X 0015585c: 2000B487 lh r20,0x0020(r29) Load Target Y 00155860: 01000234 ori r2,r0,0x0001 r2 = 1 00155864: 1980013C lui r1,0x8019 00155868: F8F422AC sw r2,0x0b08(r1) Linear Attack = True 0015586c: C0100300 sll r2,r3,0x03 00155870: 23104300 subu r2,r2,r3 00155874: 80110200 sll r2,r2,0x06 00155878: 1980033C lui r3,0x8019 0015587c: CC086324 addiu r3,r3,0x08cc Load Unit Data 00155880: 21104300 addu r2,r2,r3 00155884: 47005190 lbu r17,0x0047(r2) Load Unit's X 00155888: 48005090 lbu r16,0x0048(r2) Load Unit's Y
0015588c: 2A103202 slt r2,r17,r18 00155890: 04004010 beq r2,r0,0x001558a4 Branch if Unit X >= Target X is not true 00155894: 01001334 ori r19,r0,0x0001 Direction = +X 00155898: 5856050C jal 0x00155960 Cone Generation Routine 0015589c: 00000000 nop 001558a0: 3A560508 j 0x001558e8 001558a4: 2A105102 slt r2,r18,r17 001558a8: 04004010 beq r2,r0,0x001558bc Branch if Target X >= Unit X is not true 001558ac: FF001334 ori r19,r0,0x00ff Direction = X 001558b0: 5856050C jal 0x00155960 Cone Generation Routine 001558b4: 00000000 nop 001558b8: 3A560508 j 0x001558e8 001558bc: 2A101402 slt r2,r16,r20 001558c0: 04004010 beq r2,r0,0x001558d4 Branch if Unit Y >= Target Y is not true 001558c4: 00011334 ori r19,r0,0x0100 Direction = +Y 001558c8: 5856050C jal 0x00155960 Cone Generation Routine 001558cc: 00000000 nop 001558d0: 3A560508 j 0x001558e8 001558d4: 2A109002 slt r2,r20,r16 001558d8: 18004010 beq r2,r0,0x0015593c End if Target Y >= Unit Y is not true 001558dc: 00FF1334 ori r19,r0,0xff00 Direction = Y 001558e0: 5856050C jal 0x00155960 Cone Generation Routine 001558e4: 00000000 nop
001558e8: 21200000 addu r4,r0,r0 Tile Counter = 0 001558ec: 1980033C lui r3,0x8019 001558f0: D82D6324 addiu r3,r3,0x2dd8 001558f4: 01006290 lbu r2,0x0001(r3) Load Tile Targeted? Flag 001558f8: 00000000 nop 001558fc: 03004014 bne r2,r0,0x0015590c Branch if Tile is Targeted? 00155900: 00000000 nop 00155904: 44560508 j 0x00155910 00155908: 000060A0 sb r0,0x0000(r3) AoE = 0 0015590c: 010060A0 sb r0,0x0001(r3) Tile Targeted? = False 00155910: 01008424 addiu r4,r4,0x0001 Counter ++ 00155914: 00028228 slti r2,r4,0x0200 00155918: F6FF4014 bne r2,r0,0x001558f4 Branch if Counter < 0x200 0015591c: 05006324 addiu r3,r3,0x0005 Pointer += 5
00155920: 00000000 nop [deleted line] 00155924: 2C00B18F lw r17,0x002c(r29) 00155928: FF00E431 andi r4,r15,0x00ff 0015592c: 2128A002 addu r5,r21,r0 00155930: 42311100 srl r6,r17,0x05 00155934: A9E4050C jal 0x001792a4 check vertical tolerance + if tiles can be chosen 00155938: 0100C630 andi r6,r6,0x0001 Top Down Targeting Flag
0015593c: 3C00BF8F lw r31,0x003c(r29) 00155940: 3800B48F lw r20,0x0038(r29) 00155944: 3400B38F lw r19,0x0034(r29) 00155948: 3000B28F lw r18,0x0030(r29) 0015594c: 2C00B18F lw r17,0x002c(r29) 00155950: 2800B08F lw r16,0x0028(r29) 00155954: 4000BD27 addiu r29,r29,0x0040 Pointer + 40 00155958: 0800E003 jr r31 0015595c: 25280000 or r5,r0,r0 Is Linear/Tri? = False
====================================================================
00155960: Cone Attack Tile Calculation
r4 = Tile Coordinate r5 = Secondary Tile Coordinate r6 = AoE r7 = Row Counter r8 = 0xffffffff (Also used as Temporary High Tile Coordinate) r9 = Row Width Counter r10 = 0x0001 (True) r16 = Unit Y (Treated as Current Y) r17 = Unit X (Treated as Current X) r18 = Target X r20 = Target Y r19 = Direction
00155960: 21380000 addu r7,r0,r0 Initialize Row Counter 00155964: 19800B3C lui r11,0x8019 00155968: D82D6B25 addiu r11,r11,0x2dd8 r11 = Tile Data Pointer 0015596c: 01000A34 ori r10,r0,0x0001 r10 = True 00155970: 3400A68F lw r6,0x0034(r29) r6 = AoE 00155974: 62004006 bltz r18,0x00155af0 Branch if X is negative 00155978: 0E80033C lui r3,0x800e 0015597c: 9C4E6390 lbu r3,0x4e9c(r3) Load Map Max X 00155980: 00000000 nop 00155984: 2A104302 slt r2,r18,r3 00155988: 5D004010 beq r2,r0,0x00155af0 Branch if X >= Max X 0015598c: 00000000 nop 00155990: 5B008006 bltz r20,0x00155af0 Branch if Y is negative 00155994: 0E80023C lui r2,0x800e 00155998: A04E4290 lbu r2,0x4ea0(r2) Load Map Max Y 0015599c: 00000000 nop 001559a0: 2A108202 slt r2,r20,r2 001559a4: 56004010 beq r2,r0,0x00155af0 Branch if Y >= Max Y
001559a8: 18000302 mult r16,r3 Y * Max X 001559ac: 12100000 mflo r2 001559b0: 21205100 addu r4,r2,r17 Tile ID = Y * Max X + X
<Row Length Main Loop Starts Here> ======================== X Direction Sub Routine ========================
001559b4: 0E80083C lui r3,0x800e 001559b8: FF000834 ori r8,r0,0x00ff r8 = 1 001559bc: 24106802 and r2,r19,r8 Get X Direction from Direction Variable 001559c0: 0F004010 beq r2,r0,0x001559f0 Branch to Y if no X Direction obtained 001559c4: 00000000 nop
X Direction
001559c8: 05000215 bne r8,r2,0x001559d0 Branch if r2 =/= X Direction 001559cc: FFFF2126 addiu r1,r17,0xffff Current X  1 001559d0: 48002004 bltz r1,0x00155ae4 Proceed to Next Row if the current Target X = 1 001559d4: 00000000 nop 001559d8: 7D560508 j 0x001559f4 Go To Tile Coordinates Modify Function 001559dc: FFFF0224 addiu r2,r0,0xffff r2 = 1
+X Direction
001559e0: 9C4E6390 lbu r3,0x4e9c(r3) Load Map Max X 001559e4: 01002126 addiu r1,r17,0x0001 Current X + 1 001559e8: 42006110 beq r3,r1,0x00155ae4 End if current Target X is Max X 001559ec: 00000000 nop 001559f0: 01000220 addi r2,r0,0x0001 r2 = 1
001559f4: 20882202 add r17,r17,r2 Current Target X++ 001559f8: 93560508 j 0x00155a4c Go to Row Generation Subroutine 001559fc: 20208200 add r4,r4,r2 Tile Coordinates is modified(+/)
======================== Y Direction Sub Routine ========================
00155a00: 02121300 srl r2,r19,0x0008 Get Y Direction from Direction Variable 00155a04: 3E004010 beq r2,r0,0x00155af0 End if no Y Direction obtained 00155a08: FFFF0126 addiu r1,r16,0xffff Current Y  1
Y Direction
00155a0c: 06000215 bne r8,r2,0x00155a18 Branch if r2 =/= 0x00ff 00155a10: 00000000 nop
00155a14: 37002004 bltz r1,0x00155ae4 End Routine if the current Target Y = 1 00155a18: FFFF0224 addiu r2,r0,0xffff 00155a1c: 9C4E6390 lbu r3,0x4e9c(r3) Get Max X 00155a20: 91560508 j 0x00155a44 Jump to Modify Tile Coordinate Function 00155a24: 22180300 sub r3,r0,r3 r3 = Max X (Y)
+Y Direction
00155a28: A04E6390 lbu r3,0x4ea0(r3) Load Max Y 00155a2c: 01000126 addiu r1,r16,0x0001 Current Y + 1 00155a30: 30007010 beq r3,r16,0x00155ae4 Branch if current Target Y is greater than Max Y 00155a34: 00000000 nop 00155a38: 0E80033C lui r3,0x800e 00155a3c: 9C4E6390 lbu r3,0x4e9c(r3) Get Max X 00155a40: 01000234 ori r2,r0,0x0001
00155a44: 20800202 add r16,r16,r2 Current Target Y++ 00155a48: 20208300 add r4,r4,r3 Tile Coordinates++
======================== Row Generation Subroutine ========================
What direction are we going? If X direction, then make Y rows, and vice versa
r7 = Row Counter r9 = Row Size Counter r6 = AoE r9 = r0  r7 r9++ until r9 = r7 r7++ until r7 = r6
r20 = Target Y r18 = Target X r5 = Secondary Tile Coordinate
========================================================================================
00155a4c: 22480700 sub r9,r0,r7 Initialize Row Size Counter 00155a50: 25288000 or r5,r4,r0 Initialize Secondary Tile Coordinate <Row Size Subloop Begins Here> 00155a54: FF000334 ori r3,r0,0x00ff 00155a58: 24106302 and r2,r19,r3 Get X Direction from Direction Variable 00155a5c: 0E004010 beq r2,r0,0x00155a88 Branch if X Direction was not obtained 00155a60: 0E80033C lui r3,0x800e
Y Row
00155a64: 20100902 add r2,r16,r9 00155a68: 20004004 bltz r2,0x00155adc Branch if Y Size is negative 00155a6c: A04E6390 lbu r3,0x4ea0(r3) Load Max Y 00155a70: 00000000 nop 00155a74: 1F006210 beq r3,r2,0x00155ae4 Branch if Y Size = Max Y 00155a78: 00000000 nop 00155a7c: 0E80033C lui r3,0x800e 00155a80: 9C4E6390 lbu r3,0x4e9c(r3) Load Map Max X 00155a84: 00000000 nop 00155a88: 18006900 mult r3,r9 Max X * Row Size Counter 00155a8c: 12180000 mflo r3 00155a90: B0560508 j 0x00155ac0 Jump to Save Tile 00155a94: 20288300 add r5,r4,r3 Modify Secondary Tile Coordinate
X Row 00155a98: 02121300 srl r2,r19,0x0008 Get X Direction from Direction Variable 00155a9c: 18004010 beq r2,r0,0x00155af0 End if no X Direction obtained 00155aa0: 00000000 nop 00155aa4: 20102902 add r2,r17,r9 00155aa8: 10004004 bltz r2,0x00155adc Branch if X Size is negative 00155aac: 9C4E6390 lbu r3,0x4e9c(r3) Load Map Max X 00155ab0: 00000000 nop 00155ab4: 0F006210 beq r3,r2,0x00155ae4 Branch if X Size = Max X 00155ab8: 00000000 nop 00155abc: 20288900 add r5,r4,r9 Modify Secondary Tile Coordinate
Save Tile
00155ac0: 80100500 sll r2,r5,0x02 ID * 4 00155ac4: 21104500 addu r2,r2,r5 ID * 5 00155ac8: 21184B00 addu r3,r2,r11 00155acc: 00006AA0 sb r10,0x0000(r3) Store Low Tile's AoE = True 00155ad0: 01006AA0 sb r10,0x0001(r3) Store Low Tile Targeted? = True 00155ad4: 0001A824 addiu r8,r5,0x0100 Tile ID + 0x100 00155ad8: 80100800 sll r2,r8,0x02 ID * 4 00155adc: 21104800 addu r2,r2,r8 ID * 5 00155ae0: 21184B00 addu r3,r2,r11 00155ae4: 00006AA0 sb r10,0x0000(r3) Store High Tile's AoE = True 00155ae8: 01006AA0 sb r10,0x0001(r3) Store High Tile Targeted? = True 00155aec: D9FF2715 bne r9,r7,0x00155a44 Branch if Size Counter = Row Counter else loop 00155af0: 01002921 addi r9,r9,0x0001 Size Counter++ 00155af4: 2210C700 sub r2,r6,r7 00155af8: AEFF401C bgtz r2,0x001559a4 Finish if Row Counter has exceeded AoE else loop 00155afc: 0100E724 addiu r7,r7,0x0001 Row Counter++ 00155b00: 0800E003 jr r31 00155b04: 00000000 nop

"Arcing" AoE and Range Version 1.1 Feeds AoE/Range generation through the Arc Range Routine (001798b0), creating an AoE/Range that gains size from height/2 Uses Ability Flags 1 Unknown Flags 0x80 and 0x40. Removes and overwrites the coding otherwise attached to the Unknown Ability Flags (0017a6dc) known so far. Does not use Kanji Space. 0x80  Arcing AoE 0x40  Arcing Range Old:
0017bac8: 00002821 addu r5,r0,r0 0017bacc: 26620001 addiu r2,r19,0x0001 0017bad0: a1020000 sb r2,0x0000(r8) store aoe + 1 0017bad4: 0c05e546 jal 0x00179518 Store surrounding panels AoE value 0017bad8: a0e20000 sb r2,0x0000(r7) store aoe + 1
New: 0017bac8: 0680053C lui r5,0x8006 0017bacc: 01006226 addiu r2,r19,0x0001 0017bad0: 000002A1 sb r2,0x0000(r8) 0017bad4: B7E9050C jal 0x0017a6dc Arc Range/AoE Routine
Old:
0017a43c: 0c05e546 jal 0x00179518 Calculate Tiles Hit by Ability 0017a440: 00002821 addu r5,r0,r0 r5 = 0
New:
0017a43c: B7E9050C jal 0x0017a6dc Arc Range/AoE Routine 0017a440: 0680053C lui r5,0x8006
Old:
0017a4a0: 324200c0 andi r2,r18,0x00c0 If Unknown Flags 0x80/0x40 (!!!) 0017a4a4: 0c05e497 jal 0x0017925c Clear Some stuff for Untargetable Terrain 0017a4a8: 00000000 nop 0017a4ac: 324200c0 andi r2,r18,0x00c0 If Unknown Flags 0x80/0x40 (!!!) 0017a4b0: 10400003 beq r2,r0,0x0017a4c0 Branch if False 0017a4b4: 02802021 addu r4,r20,r0 r4 = Caster Data 0017a4b8: 0c05e9b7 jal 0x0017a6dc Target Ally/Enemy with Range Routine 0017a4bc: 02402821 addu r5,r18,r0 r5 = Ability Flags 1 0017a4c0: 324200d0 andi r2,r18,0x00d0 If Unknown Flags 0x80/0x40 or Vertical Fixed 0017a4c4: 14400005 bne r2,r0,0x0017a4dc Branch if True
New:
0017a4a0: 00000000 nop 0017a4a4: 97E4050C jal 0x0017925c Clear Some stuff for Untargetable Terrain 0017a4a8: 00000000 nop [Deleted] 0017a4ac: 00000000 nop 0017a4b0: 00000000 nop 0017a4b4: 00000000 nop 0017a4b8: 00000000 nop 0017a4bc: 21208002 addu r4,r20,r0 0017a4c0: 10004232 andi r2,r18,0x0010 0017a4c4: 05004014 bne r2,r0,0x0017a4dc Branch if Vertical Fixed
Arc Range/AoE Routine
0017a6dc: F0FBA524 addiu r5,r5,0xfbf0 0017a6e0: 1200A287 lh r2,0x0012(r29) r2 = Used Ability ID 0017a6e4: C0180200 sll r3,r2,0x03 0017a6e8: 23186200 subu r3,r3,r2 0017a6ec: 40180300 sll r3,r3,0x01 0017a6f0: 2128A300 addu r5,r5,r3 0017a6f4: 1880063C lui r6,0x8018 0017a6f8: A8A7DFAC sw r31,0xa7a8(r6) Save return address 0017a6fc: A8A7C280 lb r2,0xa7a8(r6) Load last two bytes of Return Address' instructions 0017a700: FF004230 andi r2,r2,0x00ff 0017a704: DC000334 ori r3,r0,0x00dc 0017a708: 0300A580 lb r5,0x0003(r5) Load Ability Flags 1 0017a70c: 14004314 bne r2,r3,0x0017a760 Branch if not from Targeting Routine (From AoE routine) 0017a710: 8000A230 andi r2,r5,0x0080 0017a714: 1D004010 beq r2,r0,0x0017a78c Branch if not Arc AoE 0017a718: 4CA7C324 addiu r3,r6,0xa74c 0017a71c: 2000AD93 lbu r13,0x0020(r29) r13 = Target Y 0017a720: 1C00AC93 lbu r12,0x001c(r29) r12 = Target X 0017a724: 0E80023C lui r2,0x800e 0017a728: D0FFBD27 addiu r29,r29,0x0030 0017a72c: 2000B0AF sw r16,0x0020(r29) 0017a730: 2400B1AF sw r17,0x0024(r29) 0017a734: 2800A3AF sw r3,0x0028(r29) Save Return Address 0017a738: 3899C0AC sw r0,0x9938(r6) Remove Close Range Branch from Arc routine 0017a73c: 21184002 addu r3,r18,r0 r3 = Target Height 0017a740: 21886002 addu r17,r19,r0 r17 = AoE 0017a744: 39E6050C jal 0x001798e4 Calculate Arc AoE Routine (Jump to later on in the routine) 0017a748: A04E4290 lbu r2,0x4ea0(r2) r2 = Max Map Y 0017a74c: 1880023C lui r2,0x8018 0017a750: 4014033C lui r3,0x1440 0017a754: 27006324 addiu r3,r3,0x0027 Load instructions (14400027) 0017a758: 389943AC sw r3,0x9938(r2) Restore Close Range Branch from Arc Routine 0017a75c: E5E90508 j 0x0017a794 Exit Routine 0017a760: 4000A230 andi r2,r5,0x0040 0017a764: 09004010 beq r2,r0,0x0017a78c Branch if not Arc Range 0017a768: 25288000 or r5,r4,r0 r5 = Ability Range 0017a76c: 3899C0AC sw r0,0x9938(r6) 0017a770: 2CE6050C jal 0x001798b0 Calculate Arc Range Routine 0017a774: 25208002 or r4,r20,r0 r4 = Caster Unit Data 0017a778: 1880023C lui r2,0x8018 0017a77c: 4014033C lui r3,0x1440 0017a780: 27006324 addiu r3,r3,0x0027 Load instructions (14400027) 0017a784: E5E90508 j 0x0017a794 0017a788: 389943AC sw r3,0x9938(r2) Restore Close Range Branch from Arc Routine 0017a78c: 46E5050C jal 0x00179518 Store surrounding panels AoE value (Normal function) 0017a790: 21280000 addu r5,r0,r0 0017a794: 1880023C lui r2,0x8018 0017a798: A8A75F8C lw r31,0xa7a8(r2) Load old return address 0017a79c: 00000000 nop 0017a7a0: 0800E003 jr r31 0017a7a4: 00000000 nop 0017a7a8: 00000000 nop Return Address here

Reenables Unknown Flags 1 and 2 Speaking of the Unknown Ability Flags, this hack restores their functionality that was deliberately disabled by Square. Enables you to target any ally or any enemy on the map. No notes because there really isn't much to it. It's literally a single line.
Weapon Range now accepts AoE Version 1.0 I'm releasing this against my better judgement. Enables the use of Weapon Ranged AoE. It might also enable Direct/Stop at Obstacle AoE as well. Won't crash your game, but it's interactions with AoE might cause your brain to crash if I'm reading the Weapon Strike/Direct routines correctly. Still current doing research on the matter, but feel free to be a guinea pig.
Clear Yellow Panels not occupied by a unit. Version 2.0 Overwrites Morbol AoE Depth Routine. Takes the 255 AoE check and modifies it to target only tiles with units in them. Good for Random Fire Skills. Saves Ability ID to unused lines for future Ability ID hardcoding. Enable this on an ability by flagging it as a Math Skill. Don't Target Empty Space Routine
==================================================================================================================================== Targeting/AoE Main Routine(0x0017b874) ====================================================================================================================================
Original Code: 0017b8d0: 90690003 lbu r9,0x0003(r3) Load ability flags 1 0017b8d4: 90710004 lbu r17,0x0004(r3) Load ability flags 2 0017b8d8: 90640006 lbu r4,0x0006(r3) Load ability flags 4
New Code 0017b8d4: lhu r17,0x0004(r3) Load Ability Flags 2 and 3
====================================================================================================================================
Original Code 0017bae4: 00113142 srl r6,r17,0x05 Parse down Ability Flag 2 to Top Down Targeting Flag
New Code 0017bae4: andi r6,r17,0x00e0 Parse Ability Flag 2 to Hit Ally/Enemy
====================================================================================================================================
Original Code 0017baec: 30c60001 andi r6,r6,0x0001 Keep Top Down Targeting Flag
New Code 0017baec: andi r6,r6,0x0020 Keep Top Down Targeting Flag
====================================================================================================================================
Original Code 0017baf4: 0c05e481 jal 0x00179204 moldball virus depth check 0017baf8: 00000000 nop
New Code 0017baf4: jal 0x00179204 moldball virus depth check 0017baf8: lui r2,0x8018
====================================================================================================================================
Original Code 0017b9fc: 326300ff andi r3,r19,0x00ff r3 = ability AoE 0017ba00: 340200ff ori r2,r0,0x00ff 0017ba04: 1462000c bne r3,r2,0x 0017ba38 Branch if ability AoE isn't 0xff 0017ba08: 00002021 addu r4,r0,r0 0017ba0c: 34050001 ori r5,r0,0x0001 0017ba10: 3c038019 lui r3,0x8019 0017ba14: 24632dd8 addiu r3,r3,0x2dd8 0017ba18: a0650000 sb r5,0x0000(r3) store highlight panel for targeting 0017ba1c: a0600001 sb r0,0x0001(r3) store panel not targeted 0017ba20: 24840001 addiu r4,r4,0x0001 Counter++ 0017ba24: 28820200 slti r2,r4,0x0200 Do for all tiles 0017ba28: 1440fffb bne r2,r0,0x 0017ba18 0017ba2c: 24630005 addiu r3,r3,0x0005 tile counter++ 0017ba30: 0805eebf j 0x 0017bafc skip following routine 0017ba34: 00000000 nop
New Code 0017b9fc: addu r4,r0,r0 Clear r4 0017ba00: andi r2,r17,0x4000 Get Math Skill Flag 0017ba04: lui r3,0x8018 0017ba08: addiu r3,r3,0xba28 0017ba0c: sh r0,0x0000(r3) Clear space 0017ba10: beq r2,r0,0x0017ba38 Branch if no Math Flag 0017ba14: nop 0017ba18: xori r17,r17,0x00c0 Add Ignore Ally/Enemy Flag if Math Skill (Reverses the effects of a later routine) 0017ba1c: sh r2,0x0000(r3) Jump to Tile Initialization 0017ba20: j 0x0017ba38 Save Math Skill Flag for later 0017ba24: nop 0017ba28: nop [save Math Flag here] 0017ba2c: nop [save Ability ID here] 0017ba30: nop 0017ba34: nop
====================================================================================================================================
Original Code 0017bb40: 323000c0 andi r16,r17,0x00c0 Keep Hit Ally/Enemy Flags
New Code 0017bb40: andi r16,r17,0x40c0 Keep Hit Ally/Enemy and Math Skill Flag
====================================================================================================================================
Original Code 0017bb60: 3a6700ff xori r7,r19,0x00ff 0017bb64: 0c05ef1e jal 0x0017bc78 Hit ally/enemy routine 0017bb68: 2ce70001 sltiu r7,r7,0x0001
New Code 0017bb60: lui r7,0x8018 0017bb64: jal 0x0017bc78 Hit ally/enemy routine 0017bb68: addiu r7,r7,0xba28 Load Math Skill Flag
==================================================================================================================================== Check if Ally/Enemy can be targeted Routine(0x0017bc78) ====================================================================================================================================
Original Code 0017bc90: 00e0b821 addu r23,r7,r0 r23 = 255 AoE check
New Code 0017bc90: lhu r23,0x0000(r7) r23 = Math Flag
====================================================================================================================================
Original Code 0017bd68: 32e200ff andi r2,r23,0x00ff 0017bd6c: 1440000c bne r2,r0,0x 0017bda0 Branch if AoE = 255 0017bd70: 00008021 addu r16,r0,r0 Tile Counter = 0 0017bd74: 34040001 ori r4,r0,0x0001 Tile Targeted? = True 0017bd78: 3c038019 lui r3,0x8019 0017bd7c: 24632dd8 addiu r3,r3,0x2dd8
New Code 0017bd68: addu r16,r0,r0 Tile Counter = 0 0017bd6c: ori r4,r0,0x0001 Tile Targeted? = True 0017bd70: jal 0x0017921c 0017bd74: nop 0017bd78: bne r23,r2,0x0017bda0 0017bd7c: nop
==================================================================================================================================== Morbol Virus Depth Check (0x00179204) ====================================================================================================================================
Original Code 00179204: 00042400 sll r4,r4,0x10 00179208: 00042403 sra r4,r4,0x10 0017920c: 34020149 ori r2,r0,0x0149 r2 = Moldball Virus 00179210: 14820010 bne r4,r2,0x 00179254 Branch if ID != Moldball Virus 00179214: 00000000 nop 00179218: 00002821 addu r5,r0,r0 Counter = 0 0017921c: 3c048019 lui r4,0x8019 00179220: 24842dd8 addiu r4,r4,0x2dd8 r4 = ? Tile Data Pointer 00179224: 3c038019 lui r3,0x8019 00179228: 2463f8cc addiu r3,r3,0xf8cc r3 = Tile Data Pointer 0017922c: 90620003 lbu r2,0x0003(r3) Load Tile's Halves + Depth 00179230: 00000000 nop 00179234: 304200e0 andi r2,r2,0x00e0 00179238: 10400002 beq r2,r0,0x 00179244 Branch if Depth > 1 0017923c: 24630008 addiu r3,r3,0x0008 Tile Data Pointer += 8 00179240: a0800000 sb r0,0x0000(r4) Store AoE = 0 00179244: 24a50001 addiu r5,r5,0x0001 Counter ++ 00179248: 28a20200 slti r2,r5,0x0200 0017924c: 1440fff7 bne r2,r0,0x 0017922c Branch if Counter < 0x200 00179250: 24840005 addiu r4,r4,0x0005 ? Tile Data Pointer += 5 00179254: 03e00008 jr r31 00179258: 00000000 nop
New Code r3 = Tile Data (0x80192dd8) r4 = True r23 = Math Skill
00179204: addiu r2,r2,0xba2c 00179208: sll r4,r4,0x10 Code still needs a parsed Ability ID 0017920c: sra r4,r4,0x10 00179210: sh r4,0x0000(r2) Save Ability ID to (0x0017ba28)(For some future code) 00179214: nop Must be empty for another routine I made 00179218: jr r31 0017921c: lui r3,0x8019 00179220: beq r23,r0,0x00179254 Exit if no Math Skill 00179224: addiu r3,r3,0x2dd8 00179228: lbu r2,0x0000(r3) Load AoE saved on Tile 0017922c: lbu r20,0x0002(r3) Load Unit ID 00179230: sltiu r2,r2,0x0001 True if No AoE 00179234: sltiu r20,r20,0x0001 True if No Unit ID 00179238: addu r2,r2,r20 0017923c: bne r2,r0,0x179248 Do not Target Panel if panel does not have a unit on it and isn't apart of AoE 00179240: addiu r16,r16,0x0001 Tile Counter++ 00179244: sb r4,0x0001(r3) Target Tile Panel 00179248: slti r2,r16,0x0200 0017924c: bne r2,r0,0x00179228 Loop for all 0x200 panels 00179250: addiu r3,r3,0x0005 Tile ID++ 00179254: jr r31 00179258: ori r2,r0,0x4000 ====================================================================================================================================

Enable Attacks on Yourself (Strike/Lunge Weapon) Version 0.0 Allows units to target themselves with Attack. Only works with Strike/Lunge flagged Weapons.
Caster is always apart of AoE Version 1.0 Removes the code from Unknown Flag 1 and 2 (0x80 and 0x40) of Ability Flags 1. This hack makes it so an ability will always target (make a yellow square under) the caster in addition to the targeted panel or panels. Enable this property with Unknown Flag 1. Unknown Flag 2 is nonfunctional. I can also upload an alternate version that checks for Ability IDs instead if requested. 0017bb04: 00021880 sll r3,r2,0x02 0017bb08: 00621821 addu r3,r3,r2 0017bb0c: 3c128019 lui r18,0x8019 0017bb10: 26522dd8 addiu r18,r18,0x2dd8 0017bb14: 32220001 andi r2,r17,0x0001
to
0017bb0c: andi r4,r9,0x0080 Look for Flag 1 0017bb10: jal 0x0017a6dc Always Target Caster Routine 0017bb14: lui r18,0x8019
0017a6dc: beq r4,r0,0x0017 Branch if Target Caster 0017a6e0: addiu r18,r18,0x2dd8 Load Map Data 0017a6e4: ori r2,r0,0x0001 Target Caster = True 0017a6e8: addu r3,r3,r18 r3 = Caster Tile 0017a6ec: sb r2,0x0000(r3) Target Caster Tile 0017a6f0: j 0x0017a6fc Exit Subroutine 0017a6f4: andi r2,r17,0x0001 Check Ability Flag 1 for Ignore Caster 0017a6f8: ori r2,r0,0x0000 Ignore Caster Tile = False 0017a6fc: jr r31 0017a700: nop 0017a704: 0017a708: 0017a70c: 0017a710: 0017a6dc: 0017a6dc:

F_MA Damage formula accepts Weapon Elemental (for one ability) Version 1.2 Faith Magical Damage Formula accepts Weapon Elemental when ability ID = 165(Currently Maelstrom in Arena). 00185ffc: 3c028019 lui r2,0x8019 00186000: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Data 00186004: 3c038019 lui r3,0x8019 00186008: 906338f7 lbu r3,0x38f7(r3) Load Abilities Element 0018600c: 90420071 lbu r2,0x0071(r2) Load Attacker's Elemental Strenghtened 00186010: 00000000 nop 00186014: 00431024 and r2,r2,r3 00186018: 1040000c beq r2,r0,0x0018604c Branch if Abilities Element isn't being powered 0018601c: 00000000 nop 00186020: 3c038019 lui r3,0x8019 00186024: 846338ce lh r3,0x38ce(r3) Load XA 00186028: 00000000 nop 0018602c: 00031080 sll r2,r3,0x02 XA * 4 00186030: 00431021 addu r2,r2,r3 XA * 5 00186034: 04410002 bgez r2,0x00186040 Branch if XA > 0 00186038: 00000000 nop 0018603c: 24420003 addiu r2,r2,0x0003 XA + 3 00186040: 00021083 sra r2,r2,0x02 XA * 5 / 4 (increase XA by 25%) 00186044: 3c018019 lui r1,0x8019 00186048: a42238ce sh r2,0x38ce(r1) Store new XA 0018604c: 03e00008 jr r31 00186050: 00000000 nop
========================================================================================================
00185ffc: 3c028019 lui r2,0x8019 00186000: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Data 00186004: 3c038019 lui r3,0x8019 00186008: 906338f7 lbu r3,0x38f7(r3) Load Abilities Element 0018600c: 90420071 lbu r2,0x0071(r2) Load Attacker's Elemental Strenghtened 00186010: 00000000 nop 00186014: 00431024 and r2,r2,r3
to
11EFFC(+67000): 1580013C lui r1,0x8015 FC573FAC sw r31,0x57fc(r1) 0056050C jal 0x00155800 00000000 nop 25802000 or r16,r1,r0 1580013C lui r1,0x8015 24108300 and r2,r4,r3 1040000c beq r2,r0,0x0018604c Branch if Abilities Element isn't being powered FC573F8C lw r31,0x57fc(r1) ...
00187010: 3c108019 lui r16,0x8019 00187014: 921038f7 lbu r16,0x38f7(r16)
to
120010(+67000): 0056050C jal 0x00155800 00000000 nop
...
Weapon Ele for F_MA damage Routine (0x1557fc) EE7FC(+67000) 00000000 nop 1980013C lui r1,0x8019 D6382394 lhu r3,0x38d6(r1) Load Ability ID 942D248C lw r4,0x2d94(r1) Load Attacker's Data 65010134 ori r1,r0,0x0165 03006114 bne r3,r1,0x00155820 Branch if not the correct Ability ID 1980013C lui r1,0x8019 09560508 j 0x155824 04392390 lbu r3,0x3904(r1) Load Weapon's Element F7382390 lbu r3,0x38f7(r1) Load Abilities Element 71008490 lbu r4,0x0071(r4) Load Attacker's Elemental Strengthened 25080002 or r1,r16,r0 25806000 or r16,r3,r0 0800E003 jr r31 00000000 nop

As always, the XMLs are attached to this post and notes are provided in spoilers above. Make sure you are using the latest version of FFTPatcher, or at least 489 or later. Let me know if you find any bugs, contacting me through this site or finding me on Steam. EDIT: Thanks Firefox for crashing and wiping out my message, I'm switching back to Opera after this.
« Last Edit: December 21, 2016, 09:50:51 PM by Dokurider »


