Gained JP Up Section

From Final Fantasy Hacktics Wiki
Jump to: navigation, search
Gained JP Up Section... And other stuff
0017e7e4: 27bdffc0 addiu r29,r29,0xffc0		
0017e7e8: afb40028 sw r20,0x0028(r29)		
0017e7ec: 00a0a021 addu r20,r5,r0			
0017e7f0: afbf0038 sw r31,0x0038(r29)		
0017e7f4: afb70034 sw r23,0x0034(r29)		
0017e7f8: afb60030 sw r22,0x0030(r29)		
0017e7fc: afb5002c sw r21,0x002c(r29)		
0017e800: afb30024 sw r19,0x0024(r29)		
0017e804: afb20020 sw r18,0x0020(r29)		
0017e808: afb1001c sw r17,0x001c(r29)		
0017e80c: afb00018 sw r16,0x0018(r29)		
0017e810: a2800000 sb r0,0x0000(r20)		
0017e814: a2800001 sb r0,0x0001(r20)		
0017e818: a2800002 sb r0,0x0002(r20)		
0017e81c: a2800003 sb r0,0x0003(r20)		
0017e820: 3c028019 lui r2,0x8019		
0017e824: 8c4238bc lw r2,0x38bc(r2)		Load ???
0017e828: 00000000 nop				
0017e82c: 14400019 bne r2,r0,0x0017e894		
0017e830: 0080a821 addu r21,r4,r0		
0017e834: 3c028019 lui r2,0x8019		
0017e838: 904238e8 lbu r2,0x38e8(r2)		Load can earn Exp/JP
0017e83c: 00000000 nop				
0017e840: 1040006c beq r2,r0,0x0017e9f4		
0017e844: 001510c0 sll r2,r21,0x03		
0017e848: 00551023 subu r2,r2,r21		
0017e84c: 00021180 sll r2,r2,0x06		
0017e850: 3c038019 lui r3,0x8019		
0017e854: 246308cc addiu r3,r3,0x08cc		Load Unit's Data
0017e858: 00439021 addu r18,r2,r3		
0017e85c: 92430001 lbu r3,0x0001(r18)		
0017e860: 340200ff ori r2,r0,0x00ff		
0017e864: 10620064 beq r3,r2,0x0017e9f8		Branch if unit doesn't exist
0017e868: 2402ffff addiu r2,r0,0xffff		
0017e86c: 92420058 lbu r2,0x0058(r18)		Load first set of status
0017e870: 00000000 nop				
0017e874: 30420060 andi r2,r2,0x0060		
0017e878: 1440005f bne r2,r0,0x0017e9f8		Branch if unit is Dead/Crystal
0017e87c: 2402ffff addiu r2,r0,0xffff		
0017e880: 92420059 lbu r2,0x0059(r18)		Load second set of status
0017e884: 00000000 nop				
0017e888: 30420081 andi r2,r2,0x0081		        
0017e88c: 10400003 beq r2,r0,0x0017e89c		Branch if unit is Petrify/Treasure
0017e890: 00000000 nop				
0017e894: 0805fa7e j 0x0017e9f8			
0017e898: 2402ffff addiu r2,r0,0xffff		
0017e89c: 92420021 lbu r2,0x0021(r18)		
0017e8a0: 3c038019 lui r3,0x8019		
0017e8a4: 906338e7 lbu r3,0x38e7(r3)		Load Earned Experience
0017e8a8: 92510022 lbu r17,0x0022(r18)		Load unit's Level
0017e8ac: 00431821 addu r3,r2,r3		
0017e8b0: 28620100 slti r2,r3,0x0100		
0017e8b4: 14400002 bne r2,r0,0x0017e8c0		
0017e8b8: 00000000 nop				
0017e8bc: 340300ff ori r3,r0,0x00ff		
0017e8c0: a2430021 sb r3,0x0021(r18)		Store unit's new Experience
0017e8c4: 0c017620 jal 0x0005d880		check if unit leveled up
0017e8c8: 02402021 addu r4,r18,r0		
0017e8cc: 14400006 bne r2,r0,0x0017e8e8		
0017e8d0: 00000000 nop				
0017e8d4: 3c028019 lui r2,0x8019		
0017e8d8: 9042390c lbu r2,0x390c(r2)		Load Ability type
0017e8dc: 00000000 nop				
0017e8e0: 10400004 beq r2,r0,0x0017e8f4		
0017e8e4: 00000000 nop
0017e8e8: 92420022 lbu r2,0x0022(r18)		Load Unit Level
0017e8ec: 00000000 nop				
0017e8f0: a2820002 sb r2,0x0002(r20)		Store Level into ???
0017e8f4: 3c108019 lui r16,0x8019		
0017e8f8: 261038e7 addiu r16,r16,0x38e7	       Load Earned Experience
0017e8fc: 92020000 lbu r2,0x0000(r16)		
0017e900: 00000000 nop				
0017e904: a2820000 sb r2,0x0000(r20)		
0017e908: 92420006 lbu r2,0x0006(r18)		Load Unit's Gender
0017e90c: 00000000 nop				
0017e910: 30420020 andi r2,r2,0x0020		
0017e914: 14400038 bne r2,r0,0x0017e9f8		Branch if unit is a Monster
0017e918: 00001021 addu r2,r0,r0		
0017e91c: 02402021 addu r4,r18,r0		R4 = Unit Data
0017e920: 92560003 lbu r22,0x0003(r18)		Load Unit Job ID
0017e924: 27a60010 addiu r6,r29,0x0010		
0017e928: 0c05fa8a jal 0x0017ea28		Load Job Level?
0017e92c: 02c02821 addu r5,r22,r0		
0017e930: 0040b821 addu r23,r2,r0		
0017e934: 00171040 sll r2,r23,0x01		
0017e938: 00111882 srl r3,r17,0x02		
0017e93c: 24630008 addiu r3,r3,0x0008		
0017e940: 92040000 lbu r4,0x0000(r16)		
0017e944: 00000000 nop				
0017e948: 14800002 bne r4,r0,0x0017e954		
0017e94c: 00438821 addu r17,r2,r3		
0017e950: 00008821 addu r17,r0,r0		
0017e954: 92420005 lbu r2,0x0005(r18)		Load Unit's Team
0017e958: 00008021 addu r16,r0,r0		
0017e95c: 30530030 andi r19,r2,0x0030		
0017e960: 12150009 beq r16,r21,0x0017e988		
0017e964: 00000000 nop				
0017e968: 06210002 bgez r17,0x0017e974		
0017e96c: 02202821 addu r5,r17,r0		
0017e970: 26250003 addiu r5,r17,0x0003		
0017e974: 02002021 addu r4,r16,r0		
0017e978: 00052883 sra r5,r5,0x02		Gained JP / 4
0017e97c: 8fa70010 lw r7,0x0010(r29)		
0017e980: 0c05faa0 jal 0x0017ea80		Store JP; Calculate Unlocked Jobs
0017e984: 326600ff andi r6,r19,0x00ff		
0017e988: 26100001 addiu r16,r16,0x0001		
0017e98c: 2a020015 slti r2,r16,0x0015		
0017e990: 1440fff3 bne r2,r0,0x0017e960		
0017e994: 00000000 nop				
0017e998: 92420090 lbu r2,0x0090(r18)		Load Second Set of Supports
0017e99c: 00000000 nop				
0017e9a0: 30420040 andi r2,r2,0x0040		 	
0017e9a4: 10400006 beq r2,r0,0x0017e9c0		Branch if Unit doesn't have Gained  JP Up
0017e9a8: 02a02021 addu r4,r21,r0		
0017e9ac: 00111040 sll r2,r17,0x01		
0017e9b0: 00511021 addu r2,r2,r17		
0017e9b4: 00021fc2 srl r3,r2,0x1f		
0017e9b8: 00431021 addu r2,r2,r3		
0017e9bc: 00028843 sra r17,r2,0x01		
0017e9c0: 02202821 addu r5,r17,r0		
0017e9c4: 924601ba lbu r6,0x01ba(r18)		
0017e9c8: 8fa70010 lw r7,0x0010(r29)		
0017e9cc: 0c05faa0 jal 0x0017ea80		Store JP; Calculate Unlocked Jobs
0017e9d0: 30c60030 andi r6,r6,0x0030		
0017e9d4: 02402021 addu r4,r18,r0		
0017e9d8: 02c02821 addu r5,r22,r0		
0017e9dc: 0c05fa8a jal 0x0017ea28		Load Job Level?
0017e9e0: 27a60010 addiu r6,r29,0x0010		
0017e9e4: 10570002 beq r2,r23,0x0017e9f0		
0017e9e8: 00000000 nop				
0017e9ec: a2820003 sb r2,0x0003(r20)		
0017e9f0: a2910001 sb r17,0x0001(r20)		
0017e9f4: 00001021 addu r2,r0,r0		
0017e9f8: 8fbf0038 lw r31,0x0038(r29)		
0017e9fc: 8fb70034 lw r23,0x0034(r29)		
0017ea00: 8fb60030 lw r22,0x0030(r29)		
0017ea04: 8fb5002c lw r21,0x002c(r29)		
0017ea08: 8fb40028 lw r20,0x0028(r29)		
0017ea0c: 8fb30024 lw r19,0x0024(r29)		
0017ea10: 8fb20020 lw r18,0x0020(r29)		
0017ea14: 8fb1001c lw r17,0x001c(r29)		
0017ea18: 8fb00018 lw r16,0x0018(r29)		
0017ea1c: 27bd0040 addiu r29,r29,0x0040		
0017ea20: 03e00008 jr r31			
0017ea24: 00000000 nop

Return Locations

0007366c: - Routine at 73638