Difference between revisions of "Draw Out 2 (main routine)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
 
Line 6: Line 6:
 
   
 
   
 
  00182688: 27bdff68 addiu r29,r29,0xff68
 
  00182688: 27bdff68 addiu r29,r29,0xff68
  0018268c: afb3008c sw r19,0x008c(r29) Store 0x0 onto Stack
+
  0018268c: afb3008c sw r19,0x008c(r29)
  00182690: 00809821 addu r19,r4,r0
+
  00182690: 00809821 addu r19,r4,r0 r19 = Unit Battle ID
  00182694: afb00080 sw r16,0x0080(r29) Store 0x0 onto Stack
+
  00182694: afb00080 sw r16,0x0080(r29)
  00182698: 00c08021 addu r16,r6,r0
+
  00182698: 00c08021 addu r16,r6,r0 r16 = Consumed Items List
  0018269c: afb20088 sw r18,0x0088(r29) Store 0x0 onto Stack
+
  0018269c: afb20088 sw r18,0x0088(r29)
  001826a0: 00009021 addu r18,r0,r0
+
  001826a0: 00009021 addu r18,r0,r0 r18 = 0
  001826a4: afb10084 sw r17,0x0084(r29) Store 0x0 onto Stack
+
  001826a4: afb10084 sw r17,0x0084(r29)
  001826a8: afbf0090 sw r31,0x0090(r29) Store 0x0 onto Stack
+
  001826a8: afbf0090 sw r31,0x0090(r29)
 
  001826ac: 0c060435 jal 0x001810d4 [[Load unit Data]]
 
  001826ac: 0c060435 jal 0x001810d4 [[Load unit Data]]
  001826b0: 00a08821 addu r17,r5,r0
+
  001826b0: 00a08821 addu r17,r5,r0 skillset ID in r17
  001826b4: 14400003 bne r2,r0,0x001826c4 Branch if 0x0 != 0x0
+
  001826b4: 14400003 bne r2,r0,0x001826c4 Branch if unit doesn't exist
  001826b8: 322300ff andi r3,r17,0x00ff Mask second byte
+
  001826b8: 322300ff andi r3,r17,0x00ff r3 = skillset ID
 
  001826bc: 080609da j 0x00182768
 
  001826bc: 080609da j 0x00182768
  001826c0: 00001021 addu r2,r0,r0
+
  001826c0: 00001021 addu r2,r0,r0 return 0 consumable Items in list
  001826c4: 34020013 ori r2,r0,0x0013 r2 = (0x13) 19
+
  001826c4: 34020013 ori r2,r0,0x0013 r2 = 0x13
  001826c8: 14620010 bne r3,r2,0x0018270c Branch if 0x0 != 13 (19)
+
  001826c8: 14620010 bne r3,r2,0x0018270c Branch if skillset ID != Draw Out
  001826cc: 340200ff ori r2,r0,0x00ff r2 = (0xFF) 255
+
  001826cc: 340200ff ori r2,r0,0x00ff End Draw Out List
  001826d0: 02602021 addu r4,r19,r0
+
  001826d0: 02602021 addu r4,r19,r0 Unit Battle ID
 
  001826d4: 27a20060 addiu r2,r29,0x0060
 
  001826d4: 27a20060 addiu r2,r29,0x0060
  001826d8: afa20010 sw r2,0x0010(r29) Store 0x60 onto Stack
+
  001826d8: afa20010 sw r2,0x0010(r29) stack + 0x60 for Raw Ability CT
 
  001826dc: 27a20050 addiu r2,r29,0x0050
 
  001826dc: 27a20050 addiu r2,r29,0x0050
  001826e0: afa20018 sw r2,0x0018(r29) Store 0x50 onto Stack
+
  001826e0: afa20018 sw r2,0x0018(r29) stack + 0x50 for Silence/performance checks
 
  001826e4: 27a20070 addiu r2,r29,0x0070
 
  001826e4: 27a20070 addiu r2,r29,0x0070
  001826e8: 34050013 ori r5,r0,0x0013 r5 = (0x13) 19
+
  001826e8: 34050013 ori r5,r0,0x0013 r5 = Draw Out
  001826ec: 27a60020 addiu r6,r29,0x0020
+
  001826ec: 27a60020 addiu r6,r29,0x0020 parse Stack + 0x20 for ability ID
  001826f0: 27a70040 addiu r7,r29,0x0040
+
  001826f0: 27a70040 addiu r7,r29,0x0040 parse stack + 0x48 for MP cost
  001826f4: afa00014 sw r0,0x0014(r29) Store 0x0 onto Stack
+
  001826f4: afa00014 sw r0,0x0014(r29)
 
  001826f8: 0c0605f0 jal 0x001817c0 [[Load ability data for skillset]]
 
  001826f8: 0c0605f0 jal 0x001817c0 [[Load ability data for skillset]]
  001826fc: afa2001c sw r2,0x001c(r29) Store 0x70 onto Stack
+
  001826fc: afa2001c sw r2,0x001c(r29) stack + 0x70 for #turns to complete action
 
  00182700: 00403021 addu r6,r2,r0
 
  00182700: 00403021 addu r6,r2,r0
  00182704: 14c00004 bne r6,r0,0x00182718 Branch if 0x70 != 0x0
+
  00182704: 14c00004 bne r6,r0,0x00182718 branch if # abilities is not 0
  00182708: 340200ff ori r2,r0,0x00ff r2 = (0xFF) 255
+
  00182708: 340200ff ori r2,r0,0x00ff
  0018270c: a2020000 sb r2,0x0000(r16) Store FF (255) into 0x0
+
  0018270c: a2020000 sb r2,0x0000(r16) finish Item list
 
  00182710: 080609da j 0x00182768
 
  00182710: 080609da j 0x00182768
  00182714: 00001021 addu r2,r0,r0
+
  00182714: 00001021 addu r2,r0,r0 return no valid menu Items
  00182718: 0246102a slt r2,r18,r6 Set if 0 < 0x70
+
  00182718: 0246102a slt r2,r18,r6 Set if 0 < number of abilities
  0018271c: 1040000f beq r2,r0,0x0018275c Branch if not
+
  0018271c: 1040000f beq r2,r0,0x0018275c Branch if negative abilities (sure)
  00182720: 00002821 addu r5,r0,r0
+
  00182720: 00002821 addu r5,r0,r0 counter = 0
 
  00182724: 27a40020 addiu r4,r29,0x0020
 
  00182724: 27a40020 addiu r4,r29,0x0020
  00182728: 94830000 lhu r3,0x0000(r4) Load ???
+
  00182728: 94830000 lhu r3,0x0000(r4) Load Ability ID
 
  0018272c: 00000000 nop
 
  0018272c: 00000000 nop
  00182730: 2c620170 sltiu r2,r3,0x0170 Set if < 368
+
  00182730: 2c620170 sltiu r2,r3,0x0170 Set if ID < potion
 
  00182734: 10400005 beq r2,r0,0x0018274c Branch if not
 
  00182734: 10400005 beq r2,r0,0x0018274c Branch if not
  00182738: 24840002 addiu r4,r4,0x0002
+
  00182738: 24840002 addiu r4,r4,0x0002 next Ability ID
  0018273c: 2462ffda addiu r2,r3,0xffda
+
  0018273c: 2462ffda addiu r2,r3,0xffda Ability ID - 0x26
  00182740: a2020000 sb r2,0x0000(r16) Store -0x26 into 0x0
+
  00182740: a2020000 sb r2,0x0000(r16) Store Draw Out weapon in Consumed Items list
 
  00182744: 26100001 addiu r16,r16,0x0001
 
  00182744: 26100001 addiu r16,r16,0x0001
 
  00182748: 26520001 addiu r18,r18,0x0001
 
  00182748: 26520001 addiu r18,r18,0x0001
 
  0018274c: 24a50001 addiu r5,r5,0x0001
 
  0018274c: 24a50001 addiu r5,r5,0x0001
  00182750: 00a6102a slt r2,r5,r6 Set if 0x1 < 0x70
+
  00182750: 00a6102a slt r2,r5,r6
  00182754: 1440fff4 bne r2,r0,0x00182728 Branch if so
+
  00182754: 1440fff4 bne r2,r0,0x00182728 Loop until all Abilities have been checked
 
  00182758: 00000000 nop
 
  00182758: 00000000 nop
  0018275c: 340200ff ori r2,r0,0x00ff r2 = (0xFF) 255
+
  0018275c: 340200ff ori r2,r0,0x00ff r2 = end item list
  00182760: a2020000 sb r2,0x0000(r16) Store FF (255) into 0x1
+
  00182760: a2020000 sb r2,0x0000(r16) finish item list
 
  00182764: 26420100 addiu r2,r18,0x0100
 
  00182764: 26420100 addiu r2,r18,0x0100
  00182768: 8fbf0090 lw r31,0x0090(r29) Load Stack + 0x90
+
  00182768: 8fbf0090 lw r31,0x0090(r29)
  0018276c: 8fb3008c lw r19,0x008c(r29) Load Stack + 0x8C
+
  0018276c: 8fb3008c lw r19,0x008c(r29)
  00182770: 8fb20088 lw r18,0x0088(r29) Load Stack + 0x88
+
  00182770: 8fb20088 lw r18,0x0088(r29)
  00182774: 8fb10084 lw r17,0x0084(r29) Load Stack + 0x84
+
  00182774: 8fb10084 lw r17,0x0084(r29)
  00182778: 8fb00080 lw r16,0x0080(r29) Load Stack + 0x80
+
  00182778: 8fb00080 lw r16,0x0080(r29)
 
  0018277c: 27bd0098 addiu r29,r29,0x0098
 
  0018277c: 27bd0098 addiu r29,r29,0x0098
  00182780: 03e00008 jr r31 Jump to Address
+
  00182780: 03e00008 jr r31
 
  00182784: 00000000 nop
 
  00182784: 00000000 nop
 
   
 
   
 
   
 
   
 
  </font>
 
  </font>

Latest revision as of 11:51, 18 February 2022

Draw Out 2 (main routine) 182688: 00182688 - 00182784

	001810d4: Load unit Data
	001817c0: Load ability data for skillset

00182688: 27bdff68 addiu r29,r29,0xff68			
0018268c: afb3008c sw r19,0x008c(r29)			
00182690: 00809821 addu r19,r4,r0			r19 = Unit Battle ID
00182694: afb00080 sw r16,0x0080(r29)			
00182698: 00c08021 addu r16,r6,r0			r16 = Consumed Items List
0018269c: afb20088 sw r18,0x0088(r29)			
001826a0: 00009021 addu r18,r0,r0			r18 = 0
001826a4: afb10084 sw r17,0x0084(r29)			
001826a8: afbf0090 sw r31,0x0090(r29)			
001826ac: 0c060435 jal 0x001810d4			Load unit Data
001826b0: 00a08821 addu r17,r5,r0			skillset ID in r17
001826b4: 14400003 bne r2,r0,0x001826c4			Branch if unit doesn't exist
001826b8: 322300ff andi r3,r17,0x00ff			r3 = skillset ID
001826bc: 080609da j 0x00182768			
001826c0: 00001021 addu r2,r0,r0			return 0 consumable Items in list
001826c4: 34020013 ori r2,r0,0x0013			r2 = 0x13
001826c8: 14620010 bne r3,r2,0x0018270c			Branch if skillset ID != Draw Out
001826cc: 340200ff ori r2,r0,0x00ff			End Draw Out List
001826d0: 02602021 addu r4,r19,r0			Unit Battle ID
001826d4: 27a20060 addiu r2,r29,0x0060
001826d8: afa20010 sw r2,0x0010(r29)			stack + 0x60 for Raw Ability CT
001826dc: 27a20050 addiu r2,r29,0x0050
001826e0: afa20018 sw r2,0x0018(r29)			stack + 0x50 for Silence/performance checks
001826e4: 27a20070 addiu r2,r29,0x0070
001826e8: 34050013 ori r5,r0,0x0013			r5 = Draw Out
001826ec: 27a60020 addiu r6,r29,0x0020			parse Stack + 0x20 for ability ID
001826f0: 27a70040 addiu r7,r29,0x0040			parse stack + 0x48 for MP cost
001826f4: afa00014 sw r0,0x0014(r29)			
001826f8: 0c0605f0 jal 0x001817c0			Load ability data for skillset
001826fc: afa2001c sw r2,0x001c(r29)			stack + 0x70 for #turns to complete action
00182700: 00403021 addu r6,r2,r0
00182704: 14c00004 bne r6,r0,0x00182718			branch if # abilities is not 0
00182708: 340200ff ori r2,r0,0x00ff			
0018270c: a2020000 sb r2,0x0000(r16)			finish Item list
00182710: 080609da j 0x00182768			
00182714: 00001021 addu r2,r0,r0			return no valid menu Items
00182718: 0246102a slt r2,r18,r6			Set if 0 < number of abilities
0018271c: 1040000f beq r2,r0,0x0018275c			Branch if negative abilities (sure)
00182720: 00002821 addu r5,r0,r0			counter = 0
00182724: 27a40020 addiu r4,r29,0x0020
00182728: 94830000 lhu r3,0x0000(r4)			Load Ability ID
0018272c: 00000000 nop
00182730: 2c620170 sltiu r2,r3,0x0170			Set if ID < potion
00182734: 10400005 beq r2,r0,0x0018274c			Branch if not
00182738: 24840002 addiu r4,r4,0x0002			next Ability ID
0018273c: 2462ffda addiu r2,r3,0xffda			Ability ID - 0x26
00182740: a2020000 sb r2,0x0000(r16)			Store Draw Out weapon in Consumed Items list
00182744: 26100001 addiu r16,r16,0x0001
00182748: 26520001 addiu r18,r18,0x0001
0018274c: 24a50001 addiu r5,r5,0x0001
00182750: 00a6102a slt r2,r5,r6			
00182754: 1440fff4 bne r2,r0,0x00182728			Loop until all Abilities have been checked
00182758: 00000000 nop
0018275c: 340200ff ori r2,r0,0x00ff			r2 = end item list
00182760: a2020000 sb r2,0x0000(r16)			finish item list
00182764: 26420100 addiu r2,r18,0x0100
00182768: 8fbf0090 lw r31,0x0090(r29)			
0018276c: 8fb3008c lw r19,0x008c(r29)			
00182770: 8fb20088 lw r18,0x0088(r29)			
00182774: 8fb10084 lw r17,0x0084(r29)			
00182778: 8fb00080 lw r16,0x0080(r29)			
0018277c: 27bd0098 addiu r29,r29,0x0098			
00182780: 03e00008 jr r31			
00182784: 00000000 nop