Proposition JP Gain

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
Proposition JP Gain
0005dd48: 27bdffe0 addiu r29,r29,0xffe0
0005dd4c: afb20018 sw r18,0x0018(r29)
0005dd50: 00a09021 addu r18,r5,r0		r18 = Prop JP
0005dd54: afbf001c sw r31,0x001c(r29)
0005dd58: afb10014 sw r17,0x0014(r29)
0005dd5c: 06400010 bltz r18,0x 0005dda0		Branch if Prop JP < 0
0005dd60: afb00010 sw r16,0x0010(r29)
0005dd64: 2c820014 sltiu r2,r4,0x0014
0005dd68: 104 00054 beq r2,r0,0x 0005debc		Branch if Party ID is out of range
0005dd6c: 2402ffff addiu r2,r0,0xffff		r2 = FFFF
0005dd70: 0c0166bc jal 0x 00059af0		Get Party Data Pointer
0005dd74: 00000000 nop
0005dd78: 00408821 addu r17,r2,r0		r17 = Party Data Pointer
0005dd7c: 90430001 lbu r3,0x0001(r2)		Load Unit's Party ID
0005dd80: 340200ff ori r2,r0,0x00ff
0005dd84: 1062004d beq r3,r2,0x 0005debc		Branch if Unit doesn't Exist
0005dd88: 2402ffff addiu r2,r0,0xffff		r2 = FFFF
0005dd8c: 92220004 lbu r2,0x0004(r17)		Load Party Gender Byte
0005dd90: 00000000 nop
0005dd94: 30420020 andi r2,r2,0x0020
0005dd98: 10400003 beq r2,r0,0x 0005dda8		Branch if Unit isn't a monster
0005dd9c: 00000000 nop
0005dda0: 080177af j 0x 0005debc
0005dda4: 2402ffff addiu r2,r0,0xffff		r2 = FFFF
0005dda8: 92230002 lbu r3,0x0002(r17)		Load Party Job ID
0005ddac: 00000000 nop
0005ddb0: 2462ffb6 addiu r2,r3,0xffb6		ID - 0x4a (Generic ID)
0005ddb4: 2c420014 sltiu r2,r2,0x0014
0005ddb8: 10400002 beq r2,r0,0x 0005ddc4		Branch if Job isn't Generic
0005ddbc: 00008021 addu r16,r0,r0		Generic ID = 0 (Base)
0005ddc0: 2470ffb6 addiu r16,r3,0xffb6		Generic ID = ID - 0x4a
0005ddc4: 00101040 sll r2,r16,0x01		ID * 2
0005ddc8: 02222821 addu r5,r17,r2
0005ddcc: 90a2006f lbu r2,0x006f(r5)		Load Job's Current JP High Byte
0005ddd0: 90a3006e lbu r3,0x006e(r5)		Load Job's Current JP
0005ddd4: 00021200 sll r2,r2,0x08		High Byte * 256
0005ddd8: 00621821 addu r3,r3,r2		r3 = Job's Current JP
0005dddc: 00721821 addu r3,r3,r18		Current JP += Prop JP
0005dde0: 28622710 slti r2,r3,0x2710
0005dde4: 14400002 bne r2,r0,0x 0005ddf0		Branch if Current JP < 10000
0005dde8: 00000000 nop
0005ddec: 3403270f ori r3,r0,0x270f		JP = 9999
0005ddf0: a0a3006e sb r3,0x006e(r5)		Store Party Current JP
0005ddf4: 04610002 bgez r3,0x 0005de00		Branch if Current JP is positive
0005ddf8: 00601021 addu r2,r3,r0		r2 = JP
0005ddfc: 246200ff addiu r2,r3,0x00ff		JP += 255 (>_>)
0005de00: 00021203 sra r2,r2,0x08		JP / 256
0005de04: a0a2006f sb r2,0x006f(r5)		Store Party Current JP High Byte 
0005de08: 90a20097 lbu r2,0x0097(r5)		Load Party Total JP High Byte
0005de0c: 90a30096 lbu r3,0x0096(r5)		Load Party Total JP
0005de10: 00021200 sll r2,r2,0x08		High Byte * 256
0005de14: 00621821 addu r3,r3,r2		r3 = Job's Total JP
0005de18: 00721821 addu r3,r3,r18		Total JP += Prop JP
0005de1c: 28622710 slti r2,r3,0x2710
0005de20: 14400002 bne r2,r0,0x 0005de2c		Branch if Total JP < 10000
0005de24: 00000000 nop
0005de28: 3403270f ori r3,r0,0x270f		Total JP = 9999
0005de2c: a0a30096 sb r3,0x0096(r5)		Store Total JP
0005de30: 04610002 bgez r3,0x 0005de3c		Branch if Total JP is positive
0005de34: 00601021 addu r2,r3,r0		r2 = Total JP
0005de38: 246200ff addiu r2,r3,0x00ff
0005de3c: 3064ffff andi r4,r3,0xffff		r4 = Total JP
0005de40: 00021203 sra r2,r2,0x08		Total JP / 256
0005de44: 0c0177bd jal 0x 0005def4		Calculate Job Level
0005de48: a0a20097 sb r2,0x0097(r5)		Store Total JP High Byte
0005de4c: 00101fc2 srl r3,r16,0x1f		
0005de50: 02031821 addu r3,r16,r3
0005de54: 00031843 sra r3,r3,0x01		Generic ID * 2
0005de58: 02231821 addu r3,r17,r3
0005de5c: 00402021 addu r4,r2,r0		r4 = Job Level
0005de60: 32020001 andi r2,r16,0x0001		r2 = Job Nybble Check
0005de64: 90630064 lbu r3,0x0064(r3)		Load Party Job Levels
0005de68: 10400004 beq r2,r0,0x 0005de7c		Branch if Job uses High Nybble
0005de6c: 00802821 addu r5,r4,r0		r5 = Job Level
0005de70: 306200f0 andi r2,r3,0x00f0		r2 = High Nybble Job Level
0005de74: 080177a3 j 0x 0005de8c
0005de78: 00821821 addu r3,r4,r2		Add new Low Nybble Job Level
0005de7c: 3063000f andi r3,r3,0x000f		r3 = Low Nybble Job Level
0005de80: 30a200ff andi r2,r5,0x00ff
0005de84: 00021100 sll r2,r2,0x04		High Nybble Level * 16
0005de88: 00621825 or r3,r3,r2			Add new High Nybble Job Level
0005de8c: 001017c2 srl r2,r16,0x1f
0005de90: 02021021 addu r2,r16,r2
0005de94: 00021043 sra r2,r2,0x01		Generic ID * 2
0005de98: 02221021 addu r2,r17,r2
0005de9c: a0430064 sb r3,0x0064(r2)		Store new Job Levels
0005dea0: 92250004 lbu r5,0x0004(r17)		Load Party Gender Byte
0005dea4: 0c017705 jal 0x 0005dc14		Calculate Unlocked Jobs
0005dea8: 26240064 addiu r4,r17,0x0064		r4 = Party Job Level Pointer
0005deac: 26240028 addiu r4,r17,0x0028		r4 = Party Unlocked Jobs
0005deb0: 0c0177b6 jal 0x 0005ded8		Store 3-Byte Data
0005deb4: 00402821 addu r5,r2,r0		r5 = Unlocked Jobs
0005deb8: 00001021 addu r2,r0,r0		r2 = 0
0005debc: 8fbf001c lw r31,0x001c(r29)
0005dec0: 8fb20018 lw r18,0x0018(r29)
0005dec4: 8fb10014 lw r17,0x0014(r29)
0005dec8: 8fb00010 lw r16,0x0010(r29)
0005decc: 27bd0020 addiu r29,r29,0x0020
0005ded0: 03e00008 jr r31
0005ded4: 00000000 nop


Return Locations

WLDCORE.BIN
00078fac