Difference between revisions of "Draw Out"

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

Latest revision as of 01:14, 19 February 2022

draw out?
 00182664: 27bdffe8 addiu r29,r29,0xffe8
 00182668: afbf0010 sw r31,0x0010(r29)
 0018266c: 0c0609a2 jal 0x00182688				just jump to Draw Out 2 (main routine)
 00182670: 30a500ff andi r5,r5,0x00ff				redundant
 00182674: 304200ff andi r2,r2,0x00ff				redundant
 00182678: 8fbf0010 lw r31,0x0010(r29)
 0018267c: 27bd0018 addiu r29,r29,0x0018
 00182680: 03e00008 jr r31
 00182684: 00000000 nop

Draw out 2
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