Difference between revisions of "Generate Range Routine"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<pre> Generate Range Routine r4 = Range r5 = 0 00179518: 27bdffb8 addiu r29,r29,-0x0048 0017951c: afb40038 sw r20,0x0038(r29) 00179520: 0080a021 addu r20,r4,r0 r20 = Range...")
 
m (Add duplicated link)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
DUPLICATED here : [[Calculate_Tiles_Hit_by_Ability]]
 
<pre>
 
<pre>
Generate Range Routine
+
Generate Range Routine
 
r4 = Range
 
r4 = Range
 
r5 = 0
 
r5 = 0

Latest revision as of 20:45, 4 February 2022

DUPLICATED here : Calculate_Tiles_Hit_by_Ability
Generate Range Routine  
r4 = Range
r5 = 0
00179518: 27bdffb8 addiu r29,r29,-0x0048
0017951c: afb40038 sw r20,0x0038(r29)
00179520: 0080a021 addu r20,r4,r0					r20 = Range
00179524: 328200ff andi r2,r20,0x00ff				r2 = Range if non-zero (negative?)
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,0x00179554				Branch if Range is non-zero (negative?)
00179540: afb00028 sw r16,0x0028(r29)
00179544: 0c05e500 jal 0x00179400					Empty ? Tile Grid
00179548: 00000000 nop
0017954c: 0805e585 j 0x00179614						Quit
00179550: 00000000 nop
00179554: 34120001 ori r18,r0,0x0001				r18 = True
00179558: 1040002e beq r2,r0,0x00179614				Quit if Range = 0
0017955c: 00009821 addu r19,r0,r0					r19 = Range Counter
00179560: 3c158019 lui r21,0x8019
00179564: 26b52dd8 addiu r21,r21,0x2dd8				r21 = Tile Grid Data (0x192dd8)
00179568: 1240002a beq r18,r0,0x00179614			Quit if last tile not targeted
0017956c: 00009021 addu r18,r0,r0					r18 = 0
00179570: 3c02800e lui r2,0x800e
00179574: 90424ea0 lbu r2,0x4ea0(r2)				r2 = Max Map Y
00179578: 00000000 nop
0017957c: 18400020 blez r2,0x00179600				branch if Max Y is negative
00179580: 00008821 addu r17,r0,r0					r17 = Y Counter
00179584: 3c03800e lui r3,0x800e
00179588: 90634e9c lbu r3,0x4e9c(r3)				r3 = Max Map X
0017958c: 00000000 nop
00179590: 10600015 beq r3,r0,0x001795e8				Branch if Max X = 0
00179594: 00008021 addu r16,r0,r0					r16 = X Counter
00179598: 02230018 mult r17,r3						Y Counter * Max X
0017959c: 00001012 mflo r2
001795a0: 00501021 addu r2,r2,r16					Y Counter * Max X + X Counter
001795a4: 00021880 sll r3,r2,0x02					r3 = Tile ID
001795a8: 00621821 addu r3,r3,r2
001795ac: 00751821 addu r3,r3,r21					r3 = Tile Grid pointer
001795b0: 90620001 lbu r2,0x0001(r3)				r2 = Tile Target Data
001795b4: 00000000 nop
001795b8: 10400005 beq r2,r0,0x001795d0				Branch if Tile isn't Targeted
001795bc: 02202021 addu r4,r17,r0					r4 = Y Counter
001795c0: a0600001 sb r0,0x0001(r3)					Remove Targeting
001795c4: 0c05e58f jal 0x0017963c					Generate Range Around Tile
001795c8: 02002821 addu r5,r16,r0					r5 = X Counter
001795cc: 02429021 addu r18,r18,r2					r18 = Successful Function
001795d0: 3c03800e lui r3,0x800e
001795d4: 90634e9c lbu r3,0x4e9c(r3)				r3 = Map Max X
001795d8: 26100001 addiu r16,r16,0x0001				X Counter++
001795dc: 0203102a slt r2,r16,r3					If X Counter < Max X
001795e0: 1440ffee bne r2,r0,0x0017959c				Branch Back if True
001795e4: 02230018 mult r17,r3						Y Counter * Max X
001795e8: 3c02800e lui r2,0x800e
001795ec: 90424ea0 lbu r2,0x4ea0(r2)				r2 = Map Max Y
001795f0: 26310001 addiu r17,r17,0x0001				Y Counter++
001795f4: 0222102a slt r2,r17,r2					If Y Counter < Max Y
001795f8: 1440ffe2 bne r2,r0,0x00179584				Branch back if True
001795fc: 00000000 nop
00179600: 26730001 addiu r19,r19,0x0001				Range Counter++
00179604: 328200ff andi r2,r20,0x00ff				r2 = Range if non-zero (negative?)
00179608: 0262102a slt r2,r19,r2					If Range Counter < Range
0017960c: 1440ffd6 bne r2,r0,0x00179568				Branch Back if True
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