Difference between revisions of "Pre-Attack Phase (Only checks Hamedo)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 25: Line 25:
 
  0017df58: 0c05f688 jal 0x 0017da20          [[Ability Usage Checks and MP Reduction]]
 
  0017df58: 0c05f688 jal 0x 0017da20          [[Ability Usage Checks and MP Reduction]]
 
  0017df5c: 02202021 addu r4,r17,r0
 
  0017df5c: 02202021 addu r4,r17,r0
  0017df60: 14400079 bne r2,r0,0x 0017e148
+
  0017df60: 14400079 bne r2,r0,0x0017e148 branch if ability cannot be used for MP, frog, or silence reasons
  0017df64: a630002c sh r16,0x002c(r17)      Store current mp
+
  0017df64: a630002c sh r16,0x002c(r17)      preserve current mp on unit (this routine isn't permanent?)
 
  0017df68: 00002021 addu r4,r0,r0
 
  0017df68: 00002021 addu r4,r0,r0
 
  0017df6c: 02401821 addu r3,r18,r0
 
  0017df6c: 02401821 addu r3,r18,r0
Line 33: Line 33:
 
  0017df78: 24840001 addiu r4,r4,0x0001
 
  0017df78: 24840001 addiu r4,r4,0x0001
 
  0017df7c: 28820015 slti r2,r4,0x0015
 
  0017df7c: 28820015 slti r2,r4,0x0015
  0017df80: 1440fffb bne r2,r0,0x 0017df70    cycle through units
+
  0017df80: 1440fffb bne r2,r0,0x0017df70    cycle through units
 
  0017df84: 246301c0 addiu r3,r3,0x01c0
 
  0017df84: 246301c0 addiu r3,r3,0x01c0
 
  0017df88: 9222016f lbu r2,0x016f(r17)      load skillset of attack
 
  0017df88: 9222016f lbu r2,0x016f(r17)      load skillset of attack
Line 41: Line 41:
 
  0017df98: 00000000 nop
 
  0017df98: 00000000 nop
 
  0017df9c: 30a300ff andi r3,r5,0x00ff
 
  0017df9c: 30a300ff andi r3,r5,0x00ff
  0017dfa0: 10600004 beq r3,r0,0x 0017dfb4    branch if action menu = default
+
  0017dfa0: 10600004 beq r3,r0,0x0017dfb4    branch if action menu = default
 
  0017dfa4: 00003021 addu r6,r0,r0
 
  0017dfa4: 00003021 addu r6,r0,r0
 
  0017dfa8: 34020006 ori r2,r0,0x0006
 
  0017dfa8: 34020006 ori r2,r0,0x0006
  0017dfac: 1462000d bne r3,r2,0x 0017dfe4    branch if action menu = monster
+
  0017dfac: 1462000d bne r3,r2,0x0017dfe4    branch if action menu <> monster
 
  0017dfb0: 34020008 ori r2,r0,0x0008
 
  0017dfb0: 34020008 ori r2,r0,0x0008
 
  0017dfb4: 96230170 lhu r3,0x0170(r17)      load last attack used
 
  0017dfb4: 96230170 lhu r3,0x0170(r17)      load last attack used
Line 74: Line 74:
 
  0017e01c: 27a40010 addiu r4,r29,0x0010
 
  0017e01c: 27a40010 addiu r4,r29,0x0010
 
  0017e020: 3c018019 lui r1,0x8019
 
  0017e020: 3c018019 lui r1,0x8019
  0017e024: ac20f4f8 sw r0,-0x0b08(r1)        clear ??
+
  0017e024: ac20f4f8 sw r0,-0x0b08(r1)        clear ?? (linear range flag? panel flag?)
  0017e028: 0c05f614 jal 0x 0017d850         [[0017d850 - 0017da1c|map/panel targeting, returns r2 = 1 (valid target)]]
+
  0017e028: 0c05f614 jal 0x0017d850         [[List_and_Sort_Targeted_Units]]
 
  0017e02c: 02202821 addu r5,r17,r0
 
  0017e02c: 02202821 addu r5,r17,r0
 
  0017e030: 00409821 addu r19,r2,r0
 
  0017e030: 00409821 addu r19,r2,r0
 
  0017e034: 34020001 ori r2,r0,0x0001
 
  0017e034: 34020001 ori r2,r0,0x0001
  0017e038: 16620043 bne r19,r2,0x 0017e148
+
  0017e038: 16620043 bne r19,r2,0x0017e148
 
  0017e03c: 00000000 nop
 
  0017e03c: 00000000 nop
 
  0017e040: 93b20010 lbu r18,0x0010(r29)      load target ID
 
  0017e040: 93b20010 lbu r18,0x0010(r29)      load target ID
Line 100: Line 100:
 
  0017e084: 2402ffff addiu r2,r0,0xffff
 
  0017e084: 2402ffff addiu r2,r0,0xffff
 
  0017e088: 02002021 addu r4,r16,r0
 
  0017e088: 02002021 addu r4,r16,r0
  0017e08c: 0c06325a jal 0x0018c968 [[Check if unit can react?]]
+
  0017e08c: 0c06325a jal 0x0018c968 [[Check if unit can react]]
 
  0017e090: 2614016e addiu r20,r16,0x016e
 
  0017e090: 2614016e addiu r20,r16,0x016e
 
  0017e094: 1440002d bne r2,r0,0x 0017e14c      branch if unit can't react
 
  0017e094: 1440002d bne r2,r0,0x 0017e14c      branch if unit can't react

Latest revision as of 07:37, 27 October 2024

Big... Contains Hamedo check
0017defc: 27bdffb8 addiu r29,r29,0xffb8
0017df00: afb5003c sw r21,0x003c(r29)
0017df04: 0080a821 addu r21,r4,r0           r21 = attacker ID
0017df08: afb60040 sw r22,0x0040(r29)
0017df0c: 001510c0 sll r2,r21,0x03
0017df10: 00551023 subu r2,r2,r21
0017df14: 00021180 sll r2,r2,0x06
0017df18: afb20030 sw r18,0x0030(r29)
0017df1c: 3c128019 lui r18,0x8019
0017df20: 265208cc addiu r18,r18,0x08cc
0017df24: afb1002c sw r17,0x002c(r29)
0017df28: 00528821 addu r17,r2,r18          r17 = attacker stats
0017df2c: afbf0044 sw r31,0x0044(r29)
0017df30: afb40038 sw r20,0x0038(r29)
0017df34: afb30034 sw r19,0x0034(r29)
0017df38: afb00028 sw r16,0x0028(r29)
0017df3c: 3c018019 lui r1,0x8019
0017df40: ac2038bc sw r0,0x38bc(r1)
0017df44: 92230001 lbu r3,0x0001(r17)       
0017df48: 340200ff ori r2,r0,0x00ff
0017df4c: 1062007e beq r3,r2,0x 0017e148    Unit exists check
0017df50: 00a0b021 addu r22,r5,r0
0017df54: 9630002c lhu r16,0x002c(r17)      Load current mp
0017df58: 0c05f688 jal 0x 0017da20          Ability Usage Checks and MP Reduction
0017df5c: 02202021 addu r4,r17,r0
0017df60: 14400079 bne r2,r0,0x0017e148	branch if ability cannot be used for MP, frog, or silence reasons
0017df64: a630002c sh r16,0x002c(r17)       preserve current mp on unit (this routine isn't permanent?) 
0017df68: 00002021 addu r4,r0,r0
0017df6c: 02401821 addu r3,r18,r0
0017df70: a460019a sh r0,0x019a(r3)         clear reaction ID
0017df74: a0600189 sb r0,0x0189(r3)         clear turn ended flag?
0017df78: 24840001 addiu r4,r4,0x0001
0017df7c: 28820015 slti r2,r4,0x0015
0017df80: 1440fffb bne r2,r0,0x0017df70     cycle through units
0017df84: 246301c0 addiu r3,r3,0x01c0
0017df88: 9222016f lbu r2,0x016f(r17)       load skillset of attack
0017df8c: 3c018006 lui r1,0x8006
0017df90: 00220821 addu r1,r1,r2
0017df94: 90255cb4 lbu r5,0x5cb4(r1).       Load skillset action menu byte
0017df98: 00000000 nop
0017df9c: 30a300ff andi r3,r5,0x00ff
0017dfa0: 10600004 beq r3,r0,0x0017dfb4     branch if action menu = default
0017dfa4: 00003021 addu r6,r0,r0
0017dfa8: 34020006 ori r2,r0,0x0006
0017dfac: 1462000d bne r3,r2,0x0017dfe4     branch if action menu <> monster
0017dfb0: 34020008 ori r2,r0,0x0008
0017dfb4: 96230170 lhu r3,0x0170(r17)       load last attack used
0017dfb8: 00000000 nop
0017dfbc: 2c620170 sltiu r2,r3,0x0170
0017dfc0: 10400006 beq r2,r0,0x 0017dfdc    branch if last attack isn't an active ability
0017dfc4: 000310c0 sll r2,r3,0x03
0017dfc8: 00431023 subu r2,r2,r3
0017dfcc: 00021040 sll r2,r2,0x01
0017dfd0: 3c018006 lui r1,0x8006
0017dfd4: 00220821 addu r1,r1,r2
0017dfd8: 9026fbf3 lbu r6,-0x040d(r1)       load ability flags 2
0017dfdc: 30a300ff andi r3,r5,0x00ff        r3 = action menu byte
0017dfe0: 34020008 ori r2,r0,0x0008
0017dfe4: 10620008 beq r3,r2,0x 0017e008    branch if action menu = attack
0017dfe8: 2404ffff addiu r4,r0,0xffff
0017dfec: 3402000a ori r2,r0,0x000a
0017dff0: 10620005 beq r3,r2,0x 0017e008    branch if action menu = charge
0017dff4: 34020002 ori r2,r0,0x0002
0017dff8: 10620003 beq r3,r2,0x 0017e008    branch if action menu = item inventory
0017dffc: 30c20020 andi r2,r6,0x0020
0017e000: 10400005 beq r2,r0,0x 0017e018    branch if weapon range flag not active
0017e004: 2402ffff addiu r2,r0,0xffff
0017e008: 0c05eb24 jal 0x0017ac90            Targeting validation (weapon flags)
0017e00c: 2624016e addiu r4,r17,0x016e
0017e010: 00402021 addu r4,r2,r0
0017e014: 2402ffff addiu r2,r0,0xffff
0017e018: 1082004c beq r4,r2,0x 0017e14c    branch if routine returned 0xff (attack failed?)
0017e01c: 27a40010 addiu r4,r29,0x0010
0017e020: 3c018019 lui r1,0x8019
0017e024: ac20f4f8 sw r0,-0x0b08(r1)        clear ?? (linear range flag? panel flag?)
0017e028: 0c05f614 jal 0x0017d850          List_and_Sort_Targeted_Units
0017e02c: 02202821 addu r5,r17,r0
0017e030: 00409821 addu r19,r2,r0
0017e034: 34020001 ori r2,r0,0x0001
0017e038: 16620043 bne r19,r2,0x0017e148
0017e03c: 00000000 nop
0017e040: 93b20010 lbu r18,0x0010(r29)      load target ID
0017e044: 00000000 nop
0017e048: 1255003f beq r18,r21,0x 0017e148  branch if target ID = attacker ID?
0017e04c: 001210c0 sll r2,r18,0x03
0017e050: 00521023 subu r2,r2,r18
0017e054: 00021180 sll r2,r2,0x06
0017e058: 3c038019 lui r3,0x8019
0017e05c: 246308cc addiu r3,r3,0x08cc       target data
0017e060: 00438021 addu r16,r2,r3
0017e064: 9202008e lbu r2,0x008e(r16)		Load 4th set of Reactions
0017e068: 00000000 nop				
0017e06c: 30420001 andi r2,r2,0x0001		
0017e070: 10400036 beq r2,r0,0x 0017e14c	Branch if Hamedo is not equipped
0017e074: 2402ffff addiu r2,r0,0xffff		
0017e078: 0c0634e1 jal 0x0018d384		Chance to React
0017e07c: 02002021 addu r4,r16,r0		
0017e080: 14400032 bne r2,r0,0x 0017e14c		
0017e084: 2402ffff addiu r2,r0,0xffff		
0017e088: 02002021 addu r4,r16,r0		
0017e08c: 0c06325a jal 0x0018c968		Check if unit can react
0017e090: 2614016e addiu r20,r16,0x016e
0017e094: 1440002d bne r2,r0,0x 0017e14c       branch if unit can't react
0017e098: 2402ffff addiu r2,r0,0xffff
0017e09c: 3c058019 lui r5,0x8019
0017e0a0: 24a53848 addiu r5,r5,0x3848
0017e0a4: 3c018019 lui r1,0x8019
0017e0a8: ac33f5f0 sw r19,-0x0a10(r1)          store ??
0017e0ac: 0c01788b jal 0x0005e22c             transfer target data
0017e0b0: 02802021 addu r4,r20,r0
0017e0b4: 02002021 addu r4,r16,r0
0017e0b8: 34050001 ori r5,r0,0x0001
0017e0bc: 340201c5 ori r2,r0,0x01c5
0017e0c0: 00003021 addu r6,r0,r0
0017e0c4: 34070001 ori r7,r0,0x0001
0017e0c8: 3c018019 lui r1,0x8019
0017e0cc: a4222d9c sh r2,0x2d9c(r1)        store reaction ID?
0017e0d0: 3c018019 lui r1,0x8019
0017e0d4: ac35f8c8 sw r21,-0x0738(r1)      store acting unit ID? (attacker)
0017e0d8: 0c05f994 jal 0x 0017e650         Store counter ability?
0017e0dc: a212016e sb r18,0x016e(r16)      store attacker/self ID (target)
0017e0e0: 14400015 bne r2,r0,0x 0017e138
0017e0e4: 00000000 nop
0017e0e8: 0c05f688 jal 0x 0017da20         Ability Usage Checks and MP Reduction
0017e0ec: 02002021 addu r4,r16,r0
0017e0f0: 14400011 bne r2,r0,0x 0017e138
0017e0f4: 00000000 nop
0017e0f8: 0c05f528 jal 0x 0017d4a0          Current Action Ability Data Setting / Multi Hit Formulas
0017e0fc: 02002021 addu r4,r16,r0
0017e100: 3c028019 lui r2,0x8019
0017e104: 94422d9c lhu r2,0x2d9c(r2)        load reaction ID
0017e108: 00000000 nop
0017e10c: a6c20000 sh r2,0x0000(r22)        store reaction ID to stack
0017e110: 3c018019 lui r1,0x8019
0017e114: ac3338bc sw r19,0x38bc(r1)        store skillset of attack?
0017e118: 92230003 lbu r3,0x0003(r17)       load job ID
0017e11c: 3402005d ori r2,r0,0x005d
0017e120: 14620003 bne r3,r2,0x 0017e130    branch if not mime
0017e124: 340200ff ori r2,r0,0x00ff
0017e128: a222001d sb r2,0x001d(r17)        
0017e12c: a222001f sb r2,0x001f(r17)        store weapons = 0xff
0017e130: 0805f853 j 0x 0017e14c            jump to end, return r2 = reacting unit ID?
0017e134: 02401021 addu r2,r18,r0
0017e138: 3c048019 lui r4,0x8019
0017e13c: 24843848 addiu r4,r4,0x3848
0017e140: 0c01788b jal 0x0005e22c           store target data
0017e144: 02802821 addu r5,r20,r0
0017e148: 2402ffff addiu r2,r0,0xffff       return r2 = 0xff
0017e14c: 8fbf0044 lw r31,0x0044(r29)
0017e150: 8fb60040 lw r22,0x0040(r29)
0017e154: 8fb5003c lw r21,0x003c(r29)
0017e158: 8fb40038 lw r20,0x0038(r29)
0017e15c: 8fb30034 lw r19,0x0034(r29)
0017e160: 8fb20030 lw r18,0x0030(r29)
0017e164: 8fb1002c lw r17,0x002c(r29)
0017e168: 8fb00028 lw r16,0x0028(r29)
0017e16c: 27bd0048 addiu r29,r29,0x0048
0017e170: 03e00008 jr r31
0017e174: 00000000 nop