Difference between revisions of "001b04dc - 001b06cc"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "< BATTLE.BIN 001b04dc: 27bdffa0 addiu r29,r29,0xffa0 001b04e0: afb40048 sw r20,0x0048(r29) 001b04e4: 00c0a021 addu r20,r6,r0 001b04e8: afbf005c sw r31,0x005c(r29) 00...")
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
< [[BATTLE.BIN]]
 
< [[BATTLE.BIN]]
 
+
---------------------------------------------------------------------------------------------
  001b04dc: 27bdffa0 addiu r29,r29,0xffa0
+
Parameters : r4
  001b04e0: afb40048 sw r20,0x0048(r29)
+
              r5
  001b04e4: 00c0a021 addu r20,r6,r0
+
              r6
  001b04e8: afbf005c sw r31,0x005c(r29)
+
              r7
  001b04ec: afbe0058 sw r30,0x0058(r29)
+
Returns  r2 = 0x00 if projectile reach target
  001b04f0: afb70054 sw r23,0x0054(r29)
+
          r2 = 0x01 if projectile hit an obstacle
  001b04f4: afb60050 sw r22,0x0050(r29)
+
Update 0x801bbf3c - used as counter in projectile trajectory
  001b04f8: afb5004c sw r21,0x004c(r29)
+
---------------------------------------------------------------------------------------------
  001b04fc: afb30044 sw r19,0x0044(r29)
+
  001b04dc: 27bdffa0 addiu r29,r29,-0x0060    |
  001b0500: afb20040 sw r18,0x0040(r29)
+
  001b04e0: afb40048 sw r20,0x0048(r29)       |
  001b0504: afb1003c sw r17,0x003c(r29)
+
  001b04e4: 00c0a021 addu r20,r6,r0           |
  001b0508: afb00038 sw r16,0x0038(r29)
+
  001b04e8: afbf005c sw r31,0x005c(r29)       |
  001b050c: 8e820000 lw r2,0x0000(r20)
+
  001b04ec: afbe0058 sw r30,0x0058(r29)       |
  001b0510: 34162000 ori r22,r0,0x2000
+
  001b04f0: afb70054 sw r23,0x0054(r29)       |
  001b0514: 0056001a div r2,r22
+
  001b04f4: afb60050 sw r22,0x0050(r29)       |
  001b0518: 0000a812 mflo r21
+
  001b04f8: afb5004c sw r21,0x004c(r29)       |
  001b051c: 0080b821 addu r23,r4,r0
+
  001b04fc: afb30044 sw r19,0x0044(r29)       |
  001b0520: 00a08021 addu r16,r5,r0
+
  001b0500: afb20040 sw r18,0x0040(r29)       |
  001b0524: 00e0f021 addu r30,r7,r0
+
  001b0504: afb1003c sw r17,0x003c(r29)       |
  001b0528: 86020000 lh r2,0x0000(r16)
+
  001b0508: afb00038 sw r16,0x0038(r29)       |
  001b052c: 00009021 addu r18,r0,r0
+
  001b050c: 8e820000 lw r2,0x0000(r20)       |
  001b0530: afa20010 sw r2,0x0010(r29)
+
  001b0510: 34162000 ori r22,r0,0x2000       |
  001b0534: 86020002 lh r2,0x0002(r16)
+
  001b0514: 0056001a div r2,r22               |
  001b0538: 00003821 addu r7,r0,r0
+
  001b0518: 0000a812 mflo r21                 |{{f/std|projectile trajectory lenght related}}
  001b053c: afa20014 sw r2,0x0014(r29)
+
  001b051c: 0080b821 addu r23,r4,r0           |
  001b0540: 86020004 lh r2,0x0004(r16)
+
  001b0520: 00a08021 addu r16,r5,r0           |
  001b0544: 00008821 addu r17,r0,r0
+
  001b0524: 00e0f021 addu r30,r7,r0           |
  001b0548: 1aa0002a blez r21,0x001b05f4
+
  001b0528: 86020000 lh r2,0x0000(r16)       |
  001b054c: afa20018 sw r2,0x0018(r29)
+
  001b052c: 00009021 addu r18,r0,r0           |
  001b0550: 27b30010 addiu r19,r29,0x0010
+
  001b0530: afa20010 sw r2,0x0010(r29)       |
  001b0554: 8fa20010 lw r2,0x0010(r29)
+
  001b0534: 86020002 lh r2,0x0002(r16)       |
  001b0558: 8fa30014 lw r3,0x0014(r29)
+
  001b0538: 00003821 addu r7,r0,r0           |
  001b055c: 8fa40018 lw r4,0x0018(r29)
+
  001b053c: afa20014 sw r2,0x0014(r29)       |
  001b0560: 8fa5001c lw r5,0x001c(r29)
+
  001b0540: 86020004 lh r2,0x0004(r16)       |
  001b0564: afa20020 sw r2,0x0020(r29)
+
  001b0544: 00008821 addu r17,r0,r0           |
  001b0568: afa30024 sw r3,0x0024(r29)
+
  001b0548: 1aa0002a blez r21,0x001b05f4     {{f/Cond|if r21 > 0x00}}
  001b056c: afa40028 sw r4,0x0028(r29)
+
  001b054c: afa20018 sw r2,0x0018(r29)       |{{f/std|}}
  001b0570: afa5002c sw r5,0x002c(r29)
+
  001b0550: 27b30010 addiu r19,r29,0x0010         |{{f/std|}}
  001b0574: 02569021 addu r18,r18,r22
+
                                                {{f/bloop|LOOP}}
  001b0578: 02e02021 addu r4,r23,r0
+
  001b0554: 8fa20010 lw r2,0x0010(r29)               |{{f/std|}}
  001b057c: 02403021 addu r6,r18,r0
+
  001b0558: 8fa30014 lw r3,0x0014(r29)               |
  001b0580: 8e850000 lw r5,0x0000(r20)
+
  001b055c: 8fa40018 lw r4,0x0018(r29)               |
  001b0584: 0c06bdb6 jal 0x001af6d8
+
  001b0560: 8fa5001c lw r5,0x001c(r29)               |
  001b0588: 02603821 addu r7,r19,r0
+
  001b0564: afa20020 sw r2,0x0020(r29)               |
  001b058c: 03c02021 addu r4,r30,r0
+
  001b0568: afa30024 sw r3,0x0024(r29)               |
  001b0590: 86020000 lh r2,0x0000(r16)
+
  001b056c: afa40028 sw r4,0x0028(r29)               |
  001b0594: 8fa30010 lw r3,0x0010(r29)
+
  001b0570: afa5002c sw r5,0x002c(r29)               |
  001b0598: 02602821 addu r5,r19,r0
+
  001b0574: 02569021 addu r18,r18,r22                 |
  001b059c: 00431021 addu r2,r2,r3
+
  001b0578: 02e02021 addu r4,r23,r0                   |
  001b05a0: afa20010 sw r2,0x0010(r29)
+
  001b057c: 02403021 addu r6,r18,r0                   |
  001b05a4: 86020002 lh r2,0x0002(r16)
+
  001b0580: 8e850000 lw r5,0x0000(r20)               |
  001b05a8: 8fa30014 lw r3,0x0014(r29)
+
  001b0584: 0c06bdb6 jal 0x001af6d8                   |{{f/jal|Find XYZ Position of Projectile Along Trajectory|Find XYZ Position of Projectile Along Trajectory}}
  001b05ac: 3c06801c lui r6,0x801c
+
  001b0588: 02603821 addu r7,r19,r0                   |
  001b05b0: 24c68b64 addiu r6,r6,0x8b64
+
  001b058c: 03c02021 addu r4,r30,r0                   |
  001b05b4: 00431021 addu r2,r2,r3
+
  001b0590: 86020000 lh r2,0x0000(r16)               |
  001b05b8: afa20014 sw r2,0x0014(r29)
+
  001b0594: 8fa30010 lw r3,0x0010(r29)               |
  001b05bc: 86020004 lh r2,0x0004(r16)
+
  001b0598: 02602821 addu r5,r19,r0                   |
  001b05c0: 8fa30018 lw r3,0x0018(r29)
+
  001b059c: 00431021 addu r2,r2,r3                   |
  001b05c4: 3c07801c lui r7,0x801c
+
  001b05a0: afa20010 sw r2,0x0010(r29)               |
  001b05c8: 24e78b68 addiu r7,r7,0x8b68
+
  001b05a4: 86020002 lh r2,0x0002(r16)               |
  001b05cc: 00431021 addu r2,r2,r3
+
  001b05a8: 8fa30014 lw r3,0x0014(r29)               |
  001b05d0: 0c06be2d jal 0x001af8b4
+
  001b05ac: 3c06801c lui r6,0x801c                   |
  001b05d4: afa20018 sw r2,0x0018(r29)
+
  001b05b0: 24c68b64 addiu r6,r6,0x8b64               |
  001b05d8: 00403821 addu r7,r2,r0
+
  001b05b4: 00431021 addu r2,r2,r3                   |
  001b05dc: 14e00005 bne r7,r0,0x001b05f4
+
  001b05b8: afa20014 sw r2,0x0014(r29)               |
  001b05e0: 00000000 nop
+
  001b05bc: 86020004 lh r2,0x0004(r16)               |
  001b05e4: 26310001 addiu r17,r17,0x0001
+
  001b05c0: 8fa30018 lw r3,0x0018(r29)               |
  001b05e8: 0235102a slt r2,r17,r21
+
  001b05c4: 3c07801c lui r7,0x801c                   |
  001b05ec: 1440ffd9 bne r2,r0,0x001b0554
+
  001b05c8: 24e78b68 addiu r7,r7,0x8b68               |
  001b05f0: 00000000 nop
+
  001b05cc: 00431021 addu r2,r2,r3                   |
  001b05f4: 8fa20010 lw r2,0x0010(r29)
+
  001b05d0: 0c06be2d jal 0x001af8b4                   |{{f/jal|Seek Obstacle On Trajectory|Seek Obstacle On Trajectory}} {{f/std|<nowiki>returns r2 = 0x01 if obstacle</nowiki>}}
  001b05f8: 8fa40020 lw r4,0x0020(r29)
+
  001b05d4: afa20018 sw r2,0x0018(r29)               |
  001b05fc: 8fa30014 lw r3,0x0014(r29)
+
  001b05d8: 00403821 addu r7,r2,r0                   |
  001b0600: 8fa50024 lw r5,0x0024(r29)
+
  001b05dc: 14e00005 bne r7,r0,0x001b05f4             {{f/Cond|Exit loop if there is an obstacle}}
  001b0604: 97a60018 lhu r6,0x0018(r29)
+
  001b05e0: 00000000 nop                                 |
  001b0608: 00441023 subu r2,r2,r4
+
  001b05e4: 26310001 addiu r17,r17,0x0001                 |
  001b060c: 3c01801c lui r1,0x801c
+
  001b05e8: 0235102a slt r2,r17,r21                       |
  001b0610: ac228b7c sw r2,-0x7484(r1)
+
  001b05ec: 1440ffd9 bne r2,r0,0x001b0554         {{f/eloop|Loop along trajectory}}
  001b0614: 8fa20018 lw r2,0x0018(r29)
+
  001b05f0: 00000000 nop                         |{{f/std|}}
  001b0618: 00651823 subu r3,r3,r5
+
  001b05f4: 8fa20010 lw r2,0x0010(r29)       |{{f/std|}}
  001b061c: 3c01801c lui r1,0x801c
+
  001b05f8: 8fa40020 lw r4,0x0020(r29)       |
  001b0620: ac238b80 sw r3,-0x7480(r1)
+
  001b05fc: 8fa30014 lw r3,0x0014(r29)       |
  001b0624: 8fa30028 lw r3,0x0028(r29)
+
  001b0600: 8fa50024 lw r5,0x0024(r29)       |
  001b0628: 97a40010 lhu r4,0x0010(r29)
+
  001b0604: 97a60018 lhu r6,0x0018(r29)       |
  001b062c: 97a50014 lhu r5,0x0014(r29)
+
  001b0608: 00441023 subu r2,r2,r4           |
  001b0630: 3c01801c lui r1,0x801c
+
  001b060c: 3c01801c lui r1,0x801c           |
  001b0634: a4268b90 sh r6,-0x7470(r1)
+
  001b0610: ac228b7c sw r2,-0x7484(r1)       |
  001b0638: 00431023 subu r2,r2,r3
+
  001b0614: 8fa20018 lw r2,0x0018(r29)       |
  001b063c: 3c01801c lui r1,0x801c
+
  001b0618: 00651823 subu r3,r3,r5           |
  001b0640: ac228b84 sw r2,-0x747c(r1)
+
  001b061c: 3c01801c lui r1,0x801c           |
  001b0644: 3c01801c lui r1,0x801c
+
  001b0620: ac238b80 sw r3,-0x7480(r1)       |
  001b0648: a4248b8c sh r4,-0x7474(r1)
+
  001b0624: 8fa30028 lw r3,0x0028(r29)       |
  001b064c: 3c01801c lui r1,0x801c
+
  001b0628: 97a40010 lhu r4,0x0010(r29)       |
  001b0650: a4258b8e sh r5,-0x7472(r1)
+
  001b062c: 97a50014 lhu r5,0x0014(r29)       |
  001b0654: 10e00009 beq r7,r0,0x001b067c
+
  001b0630: 3c01801c lui r1,0x801c           |
  001b0658: 02201021 addu r2,r17,r0
+
  001b0634: a4268b90 sh r6,-0x7470(r1)       |
  001b065c: 04410002 bgez r2,0x001b0668
+
  001b0638: 00431023 subu r2,r2,r3           |
  001b0660: 00000000 nop
+
  001b063c: 3c01801c lui r1,0x801c           |
  001b0664: 24420003 addiu r2,r2,0x0003
+
  001b0640: ac228b84 sw r2,-0x747c(r1)       |
  001b0668: 00021083 sra r2,r2,0x02
+
  001b0644: 3c01801c lui r1,0x801c           |
  001b066c: 3c01801c lui r1,0x801c
+
  001b0648: a4248b8c sh r4,-0x7474(r1)       |
  001b0670: ac22bf3c sw r2,-0x40c4(r1)
+
  001b064c: 3c01801c lui r1,0x801c           |
  001b0674: 0806c1a7 j 0x001b069c
+
  001b0650: a4258b8e sh r5,-0x7472(r1)       |
  001b0678: 00001021 addu r2,r0,r0
+
  001b0654: 10e00009 beq r7,r0,0x001b067c     {{f/Cond|If projectile ends in an obstacle}}
  001b067c: 02a01021 addu r2,r21,r0
+
  001b0658: 02201021 addu r2,r17,r0           |{{f/std|Distance counter}}
  001b0680: 04410002 bgez r2,0x001b068c
+
  001b065c: 04410002 bgez r2,0x001b0668           {{f/Cond|If Travel distance is invalid (<0)}}
  001b0684: 00000000 nop
+
  001b0660: 00000000 nop                             |{{f/std|}}
  001b0688: 24420003 addiu r2,r2,0x0003
+
  001b0664: 24420003 addiu r2,r2,0x0003               |{{f/std|security stuff ? }}
  001b068c: 00021083 sra r2,r2,0x02
+
  001b0668: 00021083 sra r2,r2,0x02               |{{f/std|}}
  001b0690: 3c01801c lui r1,0x801c
+
  001b066c: 3c01801c lui r1,0x801c               |
  001b0694: ac22bf3c sw r2,-0x40c4(r1)
+
  001b0670: ac22bf3c sw r2,-0x40c4(r1)           |{{f/store|Store distance to obstacle}}
  001b0698: 34020001 ori r2,r0,0x0001
+
  001b0674: 0806c1a7 j 0x001b069c                 {{f/jump|Exit routine}}
  001b069c: 8fbf005c lw r31,0x005c(r29)
+
  001b0678: 00001021 addu r2,r0,r0               |{{f/std|returns 0}}
 +
  001b067c: 02a01021 addu r2,r21,r0           |{{f/std|Target distance}}
 +
  001b0680: 04410002 bgez r2,0x001b068c       {{f/Cond|If Ditance is valid}}
 +
  001b0684: 00000000 nop                         |
 +
  001b0688: 24420003 addiu r2,r2,0x0003           |{{f/std|security stuff ? }}
 +
  001b068c: 00021083 sra r2,r2,0x02           |{{f/std|}}
 +
  001b0690: 3c01801c lui r1,0x801c           |{{f/std|}}
 +
  001b0694: ac22bf3c sw r2,-0x40c4(r1)       |{{f/store|Store distance to Target}}
 +
  001b0698: 34020001 ori r2,r0,0x0001         |{{f/std|returns 1}}
 +
  001b069c: 8fbf005c lw r31,0x005c(r29)       {{f/std|END}}
 
  001b06a0: 8fbe0058 lw r30,0x0058(r29)
 
  001b06a0: 8fbe0058 lw r30,0x0058(r29)
 
  001b06a4: 8fb70054 lw r23,0x0054(r29)
 
  001b06a4: 8fb70054 lw r23,0x0054(r29)
Line 126: Line 135:
 
  001b06c8: 03e00008 jr r31
 
  001b06c8: 03e00008 jr r31
 
  001b06cc: 00000000 nop
 
  001b06cc: 00000000 nop
 +
 +
 +
=== Return Locations ===
 +
 +
'''Battle.Bin'''
 +
001b0a54: [[001b0818_-_001b0a8c]] - Ninja thrown weapon
 +
001b07f8: [[001b06d0_-_001b0814]]

Latest revision as of 09:27, 10 March 2024

< BATTLE.BIN

---------------------------------------------------------------------------------------------
Parameters : r4
             r5
             r6
             r7
Returns  r2 = 0x00 if projectile reach target
         r2 = 0x01 if projectile hit an obstacle
Update 0x801bbf3c - used as counter in projectile trajectory
---------------------------------------------------------------------------------------------
001b04dc: 27bdffa0 addiu r29,r29,-0x0060    |
001b04e0: afb40048 sw r20,0x0048(r29)       |
001b04e4: 00c0a021 addu r20,r6,r0           |
001b04e8: afbf005c sw r31,0x005c(r29)       |
001b04ec: afbe0058 sw r30,0x0058(r29)       |
001b04f0: afb70054 sw r23,0x0054(r29)       |
001b04f4: afb60050 sw r22,0x0050(r29)       |
001b04f8: afb5004c sw r21,0x004c(r29)       |
001b04fc: afb30044 sw r19,0x0044(r29)       |
001b0500: afb20040 sw r18,0x0040(r29)       |
001b0504: afb1003c sw r17,0x003c(r29)       |
001b0508: afb00038 sw r16,0x0038(r29)       |
001b050c: 8e820000 lw r2,0x0000(r20)        |
001b0510: 34162000 ori r22,r0,0x2000        |
001b0514: 0056001a div r2,r22               |
001b0518: 0000a812 mflo r21                 |projectile trajectory lenght related
001b051c: 0080b821 addu r23,r4,r0           |
001b0520: 00a08021 addu r16,r5,r0           |
001b0524: 00e0f021 addu r30,r7,r0           |
001b0528: 86020000 lh r2,0x0000(r16)        |
001b052c: 00009021 addu r18,r0,r0           |
001b0530: afa20010 sw r2,0x0010(r29)        |
001b0534: 86020002 lh r2,0x0002(r16)        |
001b0538: 00003821 addu r7,r0,r0            |
001b053c: afa20014 sw r2,0x0014(r29)        |
001b0540: 86020004 lh r2,0x0004(r16)        |
001b0544: 00008821 addu r17,r0,r0           |
001b0548: 1aa0002a blez r21,0x001b05f4      #if r21 > 0x00
001b054c: afa20018 sw r2,0x0018(r29)        |
001b0550: 27b30010 addiu r19,r29,0x0010         |
                                                @LOOP
001b0554: 8fa20010 lw r2,0x0010(r29)                |
001b0558: 8fa30014 lw r3,0x0014(r29)                |
001b055c: 8fa40018 lw r4,0x0018(r29)                |
001b0560: 8fa5001c lw r5,0x001c(r29)                |
001b0564: afa20020 sw r2,0x0020(r29)                |
001b0568: afa30024 sw r3,0x0024(r29)                |
001b056c: afa40028 sw r4,0x0028(r29)                |
001b0570: afa5002c sw r5,0x002c(r29)                |
001b0574: 02569021 addu r18,r18,r22                 |
001b0578: 02e02021 addu r4,r23,r0                   |
001b057c: 02403021 addu r6,r18,r0                   |
001b0580: 8e850000 lw r5,0x0000(r20)                |
001b0584: 0c06bdb6 jal 0x001af6d8                   |-->Find XYZ Position of Projectile Along Trajectory
001b0588: 02603821 addu r7,r19,r0                   |
001b058c: 03c02021 addu r4,r30,r0                   |
001b0590: 86020000 lh r2,0x0000(r16)                |
001b0594: 8fa30010 lw r3,0x0010(r29)                |
001b0598: 02602821 addu r5,r19,r0                   |
001b059c: 00431021 addu r2,r2,r3                    |
001b05a0: afa20010 sw r2,0x0010(r29)                |
001b05a4: 86020002 lh r2,0x0002(r16)                |
001b05a8: 8fa30014 lw r3,0x0014(r29)                |
001b05ac: 3c06801c lui r6,0x801c                    |
001b05b0: 24c68b64 addiu r6,r6,0x8b64               |
001b05b4: 00431021 addu r2,r2,r3                    |
001b05b8: afa20014 sw r2,0x0014(r29)                |
001b05bc: 86020004 lh r2,0x0004(r16)                |
001b05c0: 8fa30018 lw r3,0x0018(r29)                |
001b05c4: 3c07801c lui r7,0x801c                    |
001b05c8: 24e78b68 addiu r7,r7,0x8b68               |
001b05cc: 00431021 addu r2,r2,r3                    |
001b05d0: 0c06be2d jal 0x001af8b4                   |-->Seek Obstacle On Trajectory returns r2 = 0x01 if obstacle
001b05d4: afa20018 sw r2,0x0018(r29)                |
001b05d8: 00403821 addu r7,r2,r0                    |
001b05dc: 14e00005 bne r7,r0,0x001b05f4             #Exit loop if there is an obstacle
001b05e0: 00000000 nop                                  |
001b05e4: 26310001 addiu r17,r17,0x0001                 |
001b05e8: 0235102a slt r2,r17,r21                       |
001b05ec: 1440ffd9 bne r2,r0,0x001b0554         Λ Loop along trajectory
001b05f0: 00000000 nop                          |
001b05f4: 8fa20010 lw r2,0x0010(r29)        |
001b05f8: 8fa40020 lw r4,0x0020(r29)        |
001b05fc: 8fa30014 lw r3,0x0014(r29)        |
001b0600: 8fa50024 lw r5,0x0024(r29)        |
001b0604: 97a60018 lhu r6,0x0018(r29)       |
001b0608: 00441023 subu r2,r2,r4            |
001b060c: 3c01801c lui r1,0x801c            |
001b0610: ac228b7c sw r2,-0x7484(r1)        |
001b0614: 8fa20018 lw r2,0x0018(r29)        |
001b0618: 00651823 subu r3,r3,r5            |
001b061c: 3c01801c lui r1,0x801c            |
001b0620: ac238b80 sw r3,-0x7480(r1)        |
001b0624: 8fa30028 lw r3,0x0028(r29)        |
001b0628: 97a40010 lhu r4,0x0010(r29)       |
001b062c: 97a50014 lhu r5,0x0014(r29)       |
001b0630: 3c01801c lui r1,0x801c            |
001b0634: a4268b90 sh r6,-0x7470(r1)        |
001b0638: 00431023 subu r2,r2,r3            |
001b063c: 3c01801c lui r1,0x801c            |
001b0640: ac228b84 sw r2,-0x747c(r1)        |
001b0644: 3c01801c lui r1,0x801c            |
001b0648: a4248b8c sh r4,-0x7474(r1)        |
001b064c: 3c01801c lui r1,0x801c            |
001b0650: a4258b8e sh r5,-0x7472(r1)        |
001b0654: 10e00009 beq r7,r0,0x001b067c     #If projectile ends in an obstacle
001b0658: 02201021 addu r2,r17,r0           |Distance counter
001b065c: 04410002 bgez r2,0x001b0668           #If Travel distance is invalid (<0)
001b0660: 00000000 nop                              |
001b0664: 24420003 addiu r2,r2,0x0003               |security stuff ? 
001b0668: 00021083 sra r2,r2,0x02               |
001b066c: 3c01801c lui r1,0x801c                |
001b0670: ac22bf3c sw r2,-0x40c4(r1)            |Store distance to obstacle
001b0674: 0806c1a7 j 0x001b069c                 >>Exit routine
001b0678: 00001021 addu r2,r0,r0                |returns 0
001b067c: 02a01021 addu r2,r21,r0           |Target distance
001b0680: 04410002 bgez r2,0x001b068c       #If Ditance is valid
001b0684: 00000000 nop                          |
001b0688: 24420003 addiu r2,r2,0x0003           |security stuff ? 
001b068c: 00021083 sra r2,r2,0x02           |
001b0690: 3c01801c lui r1,0x801c            |
001b0694: ac22bf3c sw r2,-0x40c4(r1)        |Store distance to Target
001b0698: 34020001 ori r2,r0,0x0001         |returns 1
001b069c: 8fbf005c lw r31,0x005c(r29)       END
001b06a0: 8fbe0058 lw r30,0x0058(r29)
001b06a4: 8fb70054 lw r23,0x0054(r29)
001b06a8: 8fb60050 lw r22,0x0050(r29)
001b06ac: 8fb5004c lw r21,0x004c(r29)
001b06b0: 8fb40048 lw r20,0x0048(r29)
001b06b4: 8fb30044 lw r19,0x0044(r29)
001b06b8: 8fb20040 lw r18,0x0040(r29)
001b06bc: 8fb1003c lw r17,0x003c(r29)
001b06c0: 8fb00038 lw r16,0x0038(r29)
001b06c4: 27bd0060 addiu r29,r29,0x0060
001b06c8: 03e00008 jr r31
001b06cc: 00000000 nop


Return Locations

Battle.Bin
001b0a54: 001b0818_-_001b0a8c - Ninja thrown weapon
001b07f8: 001b06d0_-_001b0814