Store level,exp, HP/MP hardcoding, store CT

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

00133588: 27bdffc8 addiu r29,r29,0xffc8
0013358c: afb00020 sw r16,0x0020(r29)
00133590: 00808021 addu r16,r4,r0
00133594: afbf0034 sw r31,0x0034(r29)
00133598: afb40030 sw r20,0x0030(r29)
0013359c: afb3002c sw r19,0x002c(r29)
001335a0: afb20028 sw r18,0x0028(r29)
001335a4: afb10024 sw r17,0x0024(r29)
001335a8: 92020022 lbu r2,0x0022(r16)			load level
001335ac: 00a09021 addu r18,r5,r0
001335b0: a6400002 sh r0,0x0002(r18)
001335b4: a6420000 sh r2,0x0000(r18)			store level
001335b8: 920201ba lbu r2,0x01ba(r16)			load ENTD flags
001335bc: 00000000 nop
001335c0: 30420030 andi r2,r2,0x0030
001335c4: 10400002 beq r2,r0,0x001335d0			branch if ally
001335c8: 34020001 ori r2,r0,0x0001
001335cc: a6420002 sh r2,0x0002(r18)			store if enemy
001335d0: 920201ba lbu r2,0x01ba(r16)			load ENTD
001335d4: 00000000 nop
001335d8: 30420038 andi r2,r2,0x0038
001335dc: 14400002 bne r2,r0,0x001335e8			branch if enemy team or control flagged
001335e0: 34020002 ori r2,r0,0x0002
001335e4: a6420002 sh r2,0x0002(r18)			store if not
001335e8: 920201b8 lbu r2,0x01b8(r16)			load AI/Autobattle setting
001335ec: 00000000 nop
001335f0: 10400002 beq r2,r0,0x001335fc			branch if none
001335f4: 34020003 ori r2,r0,0x0003
001335f8: a6420002 sh r2,0x0002(r18)			store value
001335fc: 92020021 lbu r2,0x0021(r16)			load experience
00133600: 00000000 nop
00133604: a6420008 sh r2,0x0008(r18)
00133608: 9602002a lhu r2,0x002a(r16)			load max HP
0013360c: 00000000 nop
00133610: 14400003 bne r2,r0,0x00133620			branch if not 0
00133614: a6420010 sh r2,0x0010(r18)
00133618: 24420001 addiu r2,r2,0x0001
0013361c: a6420010 sh r2,0x0010(r18)			store 1 HP
00133620: 96020028 lhu r2,0x0028(r16)			load current HP
00133624: a640000e sh r0,0x000e(r18)
00133628: a642000c sh r2,0x000c(r18)			
0013362c: 9602002e lhu r2,0x002e(r16)			load max MP
00133630: 00000000 nop
00133634: 14400003 bne r2,r0,0x00133644
00133638: a6420016 sh r2,0x0016(r18)
0013363c: 24420001 addiu r2,r2,0x0001
00133640: a6420016 sh r2,0x0016(r18)
00133644: 34110064 ori r17,r0,0x0064
00133648: 9602002c lhu r2,0x002c(r16)			load MP
0013364c: 02002021 addu r4,r16,r0
00133650: a6400014 sh r0,0x0014(r18)
00133654: a651001c sh r17,0x001c(r18)
00133658: a6420012 sh r2,0x0012(r18)
0013365c: 92030039 lbu r3,0x0039(r16)			load CT
00133660: 3c028018 lui r2,0x8018
00133664: 244234bc addiu r2,r2,0x34bc			store 0x801834bc Check some list for Unit Battle ID
00133668: a6400004 sh r0,0x0004(r18)
0013366c: a6400006 sh r0,0x0006(r18)
00133670: 3c018017 lui r1,0x8017
00133674: ac223ca8 sw r2,0x3ca8(r1)
00133678: 0c0533ad jal 0x0014ceb4				AT list calculation? (seems easier to just call the routine tbh.)
0013367c: a6430018 sh r3,0x0018(r18)
00133680: a6420004 sh r2,0x0004(r18)
00133684: 92020186 lbu r2,0x0186(r16)			load character turn flag
00133688: 00000000 nop
0013368c: 10400002 beq r2,r0,0x00133698			branch if not
00133690: 00000000 nop
00133694: a6510018 sh r17,0x0018(r18)
00133698: 86420004 lh r2,0x0004(r18)
0013369c: 00000000 nop
001336a0: 04400003 bltz r2,0x001336b0
001336a4: 00401821 addu r3,r2,r0
001336a8: 24620001 addiu r2,r3,0x0001
001336ac: a6420004 sh r2,0x0004(r18)
001336b0: 34020015 ori r2,r0,0x0015
001336b4: a6420006 sh r2,0x0006(r18)			
001336b8: 0000a021 addu r20,r0,r0
001336bc: 00008821 addu r17,r0,r0
001336c0: 0c0232ed jal 0x0008cbb4				see if unit is first unit
001336c4: 02202021 addu r4,r17,r0
001336c8: 10400014 beq r2,r0,0x0013371c			branch if so
001336cc: 00000000 nop
001336d0: 0c023374 jal 0x0008cdd0				get misc ID
001336d4: 02202021 addu r4,r17,r0
001336d8: 00409821 addu r19,r2,r0
001336dc: 0c0602bf jal 0x00180afc				get unit data
001336e0: 02602021 addu r4,r19,r0
001336e4: 90440161 lbu r4,0x0161(r2)			load ENTD
001336e8: 0c060324 jal 0x00180c90				existence checks
001336ec: 27a50010 addiu r5,r29,0x0010
001336f0: 8fa30010 lw r3,0x0010(r29)
001336f4: 00000000 nop
001336f8: 04600008 bltz r3,0x0013371c
001336fc: 00408021 addu r16,r2,r0
00133700: 16630006 bne r19,r3,0x0013371c
00133704: 00000000 nop
00133708: 92020161 lbu r2,0x0161(r16)
0013370c: 00000000 nop
00133710: 10400002 beq r2,r0,0x0013371c
00133714: 00000000 nop
00133718: 26940001 addiu r20,r20,0x0001
0013371c: 26310001 addiu r17,r17,0x0001
00133720: 2a220015 slti r2,r17,0x0015
00133724: 1440ffe6 bne r2,r0,0x001336c0
00133728: 00000000 nop
0013372c: a6540006 sh r20,0x0006(r18)
00133730: 8fbf0034 lw r31,0x0034(r29)
00133734: 8fb40030 lw r20,0x0030(r29)
00133738: 8fb3002c lw r19,0x002c(r29)
0013373c: 8fb20028 lw r18,0x0028(r29)
00133740: 8fb10024 lw r17,0x0024(r29)
00133744: 8fb00020 lw r16,0x0020(r29)
00133748: 27bd0038 addiu r29,r29,0x0038
0013374c: 03e00008 jr r31
00133750: 00000000 nop