Difference between revisions of "Set panels affected by ability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Line 11: Line 11:
 
0017a2b4: afb20048 sw r18,0x0048(r29)
 
0017a2b4: afb20048 sw r18,0x0048(r29)
 
0017a2b8: afb10044 sw r17,0x0044(r29)
 
0017a2b8: afb10044 sw r17,0x0044(r29)
0017a2bc: 0c01788b jal 0x0005e22c
+
0017a2bc: 0c01788b jal 0x0005e22c         [[Transfer Target ID? Through Mount Data]]
 
0017a2c0: afb00040 sw r16,0x0040(r29)
 
0017a2c0: afb00040 sw r16,0x0040(r29)
 
0017a2c4: 93a30010 lbu r3,0x0010(r29) get caster id
 
0017a2c4: 93a30010 lbu r3,0x0010(r29) get caster id
Line 40: Line 40:
 
0017a328: 92960047 lbu r22,0x0047(r20) load caster x coordinate
 
0017a328: 92960047 lbu r22,0x0047(r20) load caster x coordinate
 
0017a32c: 92970048 lbu r23,0x0048(r20) load caster y coordinate
 
0017a32c: 92970048 lbu r23,0x0048(r20) load caster y coordinate
0017a330: 0c060428 jal 0x001810a0 map location calc
+
0017a330: 0c060428 jal 0x001810a0 [[Map Location Calculation]]
 
0017a334: 02802021 addu r4,r20,r0
 
0017a334: 02802021 addu r4,r20,r0
 
0017a338: 00402821 addu r5,r2,r0 save target tile id?
 
0017a338: 00402821 addu r5,r2,r0 save target tile id?
Line 110: Line 110:
 
0017a420: 10400006 beq r2,r0,0x0017a43c branch if false
 
0017a420: 10400006 beq r2,r0,0x0017a43c branch if false
 
0017a424: 02602021 addu r4,r19,r0 r4 = range
 
0017a424: 02602021 addu r4,r19,r0 r4 = range
0017a428: 0c05e688 jal 0x00179a20 Weapon Range Routine
+
0017a428: 0c05e688 jal 0x00179a20 [[Set targeting for weapon attack?]]
 
0017a42c: 02802021 addu r4,r20,r0 r4 = Caster ID data
 
0017a42c: 02802021 addu r4,r20,r0 r4 = Caster ID data
 
0017a430: a2000000 sb r0,0x0000(r16) Remove Range from Caster Panel
 
0017a430: a2000000 sb r0,0x0000(r16) Remove Range from Caster Panel
 
0017a434: 0805e911 j 0x0017a444 Calculate tiles hit by ability
 
0017a434: 0805e911 j 0x0017a444 Calculate tiles hit by ability
 
0017a438: a2200000 sb r0,0x0000(r17) Remove Range from Caster Panel+
 
0017a438: a2200000 sb r0,0x0000(r17) Remove Range from Caster Panel+
0017a43c: 0c05e546 jal 0x00179518 Generate Range Routine
+
0017a43c: 0c05e546 jal 0x00179518 [[Calculate Tiles Hit by Ability]]
 
0017a440: 00002821 addu r5,r0,r0 r5 = 0
 
0017a440: 00002821 addu r5,r0,r0 r5 = 0
 
0017a444: 32420001 andi r2,r18,0x0001 If Can't Target Self
 
0017a444: 32420001 andi r2,r18,0x0001 If Can't Target Self
Line 123: Line 123:
 
0017a454: 10400003 beq r2,r0,0x0017a464 Branch if False
 
0017a454: 10400003 beq r2,r0,0x0017a464 Branch if False
 
0017a458: 02c02021 addu r4,r22,r0 r4 = Caster X
 
0017a458: 02c02021 addu r4,r22,r0 r4 = Caster X
0017a45c: 0c05e9ef jal 0x0017a7bc Vertical Fixed Routine
+
0017a45c: 0c05e9ef jal 0x0017a7bc [[Vertical Fixed Routine]]
 
0017a460: 02e02821 addu r5,r23,r0 r5 = Caster Y
 
0017a460: 02e02821 addu r5,r23,r0 r5 = Caster Y
 
0017a464: 32420008 andi r2,r18,0x0008 If Vertical Fixed
 
0017a464: 32420008 andi r2,r18,0x0008 If Vertical Fixed
Line 130: Line 130:
 
0017a470: 93a70030 lbu r7,0x0030(r29) r7 = load vertical from stack
 
0017a470: 93a70030 lbu r7,0x0030(r29) r7 = load vertical from stack
 
0017a474: 00003021 addu r6,r0,r0 r6 = 0
 
0017a474: 00003021 addu r6,r0,r0 r6 = 0
0017a478: 0c05e4a9 jal 0x001792a4 Vertical Tolerance Routine
+
0017a478: 0c05e4a9 jal 0x001792a4 [[Check Vert Tolerance and if Tiles can be Chosen]]
 
0017a47c: 00e02821 addu r5,r7,r0 r5 = Vertical
 
0017a47c: 00e02821 addu r5,r7,r0 r5 = Vertical
 
0017a480: 93a70028 lbu r7,0x0028(r29) r7 = Load AoE from Stack
 
0017a480: 93a70028 lbu r7,0x0028(r29) r7 = Load AoE from Stack
Line 141: Line 141:
 
0017a49c: 10400004 beq r2,r0,0x0017a4b0 Branch if False
 
0017a49c: 10400004 beq r2,r0,0x0017a4b0 Branch if False
 
0017a4a0: 324200c0 andi r2,r18,0x00c0 If Unknown Flags 0x80/0x40 (!!!)
 
0017a4a0: 324200c0 andi r2,r18,0x00c0 If Unknown Flags 0x80/0x40 (!!!)
0017a4a4: 0c05e497 jal 0x0017925c Clear Data from Untargetable Tiles
+
0017a4a4: 0c05e497 jal 0x0017925c [[Clear Some stuff for Untargetable Terrain]]
 
0017a4a8: 00000000 nop
 
0017a4a8: 00000000 nop
 
0017a4ac: 324200c0 andi r2,r18,0x00c0 If Unknown Flags 0x80/0x40 (!!!)
 
0017a4ac: 324200c0 andi r2,r18,0x00c0 If Unknown Flags 0x80/0x40 (!!!)
 
0017a4b0: 10400003 beq r2,r0,0x0017a4c0 Branch if False
 
0017a4b0: 10400003 beq r2,r0,0x0017a4c0 Branch if False
 
0017a4b4: 02802021 addu r4,r20,r0 r4 = Caster Data
 
0017a4b4: 02802021 addu r4,r20,r0 r4 = Caster Data
0017a4b8: 0c05e9b7 jal 0x0017a6dc Target Ally/Enemy with Range Routine
+
0017a4b8: 0c05e9b7 jal 0x0017a6dc [[Target Ally/Enemy with Range Routine]]
 
0017a4bc: 02402821 addu r5,r18,r0 r5 = Ability Flags 1
 
0017a4bc: 02402821 addu r5,r18,r0 r5 = Ability Flags 1
 
0017a4c0: 324200d0 andi r2,r18,0x00d0 If Unknown Flags 0x80/0x40 or Vertical Fixed
 
0017a4c0: 324200d0 andi r2,r18,0x00d0 If Unknown Flags 0x80/0x40 or Vertical Fixed
 
0017a4c4: 14400005 bne r2,r0,0x0017a4dc Branch if True
 
0017a4c4: 14400005 bne r2,r0,0x0017a4dc Branch if True
 
0017a4c8: 00000000 nop
 
0017a4c8: 00000000 nop
0017a4cc: 0c05e96f jal 0x0017a5bc Identify Cross Sections
+
0017a4cc: 0c05e96f jal 0x0017a5bc [[Identify Cross Sections Routine]]
 
0017a4d0: 00000000 nop
 
0017a4d0: 00000000 nop
 
0017a4d4: 0805e939 j 0x0017a4e4
 
0017a4d4: 0805e939 j 0x0017a4e4
 
0017a4d8: 00000000 nop
 
0017a4d8: 00000000 nop
0017a4dc: 0c05e993 jal 0x0017a64c Identify Cross Sections (Clone)
+
0017a4dc: 0c05e993 jal 0x0017a64c [[Identify Cross Sections Routine (Clone)]]
 
0017a4e0: 00000000 nop
 
0017a4e0: 00000000 nop
 
0017a4e4: 8fbf0064 lw r31,0x0064(r29)
 
0017a4e4: 8fbf0064 lw r31,0x0064(r29)

Revision as of 02:11, 17 May 2016

Set panels affected by ability?
0017a290: 27bdff98 addiu r29,r29,0xff98
0017a294: 27a50010 addiu r5,r29,0x0010
0017a298: afbf0064 sw r31,0x0064(r29)
0017a29c: afbe0060 sw r30,0x0060(r29)
0017a2a0: afb7005c sw r23,0x005c(r29)
0017a2a4: afb60058 sw r22,0x0058(r29)
0017a2a8: afb50054 sw r21,0x0054(r29)
0017a2ac: afb40050 sw r20,0x0050(r29)
0017a2b0: afb3004c sw r19,0x004c(r29)
0017a2b4: afb20048 sw r18,0x0048(r29)
0017a2b8: afb10044 sw r17,0x0044(r29)
0017a2bc: 0c01788b jal 0x0005e22c	        [[Transfer Target ID? Through Mount Data]]		
0017a2c0: afb00040 sw r16,0x0040(r29)
0017a2c4: 93a30010 lbu r3,0x0010(r29)		get caster id	
0017a2c8: 00000000 nop
0017a2cc: 000310c0 sll r2,r3,0x03
0017a2d0: 00431023 subu r2,r2,r3
0017a2d4: 00021180 sll r2,r2,0x06
0017a2d8: 3c038019 lui r3,0x8019
0017a2dc: 246308cc addiu r3,r3,0x08cc		load unit data
0017a2e0: 0043a021 addu r20,r2,r3			get caster data
0017a2e4: 87a30012 lh r3,0x0012(r29)		load ability id?
0017a2e8: 00000000 nop
0017a2ec: 000310c0 sll r2,r3,0x03
0017a2f0: 00431023 subu r2,r2,r3
0017a2f4: 00021040 sll r2,r2,0x01		
0017a2f8: 3c038006 lui r3,0x8006
0017a2fc: 2463fbf0 addiu r3,r3,0xfbf0		load ability flags
0017a300: 00431021 addu r2,r2,r3
0017a304: 90470001 lbu r7,0x0001(r2)		load effect area
0017a308: 90530000 lbu r19,0x0000(r2)		load range
0017a30c: a3a70028 sb r7,0x0028(r29)		save AoE to stack
0017a310: 90470002 lbu r7,0x0002(r2)		load verticle
0017a314: 90520003 lbu r18,0x0003(r2)		load flags 1
0017a318: a3a70030 sb r7,0x0030(r29)		save vertical to stack
0017a31c: 90420006 lbu r2,0x0006(r2)		load flags 4
0017a320: 00000000 nop
0017a324: a3a20038 sb r2,0x0038(r29)		save flags 4 to stack
0017a328: 92960047 lbu r22,0x0047(r20)		load caster x coordinate
0017a32c: 92970048 lbu r23,0x0048(r20)		load caster y coordinate
0017a330: 0c060428 jal 0x001810a0			[[Map Location Calculation]]
0017a334: 02802021 addu r4,r20,r0			
0017a338: 00402821 addu r5,r2,r0			save target tile id?
0017a33c: 000510c0 sll r2,r5,0x03
0017a340: 3c038019 lui r3,0x8019		
0017a344: 2463f8cc addiu r3,r3,0xf8cc		load tile data
0017a348: 00431021 addu r2,r2,r3
0017a34c: 3c068019 lui r6,0x8019
0017a350: 24c62dd8 addiu r6,r6,0x2dd8		load panel grid pointer
0017a354: 90430003 lbu r3,0x0003(r2)		load height halves + depths		
0017a358: 3c04800e lui r4,0x800e
0017a35c: 90844e9c lbu r4,0x4e9c(r4)		load map max X
0017a360: 3063001f andi r3,r3,0x001f		ignore depth data
0017a364: 02e40018 mult r23,r4				caster y * max x
0017a368: 90440002 lbu r4,0x0002(r2)		load tile height
0017a36c: 90420003 lbu r2,0x0003(r2)		load height halves
0017a370: 00042040 sll r4,r4,0x01
0017a374: 00832021 addu r4,r4,r3			height + halves
0017a378: 00021142 srl r2,r2,0x05			r2 = Depth(Ignore Halves)
0017a37c: 00021040 sll r2,r2,0x01
0017a380: 0082f021 addu r30,r4,r2			height + halves + depth = frame pointer(r30)???
0017a384: 00051880 sll r3,r5,0x02
0017a388: 00651821 addu r3,r3,r5
0017a38c: 0066a821 addu r21,r3,r6			save target tile?
0017a390: 326300ff andi r3,r19,0x00ff		r3 = Range
0017a394: 00001012 mflo r2					get Caster Y * max X
0017a398: 00562821 addu r5,r2,r22			+ caster x
0017a39c: 340200ff ori r2,r0,0x00ff
0017a3a0: 1462000b bne r3,r2,0x0017a3d0		don't branch if range = 255
0017a3a4: 00002021 addu r4,r0,r0
0017a3a8: 34050001 ori r5,r0,0x0001
0017a3ac: 00c01821 addu r3,r6,r0

<---Loop--> If Range = 255
0017a3b0: a0650000 sb r5,0x0000(r3)			all panels are apart of aoe
0017a3b4: a0600001 sb r0,0x0001(r3)			no panels are yellow
0017a3b8: 24840001 addiu r4,r4,0x0001		counter++
0017a3bc: 28820200 slti r2,r4,0x0200
0017a3c0: 1440fffb bne r2,r0,0x0017a3b0
0017a3c4: 24630005 addiu r3,r3,0x0005
<---Loop--->

0017a3c8: 0805e912 j 0x0017a448
0017a3cc: 32420001 andi r2,r18,0x0001

<---Loop--> Else:
0017a3d0: 00c01821 addu r3,r6,r0
0017a3d4: a0600000 sb r0,0x0000(r3)			no panels are apart of the aoe
0017a3d8: a0600001 sb r0,0x0001(r3)			no panels are yellow
0017a3dc: 24840001 addiu r4,r4,0x0001
0017a3e0: 28820200 slti r2,r4,0x0200
0017a3e4: 1440fffb bne r2,r0,0x0017a3d4
0017a3e8: 24630005 addiu r3,r3,0x0005
<---Loop--->

0017a3ec: 00051880 sll r3,r5,0x02
0017a3f0: 00651821 addu r3,r3,r5
0017a3f4: 3c028019 lui r2,0x8019
0017a3f8: 24422dd8 addiu r2,r2,0x2dd8
0017a3fc: 00628021 addu r16,r3,r2			r16 = caster panel
0017a400: 26640001 addiu r4,r19,0x0001		r4 = range
0017a404: 24420500 addiu r2,r2,0x0500		
0017a408: 00628821 addu r17,r3,r2			r17 = caster panel + 500? (high AoE?)
0017a40c: 34020001 ori r2,r0,0x0001
0017a410: a2040000 sb r4,0x0000(r16)		save range to caster panel
0017a414: a2240000 sb r4,0x0000(r17)		save range to caster panel+
0017a418: a2020001 sb r2,0x0001(r16)		caster panel is targeted
0017a41c: 32420020 andi r2,r18,0x0020		Weapon Range flag
0017a420: 10400006 beq r2,r0,0x0017a43c		branch if false
0017a424: 02602021 addu r4,r19,r0			r4 = range
0017a428: 0c05e688 jal 0x00179a20			[[Set targeting for weapon attack?]]
0017a42c: 02802021 addu r4,r20,r0			r4 = Caster ID data
0017a430: a2000000 sb r0,0x0000(r16)		Remove Range from Caster Panel
0017a434: 0805e911 j 0x0017a444				Calculate tiles hit by ability
0017a438: a2200000 sb r0,0x0000(r17)		Remove Range from Caster Panel+
0017a43c: 0c05e546 jal 0x00179518			[[Calculate Tiles Hit by Ability]]
0017a440: 00002821 addu r5,r0,r0			r5 = 0
0017a444: 32420001 andi r2,r18,0x0001		If Can't Target Self
0017a448: 10400002 beq r2,r0,0x0017a454		Branch if False
0017a44c: 32420010 andi r2,r18,0x0010		If Vertical Fixed
0017a450: a2a00000 sb r0,0x0000(r21)		Remove Caster Panel from Range
0017a454: 10400003 beq r2,r0,0x0017a464		Branch if False
0017a458: 02c02021 addu r4,r22,r0			r4 = Caster X
0017a45c: 0c05e9ef jal 0x0017a7bc			[[Vertical Fixed Routine]]
0017a460: 02e02821 addu r5,r23,r0			r5 = Caster Y
0017a464: 32420008 andi r2,r18,0x0008		If Vertical Fixed
0017a468: 10400005 beq r2,r0,0x0017a480		Branch if False
0017a46c: 33c400ff andi r4,r30,0x00ff		r4 = Height Value if Non Zero (Negative?)
0017a470: 93a70030 lbu r7,0x0030(r29)		r7 = load vertical from stack
0017a474: 00003021 addu r6,r0,r0			r6 = 0
0017a478: 0c05e4a9 jal 0x001792a4			[[Check Vert Tolerance and if Tiles can be Chosen]]
0017a47c: 00e02821 addu r5,r7,r0			r5 = Vertical
0017a480: 93a70028 lbu r7,0x0028(r29)		r7 = Load AoE from Stack
0017a484: 00000000 nop
0017a488: 10e00006 beq r7,r0,0x0017a4a4		Branch if AoE = 0
0017a48c: 00000000 nop
0017a490: 93a70038 lbu r7,0x0038(r29)		r7 = Load Ability Flags 4
0017a494: 00000000 nop
0017a498: 30e20020 andi r2,r7,0x0020		If Direct/Stop at Obstacle
0017a49c: 10400004 beq r2,r0,0x0017a4b0		Branch if False
0017a4a0: 324200c0 andi r2,r18,0x00c0		If Unknown Flags 0x80/0x40 (!!!)
0017a4a4: 0c05e497 jal 0x0017925c			[[Clear Some stuff for Untargetable Terrain]]
0017a4a8: 00000000 nop
0017a4ac: 324200c0 andi r2,r18,0x00c0		If Unknown Flags 0x80/0x40 (!!!)
0017a4b0: 10400003 beq r2,r0,0x0017a4c0		Branch if False
0017a4b4: 02802021 addu r4,r20,r0			r4 = Caster Data
0017a4b8: 0c05e9b7 jal 0x0017a6dc			[[Target Ally/Enemy with Range Routine]]
0017a4bc: 02402821 addu r5,r18,r0			r5 = Ability Flags 1
0017a4c0: 324200d0 andi r2,r18,0x00d0		If Unknown Flags 0x80/0x40 or Vertical Fixed
0017a4c4: 14400005 bne r2,r0,0x0017a4dc		Branch if True
0017a4c8: 00000000 nop
0017a4cc: 0c05e96f jal 0x0017a5bc			[[Identify Cross Sections Routine]]
0017a4d0: 00000000 nop
0017a4d4: 0805e939 j 0x0017a4e4
0017a4d8: 00000000 nop
0017a4dc: 0c05e993 jal 0x0017a64c			[[Identify Cross Sections Routine (Clone)]]
0017a4e0: 00000000 nop
0017a4e4: 8fbf0064 lw r31,0x0064(r29)
0017a4e8: 8fbe0060 lw r30,0x0060(r29)
0017a4ec: 8fb7005c lw r23,0x005c(r29)
0017a4f0: 8fb60058 lw r22,0x0058(r29)
0017a4f4: 8fb50054 lw r21,0x0054(r29)
0017a4f8: 8fb40050 lw r20,0x0050(r29)
0017a4fc: 8fb3004c lw r19,0x004c(r29)
0017a500: 8fb20048 lw r18,0x0048(r29)
0017a504: 8fb10044 lw r17,0x0044(r29)
0017a508: 8fb00040 lw r16,0x0040(r29)
0017a50c: 27bd0068 addiu r29,r29,0x0068
0017a510: 03e00008 jr r31
0017a514: 00000000 nop