Difference between revisions of "Draw out routine dealing with experience gain"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0017d410: 9082016f lbu r2,0x016f(r4) 0017d414: 3c018006 lui r1,0x8006 0017d418: 00220821 addu r1,r1,r2 0017d41c: 90235cb4 lbu r3,0x5cb4(r1) lo...")
 
 
Line 1: Line 1:
<font face='Courier New'>
+
'''Parameters''' : r4 = Attacker data pointer
 +
              r5 = Attacker misc data 0x18c pointer
 +
              r6 = Number of hitted units
 
   
 
   
  0017d410: 9082016f lbu r2,0x016f(r4)
+
Do some post-action stuff related to katana inventory usage
  0017d414: 3c018006 lui r1,0x8006
+
- If katana do not break (special flag 1 = 0x08 or Targeted units = 0x00)
  0017d418: 00220821 addu r1,r1,r2
+
      --> Overrides all Attacker current action specials flags with 0x0008
  0017d41c: 90235cb4 lbu r3,0x5cb4(r1) load action menu byte
+
      --> Set Attacker current action hit flag = 0x01 (hit)
  0017d420: 34020007 ori r2,r0,0x0007
+
      --> Set Attacker current action type = 0x01 (pseudo status change) 
  0017d424: 1462001c bne r3,r2,0x0017d498 branch if not katana inventory
+
- Else seems to do nothing (...)
  0017d428: 3402005d ori r2,r0,0x005d
+
Note : Attacker current action evade type is set to 0x08 in break chance routine (might be changed later ?)
  0017d42c: 90830003 lbu r3,0x0003(r4) load job ID
+
------------------------------------------------------------------------------------------------------------------------
  0017d430: 00000000 nop
+
  0017d410: 9082016f lbu r2,0x016f(r4)       |{{f/load|<nowiki>r4 = Attacker last used skillset</nowiki>}}
  0017d434: 10620018 beq r3,r2,0x0017d498 branch if job = mime, r2= ??
+
  0017d414: 3c018006 lui r1,0x8006           |
  0017d438: 30c200ff andi r2,r6,0x00ff r2 = hit counter
+
  0017d418: 00220821 addu r1,r1,r2           |{{f/std|<nowiki>r1 = 0x80060000 + Skillset ID</nowiki>}}
  0017d43c: 10400007 beq r2,r0,0x0017d45c branch if nobody hit
+
  0017d41c: 90235cb4 lbu r3,0x5cb4(r1)       |{{f/load|<nowiki>r3 = Attacker used action menu ( 0x80065cb4 + skillset ID)</nowiki>}}
  0017d440: 34020008 ori r2,r0,0x0008
+
  0017d420: 34020007 ori r2,r0,0x0007         |{{f/std|<nowiki>r2 = 0x07 (katana inventory ID)</nowiki>}}
  0017d444: 3c038019 lui r3,0x8019
+
  0017d424: 1462001c bne r3,r2,0x0017d498     {{f/Cond|<nowiki>If used action menu is katana inventory</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}}
  0017d448: 94632db0 lhu r3,0x2db0(r3) load special flags 1 and 2
+
  0017d428: 3402005d ori r2,r0,0x005d             |{{f/std|<nowiki>r2 = 0x5d (Mime job ID)</nowiki>}}
  0017d44c: 00000000 nop
+
  0017d42c: 90830003 lbu r3,0x0003(r4)             |{{f/load|<nowiki>r3 = Attacker job ID</nowiki>}}
  0017d450: 30620008 andi r2,r3,0x0008
+
  0017d430: 00000000 nop                           |
  0017d454: 1040000a beq r2,r0,0x0017d480 branch if special flag 0x08 not true
+
  0017d434: 10620018 beq r3,r2,0x0017d498         {{f/Cond|<nowiki>If Attacker job is NOT mime</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}}
  0017d458: 34020008 ori r2,r0,0x0008
+
  0017d438: 30c200ff andi r2,r6,0x00ff                 |{{f/std|<nowiki>r2 = Number of hitted target</nowiki>}}
  0017d45c: 3c018019 lui r1,0x8019
+
  0017d43c: 10400007 beq r2,r0,0x0017d45c             {{f/Cond|<nowiki>If Number of hitted unit > 0x00</nowiki>}}
  0017d460: a4222db0 sh r2,0x2db0(r1) store special flag 0x08
+
  0017d440: 34020008 ori r2,r0,0x0008                 |{{f/std|<nowiki>r2 = 0x08</nowiki>}}
  0017d464: 34020001 ori r2,r0,0x0001
+
  0017d444: 3c038019 lui r3,0x8019                         |{{f/std|<nowiki> </nowiki>}}
  0017d468: 3c018019 lui r1,0x8019
+
  0017d448: 94632db0 lhu r3,0x2db0(r3)                     |{{f/load|<nowiki>r3 = Attacker current action specials flags 1 and 2</nowiki>}} {{f/std|<nowiki>from 0x80192da0 + 0x10 (copy of attacker data)</nowiki>}}
  0017d46c: a0222dc5 sb r2,0x2dc5(r1) Store attack type = psuedo status change
+
  0017d44c: 00000000 nop                                   |
  0017d470: 3c018019 lui r1,0x8019
+
  0017d450: 30620008 andi r2,r3,0x0008                     |{{f/std|<nowiki>r2 = 0x0008 if Special flag 1 0x08 is enabled (stole item ?)</nowiki>}}
  0017d474: a0222da0 sb r2,0x2da0(r1) Store attack hit
+
  0017d454: 1040000a beq r2,r0,0x0017d480                 {{f/Cond|<nowiki>If Katana do not break</nowiki>}} /Else branch to broke section
  0017d478: 0805f526 j 0x0017d498 jump to end
+
  0017d458: 34020008 ori r2,r0,0x0008                         |{{f/std|<nowiki>r2 = 0x08</nowiki>}}
  0017d47c: 00000000 nop
+
  0017d45c: 3c018019 lui r1,0x8019                     {{f/Cond|<nowiki>E</nowiki>}}      |{{f/std|<nowiki>r1 = 0x80190000</nowiki>}}
  0017d480: 30621000 andi r2,r3,0x1000 load -1 level flag?
+
  0017d460: a4222db0 sh r2,0x2db0(r1)                         |{{f/store|<nowiki>Overrides all special flags with SF 1 = 0x08 and SF2 = 0x00</nowiki>}} {{f/std|<nowiki> 0x80192bd0</nowiki>}}
  0017d484: 10400004 beq r2,r0,0x0017d498 branch if not
+
  0017d464: 34020001 ori r2,r0,0x0001                         |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  0017d488: 00000000 nop
+
  0017d468: 3c018019 lui r1,0x8019                             |{{f/std|<nowiki>r1 = 0x80190000</nowiki>}}
  0017d48c: 90a20023 lbu r2,0x0023(r5) load can gain experience
+
  0017d46c: a0222dc5 sb r2,0x2dc5(r1)                         |{{f/store|<nowiki>Store 0x01 As Attacker current action attack type (pseudo status change)</nowiki>}} {{f/std|<nowiki>Overrides everything else</nowiki>}}
  0017d490: 00000000 nop
+
  0017d470: 3c018019 lui r1,0x8019                             |
  0017d494: a0a20023 sb r2,0x0023(r5) store can gain experience?
+
  0017d474: a0222da0 sb r2,0x2da0(r1)                         |{{f/store|<nowiki>Store ACA hit flag = 0x01 (hit)</nowiki>}}
  0017d498: 03e00008 jr r31
+
  0017d478: 0805f526 j 0x0017d498                             {{f/jump|<nowiki>Jump to </nowiki>{{f/loc|<nowiki>END</nowiki>}}<nowiki></nowiki>}}
 +
  0017d47c: 00000000 nop                                       |
 +
  0017d480: 30621000 andi r2,r3,0x1000                     {{f/Cond|<nowiki>Else </nowiki>}} {{f/std|<nowiki>r2 = 0x1000 if Special flag 2 0x10 is present</nowiki>}} {{f/std|<nowiki>Special flag 1 0x08 not present</nowiki>}}
 +
  0017d484: 10400004 beq r2,r0,0x0017d498                 {{f/Cond|<nowiki>If Special flag 2 0x10 is present</nowiki>}} /Else branch to {{f/loc|<nowiki>END</nowiki>}}
 +
  0017d488: 00000000 nop                                       |{{f/std|<nowiki> </nowiki>}}
 +
  0017d48c: 90a20023 lbu r2,0x0023(r5)                         |{{f/load|<nowiki>r2 = Attacker misc data 0x1af</nowiki>}}
 +
  0017d490: 00000000 nop                                       |
 +
  0017d494: a0a20023 sb r2,0x0023(r5)                         |{{f/store|<nowiki>Store the data back unchanged ???</nowiki>}}
 +
  0017d498: 03e00008 jr r31                                      
 
  0017d49c: 00000000 nop
 
  0017d49c: 00000000 nop
</font>
+
=== Return locations ===
 +
'''Battle.bin'''
 +
0017d128: [[Main_ability_loading_routine%3F]]

Latest revision as of 22:02, 17 February 2022

Parameters : r4 = Attacker data pointer
             r5 = Attacker misc data 0x18c pointer
             r6 = Number of hitted units

Do some post-action stuff related to katana inventory usage
- If katana do not break (special flag 1 = 0x08 or Targeted units = 0x00)
     --> Overrides all Attacker current action specials flags with 0x0008
     --> Set Attacker current action hit flag = 0x01 (hit) 
     --> Set Attacker current action type = 0x01 (pseudo status change)  
- Else seems to do nothing (...)
Note : Attacker current action evade type is set to 0x08 in break chance routine (might be changed later ?)
------------------------------------------------------------------------------------------------------------------------
0017d410: 9082016f lbu r2,0x016f(r4)        |r4 = Attacker last used skillset
0017d414: 3c018006 lui r1,0x8006            |
0017d418: 00220821 addu r1,r1,r2            |r1 = 0x80060000 + Skillset ID
0017d41c: 90235cb4 lbu r3,0x5cb4(r1)        |r3 = Attacker used action menu ( 0x80065cb4 + skillset ID)
0017d420: 34020007 ori r2,r0,0x0007         |r2 = 0x07 (katana inventory ID)
0017d424: 1462001c bne r3,r2,0x0017d498     #If used action menu is katana inventory /Else branch to END
0017d428: 3402005d ori r2,r0,0x005d              |r2 = 0x5d (Mime job ID)
0017d42c: 90830003 lbu r3,0x0003(r4)             |r3 = Attacker job ID
0017d430: 00000000 nop                           |
0017d434: 10620018 beq r3,r2,0x0017d498          #If Attacker job is NOT mime /Else branch to END
0017d438: 30c200ff andi r2,r6,0x00ff                 |r2 = Number of hitted target
0017d43c: 10400007 beq r2,r0,0x0017d45c              #If Number of hitted unit > 0x00
0017d440: 34020008 ori r2,r0,0x0008                  |r2 = 0x08
0017d444: 3c038019 lui r3,0x8019                         | 
0017d448: 94632db0 lhu r3,0x2db0(r3)                     |r3 = Attacker current action specials flags 1 and 2 from 0x80192da0 + 0x10 (copy of attacker data)
0017d44c: 00000000 nop                                   |
0017d450: 30620008 andi r2,r3,0x0008                     |r2 = 0x0008 if Special flag 1 0x08 is enabled (stole item ?)
0017d454: 1040000a beq r2,r0,0x0017d480                  #If Katana do not break /Else branch to broke section
0017d458: 34020008 ori r2,r0,0x0008                          |r2 = 0x08
0017d45c: 3c018019 lui r1,0x8019                     #E      |r1 = 0x80190000
0017d460: a4222db0 sh r2,0x2db0(r1)                          |Overrides all special flags with SF 1 = 0x08 and SF2 = 0x00  0x80192bd0
0017d464: 34020001 ori r2,r0,0x0001                          |r2 = 0x01
0017d468: 3c018019 lui r1,0x8019                             |r1 = 0x80190000
0017d46c: a0222dc5 sb r2,0x2dc5(r1)                          |Store 0x01 As Attacker current action attack type (pseudo status change) Overrides everything else
0017d470: 3c018019 lui r1,0x8019                             |
0017d474: a0222da0 sb r2,0x2da0(r1)                          |Store ACA hit flag = 0x01 (hit)
0017d478: 0805f526 j 0x0017d498                              >>Jump to END
0017d47c: 00000000 nop                                       |
0017d480: 30621000 andi r2,r3,0x1000                     #Else  r2 = 0x1000 if Special flag 2 0x10 is present Special flag 1 0x08 not present
0017d484: 10400004 beq r2,r0,0x0017d498                  #If Special flag 2 0x10 is present /Else branch to END
0017d488: 00000000 nop                                       | 
0017d48c: 90a20023 lbu r2,0x0023(r5)                         |r2 = Attacker misc data 0x1af
0017d490: 00000000 nop                                       |
0017d494: a0a20023 sb r2,0x0023(r5)                          |Store the data back unchanged ???
0017d498: 03e00008 jr r31                                        
0017d49c: 00000000 nop

Return locations

Battle.bin
0017d128: Main_ability_loading_routine?