Prep Job Wheel and Skillset Display

From Final Fantasy Hacktics Wiki
(Redirected from 0x11a378)
Jump to navigation Jump to search
8011a378: 27bdffd0 addiu r29,r29,-0x0030
8011a37c: afb20028 sw r18,0x0028(r29)
8011a380: 3c12801d lui r18,0x801d
8011a384: 265283f8 addiu r18,r18,-0x7c08            #   0x801c83f8
8011a388: 02402821 addu r5,r18,r0                   #   0x801c83f8
8011a38c: 3c048019 lui r4,0x8019
8011a390: 9084ba20 lbu r4,-0x45e0(r4)               #   *0x8018ba20
8011a394: 34060002 ori r6,r0,0x0002                 #   2
8011a398: afb10024 sw r17,0x0024(r29)
8011a39c: 00008821 addu r17,r0,r0                   #   0
8011a3a0: afbf002c sw r31,0x002c(r29)
8011a3a4: 0c04895f jal 0x8012257c                   #   numJobs = Calculate Job Wheel Jobs/Job Wheel (*0x8018ba20, 0x801c83f8, 2);
8011a3a8: afb00020 sw r16,0x0020(r29)
8011a3ac: 3c01801d lui r1,0x801d
8011a3b0: a42283f0 sh r2,-0x7c10(r1)                #   *0x801c83f0 = numJobs
8011a3b4: 00021400 sll r2,r2,0x10
8011a3b8: 18400021 blez r2,0x8011a440
8011a3bc: 00000000 nop
8011a3c0: 3c10801d lui r16,0x801d
8011a3c4: 26108424 addiu r16,r16,-0x7bdc            # r16 = 0x801C8424
8011a3c8: 3c048019 lui r4,0x8019
8011a3cc: 8484ba20 lh r4,-0x45e0(r4)                # r4 = *0x8018BA20 = Selected formation unit index
8011a3d0: 00000000 nop
8011a3d4: 00041080 sll r2,r4,0x02                   # r2 = Formation unit index * 4
8011a3d8: 3c01801d lui r1,0x801d
8011a3dc: 00220821 addu r1,r1,r2
8011a3e0: 8c22d5ec lw r2,-0x2a14(r1)                # r2 = *0x801CD5EC + Index*4 = Pointer for this unit's Temporary World Stats 
8011a3e4: 96430000 lhu r3,0x0000(r18)
8011a3e8: 84420024 lh r2,0x0024(r2)                 # r2 = Unit's Current Job
8011a3ec: 306503ff andi r5,r3,0x03ff
8011a3f0: 10a20004 beq r5,r2,0x8011a404             # Branch if Current Job equals r5
8011a3f4: 3406000f ori r6,r0,0x000f
8011a3f8: 30624000 andi r2,r3,0x4000                # -- Check for 0x4000 flag in r3
8011a3fc: 14400008 bne r2,r0,0x8011a420             # -- Branch if 0x4000 flag
8011a400: 00000000 nop
8011a404: 34020003 ori r2,r0,0x0003
8011a408: 00003821 addu r7,r0,r0
8011a40c: 0c048a3c jal 0x801228f0                 # Skillset Display
8011a410: afa20010 sw r2,0x0010(r29)
8011a414: 2c420001 sltiu r2,r2,0x0001
8011a418: 08046909 j 0x8011a424                  
8011a41c: a6020000 sh r2,0x0000(r16)              # Save r2 to the location at r16
8011a420: a6000000 sh r0,0x0000(r16)              # Zero out the location at r16 if Current Job did not equal r5 and there was the 0x4000 flag
8011a424: 26100002 addiu r16,r16,0x0002
8011a428: 3c02801d lui r2,0x801d
8011a42c: 844283f0 lh r2,-0x7c10(r2)              # r2 = Number of unlocked jobs
8011a430: 26310001 addiu r17,r17,0x0001
8011a434: 0222102a slt r2,r17,r2
8011a438: 1440ffe3 bne r2,r0,0x8011a3c8           # Loop if r17 is less than the number of unlocked jobs (hasn't finished populating the list?)
8011a43c: 26520002 addiu r18,r18,0x0002
8011a440: 3c028019 lui r2,0x8019
8011a444: 8442ba20 lh r2,-0x45e0(r2)              # r2 = *0x8018BA20 = Selected formation unit index
8011a448: 00000000 nop
8011a44c: 00021080 sll r2,r2,0x02                 # r2 = Formation unit index * 4
8011a450: 3c01801d lui r1,0x801d
8011a454: 00220821 addu r1,r1,r2
8011a458: 8c22d5ec lw r2,-0x2a14(r1)              # r2 = *0x801CD5EC + Index*4 = Pointer for this unit's Temporary World Stats 
8011a45c: 00000000 nop
8011a460: 9042011f lbu r2,0x011f(r2)              # Load unit's Proposition Byte
8011a464: 00000000 nop
8011a468: 10400003 beq r2,r0,0x8011a478           # Branch if there is a value (unit is on a Proposition or Missing)
8011a46c: 00000000 nop
8011a470: 3c01801d lui r1,0x801d
8011a474: a42083f0 sh r0,-0x7c10(r1)              # -- Zero out the number of unlocked jobs if there was a value in the Proposition Byte. Prevents unit from switching jobs.
8011a478: 3c01801d lui r1,0x801d
8011a47c: a42083f4 sh r0,-0x7c0c(r1)              # Zero out 0x801c83f4
8011a480: 0c0469de jal 0x8011a778                 # 0x11a778
8011a484: 00000000 nop
8011a488: 3c02801d lui r2,0x801d
8011a48c: 844283f0 lh r2,-0x7c10(r2)              # Load the number of unlocked jobs
8011a490: 00000000 nop
8011a494: 28420002 slti r2,r2,0x0002
8011a498: 10400005 beq r2,r0,0x8011a4b0           # Branch if there are 2+ unlocked jobs
8011a49c: 34020003 ori r2,r0,0x0003               # r2 = 3
8011a4a0: 3c018019 lui r1,0x8019
8011a4a4: ac22ba1c sw r2,-0x45e4(r1)              # -- Save 3 to 0x8018BA1C if there were less than 2 unlocked jobs
8011a4a8: 08046932 j 0x8011a4c8                   # -- Jump to end
8011a4ac: 00000000 nop
8011a4b0: 34020014 ori r2,r0,0x0014               # r2 = 0x14
8011a4b4: 3c018019 lui r1,0x8019
8011a4b8: a022c93a sb r2,-0x36c6(r1)              # Save 0x14 to 0x8018C93A
8011a4bc: 34020001 ori r2,r0,0x0001
8011a4c0: 3c018019 lui r1,0x8019
8011a4c4: a022c93c sb r2,-0x36c4(r1)              # Save 0x01 to 0x8018C93C
8011a4c8: 8fbf002c lw r31,0x002c(r29)
8011a4cc: 8fb20028 lw r18,0x0028(r29)
8011a4d0: 8fb10024 lw r17,0x0024(r29)
8011a4d4: 8fb00020 lw r16,0x0020(r29)
8011a4d8: 27bd0030 addiu r29,r29,0x0030
8011a4dc: 03e00008 jr r31
8011a4e0: 00000000 nop