Disable Green Panel on all but Target's Tile
Jump to navigation
Jump to search
0017b7b4 - 0017b870 Parameters : r4 pointer to Attacker 0x16e - 0x181 Returns : r2 = -0x01 if invalid Tile, 0x01 of Tile is valid --------------------------------------------------------------- 0017b7b4: 27bdffd0 addiu r29,r29,-0x0030 | 0017b7b8: 27a50010 addiu r5,r29,0x0010 |r5 = Stack Pointer 0017b7bc: afbf002c sw r31,0x002c(r29) | 0017b7c0: 0c01788b jal 0x0005e22c |-->Copy_Byte_Data_(20_Bytes) Copy Attacker 0x16e to 0x181 on Stack r29 0x10 to 0x23 0017b7c4: afb00028 sw r16,0x0028(r29) | 0017b7c8: 93a7001c lbu r7,0x001c(r29) |r7 = Targeted X coord 0017b7cc: 3c06800e lui r6,0x800e | 0017b7d0: 90c64e9c lbu r6,0x4e9c(r6) |r6 = Map Max X 0x800e4e9c 0017b7d4: 93a30020 lbu r3,0x0020(r29) |r3 = Targeted Y coord 0017b7d8: 93a5001e lbu r5,0x001e(r29) |r5 = Targeted Elevation 0017b7dc: 00e6102b sltu r2,r7,r6 |r2 = 0x01 if Targeted X < Map Max X 0017b7e0: 1040001e beq r2,r0,0x0017b85c #If X coordinates is valid (< Map Max X) /Else branch to END (r2 will be set to -0x01) 0017b7e4: 306400ff andi r4,r3,0x00ff |r4 = Target's Y 0017b7e8: 3c02800e lui r2,0x800e | 0017b7ec: 90424ea0 lbu r2,0x4ea0(r2) |r2 = Map Max Y 0x800e4ea0 0017b7f0: 00000000 nop | 0017b7f4: 0082102b sltu r2,r4,r2 |r2 = 0x01 if Targeted Y < Map Max Y 0017b7f8: 10400018 beq r2,r0,0x0017b85c #If Y coord is valid (< Map Max Y) /Else branch to END (r2 will be set to -0x01) 0017b7fc: 30a300ff andi r3,r5,0x00ff |r3 = Higher Elevation Flag 0017b800: 2c620002 sltiu r2,r3,0x0002 |r2 = 0x01 if elevation < 0x02 0017b804: 10400015 beq r2,r0,0x0017b85c #If Elevation is valid (< 0x02) /Else branch to END (r2 will be set to -0x01) 0017b808: 00860018 mult r4,r6 |Targeted Y * Map Max X 0017b80c: 00031200 sll r2,r3,0x08 |Elevation * 0x100 ( = 0x00 or 0x100) 0017b810: 00001812 mflo r3 |r3 = Targeted Y * Map Max X 0017b814: 00431021 addu r2,r2,r3 |r2 = (Targeted Y * Map Max X) + Elevation offset 0017b818: 00471021 addu r2,r2,r7 |r2 = Targeted X + (Targeted Y * Map Max X) + Elevation offset = Tile ID 0017b81c: 000210c0 sll r2,r2,0x03 |r2 = Tile ID * 8 (= Tile offset in Tiles data) 0017b820: 3c038019 lui r3,0x8019 | 0017b824: 2463f8cc addiu r3,r3,-0x0734 |r3 = Start of tiles data 0x8018f8cc 0017b828: 00438021 addu r16,r2,r3 |r16 = Targeted tile data pointer 0017b82c: 92020006 lbu r2,0x0006(r16) |r2 = Targeted Tile [0x06] 0017b830: 00000000 nop | 0017b834: 30420001 andi r2,r2,0x0001 |r2 = 0x01 if targeted tile is unselectable 0017b838: 14400009 bne r2,r0,0x0017b860 #If Targeted Tile is valid (selectable) /Else branch to END (r2 set to -0x01) 0017b83c: 2402ffff addiu r2,r0,-0x0001 |r2 = -0x01 0017b840: 0c05ed28 jal 0x0017b4a0 |-->Disable_Green_Panel_Flags Disable all green panels 0017b844: 00000000 nop | 0017b848: 92030005 lbu r3,0x0005(r16) |r3 = Targeted Tile [0x05] 0017b84c: 34020001 ori r2,r0,0x0001 |r2 = 0x01 0017b850: 34630080 ori r3,r3,0x0080 |r3 = Targeted Tile [0x05] with 0x80 0017b854: 0805ee18 j 0x0017b860 >>jump to END keeping r2 = 0x01 0017b858: a2030005 sb r3,0x0005(r16) |Enable green panel flag on targeted tile value 0x80 at Tile [0x05] 0017b85c: 2402ffff addiu r2,r0,-0x0001 |r2 = -0x01 0017b860: 8fbf002c lw r31,0x002c(r29) | 0017b864: 8fb00028 lw r16,0x0028(r29) | 0017b868: 27bd0030 addiu r29,r29,0x0030 | 0017b86c: 03e00008 jr r31 0017b870: 00000000 nop
Return loaction
Battle.bin 0017ac58: Calculate_Targeting_for_Menu_Types