Difference between revisions of "Calculate Tiles Hit by Ability"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Calculate Tiles Hit by Ability 00179518: 27bdffb8 addiu r29,r29,0xffb8 0017951c: afb40038 sw r20,0x0038(r29) 00179520: 0080a021 addu r20,r4,r0 r20 = AoE 00179524: 32820...")
 
m (Add duplicated link)
Line 1: Line 1:
 +
DUPLICATED here : [[Generate_Range_Routine]]
  
 
  Calculate Tiles Hit by Ability
 
  Calculate Tiles Hit by Ability

Revision as of 20:46, 4 February 2022

DUPLICATED here : Generate_Range_Routine
Calculate Tiles Hit by Ability
00179518: 27bdffb8 addiu r29,r29,0xffb8
0017951c: afb40038 sw r20,0x0038(r29)
00179520: 0080a021 addu r20,r4,r0		r20 = AoE
00179524: 328200ff andi r2,r20,0x00ff		r2 = AoE
00179528: afbf0040 sw r31,0x0040(r29)
0017952c: afb5003c sw r21,0x003c(r29)
00179530: afb30034 sw r19,0x0034(r29)
00179534: afb20030 sw r18,0x0030(r29)
00179538: afb1002c sw r17,0x002c(r29)
0017953c: 14400005 bne r2,r0,0x 00179554		Branch if AoE != 0
00179540: afb00028 sw r16,0x0028(r29)
00179544: 0c05e500 jal 0x 00179400		Null some Tile Data (192dd9)
00179548: 00000000 nop
0017954c: 0805e585 j 0x 00179614
00179550: 00000000 nop
00179554: 34120001 ori r18,r0,0x0001		Tiles Left? = True
00179558: 1040002e beq r2,r0,0x 00179614		Branch if AoE = 0
0017955c: 00009821 addu r19,r0,r0		AoE Counter = 0
00179560: 3c158019 lui r21,0x8019
00179564: 26b52dd8 addiu r21,r21,0x2dd8		r21 = ? Tile data pointer
00179568: 1240002a beq r18,r0,0x 00179614	Branch if Tiles Left? = False
0017956c: 00009021 addu r18,r0,r0		Tiles Left? = False
00179570: 3c02800e lui r2,0x800e
00179574: 90424ea0 lbu r2,0x4ea0(r2)		Load Map Max Y
00179578: 00000000 nop
0017957c: 18400020 blez r2,0x 00179600		Branch if Y <= 0
00179580: 00008821 addu r17,r0,r0		Y Counter = 0
00179584: 3c03800e lui r3,0x800e
00179588: 90634e9c lbu r3,0x4e9c(r3)		Load Map Max X
0017958c: 00000000 nop
00179590: 10600015 beq r3,r0,0x 001795e8		Branch if X = 0
00179594: 00008021 addu r16,r0,r0		X Counter = 0
00179598: 02230018 mult r17,r3			YC * Map X
0017959c: 00001012 mflo r2
001795a0: 00501021 addu r2,r2,r16		YC * Map X + XC
001795a4: 00021880 sll r3,r2,0x02		(YC * Map X + X) * 4
001795a8: 00621821 addu r3,r3,r2		Tile ID = (YC * Map X + X) * 5
001795ac: 00751821 addu r3,r3,r21
001795b0: 90620001 lbu r2,0x0001(r3)		Load Tile's Targeted Flag?
001795b4: 00000000 nop
001795b8: 10400005 beq r2,r0,0x 001795d0		Branch if Targeted Flag? = 0
001795bc: 02202021 addu r4,r17,r0		r4 = Y Counter
001795c0: a0600001 sb r0,0x0001(r3)		Store Tile's Targeted Flag? = 0
001795c4: 0c05e58f jal 0x 0017963c		Calculate Possible AoE Tiles
001795c8: 02002821 addu r5,r16,r0		r5 = X Counter
001795cc: 02429021 addu r18,r18,r2		Tiles Left? += returned Tile's Left?
001795d0: 3c03800e lui r3,0x800e
001795d4: 90634e9c lbu r3,0x4e9c(r3)		Load Map Max X
001795d8: 26100001 addiu r16,r16,0x0001		X Counter ++
001795dc: 0203102a slt r2,r16,r3
001795e0: 1440ffee bne r2,r0,0x 0017959c		Branch if X Counter < Max X
001795e4: 02230018 mult r17,r3			Y Counter * Max X
001795e8: 3c02800e lui r2,0x800e
001795ec: 90424ea0 lbu r2,0x4ea0(r2)		Load Map Max Y
001795f0: 26310001 addiu r17,r17,0x0001		Y Counter ++
001795f4: 0222102a slt r2,r17,r2
001795f8: 1440ffe2 bne r2,r0,0x 00179584		Branch if Y Counter < Max Y
001795fc: 00000000 nop
00179600: 26730001 addiu r19,r19,0x0001		AoE Counter ++
00179604: 328200ff andi r2,r20,0x00ff		r2 = AoE
00179608: 0262102a slt r2,r19,r2
0017960c: 1440ffd6 bne r2,r0,0x 00179568		Branch if AoE Counter < AoE
00179610: 00000000 nop
00179614: 8fbf0040 lw r31,0x0040(r29)
00179618: 8fb5003c lw r21,0x003c(r29)
0017961c: 8fb40038 lw r20,0x0038(r29)
00179620: 8fb30034 lw r19,0x0034(r29)
00179624: 8fb20030 lw r18,0x0030(r29)
00179628: 8fb1002c lw r17,0x002c(r29)
0017962c: 8fb00028 lw r16,0x0028(r29)
00179630: 27bd0048 addiu r29,r29,0x0048
00179634: 03e00008 jr r31
00179638: 00000000 nop