Ability Loading - Weapon Inventory

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
*Weapon Inventory*
0019a6a4: 17c3003f bne r30,r3,0x 0019a7a4	Beanch if Action Menu != Weapon Inventory
0019a6a8: 34020003 ori r2,r0,0x0003		r2 = 3
0019a6ac: 02c02021 addu r4,r22,r0		r4 = Unit's ID
0019a6b0: 02802821 addu r5,r20,r0		r5 = Unit's Skillset
0019a6b4: 0c066a94 jal 0x 0019aa50		Load Known Ability Flag
0019a6b8: 00003021 addu r6,r0,r0		Counter2 = 0 (Throw Shuriken)
0019a6bc: 10400014 beq r2,r0,0x 0019a710		Branch if Ability isn't known
0019a6c0: 00162280 sll r4,r22,0x0a		Unit's ID * 1024
0019a6c4: 00008021 addu r16,r0,r0		Item Counter = 0
0019a6c8: 00121100 sll r2,r18,0x04		Battle ID * 16
0019a6cc: 00521021 addu r2,r2,r18		ID * 17
0019a6d0: 000210c0 sll r2,r2,0x03		ID * 136
0019a6d4: 24420ef0 addiu r2,r2,0x0ef0
0019a6d8: 3c08801a lui r8,0x801a
0019a6dc: 2508f3c4 addiu r8,r8,0xf3c4
0019a6e0: 00481021 addu r2,r2,r8		r2 = Unit's Usable Move List Pointer
0019a6e4: 00131880 sll r3,r19,0x02		Counter * 4
0019a6e8: 00621821 addu r3,r3,r2
0019a6ec: 00901021 addu r2,r4,r16		Unit's ID * 1024 + Item Counter
0019a6f0: 2442007a addiu r2,r2,0x007a		(Shuriken's ID)
0019a6f4: a0740002 sb r20,0x0002(r3)		Store Unit's Skillset
0019a6f8: a4620000 sh r2,0x0000(r3)		Store Unit's ID + Shuriken ID
0019a6fc: 24630004 addiu r3,r3,0x0004		Pointer += 4
0019a700: 26100001 addiu r16,r16,0x0001		Item Counter ++
0019a704: 2a020003 slti r2,r16,0x0003
0019a708: 1440fff8 bne r2,r0,0x 0019a6ec		Branch if Item Counter < 3
0019a70c: 26730001 addiu r19,r19,0x0001		Counter ++
0019a710: 02c02021 addu r4,r22,r0		r4 = Unit's ID
0019a714: 02802821 addu r5,r20,r0		r5 = Unit's Skillset
0019a718: 0c066a94 jal 0x 0019aa50		Load Known Ability Flag
0019a71c: 34060001 ori r6,r0,0x0001		Counter2 = 1 (Throw Ball)
0019a720: 10400014 beq r2,r0,0x 0019a774		Branch if Ability isn't known
0019a724: 00008021 addu r16,r0,r0		Item Counter = 0
0019a728: 00162280 sll r4,r22,0x0a		Unit ID * 1024
0019a72c: 00121100 sll r2,r18,0x04		Battle ID * 16
0019a730: 00521021 addu r2,r2,r18		ID * 17
0019a734: 000210c0 sll r2,r2,0x03		ID * 136
0019a738: 24420ef0 addiu r2,r2,0x0ef0
0019a73c: 3c08801a lui r8,0x801a
0019a740: 2508f3c4 addiu r8,r8,0xf3c4
0019a744: 01021021 addu r2,r8,r2		r2 = Unit's Usable Move List Pointer
0019a748: 00131880 sll r3,r19,0x02		Counter * 4
0019a74c: 00621821 addu r3,r3,r2
0019a750: 00901021 addu r2,r4,r16		Unit's ID * 1024 + Item Counter
0019a754: 2442007d addiu r2,r2,0x007d		(Fire Ball ID)
0019a758: a0740002 sb r20,0x0002(r3)		Store Unit's Skillset
0019a75c: a4620000 sh r2,0x0000(r3)		Store Unit's ID + Ball ID
0019a760: 24630004 addiu r3,r3,0x0004		Pointer += 3
0019a764: 26100001 addiu r16,r16,0x0001		Item Counter ++
0019a768: 2a020003 slti r2,r16,0x0003
0019a76c: 1440fff8 bne r2,r0,0x 0019a750		Branch if Item Counter < 3
0019a770: 26730001 addiu r19,r19,0x0001		Counter ++
0019a774: 34100002 ori r16,r0,0x0002		Throw Counter = 2
0019a778: 02c02021 addu r4,r22,r0		r4 = Unit's ID
0019a77c: 02802821 addu r5,r20,r0		r5 = Unit's Skillset
0019a780: 0c066a94 jal 0x 0019aa50		Load Known Ability Flag
0019a784: 02003021 addu r6,r16,r0		Counter2 = Throw Counter (Knife and on)
0019a788: 1440ffac bne r2,r0,0x 0019a63c		Branch if Ability is known
0019a78c: 26100001 addiu r16,r16,0x0001		Throw Counter ++
0019a790: 2a02000c slti r2,r16,0x000c
0019a794: 1440fff9 bne r2,r0,0x 0019a77c		Branch if Throw Counter < 12
0019a798: 02c02021 addu r4,r22,r0		r4 = Unit's ID
0019a79c: 08066a87 j 0x 0019aa1c
0019a7a0: 02601021 addu r2,r19,r0		r2 = Counter