AI movement/panel data setting

From Final Fantasy Hacktics Wiki
Revision as of 23:23, 8 March 2017 by Dokurider (talk | contribs) (Created page with " 00194944: 3c02801a lui r2,0x801a 00194948: 90420d7b lbu r2,0x0d7b(r2) 0019494c: 27bdffc0 addiu r29,r29,0xffc0 00194950: afb10034 sw r17,0x0034(r29) 00194954: 00808821 add...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
00194944: 3c02801a lui r2,0x801a
00194948: 90420d7b lbu r2,0x0d7b(r2)
0019494c: 27bdffc0 addiu r29,r29,0xffc0
00194950: afb10034 sw r17,0x0034(r29)
00194954: 00808821 addu r17,r4,r0
00194958: afb00030 sw r16,0x0030(r29)
0019495c: 3c10801a lui r16,0x801a
00194960: 2610f3c4 addiu r16,r16,0xf3c4
00194964: 14400080 bne r2,r0,0x00194b68				Branch if Action = Decided
00194968: afbf0038 sw r31,0x0038(r29)
<Water Movement>
0019496c: 3c03801a lui r3,0x801a
00194970: 8c630bbc lw r3,0x0bbc(r3)					Load Acting Unit's Data
00194974: 00000000 nop
00194978: 90620095 lbu r2,0x0095(r3)				Load Movement 3
0019497c: 00000000 nop
00194980: 304200c8 andi r2,r2,0x00c8
00194984: 14400006 bne r2,r0,0x001949a0				Branch if Move on/in Water or Float
00194988: 26040c24 addiu r4,r16,0x0c24
0019498c: 9062005a lbu r2,0x005a(r3)
00194990: 00000000 nop
00194994: 30420040 andi r2,r2,0x0040
00194998: 10400005 beq r2,r0,0x001949b0				Branch if not Float
0019499c: 34020001 ori r2,r0,0x0001
001949a0: 3c01801a lui r1,0x801a
001949a4: a0200d7d sb r0,0x0d7d(r1)					Water Penalty = False
001949a8: 0806526f j 0x001949bc
001949ac: 00000000 nop
001949b0: 3c01801a lui r1,0x801a
001949b4: a0220d7d sb r2,0x0d7d(r1)					Water Penalty = True
001949b8: 26040c24 addiu r4,r16,0x0c24
001949bc: 0c066ade jal 0x0019ab78
001949c0: 34050048 ori r5,r0,0x0048
001949c4: 00005021 addu r10,r0,r0
001949c8: 3c0c8019 lui r12,0x8019
001949cc: 258cf8cc addiu r12,r12,0xf8cc				r12 = Tile Data
001949d0: 340b003f ori r11,r0,0x003f				r11 = Cross Section Tile
001949d4: 02004021 addu r8,r16,r0
<Find all Walkable Tiles>
001949d8: 92020e3b lbu r2,0x0e3b(r16)				Load Max Y
001949dc: 00000000 nop
001949e0: 18400027 blez r2,0x00194a80
001949e4: 00003821 addu r7,r0,r0
001949e8: 000a4a00 sll r9,r10,0x08
001949ec: 92040e3a lbu r4,0x0e3a(r16)				Load Max X
001949f0: 00000000 nop
001949f4: 1080001d beq r4,r0,0x00194a6c
001949f8: 00003021 addu r6,r0,r0
001949fc: 25030c24 addiu r3,r8,0x0c24
00194a00: 00071040 sll r2,r7,0x01
00194a04: 00432821 addu r5,r2,r3
00194a08: 00e40018 mult r7,r4
00194a0c: 00001012 mflo r2
00194a10: 01221021 addu r2,r9,r2
00194a14: 00461021 addu r2,r2,r6
00194a18: 000210c0 sll r2,r2,0x03
00194a1c: 004c2021 addu r4,r2,r12
<Unselectable?> (By Cursor)
00194a20: 90820006 lbu r2,0x0006(r4)				Load isSelectTargetable
00194a24: 00000000 nop
00194a28: 30420001 andi r2,r2,0x0001
00194a2c: 1440000a bne r2,r0,0x00194a58				Branch if Current Tile is Unselectable
00194a30: 00000000 nop
<Cross Tile?>
00194a34: 90820000 lbu r2,0x0000(r4)				Load Current Tile Data
00194a38: 00000000 nop
00194a3c: 3042003f andi r2,r2,0x003f
00194a40: 104b0005 beq r2,r11,0x00194a58			Branch if Cross Tile
<Current Tile is Walkable>
00194a44: 34028000 ori r2,r0,0x8000
00194a48: 94a30000 lhu r3,0x0000(r5)
00194a4c: 00c21007 srav r2,r2,r6
00194a50: 00621825 or r3,r3,r2
00194a54: a4a30000 sh r3,0x0000(r5)					Tile is Walkable
<X++>
00194a58: 92040e3a lbu r4,0x0e3a(r16)
00194a5c: 24c60001 addiu r6,r6,0x0001
00194a60: 00c4102a slt r2,r6,r4
00194a64: 1440ffe9 bne r2,r0,0x00194a0c
00194a68: 00e40018 mult r7,r4
<Y++>
00194a6c: 92020e3b lbu r2,0x0e3b(r16)
00194a70: 24e70001 addiu r7,r7,0x0001
00194a74: 00e2102a slt r2,r7,r2
00194a78: 1440ffdc bne r2,r0,0x001949ec
00194a7c: 00000000 nop
<Map Level++>
00194a80: 254a0001 addiu r10,r10,0x0001
00194a84: 29420002 slti r2,r10,0x0002
00194a88: 1440ffd3 bne r2,r0,0x001949d8
00194a8c: 25080024 addiu r8,r8,0x0024


00194a90: a2000e2d sb r0,0x0e2d(r16)			Action = not Decided
00194a94: 00002821 addu r5,r0,r0
<Empty ?>
00194a98: 92030e2d lbu r3,0x0e2d(r16)
00194a9c: 00052040 sll r4,r5,0x01
00194aa0: 000310c0 sll r2,r3,0x03
00194aa4: 00431021 addu r2,r2,r3
00194aa8: 000210c0 sll r2,r2,0x03
00194aac: 02021021 addu r2,r16,r2
00194ab0: 00821021 addu r2,r4,r2
00194ab4: a4400a74 sh r0,0x0a74(r2)
00194ab8: 92030e2d lbu r3,0x0e2d(r16)
00194abc: 24a50001 addiu r5,r5,0x0001
00194ac0: 000310c0 sll r2,r3,0x03
00194ac4: 00431021 addu r2,r2,r3
00194ac8: 000210c0 sll r2,r2,0x03
00194acc: 02021021 addu r2,r16,r2
00194ad0: 00822021 addu r4,r4,r2
00194ad4: 28a20012 slti r2,r5,0x0012
00194ad8: 1440ffef bne r2,r0,0x00194a98
00194adc: a4800a98 sh r0,0x0a98(r4)


00194ae0: 16200008 bne r17,r0,0x00194b04		Branch if Decided to Move/Already Moved?
00194ae4: 00001021 addu r2,r0,r0
00194ae8: 8e0317f8 lw r3,0x17f8(r16)			Acting Unit Data
00194aec: 00000000 nop
00194af0: 9062005c lbu r2,0x005c(r3)			Current Status 5
00194af4: 00000000 nop
00194af8: 30420008 andi r2,r2,0x0008
00194afc: 1040000f beq r2,r0,0x00194b3c			Branch if not Don't Move
<Don't Move>
00194b00: 00001021 addu r2,r0,r0
00194b04: 92040e31 lbu r4,0x0e31(r16)
00194b08: 92050e30 lbu r5,0x0e30(r16)
00194b0c: 000418c0 sll r3,r4,0x03
00194b10: 00641821 addu r3,r3,r4
00194b14: 00031880 sll r3,r3,0x02
00194b18: 00701821 addu r3,r3,r16
00194b1c: 92040e32 lbu r4,0x0e32(r16)
00194b20: 24630a74 addiu r3,r3,0x0a74
00194b24: 00042040 sll r4,r4,0x01
00194b28: 00832021 addu r4,r4,r3
00194b2c: 34038000 ori r3,r0,0x8000
00194b30: 00a31807 srav r3,r3,r5
00194b34: 08065390 j 0x00194e40					Exit and Return 0
00194b38: a4830000 sh r3,0x0000(r4)				Clear Designation?
00194b3c: 90640182 lbu r4,0x0182(r3)			Load Mount Data
00194b40: 00000000 nop
00194b44: 30820080 andi r2,r4,0x0080
00194b48: 14400002 bne r2,r0,0x00194b54			Branch if Riding a Unit
00194b4c: 3088001f andi r8,r4,0x001f			Get Mount ID
00194b50: 92080e2e lbu r8,0x0e2e(r16)
00194b54: 92050e30 lbu r5,0x0e30(r16)
00194b58: 92060e32 lbu r6,0x0e32(r16)
00194b5c: 92070e31 lbu r7,0x0e31(r16)
00194b60: 0c05d2e3 jal 0x00174b8c
00194b64: 01002021 addu r4,r8,r0				r4 = Moving Unit ID (Self or Mount)
00194b68: 0c0076ea jal 0x0001dba8				Get Frame RNG
00194b6c: 34040001 ori r4,r0,0x0001
00194b70: 284201b9 slti r2,r2,0x01b9
00194b74: 14400003 bne r2,r0,0x00194b84
00194b78: 00005021 addu r10,r0,r0
00194b7c: 08065390 j 0x00194e40					Exit and Return -1
00194b80: 2402ffff addiu r2,r0,0xffff
00194b84: a20019b7 sb r0,0x19b7(r16)
00194b88: 02005821 addu r11,r16,r0
00194b8c: 92020e3b lbu r2,0x0e3b(r16)
00194b90: 00000000 nop
00194b94: 18400040 blez r2,0x00194c98
00194b98: 00003821 addu r7,r0,r0
00194b9c: 000a6200 sll r12,r10,0x08
00194ba0: 01606821 addu r13,r11,r0
00194ba4: 92040e3a lbu r4,0x0e3a(r16)
00194ba8: 00000000 nop
00194bac: 10800035 beq r4,r0,0x00194c84
00194bb0: 00003021 addu r6,r0,r0
00194bb4: 25a30a74 addiu r3,r13,0x0a74
00194bb8: 00071040 sll r2,r7,0x01
00194bbc: 00434821 addu r9,r2,r3
00194bc0: 00e40018 mult r7,r4
00194bc4: 8e0517f8 lw r5,0x17f8(r16)			Load Acting Unit's Data
00194bc8: 00000000 nop
00194bcc: 90a30094 lbu r3,0x0094(r5)			Load Movement 2
00194bd0: 3c048019 lui r4,0x8019
00194bd4: 2484f8cc addiu r4,r4,0xf8cc			r4 = Tile Data
00194bd8: 30630008 andi r3,r3,0x0008
00194bdc: 00001012 mflo r2
00194be0: 01821021 addu r2,r12,r2
00194be4: 00461021 addu r2,r2,r6
00194be8: 000210c0 sll r2,r2,0x03
00194bec: 10600017 beq r3,r0,0x00194c4c			Branch if no Teleport
00194bf0: 00442021 addu r4,r2,r4
00194bf4: 90a20182 lbu r2,0x0182(r5)			Load Mount Data
00194bf8: 00000000 nop
00194bfc: 30420080 andi r2,r2,0x0080
00194c00: 14400012 bne r2,r0,0x00194c4c			Branch if Unit is Riding a Mount
00194c04: 00000000 nop
00194c08: 92020e30 lbu r2,0x0e30(r16)
00194c0c: 00000000 nop
00194c10: 00464023 subu r8,r2,r6				r8 = X Distance
00194c14: 05010002 bgez r8,0x00194c20
00194c18: 00000000 nop
00194c1c: 00084023 subu r8,r0,r8				Distance must always be positive
00194c20: 92020e32 lbu r2,0x0e32(r16)
00194c24: 00000000 nop
00194c28: 00472823 subu r5,r2,r7				r5 = Y Distance
00194c2c: 04a10002 bgez r5,0x00194c38
00194c30: 00000000 nop
00194c34: 00052823 subu r5,r0,r5				Distance must always be positive
00194c38: 92030e38 lbu r3,0x0e38(r16)			Load Current Highest Distance
00194c3c: 01051021 addu r2,r8,r5				X + Y Distance
00194c40: 0062182a slt r3,r3,r2
00194c44: 1460000a bne r3,r0,0x00194c70			Branch if Current Distance < Highest Distance
00194c48: 00000000 nop
<Move Range>?
00194c4c: 90820005 lbu r2,0x0005(r4)
00194c50: 00000000 nop
00194c54: 30420020 andi r2,r2,0x0020
00194c58: 10400005 beq r2,r0,0x00194c70			<X++> if out of move range?
<Save New Highest>
00194c5c: 34028000 ori r2,r0,0x8000
00194c60: 95230000 lhu r3,0x0000(r9)
00194c64: 00c21007 srav r2,r2,r6
00194c68: 00621825 or r3,r3,r2
00194c6c: a5230000 sh r3,0x0000(r9)
<X++>
00194c70: 92040e3a lbu r4,0x0e3a(r16)
00194c74: 24c60001 addiu r6,r6,0x0001
00194c78: 00c4102a slt r2,r6,r4
00194c7c: 1440ffd1 bne r2,r0,0x00194bc4
00194c80: 00e40018 mult r7,r4
<Y++
00194c84: 92020e3b lbu r2,0x0e3b(r16)
00194c88: 24e70001 addiu r7,r7,0x0001
00194c8c: 00e2102a slt r2,r7,r2
00194c90: 1440ffc4 bne r2,r0,0x00194ba4
00194c94: 00000000 nop
<Map Level++>
00194c98: 254a0001 addiu r10,r10,0x0001
00194c9c: 29420002 slti r2,r10,0x0002
00194ca0: 1440ffba bne r2,r0,0x00194b8c
00194ca4: 256b0024 addiu r11,r11,0x0024
00194ca8: 00004021 addu r8,r0,r0
00194cac: 340900ff ori r9,r0,0x00ff
00194cb0: 34078000 ori r7,r0,0x8000
00194cb4: 3c068019 lui r6,0x8019
00194cb8: 24c608cc addiu r6,r6,0x08cc
00194cbc: 90c20001 lbu r2,0x0001(r6)
00194cc0: 00000000 nop
00194cc4: 1049001a beq r2,r9,0x00194d30			Branch if Unit does not exist
00194cc8: 00000000 nop
00194ccc: 92020e2e lbu r2,0x0e2e(r16)
00194cd0: 00000000 nop
00194cd4: 11020016 beq r8,r2,0x00194d30			Branch if Acting Unit = Current Unit
00194cd8: 00000000 nop
00194cdc: 94c20058 lhu r2,0x0058(r6)			Load Current Status 1 and 2
00194ce0: 00000000 nop
00194ce4: 30420140 andi r2,r2,0x0140			
00194ce8: 14400011 bne r2,r0,0x00194d30			Branch if Crystal/Treasure
00194cec: 00000000 nop
00194cf0: 94c20048 lhu r2,0x0048(r6)
00194cf4: 90c50048 lbu r5,0x0048(r6)
00194cf8: 90c40047 lbu r4,0x0047(r6)
00194cfc: 000213c2 srl r2,r2,0x0f
00194d00: 000218c0 sll r3,r2,0x03
00194d04: 00621821 addu r3,r3,r2
00194d08: 00031880 sll r3,r3,0x02
00194d0c: 00701821 addu r3,r3,r16
00194d10: 24630a74 addiu r3,r3,0x0a74
00194d14: 00052840 sll r5,r5,0x01
00194d18: 00a32821 addu r5,r5,r3
00194d1c: 00872007 srav r4,r7,r4
00194d20: 94a20000 lhu r2,0x0000(r5)
00194d24: 00042027 nor r4,r0,r4
00194d28: 00441024 and r2,r2,r4
00194d2c: a4a20000 sh r2,0x0000(r5)
00194d30: 25080001 addiu r8,r8,0x0001
00194d34: 29020015 slti r2,r8,0x0015
00194d38: 1440ffe0 bne r2,r0,0x00194cbc			Do for all units
00194d3c: 24c601c0 addiu r6,r6,0x01c0


00194d40: 92030e31 lbu r3,0x0e31(r16)
00194d44: 92040e32 lbu r4,0x0e32(r16)
00194d48: 92050e30 lbu r5,0x0e30(r16)
00194d4c: 000310c0 sll r2,r3,0x03
00194d50: 00431021 addu r2,r2,r3
00194d54: 00021080 sll r2,r2,0x02
00194d58: 00501021 addu r2,r2,r16
00194d5c: 24420a74 addiu r2,r2,0x0a74
00194d60: 00042040 sll r4,r4,0x01
00194d64: 00822021 addu r4,r4,r2
00194d68: 34038000 ori r3,r0,0x8000
00194d6c: 94820000 lhu r2,0x0000(r4)
00194d70: 00a31807 srav r3,r3,r5
00194d74: 00431025 or r2,r2,r3
00194d78: a4820000 sh r2,0x0000(r4)
00194d7c: 8e0217f8 lw r2,0x17f8(r16)			Load Acting Unit Data
00194d80: 3c030008 lui r3,0x0008
00194d84: 8c420058 lw r2,0x0058(r2)				Load Current Statuses 1-4
00194d88: 34631000 ori r3,r3,0x1000
00194d8c: 00431024 and r2,r2,r3
00194d90: 1440002b bne r2,r0,0x00194e40			Exit and Return 0 if Confuse/Berserk
00194d94: 00001021 addu r2,r0,r0


00194d98: 00004021 addu r8,r0,r0
00194d9c: 340900ff ori r9,r0,0x00ff
00194da0: 34078000 ori r7,r0,0x8000
00194da4: 3406181c ori r6,r0,0x181c
00194da8: 02062021 addu r4,r16,r6
00194dac: 90850000 lbu r5,0x0000(r4)
00194db0: 00000000 nop
00194db4: 10a90012 beq r5,r9,0x00194e00


00194db8: 24c60004 addiu r6,r6,0x0004
00194dbc: 25080001 addiu r8,r8,0x0001
00194dc0: 90830001 lbu r3,0x0001(r4)
00194dc4: 90840002 lbu r4,0x0002(r4)
00194dc8: 000310c0 sll r2,r3,0x03
00194dcc: 00431021 addu r2,r2,r3
00194dd0: 00021080 sll r2,r2,0x02
00194dd4: 00501021 addu r2,r2,r16
00194dd8: 24420a74 addiu r2,r2,0x0a74
00194ddc: 00042040 sll r4,r4,0x01
00194de0: 00822021 addu r4,r4,r2
00194de4: 00a71007 srav r2,r7,r5
00194de8: 94830000 lhu r3,0x0000(r4)
00194dec: 00021027 nor r2,r0,r2
00194df0: 00621824 and r3,r3,r2
00194df4: 29020004 slti r2,r8,0x0004
00194df8: 1440ffeb bne r2,r0,0x00194da8			Go through all 3 potential spots to move to?
00194dfc: a4830000 sh r3,0x0000(r4)
<Designate Tile to Move to>?
00194e00: 00001021 addu r2,r0,r0
00194e04: 92040e31 lbu r4,0x0e31(r16)
00194e08: 92050e32 lbu r5,0x0e32(r16)
00194e0c: 92060e30 lbu r6,0x0e30(r16)
00194e10: 000418c0 sll r3,r4,0x03
00194e14: 00641821 addu r3,r3,r4
00194e18: 00031880 sll r3,r3,0x02
00194e1c: 00701821 addu r3,r3,r16
00194e20: 24630a74 addiu r3,r3,0x0a74
00194e24: 00052840 sll r5,r5,0x01
00194e28: 00a32821 addu r5,r5,r3
00194e2c: 34048000 ori r4,r0,0x8000
00194e30: 94a30000 lhu r3,0x0000(r5)
00194e34: 00c42007 srav r4,r4,r6
00194e38: 00641825 or r3,r3,r4
00194e3c: a4a30000 sh r3,0x0000(r5)
00194e40: 8fbf0038 lw r31,0x0038(r29)
00194e44: 8fb10034 lw r17,0x0034(r29)
00194e48: 8fb00030 lw r16,0x0030(r29)
00194e4c: 27bd0040 addiu r29,r29,0x0040
00194e50: 03e00008 jr r31
00194e54: 00000000 nop