Difference between revisions of "Get known skillsets"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> get known skillsets get known skillsets 00122790: 27bdffa8 addiu r29,r29,0xffa8 00122794: 00801021 addu r2,r4,r0 00122798: afb40050 sw r20,0x0050(...")
 
Line 1: Line 1:
<font face='Courier New'>
+
#  ROUTINE: GET KNOWN SKILLSETS
get known skillsets get known skillsets
+
#      Parameters:
  00122790: 27bdffa8 addiu r29,r29,0xffa8
+
#          r4 = (formationUnitIndex) Formation unit index
  00122794: 00801021 addu r2,r4,r0
+
#          r5 = (outputArray) Array to write result into
  00122798: afb40050 sw r20,0x0050(r29)
+
#      Returns:
  0012279c: 00a0a021 addu r20,r5,r0
+
#          r2 = Number of skillsets
  001227a0: 304400ff andi r4,r2,0x00ff
+
   
  001227a4: afb20048 sw r18,0x0048(r29)
+
80122790: 27bdffa8 addiu r29,r29,-0x0058
  001227a8: 00009021 addu r18,r0,r0
+
  80122794: 00801021 addu r2,r4,r0                   #  formationUnitIndex
  001227ac: 00021400 sll r2,r2,0x10
+
  80122798: afb40050 sw r20,0x0050(r29)
  001227b0: 00021383 sra r2,r2,0x0e
+
  8012279c: 00a0a021 addu r20,r5,r0                   #  outputArray
  001227b4: 27a50010 addiu r5,r29,0x0010
+
  801227a0: 304400ff andi r4,r2,0x00ff               #  formationUnitIndex
  001227b8: afbf0054 sw r31,0x0054(r29)
+
  801227a4: afb20048 sw r18,0x0048(r29)
  001227bc: afb3004c sw r19,0x004c(r29)
+
  801227a8: 00009021 addu r18,r0,r0                   #  jobWheelIndex = 0
  001227c0: afb10044 sw r17,0x0044(r29)
+
  801227ac: 00021400 sll r2,r2,0x10
  001227c4: afb00040 sw r16,0x0040(r29)
+
  801227b0: 00021383 sra r2,r2,0x0e                   #  formationUnitIndex * 4
  001227c8: 3c01801d lui r1,0x801d
+
  801227b4: 27a50010 addiu r5,r29,0x0010             #  jobWheelOutputArray
  001227cc: 00220821 addu r1,r1,r2
+
  801227b8: afbf0054 sw r31,0x0054(r29)
  001227d0: 8c22d5ec lw r2,-0x2a14(r1)
+
  801227bc: afb3004c sw r19,0x004c(r29)
  001227d4: 00000000 nop
+
  801227c0: afb10044 sw r17,0x0044(r29)
  001227d8: 94500024 lhu r16,0x0024(r2)
+
  801227c4: afb00040 sw r16,0x0040(r29)
  001227dc: 0c04895f jal 0x0012257c get unlocked jobs
+
  801227c8: 3c01801d lui r1,0x801d
  001227e0: 34060001 ori r6,r0,0x0001
+
  801227cc: 00220821 addu r1,r1,r2
  001227e4: 87a30010 lh r3,0x0010(r29) load job
+
  801227d0: 8c22d5ec lw r2,-0x2a14(r1)               #  formationUnit = formationUnits[formationUnitIndex]
  001227e8: 2402ffff addiu r2,r0,0xffff
+
  801227d4: 00000000 nop
  001227ec: 10620017 beq r3,r2,0x0012284c branch if end of list
+
  801227d8: 94500024 lhu r16,0x0024(r2)               #  formationUnit.jobID
  001227f0: 27a40010 addiu r4,r29,0x0010
+
  801227dc: 0c04895f jal 0x8012257c                  #  [[Calculate Job Wheel Jobs]] (formationUnitIndex, jobWheelOutputArray, 1);
  001227f4: 00101400 sll r2,r16,0x10
+
  801227e0: 34060001 ori r6,r0,0x0001
  001227f8: 00029c03 sra r19,r2,0x10
+
  801227e4: 87a30010 lh r3,0x0010(r29)               #  jobWheelOutputArray[0]
  001227fc: 00008021 addu r16,r0,r0
+
  801227e8: 2402ffff addiu r2,r0,-0x0001
  00122800: 02808821 addu r17,r20,r0
+
  801227ec: 10620017 beq r3,r2,0x8012284c            #  if (jobWheelOutputArray[0] != -1) {        // There is at least one job
  00122804: 02041021 addu r2,r16,r4
+
  801227f0: 27a40010 addiu r4,r29,0x0010             #      jobWheelOutputArray
  00122808: 84440000 lh r4,0x0000(r2) load job
+
  801227f4: 00101400 sll r2,r16,0x10
  0012280c: 00000000 nop
+
  801227f8: 00029c03 sra r19,r2,0x10                 #      formationUnit.jobID
  00122810: 12640008 beq r19,r4,0x00122834 branch if current job
+
  801227fc: 00008021 addu r16,r0,r0                   #      jobWheelPtrOffset = 0
  00122814: 26100002 addiu r16,r16,0x0002 counter++
+
  80122800: 02808821 addu r17,r20,r0                 #      outputArrayPtr = outputArray
  00122818: 3402005d ori r2,r0,0x005d
+
  80122804: 02041021 addu r2,r16,r4                   #      jobWheelPtr = jobWheelPtrOffset + jobWheelOutputArray
  0012281c: 10820005 beq r4,r2,0x00122834 branch if mime
+
                                                    #      do {
  00122820: 00000000 nop
+
  80122808: 84440000 lh r4,0x0000(r2)                 #          jobWheelJobID = *jobWheelPtr
  00122824: 0c0489db jal 0x0012276c get jobs skillset
+
  8012280c: 00000000 nop
  00122828: 26520001 addiu r18,r18,0x0001
+
  80122810: 12640008 beq r19,r4,0x80122834
  0012282c: a6220000 sh r2,0x0000(r17) store skillset as displayed
+
  80122814: 26100002 addiu r16,r16,0x0002             #          jobWheelPtrOffset = jobWheelPtrOffset + 2
  00122830: 26310002 addiu r17,r17,0x0002
+
                                                    #          if ((formationUnit.jobID != jobWheelJobID)
  00122834: 27a40010 addiu r4,r29,0x0010
+
  80122818: 3402005d ori r2,r0,0x005d
  00122838: 02041021 addu r2,r16,r4
+
  8012281c: 10820005 beq r4,r2,0x80122834            #              and (jobWheelJobID != JOB_ID_MIME))
  0012283c: 84430000 lh r3,0x0000(r2) load next job
+
  80122820: 00000000 nop                             #          {
  00122840: 2402ffff addiu r2,r0,0xffff
+
  80122824: 0c0489db jal 0x8012276c                  #              skillsetID = [[Get job's skillset]] (jobWheelJobID);
  00122844: 1462fff0 bne r3,r2,0x00122808 branch if not end of list
+
  80122828: 26520001 addiu r18,r18,0x0001             #              jobWheelIndex = jobWheelIndex + 1
  00122848: 02041021 addu r2,r16,r4
+
  8012282c: a6220000 sh r2,0x0000(r17)               #              *outputArrayPtr = skillsetID           
  0012284c: 00121040 sll r2,r18,0x01 numebr of skillsets*2
+
  80122830: 26310002 addiu r17,r17,0x0002             #              outputArrayPtr = outputArrayPtr + 2
  00122850: 00541021 addu r2,r2,r20
+
                                                    #          }
  00122854: 2403ffff addiu r3,r0,0xffff
+
  80122834: 27a40010 addiu r4,r29,0x0010             #          jobWheelOutputArray
  00122858: a4430000 sh r3,0x0000(r2) set end of list
+
  80122838: 02041021 addu r2,r16,r4                   #          jobWheelPtr = jobWheelPtrOffset + jobWheelOutputArray
  0012285c: 02401021 addu r2,r18,r0 return number of skillsets
+
  8012283c: 84430000 lh r3,0x0000(r2)                 #          jobWheelJobID = *jobWheelPtr
  00122860: 8fbf0054 lw r31,0x0054(r29)
+
  80122840: 2402ffff addiu r2,r0,-0x0001
  00122864: 8fb40050 lw r20,0x0050(r29)
+
  80122844: 1462fff0 bne r3,r2,0x80122808
  00122868: 8fb3004c lw r19,0x004c(r29)
+
  80122848: 02041021 addu r2,r16,r4                   #          jobWheelPtr = jobWheelPtrOffset + jobWheelOutputArray
  0012286c: 8fb20048 lw r18,0x0048(r29)
+
                                                    #      } while (jobWheelJobID != -1);
  00122870: 8fb10044 lw r17,0x0044(r29)
+
                                                    #  }
  00122874: 8fb00040 lw r16,0x0040(r29)
+
  8012284c: 00121040 sll r2,r18,0x01                 #  jobWheelIndex * 2
  00122878: 27bd0058 addiu r29,r29,0x0058
+
  80122850: 00541021 addu r2,r2,r20                   #  outputArray
  0012287c: 03e00008 jr r31
+
  80122854: 2403ffff addiu r3,r0,-0x0001
  00122880: 00000000 nop</font>
+
  80122858: a4430000 sh r3,0x0000(r2)                 #  outputArray[jobWheelIndex * 2] = -1    // Sentinel value
 +
  8012285c: 02401021 addu r2,r18,r0                   #  return jobWheelIndex;                  // Equal to number of skillsets in list
 +
  80122860: 8fbf0054 lw r31,0x0054(r29)
 +
  80122864: 8fb40050 lw r20,0x0050(r29)
 +
  80122868: 8fb3004c lw r19,0x004c(r29)
 +
  8012286c: 8fb20048 lw r18,0x0048(r29)
 +
  80122870: 8fb10044 lw r17,0x0044(r29)
 +
  80122874: 8fb00040 lw r16,0x0040(r29)
 +
  80122878: 27bd0058 addiu r29,r29,0x0058
 +
  8012287c: 03e00008 jr r31
 +
  80122880: 00000000 nop

Revision as of 16:21, 7 December 2024

#   ROUTINE: GET KNOWN SKILLSETS
#       Parameters:
#           r4 = (formationUnitIndex) Formation unit index
#           r5 = (outputArray) Array to write result into
#       Returns:
#           r2 = Number of skillsets

80122790: 27bdffa8 addiu r29,r29,-0x0058
80122794: 00801021 addu r2,r4,r0                    #   formationUnitIndex
80122798: afb40050 sw r20,0x0050(r29)
8012279c: 00a0a021 addu r20,r5,r0                   #   outputArray
801227a0: 304400ff andi r4,r2,0x00ff                #   formationUnitIndex
801227a4: afb20048 sw r18,0x0048(r29)
801227a8: 00009021 addu r18,r0,r0                   #   jobWheelIndex = 0
801227ac: 00021400 sll r2,r2,0x10
801227b0: 00021383 sra r2,r2,0x0e                   #   formationUnitIndex * 4
801227b4: 27a50010 addiu r5,r29,0x0010              #   jobWheelOutputArray
801227b8: afbf0054 sw r31,0x0054(r29)
801227bc: afb3004c sw r19,0x004c(r29)
801227c0: afb10044 sw r17,0x0044(r29)
801227c4: afb00040 sw r16,0x0040(r29)
801227c8: 3c01801d lui r1,0x801d
801227cc: 00220821 addu r1,r1,r2
801227d0: 8c22d5ec lw r2,-0x2a14(r1)                #   formationUnit = formationUnits[formationUnitIndex]
801227d4: 00000000 nop
801227d8: 94500024 lhu r16,0x0024(r2)               #   formationUnit.jobID
801227dc: 0c04895f jal 0x8012257c                   #   Calculate Job Wheel Jobs (formationUnitIndex, jobWheelOutputArray, 1);
801227e0: 34060001 ori r6,r0,0x0001
801227e4: 87a30010 lh r3,0x0010(r29)                #   jobWheelOutputArray[0]
801227e8: 2402ffff addiu r2,r0,-0x0001
801227ec: 10620017 beq r3,r2,0x8012284c             #   if (jobWheelOutputArray[0] != -1) {         // There is at least one job
801227f0: 27a40010 addiu r4,r29,0x0010              #       jobWheelOutputArray
801227f4: 00101400 sll r2,r16,0x10
801227f8: 00029c03 sra r19,r2,0x10                  #       formationUnit.jobID
801227fc: 00008021 addu r16,r0,r0                   #       jobWheelPtrOffset = 0
80122800: 02808821 addu r17,r20,r0                  #       outputArrayPtr = outputArray
80122804: 02041021 addu r2,r16,r4                   #       jobWheelPtr = jobWheelPtrOffset + jobWheelOutputArray
                                                    #       do {
80122808: 84440000 lh r4,0x0000(r2)                 #           jobWheelJobID = *jobWheelPtr
8012280c: 00000000 nop
80122810: 12640008 beq r19,r4,0x80122834
80122814: 26100002 addiu r16,r16,0x0002             #           jobWheelPtrOffset = jobWheelPtrOffset + 2
                                                    #           if ((formationUnit.jobID != jobWheelJobID) 
80122818: 3402005d ori r2,r0,0x005d
8012281c: 10820005 beq r4,r2,0x80122834             #               and (jobWheelJobID != JOB_ID_MIME))
80122820: 00000000 nop                              #           {
80122824: 0c0489db jal 0x8012276c                   #               skillsetID = Get job's skillset (jobWheelJobID);
80122828: 26520001 addiu r18,r18,0x0001             #               jobWheelIndex = jobWheelIndex + 1
8012282c: a6220000 sh r2,0x0000(r17)                #               *outputArrayPtr = skillsetID            
80122830: 26310002 addiu r17,r17,0x0002             #               outputArrayPtr = outputArrayPtr + 2
                                                    #           }
80122834: 27a40010 addiu r4,r29,0x0010              #           jobWheelOutputArray
80122838: 02041021 addu r2,r16,r4                   #           jobWheelPtr = jobWheelPtrOffset + jobWheelOutputArray
8012283c: 84430000 lh r3,0x0000(r2)                 #           jobWheelJobID = *jobWheelPtr
80122840: 2402ffff addiu r2,r0,-0x0001
80122844: 1462fff0 bne r3,r2,0x80122808
80122848: 02041021 addu r2,r16,r4                   #           jobWheelPtr = jobWheelPtrOffset + jobWheelOutputArray
                                                    #       } while (jobWheelJobID != -1);
                                                    #   }
8012284c: 00121040 sll r2,r18,0x01                  #   jobWheelIndex * 2
80122850: 00541021 addu r2,r2,r20                   #   outputArray
80122854: 2403ffff addiu r3,r0,-0x0001
80122858: a4430000 sh r3,0x0000(r2)                 #   outputArray[jobWheelIndex * 2] = -1     // Sentinel value
8012285c: 02401021 addu r2,r18,r0                   #   return jobWheelIndex;                   // Equal to number of skillsets in list
80122860: 8fbf0054 lw r31,0x0054(r29)
80122864: 8fb40050 lw r20,0x0050(r29)
80122868: 8fb3004c lw r19,0x004c(r29)
8012286c: 8fb20048 lw r18,0x0048(r29)
80122870: 8fb10044 lw r17,0x0044(r29)
80122874: 8fb00040 lw r16,0x0040(r29)
80122878: 27bd0058 addiu r29,r29,0x0058
8012287c: 03e00008 jr r31
80122880: 00000000 nop