Difference between revisions of "AI Initial Targeting Selection"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Line 1: Line 1:
<font face='Courier New'>
+
 
 
   
 
   
 
  00195d94: 3c02801a lui r2,0x801a
 
  00195d94: 3c02801a lui r2,0x801a
Line 126: Line 126:
 
  00195f64: 03e00008 jr r31
 
  00195f64: 03e00008 jr r31
 
  00195f68: 00000000 nop
 
  00195f68: 00000000 nop
</font>
+
 
 +
=== Return Locations ===
 +
'''Battle.bin '''
 +
00194070: [[Main AI action setup]]

Revision as of 16:01, 11 March 2024


00195d94: 3c02801a lui r2,0x801a
00195d98: 90420d7b lbu r2,0x0d7b(r2)			load return from 194e50
00195d9c: 27bdffe0 addiu r29,r29,0xffe0
00195da0: afb20018 sw r18,0x0018(r29)
00195da4: 3c12801a lui r18,0x801a
00195da8: 2652f3c4 addiu r18,r18,0xf3c4			r18 = AI data
00195dac: afbf001c sw r31,0x001c(r29)
00195db0: afb10014 sw r17,0x0014(r29)
00195db4: 10400011 beq r2,r0,0x00195dfc			branch if ?? = 0
00195db8: afb00010 sw r16,0x0010(r29)
00195dbc: 3c03801a lui r3,0x801a
00195dc0: 90630031 lbu r3,0x0031(r3)			???
00195dc4: 34020002 ori r2,r0,0x0002
00195dc8: 10620044 beq r3,r2,0x00195edc			branch if ?? = 0xff
00195dcc: 28620003 slti r2,r3,0x0003
00195dd0: 10400005 beq r2,r0,0x00195de8			skip if ?? < 3
00195dd4: 00000000 nop
00195dd8: 1060001a beq r3,r0,0x00195e44			jump to AI status
00195ddc: 00000000 nop
00195de0: 080657cc j 0x00195f30
00195de4: 00000000 nop

00195de8: 34020003 ori r2,r0,0x0003
00195dec: 10620047 beq r3,r2,0x00195f0c			
00195df0: 00000000 nop
00195df4: 080657cc j 0x00195f30
00195df8: 00000000 nop

Initialization

00195dfc: 00008021 addu r16,r0,r0
00195e00: 34110054 ori r17,r0,0x0054
00195e04: 0c0657db jal 0x00195f6c			Initialize some AI Data (mount, base hit %)
00195e08: 02512021 addu r4,r18,r17
00195e0c: 26100001 addiu r16,r16,0x0001
00195e10: 2a020008 slti r2,r16,0x0008
00195e14: 1440fffb bne r2,r0,0x00195e04			perform 8 times?
00195e18: 26310020 addiu r17,r17,0x0020
00195e1c: 0c0657db jal 0x00195f6c			Initialize some AI Data (mount, base hit %)
00195e20: 26440014 addiu r4,r18,0x0014
00195e24: 0c0657db jal 0x00195f6c			Initialize some AI Data (mount, base hit %)
00195e28: 26440034 addiu r4,r18,0x0034
00195e2c: 0c0657db jal 0x00195f6c			Initialize some AI Data (mount, base hit %)
00195e30: 26440154 addiu r4,r18,0x0154			AI data + 0x154?
00195e34: 0c0657db jal 0x00195f6c			Initialize some AI Data (mount, base hit %)
00195e38: 264417fc addiu r4,r18,0x17fc			AI data + 0x17fc?

Decision Stuff

00195e3c: 0c0665c7 jal 0x0019971c			Check for good units to target (based on distance,status,coordinate)
00195e40: 00000000 nop
00195e44: 0c065c6e jal 0x001971b8			Set chosen ability/target for AI status
00195e48: 00000000 nop
00195e4c: 00408021 addu r16,r2,r0
00195e50: 2402ffff addiu r2,r0,0xffff
00195e54: 16020003 bne r16,r2,0x00195e64		branch if 0xffff not returned
00195e58: 00000000 nop
00195e5c: 080657d4 j 0x00195f50			jump to end
00195e60: a2400c6d sb r0,0x0c6d(r18)	

00195e64: 1600003a bne r16,r0,0x00195f50               go to end if anything returned from AI status routine
00195e68: 00001021 addu r2,r0,r0
00195e6c: 8e4417f8 lw r4,0x17f8(r18)			load acting units data
00195e70: 00000000 nop
00195e74: 9082005a lbu r2,0x005a(r4)			load status
00195e78: 00000000 nop
00195e7c: 30420003 andi r2,r2,0x0003
00195e80: 10400006 beq r2,r0,0x00195e9c		branch if not frog/critical
00195e84: 3c034000 lui r3,0x4000
00195e88: 8e420cb4 lw r2,0x0cb4(r18)			load ??
00195e8c: 00000000 nop
00195e90: 00431024 and r2,r2,r3
00195e94: 1440000d bne r2,r0,0x00195ecc
00195e98: 00000000 nop
00195e9c: 9082005c lbu r2,0x005c(r4)			load status
00195ea0: 00000000 nop
00195ea4: 30420004 andi r2,r2,0x0004
00195ea8: 10400018 beq r2,r0,0x00195f0c		branch if not don't act
00195eac: 00000000 nop
00195eb0: 8e420e34 lw r2,0x0e34(r18)			load acting unit Decision data
00195eb4: 00000000 nop
00195eb8: 90420004 lbu r2,0x0004(r2)			
00195ebc: 00000000 nop
00195ec0: 30420040 andi r2,r2,0x0040
00195ec4: 10400011 beq r2,r0,0x00195f0c		branch if not focus on target
00195ec8: 00000000 nop
00195ecc: 2644197c addiu r4,r18,0x197c
00195ed0: 8e450e34 lw r5,0x0e34(r18)			load acting units decision data
00195ed4: 0c066ac2 jal 0x0019ab08			Transfer Halfword Values
00195ed8: 34060010 ori r6,r0,0x0010
00195edc: 0c066398 jal 0x00198e60			00198e60 - 00199058
00195ee0: 00000000 nop
00195ee4: 2403ffff addiu r3,r0,0xffff
00195ee8: 14430003 bne r2,r3,0x00195ef8			branch if 0xff returned
00195eec: 2645197c addiu r5,r18,0x197c
00195ef0: 080657d2 j 0x00195f48
00195ef4: 34020002 ori r2,r0,0x0002

00195ef8: 8e440e34 lw r4,0x0e34(r18)
00195efc: 0c066ac2 jal 0x0019ab08			Transfer Halfword Values
00195f00: 34060010 ori r6,r0,0x0010
00195f04: 080657d4 j 0x00195f50
00195f08: 00001021 addu r2,r0,r0

00195f0c: 0c065fc5 jal 0x00197f14			Auto Battle Handling
00195f10: 00000000 nop
00195f14: 00408021 addu r16,r2,r0
00195f18: 2402ffff addiu r2,r0,0xffff
00195f1c: 1202000a beq r16,r2,0x00195f48
00195f20: 34020003 ori r2,r0,0x0003
00195f24: 1600000a bne r16,r0,0x00195f50
00195f28: 00001021 addu r2,r0,r0
Non-Specific AI AutoBattle (enemies)
00195f2c: a24019b7 sb r0,0x19b7(r18)
00195f30: 0c065867 jal 0x0019619c			0019619c - 0019629c
00195f34: 00000000 nop
00195f38: 2403ffff addiu r3,r0,0xffff
00195f3c: 14430004 bne r2,r3,0x00195f50
00195f40: 00001021 addu r2,r0,r0
00195f44: 34020007 ori r2,r0,0x0007
00195f48: a2420c6d sb r2,0x0c6d(r18)
00195f4c: 2402ffff addiu r2,r0,0xffff
00195f50: 8fbf001c lw r31,0x001c(r29)
00195f54: 8fb20018 lw r18,0x0018(r29)
00195f58: 8fb10014 lw r17,0x0014(r29)
00195f5c: 8fb00010 lw r16,0x0010(r29)
00195f60: 27bd0020 addiu r29,r29,0x0020
00195f64: 03e00008 jr r31
00195f68: 00000000 nop

Return Locations

Battle.bin 
00194070: Main AI action setup