BUNIT.OUT Get first job that matches Skillset ID

From Final Fantasy Hacktics Wiki
Revision as of 06:49, 14 December 2024 by Talcall (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
see also: JOBSTTS.OUT Get first job that matches Skillset ID
find: the world routine that does the same thing
001c71d4: 27bdffe0 addiu r29,r29,-0x0020
001c71d8: afb10014 sw r17,0x0014(r29)
001c71dc: 00808821 addu r17,r4,r0               skillset ID
001c71e0: afb00010 sw r16,0x0010(r29)
001c71e4: 00008021 addu r16,r0,r0                 
001c71e8: afbf0018 sw r31,0x0018(r29)
001c71ec: 0c016a29 jal 0x0005a8a4               Get Job Data Pointer 
001c71f0: 02002021 addu r4,r16,r0
001c71f4: 90420000 lbu r2,0x0000(r2)
001c71f8: 00000000 nop
001c71fc: 10510005 beq r2,r17,0x001c7214        continue for first job ID matches input skillset
001c7200: 02001021 addu r2,r16,r0               return first job ID that matches input skillset
001c7204: 26100001 addiu r16,r16,0x0001
001c7208: 2a0200a0 slti r2,r16,0x00a0
001c720c: 1440fff7 bne r2,r0,0x001c71ec         loop for all jobs
001c7210: 2402ffff addiu r2,r0,-0x0001          otherwise return -1
001c7214: 8fbf0018 lw r31,0x0018(r29)
001c7218: 8fb10014 lw r17,0x0014(r29)
001c721c: 8fb00010 lw r16,0x0010(r29)
001c7220: 27bd0020 addiu r29,r29,0x0020
001c7224: 03e00008 jr r31
001c7228: 00000000 nop