Difference between revisions of "Skillset Loading"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Nyzer moved page Skillset Loading? to Skillset Loading: Fucking question marks)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
Runs when "act" is selected
 +
 
  Skillset Loading?
 
  Skillset Loading?
 
  r6 = action menu byte
 
  r6 = action menu byte
  00181584: 27bdfe90 addiu r29,r29,0xfe90
+
  00181584: 27bdfe90 addiu r29,r29,0xfe90 stack - 170 (lorge, to make space for ability data)
 
  00181588: afb00160 sw r16,0x0160(r29)
 
  00181588: afb00160 sw r16,0x0160(r29)
 
  0018158c: 00808021 addu r16,r4,r0 unit ID
 
  0018158c: 00808021 addu r16,r4,r0 unit ID
Line 23: Line 25:
 
  001815d4: 10620003 beq r3,r2,0x 001815e4 branch if attack
 
  001815d4: 10620003 beq r3,r2,0x 001815e4 branch if attack
 
  001815d8: 34020005 ori r2,r0,0x0005
 
  001815d8: 34020005 ori r2,r0,0x0005
  001815dc: 14620049 bne r3,r2,0x 00181704 branch if not blank
+
  001815dc: 14620049 bne r3,r2,0x 00181704 branch if not blank (frogs can't use any other skillsets dummy!)
 
  001815e0: 00001021 addu r2,r0,r0
 
  001815e0: 00001021 addu r2,r0,r0
  001815e4: 2c62000b sltiu r2,r3,0x000b set if action menu is < defend, equip change
+
  001815e4: 2c62000b sltiu r2,r3,0x000b set if action menu is < defend, equip change
  001815e8: 10400044 beq r2,r0,0x 001816fc
+
  001815e8: 10400044 beq r2,r0,0x 001816fc branch if defend or equip change
 
  001815ec: 00031080 sll r2,r3,0x02
 
  001815ec: 00031080 sll r2,r3,0x02
 
  001815f0: 3c018017 lui r1,0x8017
 
  001815f0: 3c018017 lui r1,0x8017
Line 34: Line 36:
 
  00181600: 00400008 jr r2
 
  00181600: 00400008 jr r2
 
  00181604: 00000000 nop
 
  00181604: 00000000 nop
+
Table start: 0x80174144
  00174144: 80181608 lb r24,0x1608(r0) default
+
  80181608 Default
  00174148: 80181640 lb r24,0x1640(r0) item
+
  80181640 Item
  0017414c: 80181658 lb r24,0x1658(r0) weapon inv.
+
  80181658 Throw
  00174150: 80181670 lb r24,0x1670(r0) math skill
+
  80181670 Math Skill
  00174154: 801816b8 lb r24,0x16b8(r0) Elemental
+
  801816b8 Elemental
  00174158: 801816fc lb r24,0x16fc(r0) blank
+
  801816fc Blank
  0017415c: 801816fc lb r24,0x16fc(r0) monster
+
  801816fc Monster
  00174160: 801816cc lb r24,0x16cc(r0) katana inv.
+
  801816cc Draw Out
  00174164: 801816fc lb r24,0x16fc(r0) attack
+
  801816fc Attack
  00174168: 801816fc lb r24,0x16fc(r0) jump
+
  801816fc Jump
  0017416c: 801816e4 lb r24,0x16e4(r0) charge
+
  801816e4 Charge
defend and equip change hardcoded in routine
 
  
 
  Default
 
  Default
 
  00181608: 02002021 addu r4,r16,r0 unit ID
 
  00181608: 02002021 addu r4,r16,r0 unit ID
 
  0018160c: 30a500ff andi r5,r5,0x00ff r5 = skillset
 
  0018160c: 30a500ff andi r5,r5,0x00ff r5 = skillset
  00181610: 27a60078 addiu r6,r29,0x0078
+
  00181610: 27a60078 addiu r6,r29,0x0078 parse stack + 0x78 for Ability IDs
 
  00181614: 27a20118 addiu r2,r29,0x0118
 
  00181614: 27a20118 addiu r2,r29,0x0118
  00181618: afa20010 sw r2,0x0010(r29)
+
  00181618: afa20010 sw r2,0x0010(r29) store stack + 0x118 for Raw Ability CT
 
  0018161c: 27a20130 addiu r2,r29,0x0130
 
  0018161c: 27a20130 addiu r2,r29,0x0130
  00181620: afa2 0018 sw r2,0x 0018(r29)
+
  00181620: afa20018 sw r2,0x 0018(r29) store stack + 0x130 for Silence/performance checks
 
  00181624: 27a20148 addiu r2,r29,0x0148
 
  00181624: 27a20148 addiu r2,r29,0x0148
  00181628: 27a70100 addiu r7,r29,0x0100
+
  00181628: 27a70100 addiu r7,r29,0x0100 parse stack + 0x100 for MP cost
 
  0018162c: afa00014 sw r0,0x0014(r29)
 
  0018162c: afa00014 sw r0,0x0014(r29)
  00181630: 0c0605f0 jal 0x 001817c0 Skillset Loading
+
  00181630: 0c0605f0 jal 0x001817c0 [[Load ability data for skillset]]
  00181634: afa2001c sw r2,0x001c(r29)
+
  00181634: afa2001c sw r2,0x001c(r29) Store stack + 0x148 for #turns to complete
 
  00181638: 080605c1 j 0x 00181704
 
  00181638: 080605c1 j 0x 00181704
 
  0018163c: 00000000 nop
 
  0018163c: 00000000 nop
 +
 +
Default Skillset Stack Structure:
 +
0x78 - 0x98: Ability IDs
 +
0x100 - 0x110: MP cost of abilities
 +
0x118 - 0x128: Raw Ability CT
 +
0x130 - 0x140: Silence/Performance checks
 +
0x148 - 0x158: #Turns to complete
  
 
  Item
 
  Item
 
  00181640: 02002021 addu r4,r16,r0
 
  00181640: 02002021 addu r4,r16,r0
 
  00181644: 30a500ff andi r5,r5,0x00ff
 
  00181644: 30a500ff andi r5,r5,0x00ff
  00181648: 0c0606e5 jal 0x 00181b94
+
  00181648: 0c0606e5 jal 0x00181b94                            [[Item Ability Loading]]
  0018164c: 27a60020 addiu r6,r29,0x0020
+
  0018164c: 27a60020 addiu r6,r29,0x0020 parse Stack + 0x20 (Consumable Items list)
 
  00181650: 080605c1 j 0x 00181704
 
  00181650: 080605c1 j 0x 00181704
 
  00181654: 00000000 nop
 
  00181654: 00000000 nop
 +
 +
Item Skillset Stack Structure:
 +
-0xA0 - -0x80: Ability IDs
 +
-0x78 - -0x68: MP cost per ability
 +
-0x60 - -0x50: Raw Ability CT
 +
-0x48 - -0x38: Silence/performance checks
 +
-0x30 - -0x20: #turns to complete
 +
0x20 - 0x30: List of consumable Items by Ability ID
 +
(I think the negatives in this instance mean ignored, like, forever. Items cannot have a CT, MP cost, nor can they be affected by silence/performance. potentially why it has a subroutine rather than just parsing like default.)
  
 
  Weapon Inventory
 
  Weapon Inventory
 
  00181658: 02002021 addu r4,r16,r0
 
  00181658: 02002021 addu r4,r16,r0
 
  0018165c: 30a500ff andi r5,r5,0x00ff
 
  0018165c: 30a500ff andi r5,r5,0x00ff
  00181660: 0c060737 jal 0x 00181cdc find number of throwable items
+
  00181660: 0c060737 jal 0x00181cdc [[Throw Ability & Item Loading]]
  00181664: 27a60020 addiu r6,r29,0x0020
+
  00181664: 27a60020 addiu r6,r29,0x0020 Stack + 0x20 (Consumable Items list)
 
  00181668: 080605c1 j 0x 00181704 jump to end
 
  00181668: 080605c1 j 0x 00181704 jump to end
  0018166c: 00000000 nop r2 = number of throwable items + 0x100
+
  0018166c: 00000000 nop
 +
 +
Throw Skillset Stack Structure:
 +
0x20 - 0xA0: List of Consumable Items by Item ID
 +
(the negative stack counters are present, in the same struct as Items, but I didn't feel like copy pasting.)
 +
  
 
  Math Skill
 
  Math Skill
 
  00181670: 02002021 addu r4,r16,r0
 
  00181670: 02002021 addu r4,r16,r0
 
  00181674: 30b200ff andi r18,r5,0x00ff
 
  00181674: 30b200ff andi r18,r5,0x00ff
  00181678: 02402821 addu r5,r18,r0
+
  00181678: 02402821 addu r5,r18,r0 preserve skillset ID in r18. and then copy it back into r5 like a dunce.
 
  0018167c: 27b10078 addiu r17,r29,0x0078
 
  0018167c: 27b10078 addiu r17,r29,0x0078
  00181680: 0c0607bc jal 0x 00181ef0
+
  00181680: 0c0607bc jal 0x00181ef0                                    [[Math Skill Ability Display]] Checks for primary menu
  00181684: 02203021 addu r6,r17,r0
+
  00181684: 02203021 addu r6,r17,r0 stack + 0x78 for ability list
  00181688: 1040001e beq r2,r0,0x 00181704
+
  00181688: 1040001e beq r2,r0,0x00181704 Branch if number of valid abilities is 0
 
  0018168c: 02002021 addu r4,r16,r0
 
  0018168c: 02002021 addu r4,r16,r0
 
  00181690: 02402821 addu r5,r18,r0
 
  00181690: 02402821 addu r5,r18,r0
  00181694: 0c0607c5 jal 0x 00181f14
+
  00181694: 0c0607c5 jal 0x00181f14                                    [[Math Skill Ability Display]] Checks for Secondary Menu
  00181698: 02203021 addu r6,r17,r0
+
  00181698: 02203021 addu r6,r17,r0 stack + 0x78 for ability list
  0018169c: 10400019 beq r2,r0,0x 00181704
+
  0018169c: 10400019 beq r2,r0,0x00181704 Branch if number of valid abilities is 0
 
  001816a0: 02002021 addu r4,r16,r0
 
  001816a0: 02002021 addu r4,r16,r0
 
  001816a4: 02402821 addu r5,r18,r0
 
  001816a4: 02402821 addu r5,r18,r0
  001816a8: 0c06081a jal 0x 00182068
+
  001816a8: 0c06081a jal 0x 00182068                                   [[Math Skill ability loading]]
  001816ac: 02203021 addu r6,r17,r0
+
  001816ac: 02203021 addu r6,r17,r0 stack + 0x78 for ability list
 
  001816b0: 080605c1 j 0x 00181704
 
  001816b0: 080605c1 j 0x 00181704
 
  001816b4: 00000000 nop
 
  001816b4: 00000000 nop
 +
 +
Math Skillset Stack Structure:
 +
0x78 - 0x80: (Temporary) Math Menu Abilities
 +
0x78 - 0xB8: Spell List for Math
 +
(Lots more negative stack usage here too.)
  
 
  Elemental
 
  Elemental
 
  001816b8: 02002021 addu r4,r16,r0
 
  001816b8: 02002021 addu r4,r16,r0
  001816bc: 0c060873 jal 0x 001821cc
+
  001816bc: 0c060873 jal 0x 001821cc                                   [[Elemental ability loading]]
  001816c0: 30a500ff andi r5,r5,0x00ff
+
  001816c0: 30a500ff andi r5,r5,0x00ff no stack play here that's used - Elemental doesn't call a menu.
  001816c4: 080605c1 j 0x 00181704
+
  001816c4: 080605c1 j 0x00181704
  001816c8: 3042ffff andi r2,r2,0xffff
+
  001816c8: 3042ffff andi r2,r2,0xffff returns Elemental ability ID
 +
 +
Draw Out
 
  001816cc: 02002021 addu r4,r16,r0
 
  001816cc: 02002021 addu r4,r16,r0
 
  001816d0: 30a500ff andi r5,r5,0x00ff
 
  001816d0: 30a500ff andi r5,r5,0x00ff
  001816d4: 0c0609a2 jal 0x 00182688
+
  001816d4: 0c0609a2 jal 0x00182688                                    [[Draw Out 2 (main routine)]]
  001816d8: 27a60020 addiu r6,r29,0x0020
+
  001816d8: 27a60020 addiu r6,r29,0x0020 stack + 0x20 = Consumable Items list by ability ID
  001816dc: 080605c1 j 0x 00181704
+
  001816dc: 080605c1 j 0x00181704
 
  001816e0: 00000000 nop
 
  001816e0: 00000000 nop
 +
 +
Draw Out Skillset Stack Structure:
 +
0x20 - 0x30: Consumable Items list
 +
(lots of negatives here. all redundant.)
 +
 +
Charge
 
  001816e4: 02002021 addu r4,r16,r0
 
  001816e4: 02002021 addu r4,r16,r0
 
  001816e8: 30a500ff andi r5,r5,0x00ff
 
  001816e8: 30a500ff andi r5,r5,0x00ff
  001816ec: 0c0609e2 jal 0x 00182788
+
  001816ec: 0c0609e2 jal 0x00182788                                    [[Call Charge Skillset Loading]]
  001816f0: 27a60078 addiu r6,r29,0x0078
+
  001816f0: 27a60078 addiu r6,r29,0x0078 Stack + 0x78 for Ability ID list
 
  001816f4: 080605c1 j 0x 00181704
 
  001816f4: 080605c1 j 0x 00181704
 
  001816f8: 00000000 nop
 
  001816f8: 00000000 nop
 +
 +
Charge Skillset Stack Structure:
 +
-0x18 - -0x08: # turns to complete
 +
0x78 - 0x98: Ability IDs
 +
(I noted down Charge's #turns to complete, because it was specifically and oddly placed. also, charge does have a charge time, so it may be of use.)
  
 
  Defend, Equip change, blank, monster, attack, jump
 
  Defend, Equip change, blank, monster, attack, jump
 
  001816fc: 30c200ff andi r2,r6,0x00ff
 
  001816fc: 30c200ff andi r2,r6,0x00ff
  00181700: 2c42000f sltiu r2,r2,0x000f
+
  00181700: 2c42000f sltiu r2,r2,0x000f set if action menu < 0xf (there are 15 skillset types, so this must be an error check IG)
  
 
  00181704: 8fbf016c lw r31,0x016c(r29)
 
  00181704: 8fbf016c lw r31,0x016c(r29)
Line 130: Line 170:
 
  00181718: 03e00008 jr r31
 
  00181718: 03e00008 jr r31
 
  0018171c: 00000000 nop
 
  0018171c: 00000000 nop
 
Ability loading?
 
00181720: 3c038019 lui r3,0x8019
 
00181724: 8c63f51c lw r3,-0x0ae4(r3)
 
00181728: 34020009 ori r2,r0,0x0009
 
0018172c: 14620004 bne r3,r2,0x 00181740 branch if not 0x09
 
00181730: 00004021 addu r8,r0,r0
 
00181734: 10a00002 beq r5,r0,0x 00181740 branch if 0 CT
 
00181738: 00000000 nop
 
0018173c: 24a50001 addiu r5,r5,0x0001 CT + 1
 
00181740: 00052a00 sll r5,r5,0x08 (CT + 1)* 128
 
00181744: 340a001f ori r10,r0,0x001f
 
00181748: 90c30000 lbu r3,0x0000(r6) unit ID?
 
0018174c: 00000000 nop
 
00181750: 30690040 andi r9,r3,0x0040 r9 = short charge check?
 
00181754: 3063001f andi r3,r3,0x001f
 
00181758: 106a0017 beq r3,r10,0x 001817b8
 
0018175c: 340200ff ori r2,r0,0x00ff
 
00181760: 94c70002 lhu r7,0x0002(r6)
 
00181764: 00000000 nop
 
00181768: 00e5102a slt r2,r7,r5 set if ?? < (CT + 1)* 128
 
0018176c: 1440000d bne r2,r0,0x 001817a4
 
00181770: 00000000 nop
 
00181774: 14a70009 bne r5,r7,0x 0018179c
 
00181778: 00000000 nop
 
0018177c: 14830003 bne r4,r3,0x 0018178c
 
00181780: 0064102a slt r2,r3,r4
 
00181784: 15200005 bne r9,r0,0x 0018179c
 
00181788: 00000000 nop
 
0018178c: 10400003 beq r2,r0,0x 0018179c
 
00181790: 00000000 nop
 
00181794: 15200003 bne r9,r0,0x 001817a4
 
00181798: 00000000 nop
 
0018179c: 080605ee j 0x 001817b8
 
001817a0: 310200ff andi r2,r8,0x00ff return counter
 
001817a4: 25080001 addiu r8,r8,0x0001 counter++
 
001817a8: 29020028 slti r2,r8,0x0028 limit = 0x28
 
001817ac: 1440ffe6 bne r2,r0,0x 00181748
 
001817b0: 24c60004 addiu r6,r6,0x0004 stack++
 
001817b4: 340200ff ori r2,r0,0x00ff
 
001817b8: 03e00008 jr r31
 
001817bc: 00000000 nop
 

Latest revision as of 03:21, 14 September 2024

Runs when "act" is selected

Skillset Loading?
r6 = action menu byte
00181584: 27bdfe90 addiu r29,r29,0xfe90			stack - 170 (lorge, to make space for ability data)
00181588: afb00160 sw r16,0x0160(r29)
0018158c: 00808021 addu r16,r4,r0				unit ID
00181590: 001010c0 sll r2,r16,0x03
00181594: 00501023 subu r2,r2,r16
00181598: 00021180 sll r2,r2,0x06
0018159c: afbf016c sw r31,0x016c(r29)
001815a0: afb20168 sw r18,0x0168(r29)
001815a4: afb10164 sw r17,0x0164(r29)
001815a8: 3c018019 lui r1,0x8019
001815ac: 00220821 addu r1,r1,r2
001815b0: 90220926 lbu r2,0x0926(r1)			load current status 3
001815b4: 00000000 nop
001815b8: 30420002 andi r2,r2,0x0002
001815bc: 10400009 beq r2,r0,0x 001815e4			branch if not frog
001815c0: 30c300ff andi r3,r6,0x00ff			r3 = action menu byte
001815c4: 10600007 beq r3,r0,0x 001815e4			branch if default
001815c8: 34020006 ori r2,r0,0x0006
001815cc: 10620005 beq r3,r2,0x 001815e4			branch if monster
001815d0: 34020008 ori r2,r0,0x0008
001815d4: 10620003 beq r3,r2,0x 001815e4			branch if attack
001815d8: 34020005 ori r2,r0,0x0005
001815dc: 14620049 bne r3,r2,0x 00181704			branch if not blank (frogs can't use any other skillsets dummy!)
001815e0: 00001021 addu r2,r0,r0
001815e4: 2c62000b sltiu r2,r3,0x000b			set if action menu is < defend, equip change
001815e8: 10400044 beq r2,r0,0x 001816fc			branch if defend or equip change
001815ec: 00031080 sll r2,r3,0x02
001815f0: 3c018017 lui r1,0x8017
001815f4: 00220821 addu r1,r1,r2
001815f8: 8c224144 lw r2,0x4144(r1)				
001815fc: 00000000 nop
00181600: 00400008 jr r2
00181604: 00000000 nop
				Table start: 0x80174144
					80181608	Default
					80181640	Item
					80181658	Throw
					80181670	Math Skill
					801816b8	Elemental
					801816fc	Blank
					801816fc	Monster
					801816cc	Draw Out
					801816fc	Attack
					801816fc	Jump
					801816e4	Charge
Default
00181608: 02002021 addu r4,r16,r0				unit ID
0018160c: 30a500ff andi r5,r5,0x00ff			r5 = skillset
00181610: 27a60078 addiu r6,r29,0x0078			parse stack + 0x78 for Ability IDs
00181614: 27a20118 addiu r2,r29,0x0118
00181618: afa20010 sw r2,0x0010(r29)			store stack + 0x118 for Raw Ability CT
0018161c: 27a20130 addiu r2,r29,0x0130
00181620: afa20018 sw r2,0x 0018(r29)			store stack + 0x130 for Silence/performance checks
00181624: 27a20148 addiu r2,r29,0x0148
00181628: 27a70100 addiu r7,r29,0x0100			parse stack + 0x100 for MP cost
0018162c: afa00014 sw r0,0x0014(r29)
00181630: 0c0605f0 jal 0x001817c0				Load ability data for skillset
00181634: afa2001c sw r2,0x001c(r29)			Store stack + 0x148 for #turns to complete
00181638: 080605c1 j 0x 00181704
0018163c: 00000000 nop

Default Skillset Stack Structure:
	0x78 - 0x98: Ability IDs
	0x100 - 0x110: MP cost of abilities
	0x118 - 0x128: Raw Ability CT
	0x130 - 0x140: Silence/Performance checks
	0x148 - 0x158: #Turns to complete
Item
00181640: 02002021 addu r4,r16,r0
00181644: 30a500ff andi r5,r5,0x00ff
00181648: 0c0606e5 jal 0x00181b94                             Item Ability Loading
0018164c: 27a60020 addiu r6,r29,0x0020			parse Stack + 0x20 (Consumable Items list)
00181650: 080605c1 j 0x 00181704
00181654: 00000000 nop

Item Skillset Stack Structure:
	-0xA0 - -0x80: Ability IDs
	-0x78 - -0x68: MP cost per ability
	-0x60 - -0x50: Raw Ability CT
	-0x48 - -0x38: Silence/performance checks
	-0x30 - -0x20: #turns to complete
	0x20 - 0x30: List of consumable Items by Ability ID
(I think the negatives in this instance mean ignored, like, forever. Items cannot have a CT, MP cost, nor can they be affected by silence/performance. potentially why it has a subroutine rather than just parsing like default.)
Weapon Inventory
00181658: 02002021 addu r4,r16,r0
0018165c: 30a500ff andi r5,r5,0x00ff
00181660: 0c060737 jal 0x00181cdc				Throw Ability & Item Loading
00181664: 27a60020 addiu r6,r29,0x0020			Stack + 0x20 (Consumable Items list)
00181668: 080605c1 j 0x 00181704					jump to end
0018166c: 00000000 nop

Throw Skillset Stack Structure:
	0x20 - 0xA0: List of Consumable Items by Item ID
(the negative stack counters are present, in the same struct as Items, but I didn't feel like copy pasting.)

Math Skill
00181670: 02002021 addu r4,r16,r0
00181674: 30b200ff andi r18,r5,0x00ff
00181678: 02402821 addu r5,r18,r0			preserve skillset ID in r18. and then copy it back into r5 like a dunce.
0018167c: 27b10078 addiu r17,r29,0x0078
00181680: 0c0607bc jal 0x00181ef0                                    Math Skill Ability Display Checks for primary menu
00181684: 02203021 addu r6,r17,r0			stack + 0x78 for ability list
00181688: 1040001e beq r2,r0,0x00181704			Branch if number of valid abilities is 0
0018168c: 02002021 addu r4,r16,r0
00181690: 02402821 addu r5,r18,r0
00181694: 0c0607c5 jal 0x00181f14                                    Math Skill Ability Display Checks for Secondary Menu
00181698: 02203021 addu r6,r17,r0			stack + 0x78 for ability list
0018169c: 10400019 beq r2,r0,0x00181704			Branch if number of valid abilities is 0
001816a0: 02002021 addu r4,r16,r0
001816a4: 02402821 addu r5,r18,r0
001816a8: 0c06081a jal 0x 00182068                                    Math Skill ability loading
001816ac: 02203021 addu r6,r17,r0			stack + 0x78 for ability list
001816b0: 080605c1 j 0x 00181704
001816b4: 00000000 nop

Math Skillset Stack Structure:
	0x78 - 0x80: (Temporary) Math Menu Abilities
	0x78 - 0xB8: Spell List for Math
(Lots more negative stack usage here too.)
Elemental
001816b8: 02002021 addu r4,r16,r0
001816bc: 0c060873 jal 0x 001821cc                                    Elemental ability loading
001816c0: 30a500ff andi r5,r5,0x00ff			no stack play here that's used - Elemental doesn't call a menu.
001816c4: 080605c1 j 0x00181704
001816c8: 3042ffff andi r2,r2,0xffff			returns Elemental ability ID

Draw Out
001816cc: 02002021 addu r4,r16,r0
001816d0: 30a500ff andi r5,r5,0x00ff
001816d4: 0c0609a2 jal 0x00182688                                     Draw Out 2 (main routine)
001816d8: 27a60020 addiu r6,r29,0x0020			stack + 0x20 = Consumable Items list by ability ID
001816dc: 080605c1 j 0x00181704
001816e0: 00000000 nop

Draw Out Skillset Stack Structure:
	0x20 - 0x30: Consumable Items list
(lots of negatives here. all redundant.)
Charge
001816e4: 02002021 addu r4,r16,r0
001816e8: 30a500ff andi r5,r5,0x00ff
001816ec: 0c0609e2 jal 0x00182788                                    Call Charge Skillset Loading
001816f0: 27a60078 addiu r6,r29,0x0078				Stack + 0x78 for Ability ID list
001816f4: 080605c1 j 0x 00181704
001816f8: 00000000 nop

Charge Skillset Stack Structure:
	-0x18 - -0x08: # turns to complete
	0x78 - 0x98: Ability IDs
(I noted down Charge's #turns to complete, because it was specifically and oddly placed. also, charge does have a charge time, so it may be of use.)
Defend, Equip change, blank, monster, attack, jump
001816fc: 30c200ff andi r2,r6,0x00ff
00181700: 2c42000f sltiu r2,r2,0x000f				set if action menu < 0xf (there are 15 skillset types, so this must be an error check IG)
00181704: 8fbf016c lw r31,0x016c(r29)
00181708: 8fb20168 lw r18,0x0168(r29)
0018170c: 8fb10164 lw r17,0x0164(r29)
00181710: 8fb00160 lw r16,0x0160(r29)
00181714: 27bd0170 addiu r29,r29,0x0170
00181718: 03e00008 jr r31
0018171c: 00000000 nop