001212b8 - 00121564

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

I can't really be bothered to finish documenting this, I know what it does. copies formation unit data to party data.

001212b8: 3c02801d lui r2,0x801d
001212bc: 84428634 lh r2,-0x79cc(r2)
001212c0: 27bdfe08 addiu r29,r29,0xfe08
001212c4: afb201e8 sw r18,0x01e8(r29)
001212c8: 00009021 addu r18,r0,r0
001212cc: afbf01f4 sw r31,0x01f4(r29)
001212d0: afb401f0 sw r20,0x01f0(r29)
001212d4: afb301ec sw r19,0x01ec(r29)
001212d8: afb101e4 sw r17,0x01e4(r29)
001212dc: 18400099 blez r2,0x00121544
001212e0: afb001e0 sw r16,0x01e0(r29)
001212e4: 341400ff ori r20,r0,0x00ff
001212e8: 3c11801d lui r17,0x801d
001212ec: 2631d5ec addiu r17,r17,0xd5ec
001212f0: 8e220000 lw r2,0x0000(r17)
001212f4: 00000000 nop
001212f8: 8444002c lh r4,0x002c(r2)
001212fc: 0c0166bc jal 0x00059af0
00121300: 00809821 addu r19,r4,r0
00121304: 8e230000 lw r3,0x0000(r17)
00121308: 00000000 nop
0012130c: 90630024 lbu r3,0x0024(r3)
00121310: 00408021 addu r16,r2,r0
00121314: a2030002 sb r3,0x0002(r16)
00121318: 8e220000 lw r2,0x0000(r17)
0012131c: 00000000 nop
00121320: 90420070 lbu r2,0x0070(r2)
00121324: 00000000 nop
00121328: a2020004 sb r2,0x0004(r16)
0012132c: 8e220000 lw r2,0x0000(r17)
00121330: 00000000 nop
00121334: 90420060 lbu r2,0x0060(r2)
00121338: 00000000 nop
0012133c: a2020007 sb r2,0x0007(r16)
00121340: 8e220000 lw r2,0x0000(r17)
00121344: 00000000 nop
00121348: 90420062 lbu r2,0x0062(r2)
0012134c: 00000000 nop
00121350: a2020008 sb r2,0x0008(r16)
00121354: 8e220000 lw r2,0x0000(r17)
00121358: 00000000 nop
0012135c: 94420062 lhu r2,0x0062(r2)
00121360: 00000000 nop
00121364: 00021202 srl r2,r2,0x08
00121368: a2020009 sb r2,0x0009(r16)
0012136c: 8e220000 lw r2,0x0000(r17)
00121370: 00000000 nop
00121374: 90420064 lbu r2,0x0064(r2)
00121378: 00000000 nop
0012137c: a202000a sb r2,0x000a(r16)
00121380: 8e220000 lw r2,0x0000(r17)
00121384: 00000000 nop
00121388: 94420064 lhu r2,0x0064(r2)
0012138c: 00000000 nop
00121390: 00021202 srl r2,r2,0x08
00121394: a202000b sb r2,0x000b(r16)  
00121398: 8e220000 lw r2,0x0000(r17)
0012139c: 00000000 nop
001213a0: 90420066 lbu r2,0x0066(r2)			#load half of movement
001213a4: 00000000 nop
001213a8: a202000c sb r2,0x000c(r16)			#save that half of movement
001213ac: 8e220000 lw r2,0x0000(r17)			#formation pointer
001213b0: 00000000 nop
001213b4: 94420066 lhu r2,0x0066(r2)			#load the other half of movement
001213b8: 00000000 nop
001213bc: 00021202 srl r2,r2,0x08
001213c0: a202000d sb r2,0x000d(r16)			#save the other half of movement
001213c4: 8e230000 lw r3,0x0000(r17)			#load formation pointer
001213c8: 00000000 nop
001213cc: 8462003e lh r2,0x003e(r3)			#
001213d0: 00000000 nop
001213d4: 1440004d bne r2,r0,0x0012150c		#?
001213d8: 27a40010 addiu r4,r29,0x0010			#r4 = stack pointer + 0x10 (?)
001213dc: 94640054 lhu r4,0x0054(r3)			#load RH weapon
001213e0: a2140011 sb r20,0x0011(r16)			#store RH weapon
001213e4: 1080000d beq r4,r0,0x0012141c		#branch if RH weapon is YA FISTS
001213e8: a2140012 sb r20,0x0012(r16)			#store RH shield
001213ec: 00041040 sll r2,r4,0x01
001213f0: 00441021 addu r2,r2,r4
001213f4: 00021080 sll r2,r2,0x02			#item type * 0x12
001213f8: 3c018006 lui r1,0x8006
001213fc: 00220821 addu r1,r1,r2
00121400: 90232ebd lbu r3,0x2ebd(r1)			#item type
00121404: 34020013 ori r2,r0,0x0013
00121408: 14620003 bne r3,r2,0x00121418		#branch if equipped weapon type is not shield
0012140c: 00000000 nop
00121410: 08048507 j 0x0012141c
00121414: a2040012 sb r4,0x0012(r16)			#store right hand shield (if weapon type is shield)
00121418: a2040011 sb r4,0x0011(r16)			#store right hand weapon (if weapon type is weapon)
0012141c: 8e220000 lw r2,0x0000(r17)			#load unit formation pointer
00121420: 00000000 nop
00121424: 94440056 lhu r4,0x0056(r2)			#load weapon to be equipped (?)
00121428: a2140013 sb r20,0x0013(r16)			#store left hand weapon
0012142c: 1080000d beq r4,r0,0x00121464		#branch if weapon to be equipped is YA BARE HANDS
00121430: a2140014 sb r20,0x0014(r16)			#store left hand shield
00121434: 00041040 sll r2,r4,0x01
00121438: 00441021 addu r2,r2,r4
0012143c: 00021080 sll r2,r2,0x02			#r2 = weapon * 12
00121440: 3c018006 lui r1,0x8006
00121444: 00220821 addu r1,r1,r2
00121448: 90232ebd lbu r3,0x2ebd(r1)			#load weapon's type
0012144c: 34020013 ori r2,r0,0x0013
00121450: 14620003 bne r3,r2,0x00121460		#branch if weapon type is not shield
00121454: 00000000 nop
00121458: 08048519 j 0x00121464
0012145c: a2040014 sb r4,0x0014(r16)			#save shield to equipped LH shield (if shield)
00121460: a2040013 sb r4,0x0013(r16)			#Save weapon to LH weapon (if weapon)
00121464: 8e240000 lw r4,0x0000(r17)			#load unit formation pointer
00121468: 00000000 nop
0012146c: 94820058 lhu r2,0x0058(r4)			#load equipped helmet
00121470: 00000000 nop
00121474: 10400002 beq r2,r0,0x00121480		#branch if helmet is null
00121478: 340300ff ori r3,r0,0x00ff			#helmet = 0xff (none)
0012147c: 90830058 lbu r3,0x0058(r4)			#load formation helmet
00121480: 00000000 nop
00121484: a203000e sb r3,0x000e(r16)			#save formation helmet to party helmet
00121488: 8e240000 lw r4,0x0000(r17)
0012148c: 00000000 nop
00121490: 9482005a lhu r2,0x005a(r4)			#load formation body
00121494: 00000000 nop
00121498: 10400002 beq r2,r0,0x001214a4		#branch if no formation body
0012149c: 340300ff ori r3,r0,0x00ff			#body = 0xff(none)
001214a0: 9083005a lbu r3,0x005a(r4)			#load formation body
001214a4: 00000000 nop
001214a8: a203000f sb r3,0x000f(r16)			#save formation body to party body
001214ac: 8e240000 lw r4,0x0000(r17)
001214b0: 00000000 nop
001214b4: 9482005c lhu r2,0x005c(r4)			#Load formation accessory
001214b8: 00000000 nop
001214bc: 10400002 beq r2,r0,0x001214c8		#branch if none
001214c0: 340300ff ori r3,r0,0x00ff			#accessory = none
001214c4: 9083005c lbu r3,0x005c(r4)			#load formation accessory
001214c8: 2605002b addiu r5,r16,0x002b			#r5 = pointer to base action abilities 1-8
001214cc: a2030010 sb r3,0x0010(r16)			#save formation accessory to party accessory
001214d0: 8e240000 lw r4,0x0000(r17)			#unit's formation pointer
001214d4: 34060039 ori r6,r0,0x0039
001214d8: 0c0088b7 jal 0x000222dc			#call kernel 0xa0 with 0x27 (move r6 bytes of data from r4 to r5)
001214dc: 2484007a addiu r4,r4,0x007a			#pointer to formation base action abilities 1-8
001214e0: 2605006e addiu r5,r16,0x006e			#r5 = pointer to base job JP
001214e4: 8e240000 lw r4,0x0000(r17)			#unit's formation pointer
001214e8: 34060028 ori r6,r0,0x0028
001214ec: 0c0088b7 jal 0x000222dc			#call kernel 0xa0 with 0x27 (move r6 bytes of data from r4 to r5)
001214f0: 248400be addiu r4,r4,0x00be			#pointer to formation base job JP
001214f4: 26050096 addiu r5,r16,0x0096			#base job total JP
001214f8: 8e240000 lw r4,0x0000(r17)
001214fc: 34060028 ori r6,r0,0x0028
00121500: 0c0088b7 jal 0x000222dc			#move 0x28 bytes from r4 to r5
00121504: 248400e6 addiu r4,r4,0x00e6			#formation base job Total JP 
00121508: 27a40010 addiu r4,r29,0x0010
0012150c: 02602821 addu r5,r19,r0
00121510: 0c016a35 jal 0x0005a8d4
00121514: 34060001 ori r6,r0,0x0001
00121518: 27a40010 addiu r4,r29,0x0010
0012151c: 02003021 addu r6,r16,r0
00121520: 8e250000 lw r5,0x0000(r17)
00121524: 0c0482ec jal 0x00120bb0
00121528: 26310004 addiu r17,r17,0x0004
0012152c: 3c02801d lui r2,0x801d
00121530: 84428634 lh r2,-0x79cc(r2)
00121534: 26520001 addiu r18,r18,0x0001
00121538: 0242102a slt r2,r18,r2
0012153c: 1440ff6c bne r2,r0,0x001212f0
00121540: 00000000 nop
00121544: 8fbf01f4 lw r31,0x01f4(r29)
00121548: 8fb401f0 lw r20,0x01f0(r29)
0012154c: 8fb301ec lw r19,0x01ec(r29)
00121550: 8fb201e8 lw r18,0x01e8(r29)
00121554: 8fb101e4 lw r17,0x01e4(r29)
00121558: 8fb001e0 lw r16,0x01e0(r29)
0012155c: 27bd01f8 addiu r29,r29,0x01f8
00121560: 03e00008 jr r31
00121564: 00000000 nop