Difference between revisions of "Job Wheel"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
0012257c: 27bdffd0 addiu r29,r29,0xffd0 | 0012257c: 27bdffd0 addiu r29,r29,0xffd0 | ||
00122580: afb60028 sw r22,0x0028(r29) | 00122580: afb60028 sw r22,0x0028(r29) | ||
− | 00122584: 00a0b021 addu r22,r5,r0 Move r5 to r22 | + | 00122584: 00a0b021 addu r22,r5,r0 Move r5 to r22 (Job Wheel Counter) |
00122588: afb50024 sw r21,0x0024(r29) | 00122588: afb50024 sw r21,0x0024(r29) | ||
0012258c: 00c0a821 addu r21,r6,r0 Move r6 to r21 (valid inputs are 0, 1, 2; 1 = Skillset display, 2 = Job Wheel display (grayed out sprite)) | 0012258c: 00c0a821 addu r21,r6,r0 Move r6 to r21 (valid inputs are 0, 1, 2; 1 = Skillset display, 2 = Job Wheel display (grayed out sprite)) | ||
00122590: afb10014 sw r17,0x0014(r29) | 00122590: afb10014 sw r17,0x0014(r29) | ||
− | 00122594: 00808821 addu r17,r4,r0 | + | 00122594: 00808821 addu r17,r4,r0 Party ID |
− | 00122598: 322200ff andi r2,r17,0x00ff | + | 00122598: 322200ff andi r2,r17,0x00ff Party ID w/o guest marker? |
0012259c: 3c03801d lui r3,0x801d | 0012259c: 3c03801d lui r3,0x801d | ||
− | 001225a0: 2463d5ec addiu r3,r3,0xd5ec | + | 001225a0: 2463d5ec addiu r3,r3,0xd5ec pointer to formation data |
− | 001225a4: 00021080 sll r2,r2,0x02 | + | 001225a4: 00021080 sll r2,r2,0x02 |
001225a8: afb3001c sw r19,0x001c(r29) | 001225a8: afb3001c sw r19,0x001c(r29) | ||
001225ac: 00439821 addu r19,r2,r3 | 001225ac: 00439821 addu r19,r2,r3 |
Latest revision as of 20:56, 16 March 2019
Notes to be added once the routine has been researched more
0012257c: 27bdffd0 addiu r29,r29,0xffd0 00122580: afb60028 sw r22,0x0028(r29) 00122584: 00a0b021 addu r22,r5,r0 Move r5 to r22 (Job Wheel Counter) 00122588: afb50024 sw r21,0x0024(r29) 0012258c: 00c0a821 addu r21,r6,r0 Move r6 to r21 (valid inputs are 0, 1, 2; 1 = Skillset display, 2 = Job Wheel display (grayed out sprite)) 00122590: afb10014 sw r17,0x0014(r29) 00122594: 00808821 addu r17,r4,r0 Party ID 00122598: 322200ff andi r2,r17,0x00ff Party ID w/o guest marker? 0012259c: 3c03801d lui r3,0x801d 001225a0: 2463d5ec addiu r3,r3,0xd5ec pointer to formation data 001225a4: 00021080 sll r2,r2,0x02 001225a8: afb3001c sw r19,0x001c(r29) 001225ac: 00439821 addu r19,r2,r3 001225b0: afbf002c sw r31,0x002c(r29) 001225b4: afb40020 sw r20,0x0020(r29) 001225b8: afb20018 sw r18,0x0018(r29) 001225bc: afb00010 sw r16,0x0010(r29) 001225c0: 8e640000 lw r4,0x0000(r19) 001225c4: 00009021 addu r18,r0,r0 001225c8: 0c04ac6d jal 0x0012b1b4 Store Data Pointer 001225cc: 24840077 addiu r4,r4,0x0077 001225d0: 0c04890f jal 0x0012243c Load party data into Formation screen data 001225d4: 322400ff andi r4,r17,0x00ff 001225d8: 00408021 addu r16,r2,r0 001225dc: 34020002 ori r2,r0,0x0002 001225e0: 16a20008 bne r21,r2,0x00122604 Skip if we're on the job wheel 001225e4: 00121040 sll r2,r18,0x01 001225e8: 8e620000 lw r2,0x0000(r19) 001225ec: 00000000 nop 001225f0: 84420024 lh r2,0x0024(r2) Load Unit's Job 001225f4: 00000000 nop 001225f8: 16020002 bne r16,r2,0x00122604 branch if not base job or current job 001225fc: 00121040 sll r2,r18,0x01 ctr*2 00122600: 36104000 ori r16,r16,0x4000 grey out job 00122604: 00561021 addu r2,r2,r22 add counter to 00122608: a4500000 sh r16,0x0000(r2) store base job? 0012260c: 322200ff andi r2,r17,0x00ff 00122610: 3c03801d lui r3,0x801d 00122614: 2463d5ec addiu r3,r3,0xd5ec 00122618: 00021080 sll r2,r2,0x02 0012261c: 00438021 addu r16,r2,r3 00122620: 8e020000 lw r2,0x0000(r16) 00122624: 00000000 nop 00122628: 84440024 lh r4,0x0024(r2) Load Unit's Job 0012262c: 0c0482e4 jal 0x00120b90 Special monster check 00122630: 26520001 addiu r18,r18,0x0001 Counter increase 00122634: 1440003e bne r2,r0,0x00122730 Branch if unit is a special monster 00122638: 00121040 sll r2,r18,0x01 0012263c: 8e020000 lw r2,0x0000(r16) 00122640: 00000000 nop 00122644: 8442003e lh r2,0x003e(r2) 00122648: 00000000 nop 0012264c: 14400038 bne r2,r0,0x00122730 00122650: 00121040 sll r2,r18,0x01 00122654: 0c04ac7b jal 0x0012b1ec Check for Present Flags See if job is unlocked? 00122658: 34040001 ori r4,r0,0x0001 r4 = 0x01 0012265c: 34130001 ori r19,r0,0x0001 r19 = 0x1 (counter) 00122660: 0200a021 addu r20,r16,r0 00122664: 00121040 sll r2,r18,0x01 00122668: 00568821 addu r17,r2,r22 r17 = 0x801c83f8 + r2 0012266c: 2670004a addiu r16,r19,0x004a Counter + 0x4a (Generic Jobs) 00122670: 0c04ac7b jal 0x0012b1ec Check for Present Flags See if job is unlocked? 00122674: 34040001 ori r4,r0,0x0001 r4 = 0x1 00122678: 00401821 addu r3,r2,r0 r3 = 1 if job is unlocked? 0012267c: 3402005b ori r2,r0,0x005b 00122680: 16020008 bne r16,r2,0x001226a4 Branch if Job =/= 0x5b (Bard) 00122684: 3402005c ori r2,r0,0x005c 00122688: 8e820000 lw r2,0x0000(r20) 0012268c: 00000000 nop 00122690: 90420070 lbu r2,0x0070(r2) Load Unit's Gender 00122694: 00000000 nop 00122698: 30420040 andi r2,r2,0x0040 0012269c: 14400020 bne r2,r0,0x00122720 001226a0: 3402005c ori r2,r0,0x005c 001226a4: 16020008 bne r16,r2,0x001226c8 Branch if Job =/= 0x5c (Dancer) 001226a8: 34020002 ori r2,r0,0x0002 001226ac: 8e820000 lw r2,0x0000(r20) 001226b0: 00000000 nop 001226b4: 90420070 lbu r2,0x0070(r2) Load Unit's Gender 001226b8: 00000000 nop 001226bc: 30420080 andi r2,r2,0x0080 001226c0: 14400017 bne r2,r0,0x00122720 001226c4: 34020002 ori r2,r0,0x0002 001226c8: 16a20007 bne r21,r2,0x001226e8 Skip if we're not on the job wheel 001226cc: 00000000 nop 001226d0: 8e820000 lw r2,0x0000(r20) World Unit Data Pointer 001226d4: 00000000 nop 001226d8: 84420024 lh r2,0x0024(r2) Load Unit's Current Job 001226dc: 00000000 nop 001226e0: 1202000c beq r16,r2,0x00122714 Branch if currently checked job == unit's current job 001226e4: 36024000 ori r2,r16,0x4000 Gray out Job 001226e8: 10600003 beq r3,r0,0x001226f8 Branch if Job is not unlocked 001226ec: 34020002 ori r2,r0,0x0002 001226f0: 080489c6 j 0x00122718 Continue to check next jobs (increase all counters) 001226f4: a6300000 sh r16,0x0000(r17) Store r16 into Job Wheel 001226f8: 16a20009 bne r21,r2,0x00122720 Skip if we're not on the job wheel (only increase counter) 001226fc: 00000000 nop 00122700: 00102400 sll r4,r16,0x10 Clear excess data from Job ID (Gray'd out) 00122704: 0c048922 jal 0x00122488 Check to see if allies have job active 00122708: 00042403 sra r4,r4,0x10 Move Job ID to r4 0012270c: 14400004 bne r2,r0,0x00122720 Branch if no allies have Job unlocked 00122710: 26024000 addiu r2,r16,0x4000 Gray out Job 00122714: a6220000 sh r2,0x0000(r17) Store grayed out job into Job Wheel 00122718: 26310002 addiu r17,r17,0x0002 r17 + 2 (used for pointer in RAM data) 0012271c: 26520001 addiu r18,r18,0x0001 r18 + 1 00122720: 26730001 addiu r19,r19,0x0001 r19 (Counter) + 1 00122724: 2a620014 slti r2,r19,0x0014 00122728: 1440ffd0 bne r2,r0,0x0012266c Branch if all jobs haven't been check 0012272c: 00121040 sll r2,r18,0x01 Job counter * 2 00122730: 00561021 addu r2,r2,r22 Job Wheel Pointer * Job counter * 2 00122734: 2403ffff addiu r3,r0,0xffff r3 + 0xffff 00122738: a4430000 sh r3,0x0000(r2) Store xFFFF as last entry in Job Wheel (end of job wheel) 0012273c: 02401021 addu r2,r18,r0 Move job counter to r2 00122740: 8fbf002c lw r31,0x002c(r29) 00122744: 8fb60028 lw r22,0x0028(r29) 00122748: 8fb50024 lw r21,0x0024(r29) 0012274c: 8fb40020 lw r20,0x0020(r29) 00122750: 8fb3001c lw r19,0x001c(r29) 00122754: 8fb20018 lw r18,0x0018(r29) 00122758: 8fb10014 lw r17,0x0014(r29) 0012275c: 8fb00010 lw r16,0x0010(r29) 00122760: 27bd0030 addiu r29,r29,0x0030 00122764: 03e00008 jr r31 00122768: 00000000 nop