Difference between revisions of "Action phase control"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 000739cc: 27bdffc0 addiu r29,r29,0xffc0 000739d0: afbf003c sw r31,0x003c(r29) 000739d4: afb40038 sw r20,0x0038(r29) 000739d8: afb30034 sw r19,0...")
 
m
 
(3 intermediate revisions by 2 users not shown)
Line 28: Line 28:
 
  00073a30: 0801ced3 j 0x00073b4c
 
  00073a30: 0801ced3 j 0x00073b4c
 
  00073a34: 00000000 nop
 
  00073a34: 00000000 nop
 +
 
  if pre-attack
 
  if pre-attack
 +
 
  00073a38: 8e420134 lw r2,0x0134(r18) load unit data
 
  00073a38: 8e420134 lw r2,0x0134(r18) load unit data
 
  00073a3c: 00000000 nop
 
  00073a3c: 00000000 nop
 
  00073a40: 9044018a lbu r4,0x018a(r2)
 
  00073a40: 9044018a lbu r4,0x018a(r2)
  00073a44: 0c05f7bf jal 0x0017defc Hamedo routine
+
  00073a44: 0c05f7bf jal 0x0017defc [[Pre-Attack Phase (Only checks Hamedo)]]
 
  00073a48: 27a50012 addiu r5,r29,0x0012
 
  00073a48: 27a50012 addiu r5,r29,0x0012
 
  00073a4c: 0801cebc j 0x00073af0
 
  00073a4c: 0801cebc j 0x00073af0
 
  00073a50: 00408821 addu r17,r2,r0 r17 = result
 
  00073a50: 00408821 addu r17,r2,r0 r17 = result
 +
 
  if = first attacker is acting
 
  if = first attacker is acting
 +
 
  00073a54: 8e420134 lw r2,0x0134(r18) load unit data
 
  00073a54: 8e420134 lw r2,0x0134(r18) load unit data
 
  00073a58: 00000000 nop
 
  00073a58: 00000000 nop
 
  00073a5c: 9044018a lbu r4,0x018a(r2)
 
  00073a5c: 9044018a lbu r4,0x018a(r2)
  00073a60: 0c05f26e jal 0x0017c9b8 prep current action data
+
  00073a60: 0c05f26e jal 0x0017c9b8 [[Prep Current Action Data]]
 
  00073a64: 00000000 nop
 
  00073a64: 00000000 nop
 
  00073a68: 00408821 addu r17,r2,r0
 
  00073a68: 00408821 addu r17,r2,r0
Line 52: Line 56:
 
  00073a88: ac22611c sw r2,0x611c(r1) store casting unit misc. ID
 
  00073a88: ac22611c sw r2,0x611c(r1) store casting unit misc. ID
 
  00073a8c: 9085018a lbu r5,0x018a(r4) load unit ID
 
  00073a8c: 9085018a lbu r5,0x018a(r4) load unit ID
  00073a90: 0c0505d7 jal 0x0014175c spell quote event?
+
  00073a90: 0c0505d7 jal 0x0014175c [[Spell Quote determination]]
 
  00073a94: 2484016e addiu r4,r4,0x016e r4 = unit's targeting data
 
  00073a94: 2484016e addiu r4,r4,0x016e r4 = unit's targeting data
 
  00073a98: 8642015e lh r2,0x015e(r18) load ability used ID
 
  00073a98: 8642015e lh r2,0x015e(r18) load ability used ID
Line 61: Line 65:
 
  00073aac: 0801ced3 j 0x00073b4c
 
  00073aac: 0801ced3 j 0x00073b4c
 
  00073ab0: a6420138 sh r2,0x0138(r18) store used ability ID
 
  00073ab0: a6420138 sh r2,0x0138(r18) store used ability ID
 +
 
  if gaining EXP/JP?
 
  if gaining EXP/JP?
 +
 
  00073ab4: 06200005 bltz r17,0x00073acc branch if return value = 0xff
 
  00073ab4: 06200005 bltz r17,0x00073acc branch if return value = 0xff
 
  00073ab8: 2a220004 slti r2,r17,0x0004
 
  00073ab8: 2a220004 slti r2,r17,0x0004
 
  00073abc: 10400003 beq r2,r0,0x00073acc branch if return value > 3
 
  00073abc: 10400003 beq r2,r0,0x00073acc branch if return value > 3
 
  00073ac0: 02402021 addu r4,r18,r0
 
  00073ac0: 02402021 addu r4,r18,r0
  00073ac4: 0c0203fb jal 0x00080fec prep for earned JP/EXP
+
  00073ac4: 0c0203fb jal 0x00080fec [[Activate numerical sprite data?|prep for earned JP/EXP]]
 
  00073ac8: 02202821 addu r5,r17,r0
 
  00073ac8: 02202821 addu r5,r17,r0
  00073acc: 0c020bbb jal 0x00082eec set animation based on status
+
  00073acc: 0c020bbb jal 0x00082eec [[Set Animation based on status]]
 
  00073ad0: 02402021 addu r4,r18,r0
 
  00073ad0: 02402021 addu r4,r18,r0
  00073ad4: 0c01cac5 jal 0x00072b14
+
  00073ad4: 0c01cac5 jal 0x00072b14                             [[00072b14 - 00072b4c]]
 
  00073ad8: 02402021 addu r4,r18,r0
 
  00073ad8: 02402021 addu r4,r18,r0
 
  00073adc: 0801ced3 j 0x00073b4c
 
  00073adc: 0801ced3 j 0x00073b4c
 
  00073ae0: 2411ffff addiu r17,r0,0xffff
 
  00073ae0: 2411ffff addiu r17,r0,0xffff
 +
 
  If Reacting phase
 
  If Reacting phase
  00073ae4: 0c05f85e jal 0x0017e178 main reaction routine
+
 
 +
  00073ae4: 0c05f85e jal 0x0017e178 [[Main reaction routine?]]
 
  00073ae8: 27a40012 addiu r4,r29,0x0012
 
  00073ae8: 27a40012 addiu r4,r29,0x0012
 
  00073aec: 00408821 addu r17,r2,r0
 
  00073aec: 00408821 addu r17,r2,r0
Line 82: Line 90:
 
  00073af8: 3c018009 lui r1,0x8009
 
  00073af8: 3c018009 lui r1,0x8009
 
  00073afc: ac3360e4 sw r19,0x60e4(r1) set ?? byte = 29 - game flow byte?
 
  00073afc: ac3360e4 sw r19,0x60e4(r1) set ?? byte = 29 - game flow byte?
  00073b00: 0c01e9c9 jal 0x0007a724 find unit misc data pointer
+
  00073b00: 0c01e9c9 jal 0x0007a724 [[Get_unit_misc_data_that_matches_r4_ID]]
 
  00073b04: 3224ffff andi r4,r17,0xffff
 
  00073b04: 3224ffff andi r4,r17,0xffff
 
  00073b08: 00408021 addu r16,r2,r0
 
  00073b08: 00408021 addu r16,r2,r0
Line 92: Line 100:
 
  00073b20: ac22611c sw r2,0x611c(r1) store casting units ID
 
  00073b20: ac22611c sw r2,0x611c(r1) store casting units ID
 
  00073b24: 9065018a lbu r5,0x018a(r3) load unit ID
 
  00073b24: 9065018a lbu r5,0x018a(r3) load unit ID
  00073b28: 0c0505d7 jal 0x0014175c big control routine?
+
  00073b28: 0c0505d7 jal 0x0014175c [[Spell Quote determination]]
 
  00073b2c: 34060001 ori r6,r0,0x0001
 
  00073b2c: 34060001 ori r6,r0,0x0001
 
  00073b30: 87a20012 lh r2,0x0012(r29) load used ability ID
 
  00073b30: 87a20012 lh r2,0x0012(r29) load used ability ID
Line 103: Line 111:
 
  00073b4c: 1634000a bne r17,r20,0x00073b78
 
  00073b4c: 1634000a bne r17,r20,0x00073b78
 
  00073b50: 34020001 ori r2,r0,0x0001
 
  00073b50: 34020001 ori r2,r0,0x0001
 +
 
  if hamedo/Reaction fails
 
  if hamedo/Reaction fails
 +
 
  00073b54: 3c028009 lui r2,0x8009
 
  00073b54: 3c028009 lui r2,0x8009
 
  00073b58: 8c426214 lw r2,0x6214(r2) load ?? word
 
  00073b58: 8c426214 lw r2,0x6214(r2) load ?? word

Latest revision as of 05:23, 16 November 2022

000739cc: 27bdffc0 addiu r29,r29,0xffc0
000739d0: afbf003c sw r31,0x003c(r29)
000739d4: afb40038 sw r20,0x0038(r29)
000739d8: afb30034 sw r19,0x0034(r29)
000739dc: afb20030 sw r18,0x0030(r29)
000739e0: afb1002c sw r17,0x002c(r29)
000739e4: 0c01e886 jal 0x0007a218				get unit misc data
000739e8: afb00028 sw r16,0x0028(r29)
000739ec: 00409021 addu r18,r2,r0				r18 = unit misc data
000739f0: 2414ffff addiu r20,r0,0xffff
000739f4: 34130029 ori r19,r0,0x0029
000739f8: 3c038009 lui r3,0x8009
000739fc: 8c636214 lw r3,0x6214(r3)              load action phase
00073a00: 34020001 ori r2,r0,0x0001
00073a04: 10620013 beq r3,r2,0x00073a54          branch if first attacker acting
00073a08: 28620002 slti r2,r3,0x0002
00073a0c: 10400005 beq r2,r0,0x00073a24          branch if reacting or action ending
00073a10: 00000000 nop
00073a14: 10600008 beq r3,r0,0x00073a38          branch if word = 0 (Pre attack)
00073a18: 00000000 nop
00073a1c: 0801ced3 j 0x00073b4c
00073a20: 00000000 nop
00073a24: 34020002 ori r2,r0,0x0002
00073a28: 1062002e beq r3,r2,0x00073ae4			branch if reacting
00073a2c: 00000000 nop
00073a30: 0801ced3 j 0x00073b4c
00073a34: 00000000 nop
if pre-attack
00073a38: 8e420134 lw r2,0x0134(r18)			load unit data
00073a3c: 00000000 nop
00073a40: 9044018a lbu r4,0x018a(r2)
00073a44: 0c05f7bf jal 0x0017defc				Pre-Attack Phase (Only checks Hamedo)
00073a48: 27a50012 addiu r5,r29,0x0012
00073a4c: 0801cebc j 0x00073af0
00073a50: 00408821 addu r17,r2,r0				r17 = result
if = first attacker is acting
00073a54: 8e420134 lw r2,0x0134(r18)			load unit data
00073a58: 00000000 nop
00073a5c: 9044018a lbu r4,0x018a(r2)
00073a60: 0c05f26e jal 0x0017c9b8				Prep Current Action Data
00073a64: 00000000 nop
00073a68: 00408821 addu r17,r2,r0
00073a6c: 16200011 bne r17,r0,0x00073ab4		branch if result != 0
00073a70: 34060001 ori r6,r0,0x0001
00073a74: 3c018009 lui r1,0x8009
00073a78: ac3360e4 sw r19,0x60e4(r1)			store next script
00073a7c: 92420004 lbu r2,0x0004(r18)			load unit misc. ID
00073a80: 8e440134 lw r4,0x0134(r18)			load unit data
00073a84: 3c018009 lui r1,0x8009
00073a88: ac22611c sw r2,0x611c(r1)				store casting unit misc. ID
00073a8c: 9085018a lbu r5,0x018a(r4)			load unit ID
00073a90: 0c0505d7 jal 0x0014175c				Spell Quote determination
00073a94: 2484016e addiu r4,r4,0x016e			r4 = unit's targeting data
00073a98: 8642015e lh r2,0x015e(r18)			load ability used ID
00073a9c: a24001b5 sb r0,0x01b5(r18)			clear ??
00073aa0: 3c01800a lui r1,0x800a
00073aa4: ac208db8 sw r0,-0x7248(r1)			store some display data?
00073aa8: ae420170 sw r2,0x0170(r18)			store used ability?
00073aac: 0801ced3 j 0x00073b4c
00073ab0: a6420138 sh r2,0x0138(r18)			store used ability ID
if gaining EXP/JP?
00073ab4: 06200005 bltz r17,0x00073acc			branch if return value = 0xff
00073ab8: 2a220004 slti r2,r17,0x0004
00073abc: 10400003 beq r2,r0,0x00073acc			branch if return value > 3
00073ac0: 02402021 addu r4,r18,r0
00073ac4: 0c0203fb jal 0x00080fec				prep for earned JP/EXP
00073ac8: 02202821 addu r5,r17,r0
00073acc: 0c020bbb jal 0x00082eec				Set Animation based on status
00073ad0: 02402021 addu r4,r18,r0
00073ad4: 0c01cac5 jal 0x00072b14                              00072b14 - 00072b4c
00073ad8: 02402021 addu r4,r18,r0
00073adc: 0801ced3 j 0x00073b4c
00073ae0: 2411ffff addiu r17,r0,0xffff
If Reacting phase
00073ae4: 0c05f85e jal 0x0017e178				Main reaction routine?
00073ae8: 27a40012 addiu r4,r29,0x0012
00073aec: 00408821 addu r17,r2,r0
00073af0: 12340018 beq r17,r20,0x00073b54		branch if result = 0xff (fail?)
00073af4: 00000000 nop
00073af8: 3c018009 lui r1,0x8009
00073afc: ac3360e4 sw r19,0x60e4(r1)			set ?? byte = 29 - game flow byte?
00073b00: 0c01e9c9 jal 0x0007a724				Get_unit_misc_data_that_matches_r4_ID
00073b04: 3224ffff andi r4,r17,0xffff
00073b08: 00408021 addu r16,r2,r0
00073b0c: 92020004 lbu r2,0x0004(r16)			unit misc ID
00073b10: a3a00011 sb r0,0x0011(r29)
00073b14: 8e030134 lw r3,0x0134(r16)			load unit data
00073b18: 27a40010 addiu r4,r29,0x0010
00073b1c: 3c018009 lui r1,0x8009
00073b20: ac22611c sw r2,0x611c(r1)				store casting units ID
00073b24: 9065018a lbu r5,0x018a(r3)			load unit ID
00073b28: 0c0505d7 jal 0x0014175c				Spell Quote determination
00073b2c: 34060001 ori r6,r0,0x0001
00073b30: 87a20012 lh r2,0x0012(r29)			load used ability ID
00073b34: 00008821 addu r17,r0,r0
00073b38: a20001b5 sb r0,0x01b5(r16)
00073b3c: 3c01800a lui r1,0x800a
00073b40: ac208db8 sw r0,-0x7248(r1)
00073b44: ae020170 sw r2,0x0170(r16)			store used ability ID
00073b48: a6020138 sh r2,0x0138(r16)			store used ability ID
00073b4c: 1634000a bne r17,r20,0x00073b78
00073b50: 34020001 ori r2,r0,0x0001
if hamedo/Reaction fails
00073b54: 3c028009 lui r2,0x8009
00073b58: 8c426214 lw r2,0x6214(r2)				load ?? word
00073b5c: 00000000 nop
00073b60: 24420001 addiu r2,r2,0x0001
00073b64: 3c018009 lui r1,0x8009
00073b68: ac226214 sw r2,0x6214(r1)				set stage of attack
00073b6c: 28420003 slti r2,r2,0x0003
00073b70: 1440ffa1 bne r2,r0,0x000739f8			run routine again until acted and reacted
00073b74: 00001021 addu r2,r0,r0
00073b78: 8fbf003c lw r31,0x003c(r29)
00073b7c: 8fb40038 lw r20,0x0038(r29)
00073b80: 8fb30034 lw r19,0x0034(r29)
00073b84: 8fb20030 lw r18,0x0030(r29)
00073b88: 8fb1002c lw r17,0x002c(r29)
00073b8c: 8fb00028 lw r16,0x0028(r29)
00073b90: 27bd0040 addiu r29,r29,0x0040
00073b94: 03e00008 jr r31
00073b98: 00000000 nop