Modding => PSX FFT Hacking => Topic started by: Grond on April 18, 2023, 08:17:51 pm
Title: Grond's ASM patches
Post by: Grond on April 18, 2023, 08:17:51 pm
My ASM patches. XMLs attached at bottom of post. The 'Half of MP and Short Charge' xml is a couple of old patches, but now fixed up with AI functions. The 'Random Battle Music' xml lets you choose which four songs you want to play during random battles. - ABILITY & STATUS
<Patch name="Enemies use different potions with Auto Potion depending on level"> <Description>This is actually based on the attacker's level, not the target's. Variables: Hi = Starting Level for Hi-Potion use (default 15), X = Starting Level for X-Potion use (default 30)</Description> <Location file="BATTLE_BIN" offset="117780"> BA018290 <!-- lbu r2,0x01ba(r4) --> 00000000 30004230 <!-- andi r2,r2,0x0030 --> 13004014 <!-- bne r2,r0,0x0017e7dc ;Branch if unit isn't on player's team --> 00000000 0680013C <!-- lui r1,0x8006 --> D0972290 <!-- lbu r2,-0x6830(r1) ;Load Potion quantity --> 00000000 0C004014 <!-- bne r2,r0,0x0017e7d4 ;branch if potions are available --> F0000234 <!-- ori r2,r0,0x00f0 ;Return 0xf0 (potion) --> D1972290 <!-- lbu r2,-0x682f(r1) ;Load Hi potion quantity --> 00000000 03004010 <!-- beq r2,r0,0x0017e7c0 ;branch if hi potions quantity = 0 --> 00000000 F5F90508 <!-- j 0x0017e7d4 ;Jump to end --> F1000234 <!-- ori r2,r0,0x00f1 ;Return 0xF1 (Hi Potion) --> D2972390 <!-- lbu r3,-0x682e(r1);Load X potion quantity --> 00000000 02006014 <!-- bne r3,r0,0x0017e7d4 ;branch if X potions are available --> F2000234 <!-- ori r2,r0,0x00f2 ;Return X potion --> FFFF0224 <!-- addiu r2,r0,0xffff ;If no potions are available, return 0xffff --> 0800E003 <!-- jr r31 --> 00000000 00830508 <!-- j 0x00160c00 ;jump to new code --> 1980023C <!-- lui r2,0x8019 --> </Location> <Location file="BATTLE_BIN" offset="F9C00"> 942D428C <!-- lw r2,0x2d94(r2) ;Load Attacker's Data Pointer --> 00000000 22004290 <!-- lbu r2,0x0022(r2) ;Load Level --> 00000000 </Location> <Variable file="BATTLE_BIN" offset="F9C10" default="0F" name="Hi" /> <Location file="BATTLE_BIN" offset="F9C11"> 00432C <!-- sltiu r3,r2,0x000F ;set r3 to 1 if Level is < (15) --> 08006014 <!-- bne r3,r0,0x00160c38 ;branch to 'return potion exit' if r3 != 0 --> 00000000 </Location> <Variable file="BATTLE_BIN" offset="F9C1C" default="1E" name="X" /> <Location file="BATTLE_BIN" offset="F9C1D"> 00432C <!-- sltiu r3,r2,0x001E ;set r3 to 1 if Level is < (30) --> 03006014 <!-- bne r3,r0,0x00160c30 ;branch to 'return hi-potion exit' if r3 != 0) --> 00000000 F5F90508 <!-- j 0x0017e7d4 ;exit while... --> F2000234 <!-- ori r2,r0,0x00f2 ;Returning 0xf2 (X Potion) --> F5F90508 <!-- j 0x0017e7d4 ;exit while... --> F1000234 <!-- ori r2,r0,0x00f1 ;Returning 0xf1 (Hi Potion) --> F5F90508 <!-- j 0x0017e7d4 ;exit while... --> F0000234 <!-- ori r2,r0,0x00f0 ;Returning 0xf0 (Potion) --> </Location> </Patch>
<Patch name="Potions are X% stronger with Throw Item equipped (READ DESCRIPTION)"> <Description>! Note that with this patch, the base amount healed by Potions is no longer Z*10, just Z. So adjust values accordingly in FFTPatcher.</Description> <Location file="BATTLE_BIN" offset="123278"> E0820508 <!-- j 0x00160b80 ;Jump to new code section --> 00000000 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;r3 = Current Attack Data Pointer --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F9B80"> 1980023C <!-- lui r2,0x8019 --> 942D428C <!-- lw r2,0x2d94(r2) ;r2 = Attacker's Current Data Pointer --> 00000000 91004290 <!-- lbu r2,0x0091(r2) ;r2 = 3rd Set of Supports --> 00000000 08004230 <!-- andi r2,r2,0x0008 ;Check for Throw Item --> 05004010 <!-- beq r2,r0,0x00160bb0 ;Branch ahead if no Throw Item --> </Location> <Variable file="BATTLE_BIN" offset="F9B9C" bytes="2" default="0600" name="X" > <Preset name="100%" value="0800" /> <Preset name="85%" value="0767" /> <Preset name="80%" value="0734" /> <Preset name="75%" value="0700" /> <Preset name="70%" value="06CE" /> <Preset name="67%" value="06AF" /> <Preset name="60%" value="0668" /> <Preset name="55%" value="0634" /> <Preset name="50%" value="0600" /> <Preset name="45%" value="05CD" /> <Preset name="40%" value="059A" /> <Preset name="33%" value="0555" /> <Preset name="30%" value="0534" /> <Preset name="25%" value="0500" /> <Preset name="20%" value="04CD" /> <Preset name="15%" value="049A" /> <Preset name="12.5%" value="0480" /> <Preset name="10%" value="0467" /> <Preset name="Custom (X/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="F9B9E"> 0234 <!-- ori r2,r0,0x0600 ;r2 = Variable (X) [1536] --> 19004300 <!-- multu r2,r3 ;X*Z --> 12100000 <!-- mflo r2 ;r2 = X*Z --> A0280608 <!-- j 0x0018a280 ;Jump back to original code --> 82120200 <!-- srl r2,r2,0x0a ;r2 = (X*Z)/1024 --> A0280608 <!-- j 0x0018a280 ;Jump back to original code --> 21100300 <!-- addu r2,r0,r3 ;r2 = Z --> </Location> </Patch>
<Patch name="Ethers are X% stronger with Throw Item equipped (READ DESCRIPTION)"> <Description>! Note that with this patch, the base amount healed by Ethers is no longer Z*10, just Z. So adjust values accordingly in FFTPatcher.</Description> <Location file="BATTLE_BIN" offset="1212B4"> F0820508 <!-- j 0x00160bc0 ;Jump to new code section --> 00000000 00000000 </Location> <Location file="BATTLE_BIN" offset="F9BC0"> 1980023C <!-- lui r2,0x8019 --> 942D428C <!-- lw r2,0x2d94(r2) ;r2 = Attacker's Current Data Pointer --> 00000000 91004290 <!-- lbu r2,0x0091(r2) ;r2 = 3rd Set of Supports --> 00000000 08004230 <!-- andi r2,r2,0x0008 ;Check for Throw Item --> 05004010 <!-- beq r2,r0,0x00160bf0 ;Branch ahead if no Throw Item --> </Location> <Variable file="BATTLE_BIN" offset="F9BDC" bytes="2" default="0600" name="X" > <Preset name="100%" value="0800" /> <Preset name="85%" value="0767" /> <Preset name="80%" value="0734" /> <Preset name="75%" value="0700" /> <Preset name="70%" value="06CE" /> <Preset name="67%" value="06AF" /> <Preset name="60%" value="0668" /> <Preset name="55%" value="0634" /> <Preset name="50%" value="0600" /> <Preset name="45%" value="05CD" /> <Preset name="40%" value="059A" /> <Preset name="33%" value="0555" /> <Preset name="30%" value="0534" /> <Preset name="25%" value="0500" /> <Preset name="20%" value="04CD" /> <Preset name="15%" value="049A" /> <Preset name="12.5%" value="0480" /> <Preset name="10%" value="0467" /> <Preset name="Custom (X/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="F9BDE"> 0234 <!-- ori r2,r0,0x0600 ;r2 = Variable (X) [1536] --> 19004300 <!-- multu r2,r3 ;X*Z --> 12100000 <!-- mflo r2 ;r2 = X*Z --> B0200608 <!-- j 0x001882c0 :Jump back to original code --> 82120200 <!-- srl r2,r2,0x0a ;r2 = (X*Z)/1024 --> B0200608 <!-- j 0x001882c0 :Jump back to original code --> 21100300 <!-- addu r2,r0,r3 ;r2 = Z --> </Location> </Patch>
<Patch name="Draw Out Katana break chance is halved"> <Description>! Use this if NOT using the below 'Draw Out doesn't break Katana while Maintenance is equipped' patch.</Description> <Location file="BATTLE_BIN" offset="12097C"> 64000434 <!-- ori r4,r0,0x0064 ;100 = Max Break % (moved) --> </Location> <Location file="BATTLE_BIN" offset="12098C"> 42280500 <!-- srl r5,r5,0x01 ;r5 = WP (Break %) / 2 --> </Location> </Patch>
<Patch name="Draw Out doesn't break Katana while Maintenance is equipped"> <Description> </Description> <Location file="BATTLE_BIN" offset="1156F4"> 6B1E0608 <!-- j 0x001879ac ;Jump from Attack Preparation (Katana Inventory) --> 91006292 <!-- lbu r2,0x0091(r19) ;r2 = 3rd set of Supports --> </Location> <Location file="BATTLE_BIN" offset="120910"> 1980013C <!-- lui r1,0x8019 --> 8C2D268C <!-- lw r6,0x2d8c(r1) ;r6 = Attacker's Current Action Data Pointer --> 942D278C <!-- lw r7,0x2d94(r1) ;r7 = Attacker's Data Pointer --> E8FFBD27 <!-- addiu r29,r29,0xffe8 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 0300E390 <!-- lbu r3,0x0003(r7) ;r3 = Attacker's Job --> 5D000234 <!-- ori r2,r0,0x005d ;r2 = 5d (Mime) --> 18006210 <!-- beq r3,r2,0x00187990 ;Branch to end if Attacker is a Mime --> 9100E390 <!-- lbu r3,0x0091(r7) ;r3 = 3rd set of Supports --> 00000000 04006330 <!-- andi r3,r3,0x0004 ;Check for Maintenance --> 18006014 <!-- bne r3,r0,0x001879a0 ;Branch to 'do nothing & exit' if has Maintenance --> 01000234 <!-- ori r2,r0,0x0001 ;r2 = 1 (Hit flag) --> 0000C2A0 <!-- sb r2,0x0000(r6) ;18c Store Hit --> 7601E390 <!-- lbu r3,0x0176(r7) ;r3 = Used Item/Equip Id --> 08000234 <!-- ori r2,r0,0x0008 ;r2 = 8 ('Put Katana Back' flag?) --> 0300C3A0 <!-- sb r3,0x0003(r6) ;18f Store Item Removed?/Returned? --> 0200C2A0 <!-- sb r2,0x0002(r6) ;18e Miss Type? = Put Katana Back? --> FCF5228C <!-- lw r2,-0x0a04(r1) ;r2 = Damage Display? Action State? --> 00000000 09004014 <!-- bne r2,r0,0x00187988 ;Branch if ??? != 0 (removes katana?) --> 00000000 02392590 <!-- lbu r5,0x3902(r1) ;r5 = Weapon Power --> 3378010C <!-- jal 0x0005e0cc ;Random --> 64000434 <!-- ori r4,r0,0x0064 ;r4 = 100 (chance to NOT break equals 100 - WP) --> 04004010 <!-- beq r2,r0,0x00187988 ;Branch if Katana Removed? --> 00000000 08000234 <!-- ori r2,r0,0x0008 ;r2 = 8 ('Put Katana Back' flag?) --> 641E0608 <!-- j 0x00187990 ;Jump to end if Katana Put Back? --> 1000C2A4 <!-- sh r2,0x0010(r6) ;(19c = 8 store Katana Put Back?) --> 00100234 <!-- ori r2,r0,0x1000 ;('Remove Katana' flag?) --> 1000C2A4 <!-- sh r2,0x0010(r6) ;(19c = 1000 store Remove Katana?) --> 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 641E0608 <!-- j 0x00187990 ;Jump to exit --> 1000C0A4 <!-- sh r0,0x0010(r6) ;Store Katana neither removed nor put back --> 00000000 <!-- ↓Attack Preparation part↓ --> 04004230 <!-- andi r2,r2,0x0004 ;Check for Maintenance --> 02004014 <!-- bne r2,r0,0x001879bc ;Branch over Decrem. Item if has Maintenance--> 00000000 55F2050C <!-- jal 0x0017c954 ;Decrement Item Quantity --> 01000634 <!-- ori r6,r0,0x0001 --> FFF10508 <!-- j 0x0017c7fc ;Jump back to Attack Preparation --> 00000000 </Location> </Patch>
<Patch name="Draw Out Katana break chance is halved, for 'Draw Out/Maintenance' patch"> <Description>! Use only if using the above 'Draw Out doesn't break Katana while Maintenance is equipped' patch.</Description> <Location file="BATTLE_BIN" offset="120964"> 64000434 <!-- ori r4,r0,0x0064 ;100 = Max Break % (moved) --> </Location> <Location file="BATTLE_BIN" offset="120970"> 42280500 <!-- srl r5,r5,0x01 ;r5 = WP (Break %) / 2 --> </Location> </Patch>
<Patch name="Skillset ID for 'Remove transparent status if Jump is used'"> <Description>You might need this if you changed 12 Jump into a normal skillset, but are keeping the original Jump function playable. By default the check is changed to 34 (Izlude's Jump).</Description> <Variable file="BATTLE_BIN" offset="123C88" default="34" name="ID" /> </Patch>
<Patch name="Defending status reduces damage by X%"> <Description>Does not alter the evade%-doubling functionality of Defending.</Description> <Location file="BATTLE_BIN" offset="11F458"> 68820508 <!-- j 0x001609a0 ;Jump from Target XA affecting Statuses (Physical) --> </Location> <Location file="BATTLE_BIN" offset="11F4F0"> 68820508 <!-- j 0x001609a0 ;Jump from Target's Status Affecting XA (Magical) --> </Location> <Location file="BATTLE_BIN" offset="F99A0"> 1980043C <!-- lui r4,0x8019 ;r4 = 80190000 --> 982D828C <!-- lw r2,0x2d98(r4) ;r2 = Target Current Data Pointer --> 00000000 58004290 <!-- lbu r2,0x0058(r2) ;r2 = 1st Set of Statuses --> 00000000 02004230 <!-- andi r2,r2,0x0002 ;Check for Defending --> 07004010 <!-- beq r2,r0,1609d8 ;Branch to end if not Defending --> 00000000 CE388384 <!-- lh r3,0x38ce(r4) ;r3 = XA --> </Location> <Variable file="BATTLE_BIN" offset="F99C4" bytes="2" default="0200" name="X" > <Preset name="10%" value="039A" /> <Preset name="15%" value="0368" /> <Preset name="20%" value="0334" /> <Preset name="25%" value="0300" /> <Preset name="30%" value="02CE" /> <Preset name="34%" value="02AA" /> <Preset name="40%" value="0268" /> <Preset name="45%" value="0234" /> <Preset name="50%" value="0200" /> <Preset name="55%" value="01CD" /> <Preset name="60%" value="019A" /> <Preset name="66%" value="015D" /> <Preset name="70%" value="0134" /> <Preset name="75%" value="0100" /> <Preset name="80%" value="00CE" /> <Preset name="85%" value="009A" /> <Preset name="90%" value="0067" /> <Preset name="99%" value="0001" /> <Preset name="Custom (X/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="F99C6"> 0234 <!-- ori r2,r0,0x0040 ;r2 = Variable X --> 19004300 <!-- multu r2,r3 ;XA*X --> 12100000 <!-- mflo r2 ;r2 = XA*X --> 82120200 <!-- srl r2,r2,0x0a ;r2 = (XA*X)/1024 --> CE3882A4 <!-- sh r2,0x38ce(r4) ;Store new XA --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Defending status no longer doubles evade%"> <Description>The effect is simply moved to Transparent status.</Description> <Location file="BATTLE_BIN" offset="11E47C"> 5A004290 00000000 10004230 </Location> </Patch>
<Patch name="Attack damage with Two Swords equipped is X% of normal"> <Description>Edit of '2 Swords Penalty' by Emmy. Affects all attacks that refer to the Charge calculation (by default the 'weapon' formulas 01-07). Does not care whether you actually have two weapons equipped, only that the Two Swords support is equipped/innate.</Description> <Location file="BATTLE_BIN" offset="11EF80"> 78820508 <!-- j 0x001609e0 ;Jump from Charge Calculation --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F99E0"> 1980013C <!-- lui r1,0x8019 --> CE382394 <!-- lhu r3,0x38ce(r1) ;r3 = XA --> E4382490 <!-- lbu r4,0x38e4(r1) ;r4 = Charge's Power --> 942D228C <!-- lw r2,0x2d94(r1) ;r2 = Attacker's Data Pointer --> 21186400 <!-- addu r3,r3,r4 ;r3 = XA + Charge's Power --> 91004290 <!-- lbu r2,0x0091(r2) ;r2 = 3rd Set of Supports --> CE3823A4 <!-- sh r3,0x38ce(r1) ;Store New XA = XA + Charge's Power --> 01004230 <!-- andi r2,r2,0x0001 ;Check for Two Swords --> 04004010 <!-- beq r2,r0,0x00160a14 ;Branch to end if no Two Swords --> </Location> <Variable file="BATTLE_BIN" offset="F9A04" bytes="2" default="0334" name="X" > <Preset name="90%" value="039A" /> <Preset name="85%" value="0367" /> <Preset name="80%" value="0334" /> <Preset name="75%" value="0300" /> <Preset name="70%" value="02CE" /> <Preset name="66%" value="02AA" /> <Preset name="60%" value="0268" /> <Preset name="55%" value="0234" /> <Preset name="50%" value="0200" /> <Preset name="Custom (X/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="F9A06"> 0434 <!-- ori r4,r0,0x0334 ;r4 = Variable (X) [820] --> 19008300 <!-- multu r4,r3 ;X*XA --> 12200000 <!-- mflo r4 ;r4 = X*XA --> 821A0400 <!-- srl r3,r4,0x0a ;r3 = (X*XA)/1024 --> 0800E003 <!-- jr r31 --> CE3823A4 <!-- sh r3,0x38ce(r1) ;Store New XA --> </Location> </Patch>
<Patch name="Blade Grasp doesn't trigger on ranged weapon attacks"> <Description>Blade Grasp doesn't work against Gun, Crossbow, Bow, Instrument, and Book (and bare hands). Throw is still graspable.</Description> <Location file="BATTLE_BIN" offset="126068"> 88820508 <!-- j 0x00160a20 ;Jump from Blade Grasp Usability --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F9A20"> 1980023C <!-- lui r2,0x8019 --> D8384290 <!-- lbu r2,0x38d8(r2) ;Load Used Weapon ID --> 0680013C <!-- lui r1,0x8006 --> 40180200 <!-- sll r3,r2,0x01 ;ID * 2 --> 21186200 <!-- addu r3,r3,r2 ;ID * 3 --> 80180300 <!-- sll r3,r3,0x02 ;ID * 12 --> 21082300 <!-- addu r1,r1,r3 ;80060000 + ID * 12 --> BD2E2290 <!-- lbu r2,0x2ebd(r1) ;Load Used Weapon Item Type --> 00000000 08004010 <!-- beq r2,r0,0x00160a68 ;Branch to end if empty-handed (to Grasp punches, change this line to 00000000) --> F6FF4224 <!-- addiu r2,r2,-0x000a ;Weapon Item Type - 10 (Gun) --> 0500422C <!-- sltiu r2,r2,0x0005 ;Check 5 item types (Guns through Books) --> 05004014 <!-- bne r2,r0,0x00160a68 ;Branch to end if weapon is ranged type --> 64000234 <!-- ori r2,r0,0x0064 ;R2 = 0x64 (or 100) --> 1980043C <!-- lui r4,0x8019 --> 982D848C <!-- lw r4,0x2d98(r4) ;Load Defender's Stats --> 1C340608 <!-- j 0x0018d070 ;Jump back into original Blade Grasp function --> 00000000 36340608 <!-- j 0x0018d0d8 ;Jump to exit --> 00000000 </Location> </Patch>
<Patch name="Blade Grasp only triggers on blade attacks"> <Description>Blade Grasp only works against Knife, Ninja Blade, Sword, Knight Sword, and Katana. Throw is still graspable.</Description> <Location file="BATTLE_BIN" offset="126068"> 88820508 <!-- j 0x00160a20 ;Jump from Blade Grasp Usability --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F9A20"> 1980023C <!-- lui r2,0x8019 --> D8384290 <!-- lbu r2,0x38d8(r2) ;Load Used Weapon ID --> 0680013C <!-- lui r1,0x8006 --> 40180200 <!-- sll r3,r2,0x01 ;ID * 2 --> 21186200 <!-- addu r3,r3,r2 ;ID * 3 --> 80180300 <!-- sll r3,r3,0x02 ;ID * 12 --> 21082300 <!-- addu r1,r1,r3 ;80060000 + ID * 12 --> BD2E2290 <!-- lbu r2,0x2ebd(r1) ;Load Used Weapon Item Type --> 00000000 08004010 <!-- beq r2,r0,0x00160a68 ;Branch to end if empty-handed (to Grasp punches, change this line to 00000000) --> FAFF4224 <!-- addiu r2,r2,-0x0006 ;Weapon Item Type - 6 (Axe) --> 0D00422C <!-- sltiu r2,r2,0x000d ;Check 13 item types (Axes to Cloths) --> 05004014 <!-- bne r2,r0,0x00160a68 ;Branch to end if weapon is not blade --> 64000234 <!-- ori r2,r0,0x0064 ;r2 = 0x64 (or 100) --> 1980043C <!-- lui r4,0x8019 --> 982D848C <!-- lw r4,0x2d98(r4) ;Load Defender's Stats --> 1C340608 <!-- j 0x0018d070 ;Jump back into original Blade Grasp function --> 00000000 36340608 <!-- j 0x0018d0d8 ;Jump to exit --> 00000000 </Location> </Patch>
<Patch name="Damage Split no longer recovers HP; only redirects half of damage"> <Description> </Description> <Location file="BATTLE_BIN" offset="1241E4"> 00000000 00000000 00000000 </Location> </Patch>
FORMULAS
<Patch name="Swordskill formulas (2D, 2E, 2F, 30) check magical evade instead of physical"> <Description>This covers all base game Holy Sword, Mighty Sword, and Dark Sword skills. Does nothing unless 'Evadable' is flagged properly in FFTPatcher.</Description> <Location file="BATTLE_BIN" offset="122B28"> 6E </Location> <Location file="BATTLE_BIN" offset="122B9C"> 6E </Location> <Location file="BATTLE_BIN" offset="122C58"> 6E </Location> <Location file="BATTLE_BIN" offset="122C98"> 6E </Location> </Patch>
<Patch name="Swordskill damage becomes ((PA+MA)/2)*(WP+Y) - Master routine"> <Description>! Note that this has no effect by itself - you also need one or more of the swordskill formula edits below! This allows negative Y values. 255 = -1, 254 = -2, etc. Watch out for underflow with low WP weapons like Nagrarok, and don't use negative Y on abilities unless they require a weapon (bare hands = 0 WP).</Description> <Location file="BATTLE_BIN" offset="F9440"> 1980013C <!-- lui r1,0x8019 --> 942D248C <!-- lw r4,0x2d94(r1) ;r4 = Attacker's Data Pointer --> 02392290 <!-- lbu r2,0x3902(r1) ;r2 = Weapon Power --> FA382380 <!-- lb r3,0x38fa(r1) ;r3 = Ability Y --> 37008590 <!-- lbu r5,0x0037(r4) ;r5 = Attacker's MA --> 36008490 <!-- lbu r4,0x0036(r4) ;r4 = Attacker's PA --> 21104300 <!-- addu r2,r2,r3 ;r2 = WP + Y --> D03822A4 <!-- sh r2,0x38d0(r1) ;Store WP + Y as YA --> 21208500 <!-- addu r4,r4,r5 ;r4 = PA + MA --> 42200400 <!-- srl r4,r4,0x01 ;r4 = (PA + MA) / 2 --> CE3824A4 <!-- sh r4,0x38ce(r1) ;Store (PA + MA) / 2 as XA --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 2E (Mighty Sword) has X% chance to break equipment"> <Description>Also gets PA*(WP+Y) and 100% status like the base game Holy Sword skills. ! The 0-100% chance to break equipment must be set under X for each ability in FFTPatcher, or nothing will ever break. ! This patch does not affect the hardcoding of formula 2E's equipment breaking to ability slots A0-A3. The formula can be used in other slots without equipment breaking, however. This is an edit/fix of Choto's Mighty Sword Hack. From his description of it: "This makes it so that the mighty swordskills have a % chance to break equipment, but always function as normal damage swordskills. Maintenance prevents item breakage, but not damage. (...) I also (...) divided the damage by 2 to prevent roflstomping." </Description> <Location file="BATTLE_BIN" offset="122B94"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 1980023C <!-- lui r2,0x8019 --> 982D428C <!-- lw r2,0x2d98(r2) ;Load Target Data Pointer --> 00000000 91004290 <!-- lbu r2,0x0091(r2) ;Load Target's 3rd set of Supports --> 1980053C <!-- lui r5,0x8019 ;Prepare to load Ability X --> 04004230 <!-- andi r2,r2,0x0004 ;Check Maintenance --> 0C004014 <!-- bne r2,r0,0x00189be8 ;Branch if has Maintenance --> 64000434 <!-- ori r4,r0,0x0064 ;Max break % --> B63B060C <!-- jal 0x0018eed8 ;Random Process --> F938A590 <!-- lbu r5,0x38f9(r5) ;Load Ability X --> 08004014 <!-- bne r2,r0,0x00189be8 ;Branch if roll to break fails --> 00000000 721E060C <!-- jal 0x001879c8 ;Steal/Break/Might Sword Hard Coding --> 00000000 04004014 <!-- bne r2,r0,0x00189be8 ;Branch if nothing to break --> 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;Load Action Data Pointer --> 04000234 <!-- ori r2,r0,0x0004 ;Equipment broken flag --> 100062A4 <!-- sh r2,0x0010(r3) ;Store special flag - break item --> 4421060C <!-- jal 0x001885b8 ;Physical Evade Calculation --> 00000000 15004014 <!-- bne r2,r0,0x00189c48 ;Branch to end if evaded --> 00000000 9717060C <!-- jal 0x00185e5c ;Store PA and WP + Y --> 00000000 E917060C <!-- jal 0x00185fa4 ;Weapon Element Strengthen --> 00000000 A921060C <!-- jal 0x001886a4 ;Damage Calculation --> 00000000 F41B060C <!-- jal 0x00186fd0 ;Elemental Damage Modification (Prep) --> 00000000 1980043C <!-- lui r4,0x8019 --> 902D848C <!-- lw r4,0x2d90(r4) ;Load Action Data Pointer --> 00000000 00008290 <!-- lbu r2,0x0000(r4) ;Load Hit Flag --> 00000000 06004010 <!-- beq r2,r0,0x00189c48 ;Branch to end if element nulled --> 00000000 04008394 <!-- lhu r3,0x0004(r4) ;Load damage --> 00000000 42180300 <!-- srl r3,r3,0x01 ;Halve damage --> 3F1C060C <!-- jal 0x001870fc ;Elemental Absorption --> 040083A4 <!-- sh r3,0x0004(r4) ;Store new damage --> DF260608 <!-- j 0x00189b7c ;Jump to formula 2D's status + exit --> 00000000 </Location> </Patch>
<Patch name="'Formula 2E has X% chance to break equipment' checks magical evade instead of physical"> <Description>Does nothing unless 'Evadable' is flagged properly in FFTPatcher. This is only for the above 'Formula 2E has X% chance to break equipment' patch.</Description> <Location file="BATTLE_BIN" offset="122BE8"> 6E </Location> </Patch>
<Patch name="'Formula 2E has X% chance to break equipment' damage becomes ((PA+MA)/2)*(WP+Y)"> <Description>! Requires 'Swordskill damage becomes ((PA+MA)/2)*(WP+Y) - Master routine'! This is only for the above 'Formula 2E has X% chance to break equipment' patch.</Description> <Location file="BATTLE_BIN" offset="122BF8"> 1081050C </Location> </Patch>
<Patch name="'Formula 2E has X% chance to break equipment' damage halving removed"> <Description>This is only for the above 'Formula 2E has X% chance to break equipment' patch.</Description> <Location file="BATTLE_BIN" offset="122C3C"> 00000000 </Location> </Patch>
<Patch name="Formula 2F (Dark Sword) works like 2D plus MP absorb"> <Description>Makes 2F a clone of 2D plus MP absorption, including WP+Y, weapon elemental (except elemental absorption does 0 damage) and 100% status inflicting.</Description> <Location file="BATTLE_BIN" offset="122C60"> 09004014 <!-- bne r2,r0,0x00189c88 ;Branch to end if evaded --> 00000000 9717060C <!-- jal 0x00185e5c ;Load WP + Y as Y --> 00000000 E917060C <!-- jal 0x00185fa4 ;Element Strengthen Calculation --> 00000000 A921060C <!-- jal 0x001886a4 ;Physical Damage Calculation --> 00000000 20810508 <!-- j 0x00160480 --> 00000000 2F810508 <!-- j 0x001604bc --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F9480"> F41B060C <!-- jal 0x00186fd0 ;Elemental Damage Modification (Prep) --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Target Current Action Data pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Hit Flag --> 00000000 07004010 <!-- beq r2,r0,0x001604bc ;Branch to end if nulled --> 00000000 3F1C060C <!-- jal 0x 001870fc ;Elemental Absorption --> 00000000 1B1D060C <!-- jal 0x0018746c ;MP Absorb --> 00000000 AD1F060C <!-- jal 0x00187eb4 ;Status Proc --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 05 works like 03 but evadable and with 100% knockback"> <Description>Uses the standard gun damage formula of WP*WP. Knockback still fails against units immune to it without a patch to change that behavior.</Description> <Location file="BATTLE_BIN" offset="121C9C"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 4421060C <!-- jal 0x00188510 ;Physical Evade Calculation --> 00000000 0D004014 <!-- bne r2,r0,0x00188ce4 ;Branch to end if evaded --> 1980013C <!-- lui r1,0x8019 --> 02392290 <!-- lbu r2,0x3902(r1) ;Load WP --> 00000000 CE3822A4 <!-- sh r2,0x38ce(r1) ;Store WP as XA --> D03822A4 <!-- sh r2,0x38d0(r1) ;Store WP as YA --> E017060C <!-- jal 0x00185f80 ;Charge Calculation --> 00000000 A921060C <!-- jal 0x001886a4 ;Damage Calculation --> 00000000 FB10060C <!-- jal 0x001843ec ;Knockback Calculation --> 00000000 00000000 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 11 becomes Y% damage, LVL -1, 100% status, hit at MA+X"> <Description>'Dark Spark' formula. Fails against units with ??? Stats. Has typical element properties, ignores Faith, magic evadable.</Description> <Location file="BATTLE_BIN" offset="128654"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> A00A1680 </Location> <Location file="BATTLE_BIN" offset="F9AA0"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 6E21060C <!-- jal 0x001885b8 ;Magical Evade Calculation --> 00000000 28004014 <!-- bne r2,r0,0x00160b54 ;Branch to end if evaded --> 00000000 A122060C <!-- jal 0x00188a84 ;MA + X without faith --> 00000000 24004014 <!-- bne r2,r0,0x00160b54 ;Branch to end if fail to hit --> 00000000 1980013C <!-- lui r1,0x8019 --> 982D228C <!-- lw r2,0x2d98(r1) ;Load Target's Data Pointer --> 00000000 06004390 <!-- lbu r3,0x0006(r2) ;r3 = ??? Stats flag (0005 to check for Immortal) --> 00000000 04006330 <!-- andi r3,r3,0x0004 ;Check for ??? Stats --> 20006014 <!-- bne r3,r0,0x00160b64 ;Branch to nullification if has ??? Stats --> 00000000 22004290 <!-- lbu r2,0x0022(r2) ;r2 = Level --> 00000000 0200422C <!-- sltiu r2,r2,0x0002 ;Set r2 to 1 if Level is 1 --> 06004014 <!-- bne r2,r0,0x00160b10 ;Branch ahead if Level is 1 --> 00000000 902D228C <!-- lw r2,0x2d90(r1) ;Load Current Action Data Pointer --> 00010334 <!-- ori r3,r0,0x0100 ;r3 = 256 (-1) --> 100043A4 <!-- sh r3,0x0010(r2) ;Store Level change --> 01000334 <!-- ori r3,r0,0x0001 ;Pseudo-Status flag --> 250043A0 <!-- sb r3,0x0025(r2) ;Store Attack Type as Pseudo-Status --> 8919060C <!-- jal 0x00186624 ;Calculate % of damage --> 00000000 B41B060C <!-- jal 0x00186ed0 ;Weather Elemental effects --> 00000000 FE1B060C <!-- jal 0x00186ff8 ;Apply Elemental --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Load Current Action Data Pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Load Hit Flag --> 00000000 05004010 <!-- beq r2,r0,0x00160b54 ;Branch to end if nulled --> 00000000 3F1C060C <!-- jal 0x001870fc ;Elemental Absorption --> 00000000 AD1F060C <!-- jal 0x00187eb4 ;Apply status (Preserve hit status, evade type, hit %) --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 9013060C <!-- jal 0x00184e40 ;Nullify stuff --> 00000000 D5820508 <!-- j 0x00160b54 ;Jump to exit --> 00000000 </Location> </Patch>
<Patch name="Formula 13 becomes Damage=(PA*(WP+Y))+Absorb HP+MP"> <Description>'Lancet' formula. MP absorption is half that of HP absorption. Basically a combination of formulas 2F and 30, plus the WP+Y and weapon elemental properties of 2D (although absorbed elements result in 0 damage).</Description> <Location file="BATTLE_BIN" offset="12865C"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> 10061680 </Location> <Location file="BATTLE_BIN" offset="F9610"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 4421060C <!-- jal 0x00188510 ;Physical Evade Calculation --> 00000000 14004014 <!-- bne r2,r0,0x00160674 ;Branch to end if evaded --> 00000000 9717060C <!-- jal 0x00185e5c ;Store PA and WP + Y --> 00000000 E917060C <!-- jal 0x00185fa4 ;Weapon Element Strengthen --> 00000000 A921060C <!-- jal 0x001886a4 ;Damage Calculation --> 00000000 F41B060C <!-- jal 0x00186fd0 ;Weapon Elemental routine --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Load Current Action Data Pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Load Hit Flag --> 00000000 05004010 <!-- beq r2,r0,0x00160674 ;Branch to end if element nulled --> 00000000 3F1C060C <!-- jal 0x001870fc ;Elemental Absorption --> 00000000 A481050C <!-- jal 0x00160690 ;Lancet effect routine --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F9690"> 1980023C <!-- lui r2,0x8019 --> 982D428C <!-- lw r2,0x2d98(r2) ;Load Defender's Stats --> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 58004290 <!-- lbu r2,0x0058(r2) ;Load 1st set of Current Status --> 1000BFAF <!-- sw r31,0x0010(r29) --> 10004230 <!-- andi r2,r2,0x0010 ;Check for Undead --> 03004010 <!-- beq r2,r0,0x001606b8 ;Branch if target is not undead --> 00000000 9B1C0608 <!-- j 0x0018726c ;Undead reverse & exit --> 00000000 912E060C <!-- jal 0x0018ba44 ;Set some data for current attack --> 00000000 1980043C <!-- lui r4,0x8019 --> 902D848C <!-- lw r4,0x2d90(r4) ;Load Defender Current Action Data Pointer --> 00000000 00008290 <!-- lbu r2,0x0000(r4) ;Load Defender Hit Flag --> 00000000 0F004010 <!-- beq r2,r0,0x00160714 ;Branch to end if Attack missed --> 00000000 1980033C <!-- lui r3,0x8019 --> 8C2D638C <!-- lw r3,0x2d8c(r3) ;Load Attacker Current Action Data Pointer --> 04008294 <!-- lhu r2,0x0004(r4) ;Load Defender HP Damage --> 00000000 060062A4 <!-- sh r2,0x0006(r3) ;Store Defender HP Damage as HP Recovery for Attacker --> 42100200 <!-- srl r2,r2,0x01 ;Defender HP Damage/2 --> 080082A4 <!-- sh r2,0x0008(r4) ;Store Defender HP Damage/2 as MP Damage for Defender --> 0A0062A4 <!-- sh r2,0x000a(r3) ;Store Defender HP Damage/2 as MP Recovery for Attacker --> 50000234 <!-- ori r2,r0,0x0050 ;40: HP Recovery + 10: MP Recovery --> 250062A0 <!-- sb r2,0x0025(r3) ;Store Attack Flag as HP & MP Healing for Attacker --> 01000234 <!-- ori r2,r0,0x0001 ;1 = Hit --> 000062A0 <!-- sb r2,0x0000(r3) ;Store Attacker Hit Flag as Hit --> A0000234 <!-- ori r2,r0,0x00a0 ;80: HP Damage + 20: MP Damage --> 250082A0 <!-- sb r2,0x0025(r4) ;Store Attack Flag as HP & MP Damage for Defender --> 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="'Formula 13...Absorb HP+MP' checks magical evade instead of physical (READ DESCRIPTION)"> <Description>! Do not try to apply this at the same time as the main Formula 13 patch above, or FFTorgASM may detect a 'conflict' (that is intentional in this case) and move the patch out of the space intended for it! Does nothing unless 'Evadable' is flagged properly in FFTPatcher. This is only for the above 'Formula 13 becomes Damage=(PA*(WP+Y))+Absorb HP+MP' patch.</Description> <Location file="BATTLE_BIN" offset="F9618"> 6E </Location> </Patch>
<Patch name="'Formula 13...Absorb HP+MP' damage becomes ((PA+MA)/2)*(WP+Y) (READ DESCRIPTION)"> <Description>! Do not try to apply this at the same time as the main Formula 13 patch above, or FFTorgASM may detect a 'conflict' (that is intentional in this case) and move the patch out of the space intended for it! ! Requires 'Swordskill damage becomes ((PA+MA)/2)*(WP+Y) - Master routine'! This is only for the above 'Formula 13 becomes Damage=(PA*(WP+Y))+Absorb HP+MP' patch.</Description> <Location file="BATTLE_BIN" offset="F9628"> 1081050C </Location> </Patch>
<Patch name="Formula 18 becomes Weapon Attack: Damage+X% from the back, +Y% from the sides"> <Description>'Sneak Attack' formula. Performs a weapon attack with increased damage based on target facing. No change to evade rates, but always fails from the front. Can poach if Secret Hunt is equipped.</Description> <Location file="BATTLE_BIN" offset="128670"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> F00E1680 </Location> <Location file="BATTLE_BIN" offset="F9EF0"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 01000234 <!-- ori r2,r0,0x0001 ;r2 = Default to attack flag --> 1980013C <!-- lui r1,0x8019 --> E93822A0 <!-- sb r2,0x38e9(r1) ;Store Default to attack flag --> 562B060C <!-- jal 0x0018ad58 ;Perform weapon attack routine --> 00000000 CC83050C <!-- jal 0x00160f30 ;Sneak Attack function routine --> 00000000 281F060C <!-- jal 0x00187ca0 ;Formula 01 - 06 Aftermath (Poach) --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F9F30"> <!-- Most of this is cloned from Facing Evade Calculation --> 1980053C982DA58C1980043C942D848C4700A390470082900000000023406200 480082900200010521200001232004004800A390FF008430233862000200E104 2110E00023100200FF0043302B1064001D004010010006340C00001900000000 4800A29400000000000F4330000102340300621400030234EF83050821300000 02006214000000000200063458000105000000001980023C982D428C00000000 4800429400000000000F43300003023448006210000102344D00621400000000 48840508020006342B1083001C004010000000000B00E018000000004800A294 00000000000F433003006014000202340D840508213000000200621400000000 020006343A00E104000000001980023C982D428C000000004800429400000000 000F4330000202342A006210000000002F006014000000004884050802000634 06000019000103344800A29400000000000F42301F0043100000000009000105 000303341980023C982D428C000000004800429400000000000F423015004310 000000000900E018000000001980023C982D428C000000004800429400000000 000F42300B004010000000000B00E104000203341980023C982D428C00000000 4800429400000000000F42300300431400000000488405082130000004000015 000000000200E01400000000020006341980033CE2386324000066A0 1980013C <!-- lui r1,0x8019 --> 902D218C <!-- lw r1,0x2d90(r1) ;r1 = Current Action Data Pointer --> 02000234 <!-- ori r2,r0,0x0002 ;r2 = 2 (Back) --> 0600C210 <!-- beq r6,r2,0x00161154 ;Branch ahead if Facing Mod = 2 (Back) --> 00000000 01000234 <!-- ori r2,r0,0x0001 ;r2 = 1 (Sides) --> 0B00C210 <!-- beq r6,r2,0x00161174 ;Branch ahead if Facing Mod = 1 (Sides) --> 05000334 <!-- ori r3,r0,0x0005 ;Miss Type = Nullified --> 65840508 <!-- j 0x00161194 ;Jump to more nulling & exit --> 000020A0 <!-- sb r0,0x0000(r1) ;Store Unable to Hit Flag --> 04002294 <!-- lhu r2,0x0004(r1) ;r2 = Damage --> </Location> <Variable file="BATTLE_BIN" offset="FA158" bytes="2" default="0100" name="X (damage increase from the back)"> <Preset name="100%" value="0400" /> <Preset name="85%" value="0367" /> <Preset name="80%" value="0334" /> <Preset name="75%" value="0300" /> <Preset name="70%" value="02CE" /> <Preset name="66%" value="02AA" /> <Preset name="60%" value="0268" /> <Preset name="55%" value="0234" /> <Preset name="50%" value="0200" /> <Preset name="45%" value="01CD" /> <Preset name="40%" value="019A" /> <Preset name="34%" value="015D" /> <Preset name="30%" value="0134" /> <Preset name="25%" value="0100" /> <Preset name="20%" value="00CD" /> <Preset name="15%" value="009A" /> <Preset name="12.5%" value="0080" /> <Preset name="10%" value="0067" /> <Preset name="Custom (X/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="FA15A"> 0334 <!-- ori r3,r0,0x0100 ;r3 = Variable (X) [256] --> 19004300 <!-- multu r2,r3 ;Damage*X --> 12180000 <!-- mflo r3 ;r3 = Damage*X --> 821A0300 <!-- srl r3,r3,0x0a ;r3 = (Damage*X)/1024 --> 21106200 <!-- addu r2,r3,r2 ;r2 = ((Damage*X)/1024)+Damage --> 0800E003 <!-- jr r31 ;exit --> 040022A4 <!-- sh r2,0x0004(r1) ;Store New Damage [125%] --> 04002294 <!-- lhu r2,0x0004(r1) ;r2 = Damage --> </Location> <Variable file="BATTLE_BIN" offset="FA178" bytes="2" default="0080" name="Y (damage increase from the sides)"> <Preset name="85%" value="0367" /> <Preset name="80%" value="0334" /> <Preset name="75%" value="0300" /> <Preset name="70%" value="02CE" /> <Preset name="66%" value="02AA" /> <Preset name="60%" value="0268" /> <Preset name="55%" value="0234" /> <Preset name="50%" value="0200" /> <Preset name="45%" value="01CD" /> <Preset name="40%" value="019A" /> <Preset name="34%" value="015D" /> <Preset name="30%" value="0134" /> <Preset name="25%" value="0100" /> <Preset name="20%" value="00CD" /> <Preset name="15%" value="009A" /> <Preset name="12.5%" value="0080" /> <Preset name="10%" value="0067" /> <Preset name="0%" value="0000" /> <Preset name="Custom (Y/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="FA17A"> 0334 <!-- ori r3,r0,0x0080 ;r3 = Variable (Y) [128] --> 19004300 <!-- multu r2,r3 ;Damage*Y --> 12180000 <!-- mflo r3 ;r3 = Damage*Y --> 821A0300 <!-- srl r3,r3,0x0a ;r3 = (Damage*Y)/1024 --> 21106200 <!-- addu r2,r3,r2 ;r2 = ((Damage*Y)/1024)+Damage --> 0800E003 <!-- jr r31 ;exit --> 040022A4 <!-- sh r2,0x0004(r1) ;Store New Damage [112.5%] --> 020023A0 <!-- sb r3,0x0002(r1) ;Store Miss Type: Nullified --> 040020A4 <!-- sh r0,0x0004(r1) ;Store HP Damage = 0 --> 2A0020A4 <!-- sh r0,0x002a(r1) ;Store Hit% = 0 --> 100020A4 <!-- sh r0,0x0010(r1) ;Store Special Effect? = 0 --> 0800E003 <!-- jr r31 --> 250020A0 <!-- sb r0,0x0025(r1) ;Store cleared Attack Type Flags --> 00000000 </Location> </Patch>
<Patch name="Formula 19 becomes Weapon Attack: Damage+X% to monsters"> <Description>'Sidewinder' formula. Performs a weapon attack with increased damage if the target is of the Monster gender. Always fails against targets with ??? Stats and non-monsters. Can poach if Secret Hunt is equipped.</Description> <Location file="BATTLE_BIN" offset="128674"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> 30071680 </Location> <Location file="BATTLE_BIN" offset="F9730"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 1980023C <!-- lui r2,0x8019 --> 982D428C <!-- lw r2,0x2d98(r2) ;r2 = Target's Stats --> 00000000 06004390 <!-- lbu r3,0x0006(r2) ;r3 = Target's Gender Byte --> 00000000 04006230 <!-- andi r2,r3,0x0004 ;Check if Target's Gender Includes ??? Stats --> 04004014 <!-- bne r2,r0,0x00160764 ;Branch to Force Miss if Target has ??? Stats --> 00000000 20006230 <!-- andi r2,r3,0x0020 ;Check if Target's Gender = Monster --> 04004014 <!-- bne r2,r0,0x00160770 ;Branch past Force Miss if Unit is a Monster --> 00000000 C310060C <!-- jal 0x0018430c ;Force Miss routine --> 00000000 EC810508 <!-- j 0x001607b0 ;Jump to end --> 01000234 <!-- ori r2,r0,0x0001 ;r2 = Default to attack flag --> 1980013C <!-- lui r1,0x8019 --> E93822A0 <!-- sb r2,0x38e9(r1) ;Store Default to attack flag --> 562B060C <!-- jal 0x0018ad58 ;Perform Weapon Attack routine --> 00000000 1980013C <!-- lui r1,0x8019 --> 902D218C <!-- lw r1,0x2d90(r1) ;r1 = Current Action Data Pointer --> 00000000 04002294 <!-- lhu r2,0x0004(r1) ;r2 = Damage --> </Location> <Variable file="BATTLE_BIN" offset="F9794" bytes="2" default="0555" name="X"> <Preset name="100%" value="0800" /> <Preset name="85%" value="0767" /> <Preset name="80%" value="0734" /> <Preset name="75%" value="0700" /> <Preset name="70%" value="06CE" /> <Preset name="67%" value="06AF" /> <Preset name="60%" value="0668" /> <Preset name="55%" value="0634" /> <Preset name="50%" value="0600" /> <Preset name="45%" value="05CD" /> <Preset name="40%" value="059A" /> <Preset name="33%" value="0555" /> <Preset name="30%" value="0534" /> <Preset name="25%" value="0500" /> <Preset name="20%" value="04CD" /> <Preset name="15%" value="049A" /> <Preset name="12.5%" value="0480" /> <Preset name="10%" value="0467" /> <Preset name="Custom (X/400h [1024] )" modify="true" /> </Variable> <Location file="BATTLE_BIN" offset="F9796"> 0334 <!-- ori r3,r0,0x0555 ;r3 = Variable (X) [1365] --> 19004300 <!-- multu r2,r3 ;Damage*X --> 12100000 <!-- mflo r2 ;r2 = Damage*X --> 82120200 <!-- srl r2,r2,0x0a ;r2 = (Damage*X)/1024 --> 040022A4 <!-- sh r2,0x0004(r1) ;store new damage amount --> 281F060C <!-- jal 0x00187ca0 ;Formula 01 - 06 Aftermath (Poach) --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 21 (Bizen Boat) gains 100% status inflicting"> <Description> </Description> <Location file="BATTLE_BIN" offset="122614"> 1980013C <!-- lui r1,0x8019 --> CE382394 <!-- lhu r3,0x38ce(r1) ;r3 = XA --> D0382294 <!-- lhu r2,0x38d0(r1) ;r2 = YA --> 00000000 19006200 <!-- multu r3,r2 ;XA * YA --> 902D238C <!-- lw r3,0x2d90(r1) ;r3 = Target Current Action Data Pointer --> 20000234 <!-- ori r2,r0,0x0020 ;r2 = MP Damage flag --> 250062A0 <!-- sb r2,0x0025(r3) ;Store Attack Type as MP Damage --> 12100000 <!-- mflo r2 ;r2 = XA * YA --> 080062A4 <!-- sh r2,0x0008(r3) ;Store XA * YA MP Damage --> AD1F060C <!-- jal 0x00187eb4 ;Apply status (Preserve hit status, evade type, hit %) --> 00000000 </Location> </Patch>
<Patch name="Formula 27 (Gil Taking) becomes Damage=(SP/2)*((PA+WP)/2)+Steal Gil"> <Description>'Mug' formula. Has weapon elemental, Attack/Defense Up, Martial Arts, and critical hits.</Description> <Location file="BATTLE_BIN" offset="122828"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 4421060C <!-- jal 0x00188510 ;Physical Evade Calculation --> 00000000 0B004014 <!-- bne r2,r0,0x00189868 ;Branch to end if evaded --> 00000000 D119060C <!-- jal 0x00186744 ;Steal Gil routine --> 00000000 1980013C <!-- lui r1,0x8019 --> 942D228C <!-- lw r2,0x2d94(r1) ;r2 = Attacker's Data Pointer --> 02392390 <!-- lbu r3,0x3902(r1) ;r3 = WP --> 36004490 <!-- lbu r4,0x0036(r2) ;r4 = PA --> 38004290 <!-- lbu r2,0x0038(r2) ;r2 = SP --> 21188300 <!-- addu r3,r4,r3 ;r3 = PA+WP --> F4810508 <!-- j 0x001607d0 ;Jump to new code section --> 42100200 <!-- srl r2,r2,0x01 ;r2 = SP/2 --> 0A820508 <!-- j 0x00160828 ;Jump to exit --> 00000000 </Location> <Location file="BATTLE_BIN" offset="F97D0"> 42180300 <!-- srl r3,r3,0x01 ;r3 = (PA+WP)/2 --> CE3822A4 <!-- sh r2,0x38ce(r1) ;XA = SP/2 --> D03823A4 <!-- sh r3,0x38d0(r1) ;YA = (PA+WP)/2 --> E917060C <!-- jal 0x00185fa4 ;Weapon Element Strengthen --> 00000000 7E21060C <!-- jal 0x001885f8 ;Physical XA Modifying Statuses/Support --> 00000000 3E19060C <!-- jal 0x001864f8 ;Critical Hit Calculation --> 00000000 5A19060C <!-- jal 0x00186568 ;XA * YA Calculation --> 00000000 F41B060C <!-- jal 0x00186fd0 ;Weapon Elemental routine --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Load Current Action Data Pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Load Hit Flag --> 00000000 03004010 <!-- beq r2,r0,0x00160828 ;Branch to end if element nulled --> 00000000 3F1C060C <!-- jal 0x001870fc ;Elemental Absorption --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 27 stolen Gil amount is doubled"> <Description>From (CasterLevel*Speed) to (CasterLevel*Speed)*2</Description> <Location file="BATTLE_BIN" offset="11F788"> 40801000 </Location> </Patch>
<Patch name="Formula 27 stolen Gil amount is quadrupled"> <Description>From (CasterLevel*Speed) to (CasterLevel*Speed)*4</Description> <Location file="BATTLE_BIN" offset="11F788"> 80801000 </Location> </Patch>
<Patch name="Formula 36 (Accumulate) boosts PA by Y, MA by X"> <Description> </Description> <Location file="BATTLE_BIN" offset="11F8F0"> 1980013C <!-- lui r1,0x8019 --> F9382290 <!-- lbu r2,0x38f9(r1) ;r2 = Ability X --> FA382390 <!-- lbu r3,0x38fa(r1) ;r3 = Ability Y --> 902D218C <!-- lw r1,0x2d90(r1) ;r1 = Current Action Data Pointer --> 80004234 <!-- ori r2,r2,0x0080 ;Set r2 as negative --> 150022A0 <!-- sb r2,0x0015(r1) ;Store r2 as MA change --> 80006334 <!-- ori r3,r3,0x0080 ;Set r3 as negative --> 140023A0 <!-- sb r3,0x0014(r1) ;Store r3 as PA change --> 01000234 <!-- ori r2,r0,0x0001 ;Load Pseudo-Status Flag --> 0800E003 <!-- jr r31 --> 250022A0 <!-- sb r2,0x0025(r1) ;Store Attack Type as Pseudo-Status --> </Location> </Patch>
(continued; post size exceeded)
Title: Re: Grond's ASM patches
Post by: Grond on April 18, 2023, 08:56:55 pm
FORMULAS (continued)
<Patch name="Formula 42 (Work skills) gain damage modifiers, crits, and 100% status"> <Description>Damage is now modified by presence of Attack/Defense Up, Martial Arts, Charging, Protect, Sleep, Chicken, Frog. Inflict Status ID on Compress should probably be changed from 29 to 77 (assuming them unchanged from the base game) to avoid a 100% Death infliction rate.</Description> <Location file="BATTLE_BIN" offset="12317C"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 8117060C <!-- jal 0x00185e04 ;Store PA and Y as XA and YA --> 00000000 5318060C <!-- jal 0x0018614c ;Formula 32-35 Attack Up and Martial Arts --> 00000000 B722060C <!-- jal 0x00188adc ;Cluster of Physical Routines --> 00000000 3E19060C <!-- jal 0x001864f8 ;Critical Hit Calculation --> 00000000 1980013C <!-- lui r1,0x8019 --> CE382394 <!-- lhu r3,0x38ce(r1) ;r3 = XA --> D0382294 <!-- lhu r2,0x38d0(r1) ;r2 = YA --> 00000000 19006200 <!-- multu r3,r2 ;XA * YA --> 902D238C <!-- lw r3,0x2d90(r1) ;r3 = Target Current Action Data Pointer --> 12100000 <!-- mflo r2 ;r2 = XA * YA --> 040062A4 <!-- sh r2,0x0004(r3) ;Store XA * YA Damage to Target --> 00140200 <!-- sll r2,r2,0x10 ;r2 = (XA * YA)*65536 --> F9382390 <!-- lbu r3,0x38f9(r1) ;r3 = Ability X --> 03140200 <!-- sra r2,r2,0x10 ;r2 = ((XA * YA)*65536)/65536 --> 1A004300 <!-- div r2,r3 ;(XA * YA)/ X --> 12100000 <!-- mflo r2 ;r2 = (XA * YA)/ X --> 8C2D248C <!-- lw r4,0x2d8c(r1) ;r4 = Attacker Current Action Data Pointer --> 01000334 <!-- ori r3,r0,0x0001 ;r3 = Hit flag = Hit --> 000083A0 <!-- sb r3,0x0000(r4) ;Store Hit on Attacker --> 040082A4 <!-- sh r2,0x0004(r4) ;Store (XA * YA)/ X Damage to Attacker --> 902D228C <!-- lw r2,0x2d90(r1) ;r2 = Target Current Action Data Pointer --> 80000334 <!-- ori r3,r0,0x0080 ;r3 = HP Damage flag --> 250043A0 <!-- sb r3,0x0025(r2) ;Store Attack Type as HP Damage on Target --> 8C2D228C <!-- lw r2,0x2d8c(r1) ;r2 = Attacker Current Action Data Pointer --> 00000000 250043A0 <!-- sb r3,0x0025(r2) ;Store Attack Type as HP Damage on Attacker --> AD1F060C <!-- jal 0x00187eb4 ;Apply status (Preserve hit status, evade type, hit %) --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 46 becomes Y% Damage, Status at SP+X%; no damage if status fails"> <Description>A physical formula with Attack/Defense Up, Martial Arts, elemental (but not weapon elemental); physically evadable.</Description> <Location file="BATTLE_BIN" offset="128728"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> 40081680 </Location> <Location file="BATTLE_BIN" offset="F9840"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 4421060C <!-- jal 0x00188510 ;;Physical Evade Calculation --> 00000000 2A004014 <!-- bne r2,r0,0x001608fc ;Branch to end if evaded --> 00000000 8C17060C <!-- jal 0x00185e30 ;Store Speed and X --> 00000000 7E21060C <!-- jal 0x001885f8 ;Physical XA Modifying Statuses/Support --> 00000000 6719060C <!-- jal 0x0018659c ;Set XA + YA for Status Formulas --> 00000000 441D060C <!-- jal 0x00187510 ;Set XA * YA as hit% --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Load Action Data Pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Load Hit Flag --> 00000000 1B004010 <!-- beq r2,r0,0x001608fc ;Branch to end if missed --> 00000000 FF17060C <!-- jal 0x00185ffc ;Elemental Strengthen --> 00000000 8919060C <!-- jal 0x00186624 ;Calculate Y% of damage --> 00000000 B41B060C <!-- jal 0x00186ed0 ;Weather Elemental effects? --> 00000000 FE1B060C <!-- jal 0x00186ff8 ;Apply Elemental --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Load Action Data Pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Load Hit Flag --> 00000000 0C004010 <!-- beq r2,r0,0x001608fc ;Branch to end if element nulled --> 00000000 3F1C060C <!-- jal 0x001870fc ;Elemental Absorption --> 00000000 AD1F060C <!-- jal 0x00187eb4 ;Apply status (Preserve hit status, evade type, hit %) --> 00000000 25004290 <!-- lbu r2,0x0025(r2) ;r2 = Attack Type --> 00000000 08004230 <!-- andi r2,r2,0x0008 ;Check status change --> 03004014 <!-- bne r2,r0,0x001608fc ;Branch to end if status change --> 00000000 9013060C <!-- jal 0x00184e40 ;Nullification --> 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 5F becomes X*(TargetLevel+1) damage"> <Description>'Flare Star'/'Chocobuckle' formula. 'X' is Ability X in FFTPatcher. Raw damage--no elemental, (M)Attack/Defense Up, compatibility, Faith, or evasion.</Description> <Location file="BATTLE_BIN" offset="12878C"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> 10091680 </Location> <Location file="BATTLE_BIN" offset="F9910"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 1980013C <!-- lui r1,0x8019 --> 982D228C <!-- lw r2,0x2d98(r1) ;r2 = Target's Data Pointer --> F9382390 <!-- lbu r3,0x38f9(r1) ;r3 = Ability X --> 22004290 <!-- lbu r2,0x0022(r2) ;r2 = Target's Level --> CE3823A4 <!-- sh r3,0x38ce(r1) ;Store Ability X as XA --> 01004224 <!-- addiu r2,r2,0x0001 ;r2 = Level+1 --> 5A19060C <!-- jal 0x00186568 ;XA * YA Calculation --> D03822A4 <!-- sh r2,0x38d0(r1) ;Store Level+1 as YA --> 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 60 becomes X*Injured damage"> <Description>'Everyone's Grudge' formula. 'X' is Ability X in FFTPatcher. 'Injured' is the game's weird name for the number of enemies you have allowed to decay into Crystal/Treasure Box. Raw damage--no elemental, (M)Attack/Defense Up, compatibility, Faith, or evasion.</Description> <Location file="BATTLE_BIN" offset="128790"> <!-- Consult ffhacktics.com/wiki/Formula_Table to use a different formula --> 50091680 </Location> <Location file="BATTLE_BIN" offset="F9950"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> 64ED040C <!-- jal 0x0013b590 ;Get Script Variable... --> 61000434 <!-- ori r4,r0,0x0061 ;With r2 = 'Injured' --> 1980013C <!-- lui r1,0x8019 --> F9382390 <!-- lbu r3,0x38f9(r1) ;r3 = Ability X --> D03822A4 <!-- sh r2,0x38d0(r1) ;Store 'Injured' as YA --> 5A19060C <!-- jal 0x00186568 ;XA * YA Calculation --> CE3823A4 <!-- sh r3,0x38ce(r1) ;store ability X as XA --> 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 63 (Throw) damage becomes (SP+(PA/2))*WP"> <Description>Also gains elemental strengthen, Attack Up/Martial Arts, and crits.</Description> <Location file="BATTLE_BIN" offset="123B98"> E8FFBD27 <!-- addiu r29,r29,-0x0018 --> 1000BFAF <!-- sw r31,0x0010(r29) --> EB20060C <!-- jal 0x001883ac ;Catch routine --> 00000000 4421060C <!-- jal 0x00188510 ;Physical Evade Calculation --> 00000000 20004014 <!-- bne r2,r0,0x00123c34 ;Branch to end if evaded --> 1980013C <!-- lui r1,0x8019 --> 942D228C <!-- lw r2,0x2d94(r1) ;r2 = Attacker's Data Pointer --> 02392390 <!-- lbu r3,0x3902(r1) ;r3 = WP --> 36004490 <!-- lbu r4,0x0036(r2) ;r4 = PA --> 38004290 <!-- lbu r2,0x0038(r2) ;r2 = SP --> 42200400 <!-- srl r4,r4,0x01 ;r4 = PA/2 --> 21104400 <!-- addu r2,r2,r4 ;r2 = SP+(PA/2) --> D03823A4 <!-- sh r3,0x38d0(r1) ;YA = WP --> CE3822A4 <!-- sh r2,0x38ce(r1) ;XA = SP+(PA/2) --> E917060C <!-- jal 0x00185fa4 ;Weapon Element Strengthen --> 00000000 5318060C <!-- jal 0x0018614c ;Formula 32-35 Attack Up and Martial Arts --> 00000000 B722060C <!-- jal 0x00188adc ;Cluster of Physical Routines --> 00000000 3E19060C <!-- jal 0x001864f8 ;Critical Hit Calculation --> 00000000 5A19060C <!-- jal 0x00186568 ;XA * YA Calculation --> 00000000 F41B060C <!-- jal 0x00186fd0 ;Weapon Elemental routine --> 00000000 1980023C <!-- lui r2,0x8019 --> 902D428C <!-- lw r2,0x2d90(r2) ;Load Current Action Data Pointer --> 00000000 00004290 <!-- lbu r2,0x0000(r2) ;Load Hit Flag --> 00000000 05004010 <!-- beq r2,r0,0x00123c34 ;Branch to end if element nulled --> 00000000 3F1C060C <!-- jal 0x001870fc ;Elemental Absorption --> 00000000 00000000 00000000 1000BF8F <!-- lw r31,0x0010(r29) --> 1800BD27 <!-- addiu r29,r29,0x0018 --> 0800E003 <!-- jr r31 --> 00000000 </Location> </Patch>
<Patch name="Formula 63 (Throw) gains 19% status inflicting (READ DESCRIPTION)"> <Description>! Requires the above Formula 63 edit to be applied first. Has a fairly major quirk: if the thrown weapon normally casts an ability on-strike, it will interpret the Ability ID as an 'Inflict Status' ID, if the Ability ID is between 0-7F (range of Inflict Status IDs). For example, an Ice Brand, which casts Ice 2 (Ability ID 19) will add Innocent (Inflict Status ID 19) when thrown. This can be worked around by not having throwable weapons cast an ability between 0-7F, or by nulling out (unchecking all boxes) the Inflict Status ID that matches up with the Ability ID. Or you could perhaps get creative and e.g. have thrown Ice Brands add Stop (to simulate freezing) by changing Inflict Status ID 19 to Stop.</Description> <Location file="BATTLE_BIN" offset="123BB0"> 22004014 <!-- bne r2,r0,0x00123c3c ;Update branch to exit --> </Location> <Location file="BATTLE_BIN" offset="123C1C"> 07004010 <!-- beq r2,r0,0x00123c3c ;Update branch to exit --> </Location> <Location file="BATTLE_BIN" offset="123C24"> C721060C <!-- jal 0x0018871c ;Elemental Absorb and status roll --> 00000000 03004014 <!-- bne r2,r0,0x0018ac3c ;Branch to end if status roll fails --> 00000000 AD1F060C <!-- jal 0x00187eb4 ;Apply status (Preserve hit status, evade type, hit %) --> 00000000 192B0608 <!-- j 0x0018ac64 ;Jump to Formula 64's exit --> 00000000 </Location> </Patch>
<Patch name="Stop game calendar from advancing by a year after meeting Rafa"> <Description>At the end of event 10E (exploding frog event), changes a CallFunction(x02) (make a year pass) instruction to CallFunction(x04) (remove enemy units).</Description> <Location file="EVENT_TEST_EVT" offset="21C800"> 04 </Location> </Patch>
<Patch name="Make game calendar advance by a year at the start of Chapter 3"> <Description>At the end of event C9 (Delita killing Gelwan event), changes a CallFunction(x06) (bring up the Save screen) instruction to CallFunction(x02) (make a year pass).</Description> <Location file="EVENT_TEST_EVT" offset="192BA0"> 02 </Location> </Patch>
<Patch name="Fix palette of zodiac stones during Riovanes Rooftop event"> <Description>About halfway through event 124, changes an EVTCHRPalette instruction to call palette 06 instead of 03. This makes the stones the correct red (Scorpio) and yellow (Taurus). However, they are still referred to as a single stone in the event dialog.</Description> <Location file="EVENT_TEST_EVT" offset="24865A"> 06 </Location> </Patch>
<Patch name="Mustadio not required for chapter 4 Goug events"> <Description>Instead of 16 Mustadio, checks for 03 Ramza.</Description> <Location file="WORLD_WLDCORE_BIN" offset="30B00"> 03 </Location> <Location file="WORLD_WLDCORE_BIN" offset="30B22"> 03 </Location> <Location file="WORLD_WLDCORE_BIN" offset="30B44"> 03 </Location> <Location file="WORLD_WLDCORE_BIN" offset="30B6C"> 03 </Location> </Patch>
OTHER
<Patch name="Degenerator Traps turned into another status trap"> <Description>For those who want to get rid of Degenerators, but would like to keep four trap types. Changed to 'Sticky Trap' (Don't Act + Don't Move). Also makes Steel Needle do 1/4 Max HP damage instead of 1/5.</Description> <Location file="BATTLE_BIN" offset="126C34"> 18006210 <!-- beq r3,r2,0x0018dc98 --> 02006228 <!-- slti r2,r3,0x0002 --> 05004010 <!-- beq r2,r0,0x0018dc54 --> 00000000 0A006010 <!-- beq r3,r0,0x0018dc70 --> 01000234 <!-- ori r2,r0,0x0001 --> 4A370608 <!-- j 0x0018dd28 --> FF001134 <!-- ori r17,r0,0x00ff --> 02000234 <!-- ori r2,r0,0x0002 --> 19006210 <!-- beq r3,r2,0x0018dcc0 --> 03000234 <!-- ori r2,r0,0x0003 --> 28006210 <!-- beq r3,r2,0x0018dd04 --> 00000000 4A370608 <!-- j 0x0018dd28 --> FF001134 <!-- ori r17,r0,0x00ff --> 21200000 <!-- addu r4,r0,r0 --> 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;r3 = Current Action Data Pointer --> 0C000234 <!-- ori r2,r0,0x000c ;r2 = Status(es) to inflict (Don't Act+Move) --> C912060C <!-- jal 0x00184b24 ;Check if Unit is immune to status --> 1F0062A0 <!-- sb r2,0x001f(r3) ;Store in Attack's Status Infliction 5 --> 1A004010 <!-- beq r2,r0,0x0018dcf4 ;Branch if no status is inflicted --> 00000000 38370608 <!-- j 0x0018dce0 ;Jump to store attack type --> 00000000 21200000 <!-- addu r4,r0,r0 --> 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;r3 = Current Action Data Pointer --> 01000234 <!-- ori r2,r0,0x0001 ;r2 = Status(es) to inflict (Death Sentence) --> C912060C <!-- jal 0x00184b24 ;Check if Unit is immune to status --> 1F0062A0 <!-- sb r2,0x001f(r3) ;Store in Attack's Status Infliction 5 --> 10004010 <!-- beq r2,r0,0x0018dcf4 ;Branch if no status is inflicted --> 00000000 38370608 <!-- j 0x0018dce0 ;Jump to store attack type --> 00000000 21200000 <!-- addu r4,r0,r0 --> 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;r3 = Current Action Data Pointer --> 10000234 <!-- ori r2,r0,0x0010 ;r2 = Status(es) to inflict (Sleep) --> C912060C <!-- jal 0x00184b24 ;Check if Unit is immune to status --> 1F0062A0 <!-- sb r2,0x001f(r3) ;Store in Attack's Status Infliction 5 --> 06004010 <!-- beq r2,r0,0x0018dcf4 ;Branch if no status is inflicted --> 00000000 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;r3 = Current Action Data Pointer --> 08000234 <!-- ori r2,r0,0x0008 ;r2 = Status Change flag --> 4A370608 <!-- j 0x0018dd28 --> 250062A0 <!-- sb r2,0x0025(r3) ;Store Attack Type as Status Change --> C310060C <!-- jal 0x0018430c --> 00000000 4B370608 <!-- j 0x0018dd2c --> 21102002 <!-- addu r2,r17,r0 --> 1980033C <!-- lui r3,0x8019 --> 902D638C <!-- lw r3,0x2d90(r3) ;r3 = Current Action Data Pointer --> 80000234 <!-- ori r2,r0,0x0080 ;r2 = HP Damage flag --> 250062A0 <!-- sb r2,0x0025(r3) ;Store Attack Type as HP Damage --> 2A000296 <!-- lhu r2,0x002a(r16) ;r2 = Max HP --> 00000000 82100200 <!-- srl r2,r2,0x02 ;r2 = Max HP / 4 --> 040062A4 <!-- sh r2,0x0004(r3) ;Store (Max HP / 4) HP Damage --> 00000000 </Location> </Patch>
<Patch name="Units with ??? stats start with a maxed CT gauge"> <Description>Still doesn't seem to prevent you from going first in multi-part battles (like Velius) but should work as expected in single-part battles.</Description> <Location file="BATTLE_BIN" offset="11B874"> 9C820508 <!-- j 0x00160a70 ;Jump from 'In between turn control routine' --> </Location> <Location file="BATTLE_BIN" offset="F9A70"> 06006490 <!-- lbu r4,0x0006(r3) ;r3 = Gender byte --> 00000000 04008430 <!-- andi r4,r4,0x0004 ;Check for ??? stats --> 03008014 <!-- bne r4,r0,0x00160a8c ;Branch ahead if ??? stats on --> 00000000 390060A0 <!-- sb r0,0x0039(r3) ;If not, store 0 CT as usual --> 1F0A0608 <!-- j 0x0018287c ;Jump back to original code --> FF000434 <!-- ori r4,r0,0x00ff ;r4 = 255 --> 1F0A0608 <!-- j 0x0018287c ;Jump back to original code... --> 390064A0 <!-- sb r4,0x0039(r3) ;...while storing 255 (Quick) CT --> </Location> </Patch>
<Patch name="Shields use correct graphics in battle"> <Description>! Use only if your shields are still using the base game graphics! In the weapon+shield battle graphics lookup table, there is a couple bytes of junk data wedged in between the weapon and shield locations, offsetting all the shield graphics. This fixes that by nudging the shields back to where they should be.</Description> <Location file="BATTLE_BIN" offset="2D4E4" mode="DATA"> E000E0063000A006F0008006700060066000D006D000D0067000300680008006 </Location> </Patch>