Difference between revisions of "Skillset Display"
Jump to navigation
Jump to search
RetroTypes (talk | contribs) m |
RetroTypes (talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | #Parameters: | |
+ | #r4 = Formation Unit Index | ||
+ | #r5 = Job ID | ||
+ | #r6 = Ability Type (Reaction = 1, Support = 2, Movement = 3) | ||
+ | #r7 = Pointer to output ability array | ||
+ | #*(r29 + 0x10) = switch | ||
+ | |||
001228f0: 27bdffc0 addiu r29,r29,0xffc0 | 001228f0: 27bdffc0 addiu r29,r29,0xffc0 | ||
001228f4: afb20020 sw r18,0x0020(r29) | 001228f4: afb20020 sw r18,0x0020(r29) | ||
Line 21: | Line 27: | ||
00122938: 00042400 sll r4,r4,0x10 | 00122938: 00042400 sll r4,r4,0x10 | ||
0012293c: 00042403 sra r4,r4,0x10 | 0012293c: 00042403 sra r4,r4,0x10 | ||
− | 00122940: 0c0489e4 jal 0x00122790 | + | 00122940: 0c0489e4 jal 0x00122790 [[Get known skillsets]] |
00122944: 02c02821 addu r5,r22,r0 | 00122944: 02c02821 addu r5,r22,r0 | ||
00122948: 08048afc j 0x00122bf0 Jump to end | 00122948: 08048afc j 0x00122bf0 Jump to end | ||
Line 29: | Line 35: | ||
00122950: 00058400 sll r16,r5,0x10 | 00122950: 00058400 sll r16,r5,0x10 | ||
00122954: 00108403 sra r16,r16,0x10 | 00122954: 00108403 sra r16,r16,0x10 | ||
− | 00122958: 0c0489db jal 0x0012276c | + | 00122958: 0c0489db jal 0x0012276c [[Get job's skillset]] |
0012295c: 02002021 addu r4,r16,r0 | 0012295c: 02002021 addu r4,r16,r0 | ||
00122960: 00408821 addu r17,r2,r0 | 00122960: 00408821 addu r17,r2,r0 | ||
− | 00122964: 0c0488ee jal 0x001223b8 | + | 00122964: 0c0488ee jal 0x001223b8 [[Default to base job if not generic job]] |
00122968: 02002021 addu r4,r16,r0 | 00122968: 02002021 addu r4,r16,r0 | ||
0012296c: 02202021 addu r4,r17,r0 r17 = skillset | 0012296c: 02202021 addu r4,r17,r0 r17 = skillset | ||
− | 00122970: 0c0488f9 jal 0x001223e4 get some skillset pointer (r2 = job ID that has the skillset) | + | 00122970: 0c0488f9 jal 0x001223e4 get some skillset pointer (r2 = job ID that has the skillset) [[001223e4 - 00122438]] |
00122974: 0040b821 addu r23,r2,r0 r2 = generic job # | 00122974: 0040b821 addu r23,r2,r0 r2 = generic job # | ||
00122978: 2403ffff addiu r3,r0,0xffff | 00122978: 2403ffff addiu r3,r0,0xffff | ||
Line 50: | Line 56: | ||
001229a0: 00000000 nop | 001229a0: 00000000 nop | ||
001229a4: 02202021 addu r4,r17,r0 | 001229a4: 02202021 addu r4,r17,r0 | ||
− | 001229a8: 0c01698e jal 0x0005a638 | + | 001229a8: 0c01698e jal 0x0005a638 [[Store Skillset's Abilities]] |
001229ac: 3405000f ori r5,r0,0x000f | 001229ac: 3405000f ori r5,r0,0x000f | ||
001229b0: 16400004 bne r18,r0,0x001229c4 branch if not active ability | 001229b0: 16400004 bne r18,r0,0x001229c4 branch if not active ability | ||
Line 118: | Line 124: | ||
00122a80: 00431021 addu r2,r2,r3 job#*2 + formation pointer | 00122a80: 00431021 addu r2,r2,r3 job#*2 + formation pointer | ||
00122a84: 945700be lhu r23,0x00be(r2) load Current JP | 00122a84: 945700be lhu r23,0x00be(r2) load Current JP | ||
− | 00122a88: 0c04ac6d jal 0x0012b1b4 | + | 00122a88: 0c04ac6d jal 0x0012b1b4 [[Store Data Pointer]] |
00122a8c: 00832021 addu r4,r4,r3 Base Action Abilities pointer | 00122a8c: 00832021 addu r4,r4,r3 Base Action Abilities pointer | ||
00122a90: 8ea20000 lw r2,0x0000(r21) load formation data | 00122a90: 8ea20000 lw r2,0x0000(r21) load formation data | ||
00122a94: 00000000 nop | 00122a94: 00000000 nop | ||
00122a98: 84440024 lh r4,0x0024(r2) load job | 00122a98: 84440024 lh r4,0x0024(r2) load job | ||
− | 00122a9c: 0c0482e4 jal 0x00120b90 | + | 00122a9c: 0c0482e4 jal 0x00120b90 [[Special monster check]] |
00122aa0: 00000000 nop | 00122aa0: 00000000 nop | ||
00122aa4: 1440000e bne r2,r0,0x00122ae0 special monster | 00122aa4: 1440000e bne r2,r0,0x00122ae0 special monster | ||
Line 138: | Line 144: | ||
00122ad0: 00000000 nop | 00122ad0: 00000000 nop | ||
− | 00122ad4: 0c04ac7b jal 0x0012b1ec | + | 00122ad4: 0c04ac7b jal 0x0012b1ec [[Check for Present Flags]] |
00122ad8: 34040001 ori r4,r0,0x0001 | 00122ad8: 34040001 ori r4,r0,0x0001 | ||
00122adc: 00401821 addu r3,r2,r0 r3 = 1 if ability is unlocked | 00122adc: 00401821 addu r3,r2,r0 r3 = 1 if ability is unlocked | ||
Line 228: | Line 234: | ||
00122c14: 27bd0040 addiu r29,r29,0x0040 | 00122c14: 27bd0040 addiu r29,r29,0x0040 | ||
00122c18: 03e00008 jr r31 | 00122c18: 03e00008 jr r31 | ||
− | 00122c1c: 00000000 nop | + | 00122c1c: 00000000 nop |
+ | |||
+ | '''Return Locations''' | ||
+ | 00122ca0 : [[Get Equipable RSM]] | ||
+ | 00122cc4 : [[Get Equipable RSM]] | ||
+ | 0011a40c : [[Prep Job Wheel and Skillset Display]] | ||
+ | 0011f774 : [[Learn Abilities Menu]] | ||
+ | 0011f9c0 : [[Learn Abilities Menu]] | ||
+ | 0011fb28 : [[Learn Abilities Menu]] | ||
+ | 0011f06c : [[0011f040 - 0011f08c]] | ||
+ | 0011a40c : [[0011a378 - 0011a4e0]] | ||
+ | 0011fef0 : [[0011fd28 - 001200f4]] | ||
+ | 00120020 : [[0011fd28 - 001200f4]] | ||
+ | 0011f774 : [[0011f5f0 - 0011fc14]] | ||
+ | 0011f9c0 : [[0011f5f0 - 0011fc14]] | ||
+ | 0011fb28 : [[0011f5f0 - 0011fc14]] | ||
+ | 0011e8a0 : [[0011e630 - 0011ed14]] |
Latest revision as of 05:53, 7 December 2024
#Parameters: #r4 = Formation Unit Index #r5 = Job ID #r6 = Ability Type (Reaction = 1, Support = 2, Movement = 3) #r7 = Pointer to output ability array #*(r29 + 0x10) = switch
001228f0: 27bdffc0 addiu r29,r29,0xffc0 001228f4: afb20020 sw r18,0x0020(r29) 001228f8: 00c09021 addu r18,r6,r0 01 (cursor counter?) 001228fc: afb60030 sw r22,0x0030(r29) 00122900: 00e0b021 addu r22,r7,r0 R/S/M display pointer / stack 00122904: afb40028 sw r20,0x0028(r29) 00122908: 0080a021 addu r20,r4,r0 00 0012290c: afb30024 sw r19,0x0024(r29) 00122910: 8fb30050 lw r19,0x0050(r29) 00122914: 34020001 ori r2,r0,0x0001 00122918: afbf0038 sw r31,0x0038(r29) 0012291c: afb70034 sw r23,0x0034(r29) 00122920: afb5002c sw r21,0x002c(r29) 00122924: afb1001c sw r17,0x001c(r29) 00122928: 16620009 bne r19,r2,0x00122950 branch if learning/displaying jobs and abilities 0012292c: afb00018 sw r16,0x0018(r29) 00122930: 16400008 bne r18,r0,0x00122954 branch if learning/displaying jobs and abilities OR setting R/S/M 00122934: 00058400 sll r16,r5,0x10 job 00122938: 00042400 sll r4,r4,0x10 0012293c: 00042403 sra r4,r4,0x10 00122940: 0c0489e4 jal 0x00122790 Get known skillsets 00122944: 02c02821 addu r5,r22,r0 00122948: 08048afc j 0x00122bf0 Jump to end 0012294c: 00000000 nop If not setting 00122950: 00058400 sll r16,r5,0x10 00122954: 00108403 sra r16,r16,0x10 00122958: 0c0489db jal 0x0012276c Get job's skillset 0012295c: 02002021 addu r4,r16,r0 00122960: 00408821 addu r17,r2,r0 00122964: 0c0488ee jal 0x001223b8 Default to base job if not generic job 00122968: 02002021 addu r4,r16,r0 0012296c: 02202021 addu r4,r17,r0 r17 = skillset 00122970: 0c0488f9 jal 0x001223e4 get some skillset pointer (r2 = job ID that has the skillset) 001223e4 - 00122438 00122974: 0040b821 addu r23,r2,r0 r2 = generic job # 00122978: 2403ffff addiu r3,r0,0xffff 0012297c: 1443000a bne r2,r3,0x001229a8 branch if job not found that matches skillset 00122980: 02202021 addu r4,r17,r0 r4 = skillset ID 00122984: 00141400 sll r2,r20,0x10 00122988: 00021383 sra r2,r2,0x0e 0012298c: 3c01801d lui r1,0x801d 00122990: 00220821 addu r1,r1,r2 00122994: 8c22d5ec lw r2,-0x2a14(r1) 00122998: 00000000 nop 0012299c: 9451005e lhu r17,0x005e(r2) default to primary skillset 001229a0: 00000000 nop 001229a4: 02202021 addu r4,r17,r0 001229a8: 0c01698e jal 0x0005a638 Store Skillset's Abilities 001229ac: 3405000f ori r5,r0,0x000f 001229b0: 16400004 bne r18,r0,0x001229c4 branch if not active ability 001229b4: 00408021 addu r16,r2,r0 Active ability 001229b8: 34030001 ori r3,r0,0x0001 lower limit 001229bc: 08048a80 j 0x00122a00 001229c0: 340201a5 ori r2,r0,0x01a5 set upper limit 001229c4: 34020001 ori r2,r0,0x0001 001229c8: 16420004 bne r18,r2,0x001229dc branch if not = 1 001229cc: 34020002 ori r2,r0,0x0002 reaction 1 001229d0: 340301a6 ori r3,r0,0x01a6 001229d4: 08048a80 j 0x00122a00 001229d8: 340201c5 ori r2,r0,0x01c5 support 2 001229dc: 16420004 bne r18,r2,0x001229f0 branch if not 2 001229e0: 34020003 ori r2,r0,0x0003 001229e4: 340301c6 ori r3,r0,0x01c6 001229e8: 08048a80 j 0x00122a00 001229ec: 340201e5 ori r2,r0,0x01e5 movement 001229f0: 16420002 bne r18,r2,0x001229fc branch if not 3 001229f4: 34030001 ori r3,r0,0x0001 001229f8: 340301e6 ori r3,r0,0x01e6 001229fc: 340201fd ori r2,r0,0x01fd 00122a00: 00009021 addu r18,r0,r0 00122a04: 00603021 addu r6,r3,r0 00122a08: 00402821 addu r5,r2,r0 00122a0c: 02002021 addu r4,r16,r0 00122a10: 84830000 lh r3,0x0000(r4) load temp ability 00122a14: 00000000 nop 00122a18: 0066102a slt r2,r3,r6 set ability < lower ability limit (out of range) 00122a1c: 14400003 bne r2,r0,0x00122a2c branch if out of range 00122a20: 00a3102a slt r2,r5,r3 set if ability > upper limit (out of range) 00122a24: 10400002 beq r2,r0,0x00122a30 branch if not 00122a28: 00000000 nop 00122a2c: a4800000 sh r0,0x0000(r4) clear that ability? 00122a30: 26520001 addiu r18,r18,0x0001 00122a34: 2a420018 slti r2,r18,0x0018 perform for all abilities 00122a38: 1440fff5 bne r2,r0,0x00122a10 00122a3c: 24840002 addiu r4,r4,0x0002 00122a40: 00008821 addu r17,r0,r0 00122a44: 00009021 addu r18,r0,r0 00122a48: 00141400 sll r2,r20,0x10 ?? << 0x10 00122a4c: 3c03801d lui r3,0x801d 00122a50: 2463d5ec addiu r3,r3,0xd5ec 1cd5ec 00122a54: 00021383 sra r2,r2,0x0e ?? >> 0x0e 00122a58: 00431021 addu r2,r2,r3 00122a5c: 0040a821 addu r21,r2,r0 00122a60: 0200a021 addu r20,r16,r0 66204 - temp ability list 00122a64: 02c08021 addu r16,r22,r0 00122a68: 00172400 sll r4,r23,0x10 generic job #? 00122a6c: 00042403 sra r4,r4,0x10 00122a70: 00041040 sll r2,r4,0x01 job#*2 00122a74: 00442021 addu r4,r2,r4 job#*3 00122a78: 8ea30000 lw r3,0x0000(r21) load formation data 00122a7c: 2484007a addiu r4,r4,0x007a job*3 + 7a 00122a80: 00431021 addu r2,r2,r3 job#*2 + formation pointer 00122a84: 945700be lhu r23,0x00be(r2) load Current JP 00122a88: 0c04ac6d jal 0x0012b1b4 Store Data Pointer 00122a8c: 00832021 addu r4,r4,r3 Base Action Abilities pointer 00122a90: 8ea20000 lw r2,0x0000(r21) load formation data 00122a94: 00000000 nop 00122a98: 84440024 lh r4,0x0024(r2) load job 00122a9c: 0c0482e4 jal 0x00120b90 Special monster check 00122aa0: 00000000 nop 00122aa4: 1440000e bne r2,r0,0x00122ae0 special monster 00122aa8: 34030001 ori r3,r0,0x0001 set ability known if special monster 00122aac: 8ea20000 lw r2,0x0000(r21) 00122ab0: 00000000 nop 00122ab4: 8442003e lh r2,0x003e(r2) 00122ab8: 00000000 nop 00122abc: 10400005 beq r2,r0,0x00122ad4 branch if not ?? 00122ac0: 2a420003 slti r2,r18,0x0003 00122ac4: 10400044 beq r2,r0,0x00122bd8 jump to end if more than 3 abilities 00122ac8: 34020003 ori r2,r0,0x0003 00122acc: 08048ab8 j 0x00122ae0 skip job unlocked check/ 00122ad0: 00000000 nop 00122ad4: 0c04ac7b jal 0x0012b1ec Check for Present Flags 00122ad8: 34040001 ori r4,r0,0x0001 00122adc: 00401821 addu r3,r2,r0 r3 = 1 if ability is unlocked 00122ae0: 86850000 lh r5,0x0000(r20) load temp ability 00122ae4: 00000000 nop 00122ae8: 10a00036 beq r5,r0,0x00122bc4 branch if attack 00122aec: 00a02021 addu r4,r5,r0 00122af0: 1660000f bne r19,r0,0x00122b30 00122af4: 34020001 ori r2,r0,0x0001 00122af8: 1460000b bne r3,r0,0x00122b28 branch if ability is known 00122afc: 000510c0 sll r2,r5,0x03 00122b00: 3c018006 lui r1,0x8006 00122b04: 00220821 addu r1,r1,r2 00122b08: 9022ebf3 lbu r2,-0x140d(r1) load learn on hit bytes 00122b0c: 00000000 nop 00122b10: 000211c2 srl r2,r2,0x07 00122b14: 14400003 bne r2,r0,0x00122b24 branch if learn with JP 00122b18: 00000000 nop 00122b1c: 08048aca j 0x00122b28 00122b20: 34844000 ori r4,r4,0x4000 set job unknown 00122b24: 34846000 ori r4,r4,0x6000 set ability learn on hit 00122b28: 08048aef j 0x00122bbc 00122b2c: a6040000 sh r4,0x0000(r16) store ability 00122b30: 16620005 bne r19,r2,0x00122b48 00122b34: 00000000 nop 00122b38: 10600022 beq r3,r0,0x00122bc4 branch if ability not known 00122b3c: 00000000 nop 00122b40: 08048aef j 0x00122bbc 00122b44: a6040000 sh r4,0x0000(r16) store ability ID 00122b48: 34020002 ori r2,r0,0x0002 00122b4c: 16620016 bne r19,r2,0x00122ba8 00122b50: 00000000 nop 00122b54: 14600011 bne r3,r0,0x00122b9c branch if ability is known 00122b58: 000518c0 sll r3,r5,0x03 check if have enough jp 00122b5c: 3c018006 lui r1,0x8006 00122b60: 00230821 addu r1,r1,r3 00122b64: 9022ebf3 lbu r2,-0x140d(r1) load learn on hit flag 00122b68: 00000000 nop 00122b6c: 000211c2 srl r2,r2,0x07 00122b70: 14400014 bne r2,r0,0x00122bc4 branch if learn with JP 00122b74: 00171400 sll r2,r23,0x10 JP << 10 00122b78: 3c018006 lui r1,0x8006 00122b7c: 00230821 addu r1,r1,r3 00122b80: 9423ebf0 lhu r3,-0x1410(r1) load JP cost 00122b84: 00021403 sra r2,r2,0x10 00122b88: 0043102a slt r2,r2,r3 set if jp < cost 00122b8c: 10400004 beq r2,r0,0x00122ba0 branch if having enough jp 00122b90: 00000000 nop 00122b94: 08048ae8 j 0x00122ba0 00122b98: 34844000 ori r4,r4,0x4000 store ability as unknown 00122b9c: 34841000 ori r4,r4,0x1000 add 0x1000 flag 00122ba0: 08048aef j 0x00122bbc 00122ba4: a6040000 sh r4,0x0000(r16) store ability ID as known? 00122ba8: 34020003 ori r2,r0,0x0003 00122bac: 16620005 bne r19,r2,0x00122bc4 00122bb0: 00000000 nop 00122bb4: 14600003 bne r3,r0,0x00122bc4 branch if ability is known 00122bb8: 00000000 nop 00122bbc: 26100002 addiu r16,r16,0x0002 increment ability list 00122bc0: 26310001 addiu r17,r17,0x0001 skillset++? 00122bc4: 26520001 addiu r18,r18,0x0001 ability # ++ 00122bc8: 2a420018 slti r2,r18,0x0018 do for 0x18 abilities 00122bcc: 1440ffb0 bne r2,r0,0x00122a90 do for all abilities 00122bd0: 26940002 addiu r20,r20,0x0002 increment temp ability list 00122bd4: 34020003 ori r2,r0,0x0003 00122bd8: 12620004 beq r19,r2,0x00122bec 00122bdc: 00111040 sll r2,r17,0x01 00122be0: 00561021 addu r2,r2,r22 00122be4: 2403ffff addiu r3,r0,0xffff 00122be8: a4430000 sh r3,0x0000(r2) store end of ability list 00122bec: 02201021 addu r2,r17,r0 00122bf0: 8fbf0038 lw r31,0x0038(r29) 00122bf4: 8fb70034 lw r23,0x0034(r29) 00122bf8: 8fb60030 lw r22,0x0030(r29) 00122bfc: 8fb5002c lw r21,0x002c(r29) 00122c00: 8fb40028 lw r20,0x0028(r29) 00122c04: 8fb30024 lw r19,0x0024(r29) 00122c08: 8fb20020 lw r18,0x0020(r29) 00122c0c: 8fb1001c lw r17,0x001c(r29) 00122c10: 8fb00018 lw r16,0x0018(r29) 00122c14: 27bd0040 addiu r29,r29,0x0040 00122c18: 03e00008 jr r31 00122c1c: 00000000 nop
Return Locations
00122ca0 : Get Equipable RSM 00122cc4 : Get Equipable RSM 0011a40c : Prep Job Wheel and Skillset Display 0011f774 : Learn Abilities Menu 0011f9c0 : Learn Abilities Menu 0011fb28 : Learn Abilities Menu 0011f06c : 0011f040 - 0011f08c 0011a40c : 0011a378 - 0011a4e0 0011fef0 : 0011fd28 - 001200f4 00120020 : 0011fd28 - 001200f4 0011f774 : 0011f5f0 - 0011fc14 0011f9c0 : 0011f5f0 - 0011fc14 0011fb28 : 0011f5f0 - 0011fc14 0011e8a0 : 0011e630 - 0011ed14