JOBSTTS.OUT Move Unit Battle Job data to Jobstts
Jump to navigation
Jump to search
001dffc0: 27bdffe0 addiu r29,r29,0xffe0 001dffc4: afb00010 sw r16,0x0010(r29) 001dffc8: 00808021 addu r16,r4,r0 unit battle data 001dffcc: afbf0018 sw r31,0x0018(r29) 001dffd0: afb10014 sw r17,0x0014(r29) 001dffd4: 92020003 lbu r2,0x0003(r16) load current unit job ID 001dffd8: 00a08821 addu r17,r5,r0 job list current unit data 001dffdc: a6220000 sh r2,0x0000(r17) store current unit job ID 001dffe0: 92020006 lbu r2,0x0006(r16) load gender byte 001dffe4: 00000000 nop 001dffe8: a2220006 sb r2,0x0006(r17) store gender byte 001dffec: 92020001 lbu r2,0x0001(r16) load unit ID 001dfff0: 00000000 nop 001dfff4: a6220002 sh r2,0x0002(r17) store unit ID 001dfff8: 92020000 lbu r2,0x0000(r16) Load base job class 001dfffc: 00000000 nop 001e0000: a2220007 sb r2,0x0007(r17) store base job class 001e0004: 92020012 lbu r2,0x0012(r16) primary skillset 001e0008: 00000000 nop 001e000c: a6220004 sh r2,0x0004(r17) store 001e0010: 920201ba lbu r2,0x01ba(r16) modified entd flags 001e0014: 00000000 nop 001e0018: 30430030 andi r3,r2,0x0030 check team bits 001e001c: 30420038 andi r2,r2,0x0038 check team bits & control 001e0020: 14400002 bne r2,r0,0x001e002c if control unit, or on any non player team, 001e0024: 0003182b sltu r3,r0,r3 skip special monster check if on enemy team 001e0028: 34030002 ori r3,r0,0x0002 if player/player controlled unit, never skip special monster check. 001e002c: 34020001 ori r2,r0,0x0001 001e0030: 10620006 beq r3,r2,0x001e004c skip special monster check if unit is on enemy team 001e0034: 26040096 addiu r4,r16,0x0096 001e0038: 92040003 lbu r4,0x0003(r16) unit's job ID 001e003c: 0c077fe8 jal 0x001dffa0 JOBSTTS.OUT Special Monster check 001e0040: 00000000 nop 001e0044: 10400006 beq r2,r0,0x001e0060 skip if not monster. 001e0048: 26040096 addiu r4,r16,0x0096 001e004c: 26250008 addiu r5,r17,0x0008 copy unlocked jobs into jobstts unit data table 001e0050: 0c0088b7 jal 0x000222dc bcopy 001e0054: 34060003 ori r6,r0,0x0003 001e0058: 08078023 j 0x001e008c 001e005c: 26040099 addiu r4,r16,0x0099 base action abilities pointer
if unit is not a special monster
001e0060: 92050006 lbu r5,0x0006(r16) 001e0064: 260400d2 addiu r4,r16,0x00d2 001e0068: 0c017705 jal 0x0005dc14 Calculate Unlocked Jobs you can figure out the arguments for this I think. 001e006c: 30a50080 andi r5,r5,0x0080 001e0070: 00401821 addu r3,r2,r0 unlocked jobs in r3 001e0074: 00031403 sra r2,r3,0x10 001e0078: a2220008 sb r2,0x0008(r17) 001e007c: 00031203 sra r2,r3,0x08 001e0080: a2220009 sb r2,0x0009(r17) 001e0084: a223000a sb r3,0x000a(r17) store unlocked jobs 1 - 20 001e0088: 26040099 addiu r4,r16,0x0099
001e008c: 2625000b addiu r5,r17,0x000b 001e0090: 0c0088b7 jal 0x000222dc bcopy 001e0094: 34060039 ori r6,r0,0x0039 copy 39 bytes of action/rsm ability flags 001e0098: 260400d2 addiu r4,r16,0x00d2 001e009c: 26250044 addiu r5,r17,0x0044 001e00a0: 0c0088b7 jal 0x000222dc bcopy 9 bytes of job levels 001e00a4: 3406000a ori r6,r0,0x000a 001e00a8: 260400dc addiu r4,r16,0x00dc 001e00ac: 2625004e addiu r5,r17,0x004e 001e00b0: 0c0088b7 jal 0x000222dc bcopy jesus fuck - this could have been done with literally 1 bcopy god fuck. 001e00b4: 34060028 ori r6,r0,0x0028 base job JP 001e00b8: 26040104 addiu r4,r16,0x0104 001e00bc: 26250076 addiu r5,r17,0x0076 001e00c0: 0c0088b7 jal 0x000222dc bcopy total job JP 001e00c4: 34060028 ori r6,r0,0x0028 001e00c8: 00001821 addu r3,r0,r0 001e00cc: 3404270f ori r4,r0,0x270f 9999 001e00d0: 02202821 addu r5,r17,r0 001e00d4: 94a2004e lhu r2,0x004e(r5) 001e00d8: 00000000 nop 001e00dc: 2c422710 sltiu r2,r2,0x2710 001e00e0: 14400002 bne r2,r0,0x001e00ec 001e00e4: 00000000 nop 001e00e8: a4a4004e sh r4,0x004e(r5) stores job JP back in itself but capped at 9999. 001e00ec: 94a20076 lhu r2,0x0076(r5) 001e00f0: 00000000 nop 001e00f4: 2c422710 sltiu r2,r2,0x2710 001e00f8: 14400002 bne r2,r0,0x001e0104 001e00fc: 24630001 addiu r3,r3,0x0001 001e0100: a4a40076 sh r4,0x0076(r5) stores total job JP back in itself but capped at 9999 001e0104: 28620014 slti r2,r3,0x0014 001e0108: 1440fff2 bne r2,r0,0x001e00d4 001e010c: 24a50002 addiu r5,r5,0x0002 001e0110: 8fbf0018 lw r31,0x0018(r29) 001e0114: 8fb10014 lw r17,0x0014(r29) 001e0118: 8fb00010 lw r16,0x0010(r29) 001e011c: 27bd0020 addiu r29,r29,0x0020 001e0120: 03e00008 jr r31 001e0124: 00000000 nop