Difference between revisions of "Initialize some AI Data (mount, base hit %)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 00195d94: 3c02801a lui r2,0x801a 00195d98: 90420d7b lbu r2,0x0d7b(r2) load return from 194e50 00195d9c: 27bdffe0 addiu r29,r29,0xffe0 00195da...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<font face='Courier New'>
+
'''BATTLE.BIN''' :  - Initialize some AI Data (mount, base hit %)  
+
  ------------------------------------------------------------------------------------------
00195d94: 3c02801a lui r2,0x801a
+
  Parameter : r4 = Pointer to Some AI data TABLE (see return location)
  00195d98: 90420d7b lbu r2,0x0d7b(r2) load return from 194e50
+
  Returns nothing
00195d9c: 27bdffe0 addiu r29,r29,0xffe0
+
  ------------------------------------------------------------------------------------------
00195da0: afb20018 sw r18,0x0018(r29)
+
  Return : Return nothing
  00195da4: 3c12801a lui r18,0x801a
+
  00195f6c: 24028001 addiu r2,r0,0x8001        |
  00195da8: 2652f3c4 addiu r18,r18,0xf3c4 r18 = AI data
+
  00195f70: a482001e sh r2,0x001e(r4)          |{{f/store|Store 0x8001 at Pointer 0x001e}}
00195dac: afbf001c sw r31,0x001c(r29)
+
  00195f74: 34020005 ori r2,r0,0x0005          |{{f/std|<nowiki>r2 = 5</nowiki>}}
  00195db0: afb10014 sw r17,0x0014(r29)
+
  00195f78: a080001c sb r0,0x001c(r4)         |{{f/store|Reset Pointer 0x001c}} {{f/std|Initialize Mount Info? (I have no idea what this is supposed to represent)}}
00195db4: 10400011 beq r2,r0,0x00195dfc branch if ?? = 0
+
  00195f7c: a080001d sb r0,0x001d(r4)         |{{f/store|Reset Pointer 0x001d}} {{f/std|Initialize Base Hit%}}
  00195db8: afb00010 sw r16,0x0010(r29)
+
  00195f80: a0820003 sb r2,0x0003(r4)         |{{f/store|Store 0x05 at Pointer 0x0003}}
  00195dbc: 3c03801a lui r3,0x801a
+
  00195f84: 03e00008 jr r31                    {{f/jump|Jump to Address}}
  00195dc0: 90630031 lbu r3,0x0031(r3) ???
+
  00195f88: a0800001 sb r0,0x0001(r4)         |{{f/store|Initialize Pointer + 0x01}}
00195dc4: 34020002 ori r2,r0,0x0002
+
===Return locations===
  00195dc8: 10620044 beq r3,r2,0x00195edc branch if ?? = 0xff
+
  '''BATTLE.BIN'''
  00195dcc: 28620003 slti r2,r3,0x0003
+
  00195e0c: [[AI_Initial_Targeting_Selection]]                        8019f3c4 + 0x0054 to 0x134 (step 0x20)
00195dd0: 10400005 beq r2,r0,0x00195de8 skip if ?? < 3
+
  00195e24: [[AI_Initial_Targeting_Selection]]                        8019f3c4 + 0x0014
00195dd4: 00000000 nop
+
  00195e2c: [[AI_Initial_Targeting_Selection]]                        8019f3c4 + 0x0034
00195dd8: 1060001a beq r3,r0,0x00195e44 jump to AI status
+
  00195e34: [[AI_Initial_Targeting_Selection]]                        8019f3c4 + 0x0154
00195ddc: 00000000 nop
+
  00195e3c: [[AI_Initial_Targeting_Selection]]                        8019f3c4 + 0x17fc
00195de0: 080657cc j 0x00195f30
+
  00197098: [[Compare_Set_Highest_Unit_Target_Priority_(00196fc4)]]  8019f3c4 + 0x0034
00195de4: 00000000 nop
+
  0019ae48: [[0019ae30_-_0019ae54]]                                  8019f3c4 + 0x17fc
00195de8: 34020003 ori r2,r0,0x0003
 
00195dec: 10620047 beq r3,r2,0x00195f0c
 
00195df0: 00000000 nop
 
00195df4: 080657cc j 0x00195f30
 
00195df8: 00000000 nop
 
00195dfc: 00008021 addu r16,r0,r0
 
00195e00: 34110054 ori r17,r0,0x0054
 
00195e04: 0c0657db jal 0x00195f6c r4 = AI data + 0x54
 
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 AI data + 0x14?
 
00195e20: 26440014 addiu r4,r18,0x0014
 
00195e24: 0c0657db jal 0x00195f6c AI data + 0x34?
 
00195e28: 26440034 addiu r4,r18,0x0034
 
00195e2c: 0c0657db jal 0x00195f6c
 
00195e30: 26440154 addiu r4,r18,0x0154 AI data + 0x154?
 
00195e34: 0c0657db jal 0x00195f6c
 
00195e38: 264417fc addiu r4,r18,0x17fc AI data + 0x17fc?
 
00195e3c: 0c0665c7 jal 0x0019971c
 
00195e40: 00000000 nop
 
00195e44: 0c065c6e jal 0x001971b8 set ability/skillset for AI statuses
 
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
 
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 ???
 
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 halfwaords
 
00195f00: 34060010 ori r6,r0,0x0010
 
00195f04: 080657d4 j 0x00195f50
 
00195f08: 00001021 addu r2,r0,r0
 
00195f0c: 0c065fc5 jal 0x00197f14 ???
 
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
 
00195f2c: a24019b7 sb r0,0x19b7(r18)
 
00195f30: 0c065867 jal 0x0019619c
 
  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
 
</font>
 

Latest revision as of 12:05, 8 April 2024

BATTLE.BIN :  - Initialize some AI Data (mount, base hit %) 
------------------------------------------------------------------------------------------
Parameter : r4 = Pointer to Some AI data TABLE (see return location)
Returns nothing
------------------------------------------------------------------------------------------
Return : Return nothing
00195f6c: 24028001 addiu r2,r0,0x8001        |
00195f70: a482001e sh r2,0x001e(r4)          |Store 0x8001 at Pointer 0x001e
00195f74: 34020005 ori r2,r0,0x0005          |r2 = 5
00195f78: a080001c sb r0,0x001c(r4)          |Reset Pointer  0x001c Initialize Mount Info? (I have no idea what this is supposed to represent)
00195f7c: a080001d sb r0,0x001d(r4)          |Reset Pointer 0x001d Initialize Base Hit%
00195f80: a0820003 sb r2,0x0003(r4)          |Store 0x05 at Pointer 0x0003
00195f84: 03e00008 jr r31                    >>Jump to Address
00195f88: a0800001 sb r0,0x0001(r4)          |Initialize Pointer + 0x01

Return locations

BATTLE.BIN
 00195e0c: AI_Initial_Targeting_Selection                        8019f3c4 + 0x0054 to 0x134 (step 0x20)
 00195e24: AI_Initial_Targeting_Selection                        8019f3c4 + 0x0014
 00195e2c: AI_Initial_Targeting_Selection                        8019f3c4 + 0x0034
 00195e34: AI_Initial_Targeting_Selection                        8019f3c4 + 0x0154
 00195e3c: AI_Initial_Targeting_Selection                        8019f3c4 + 0x17fc
 00197098: Compare_Set_Highest_Unit_Target_Priority_(00196fc4)   8019f3c4 + 0x0034
 0019ae48: 0019ae30_-_0019ae54                                   8019f3c4 + 0x17fc