Initialize Unit's Job Levels

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Initialize Unit's Job Levels
0005df38: 27bdffd8 addiu r29,r29,0xffd8
0005df3c: afb3001c sw r19,0x001c(r29)
0005df40: 00009821 addu r19,r0,r0		Counter = 0
0005df44: afb20018 sw r18,0x0018(r29)
0005df48: 00a09021 addu r18,r5,r0		r18 = Pointer to Unit's Base/Chemist Job Level
0005df4c: afb10014 sw r17,0x0014(r29)
0005df50: 00808821 addu r17,r4,r0		r17 = Pointer to Unit's Total Base Job JP
0005df54: afbf0020 sw r31,0x0020(r29)
0005df58: afb00010 sw r16,0x0010(r29)
0005df5c: 96240000 lhu r4,0x0000(r17)		Load Unit's Total JP
0005df60: 0c0177bd jal 0x0005def4		Calculate Job Level
0005df64: 26730001 addiu r19,r19,0x0001		Counter ++
0005df68: 96240002 lhu r4,0x0002(r17)		Load Unit's next Total JP
0005df6c: 26310004 addiu r17,r17,0x0004		Total JP Pointer += 4
0005df70: 0c0177bd jal 0x0005def4		Calculate Job Level
0005df74: 00028100 sll r16,r2,0x04		Job Levels = Job Level * 16 (high nybble)
0005df78: 02028025 or r16,r16,r2		Job Levels += Job Level (low nybble)
0005df7c: a2500000 sb r16,0x0000(r18)		Store Unit's Job Levels
0005df80: 2a62000a slti r2,r19,0x000a
0005df84: 1440fff5 bne r2,r0,0x0005df5c		Branch if Counter < 10
0005df88: 26520001 addiu r18,r18,0x0001		Job Level Pointer ++
0005df8c: 8fbf0020 lw r31,0x0020(r29)
0005df90: 8fb3001c lw r19,0x001c(r29)
0005df94: 8fb20018 lw r18,0x0018(r29)
0005df98: 8fb10014 lw r17,0x0014(r29)
0005df9c: 8fb00010 lw r16,0x0010(r29)
0005dfa0: 27bd0028 addiu r29,r29,0x0028
0005dfa4: 03e00008 jr r31
0005dfa8: 00000000 nop


Return Locations

0005a924: Initialize Unit's Job Data