Difference between revisions of "MP Healing Item Formula"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " MP Healing Item Formula 00188288: 3c038019 lui r3,0x8019 0018828c: 906338db lbu r3,0x38db(r3) Load Used Item ID 00188290: 3c048019 lui r4,0x8019 00188294: 8c842d90 lw r4...")
 
m
 
Line 1: Line 1:
 
  MP Healing Item Formula
 
  MP Healing Item Formula
  00188288: 3c038019 lui r3,0x8019
+
  00188288: 3c038019 lui r3,0x8019           |
  0018828c: 906338db lbu r3,0x38db(r3) Load Used Item ID
+
  0018828c: 906338db lbu r3,0x38db(r3)       |{{f/load|<nowiki>r3 = Current Ability used Item ID</nowiki>}}
  00188290: 3c048019 lui r4,0x8019
+
  00188290: 3c048019 lui r4,0x8019           |
  00188294: 8c842d90 lw r4,0x2d90(r4) Load Current Action Data Pointer
+
  00188294: 8c842d90 lw r4,0x2d90(r4)         |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}}
  00188298: 00031040 sll r2,r3,0x01 ID * 2
+
  00188298: 00031040 sll r2,r3,0x01           |{{f/std|Item ID * 2}}
  0018829c: 00431021 addu r2,r2,r3 ID * 3
+
  0018829c: 00431021 addu r2,r2,r3           |{{f/std|Item ID * 3}}
  001882a0: 3c018006 lui r1,0x8006
+
  001882a0: 3c018006 lui r1,0x8006           |
  001882a4: 00220821 addu r1,r1,r2 80060000 + ID * 3 (Item's Second Table Data)
+
  001882a4: 00220821 addu r1,r1,r2           |{{f/std|<nowiki>r1 = 80060000 + ID * 3 (Item Offset in Second Table Data)</nowiki>}}
  001882a8: 90233f99 lbu r3,0x3f99(r1) Load Z value
+
  001882a8: 90233f99 lbu r3,0x3f99(r1)       |{{f/load|<nowiki>r3 = Item Z value</nowiki>}} {{f/std| 0x80063f98 + 0x01 + Item Offset}}
  001882ac: 34020010 ori r2,r0,0x0010
+
  001882ac: 34020010 ori r2,r0,0x0010         |{{f/std|<nowiki>r2 = 0x10</nowiki>}}
  001882b0: a0820025 sb r2,0x0025(r4) Store Attack Type = MP Recovery
+
  001882b0: a0820025 sb r2,0x0025(r4)         |{{f/store|Set TCA Attack Type as MP recovery}}
  001882b4: 00031080 sll r2,r3,0x02 Z * 4
+
  001882b4: 00031080 sll r2,r3,0x02           |{{f/std|Z * 4}}
  001882b8: 00431021 addu r2,r2,r3 Z * 5
+
  001882b8: 00431021 addu r2,r2,r3           |{{f/std|Z * 5}}
  001882bc: 00021040 sll r2,r2,0x01 Z * 10
+
  001882bc: 00021040 sll r2,r2,0x01           |{{f/std|Z * 10}}
  001882c0: 03e00008 jr r31
+
  001882c0: 03e00008 jr r31                   |
  001882c4: a482000a sh r2,0x000a(r4) Store MP Healing = Z * 10
+
  001882c4: a482000a sh r2,0x000a(r4)         |{{f/store|Store Z*10 as TCA MP recovery}}
 +
=== Return location ===
 +
'''Battle.bin'''
 +
0018b97c - [[Pre Formula Setup (FDC)|Pre Formula Setup]]

Latest revision as of 19:01, 25 April 2022

MP Healing Item Formula
00188288: 3c038019 lui r3,0x8019            |
0018828c: 906338db lbu r3,0x38db(r3)        |r3 = Current Ability used Item ID
00188290: 3c048019 lui r4,0x8019            |
00188294: 8c842d90 lw r4,0x2d90(r4)         |r4 = Target Current Action (TCA) data pointer
00188298: 00031040 sll r2,r3,0x01           |Item ID * 2
0018829c: 00431021 addu r2,r2,r3            |Item ID * 3
001882a0: 3c018006 lui r1,0x8006            |
001882a4: 00220821 addu r1,r1,r2            |r1 = 80060000 + ID * 3 (Item Offset in Second Table Data)
001882a8: 90233f99 lbu r3,0x3f99(r1)        |r3 = Item Z value  0x80063f98 + 0x01 + Item Offset
001882ac: 34020010 ori r2,r0,0x0010         |r2 = 0x10
001882b0: a0820025 sb r2,0x0025(r4)         |Set TCA Attack Type as MP recovery
001882b4: 00031080 sll r2,r3,0x02           |Z * 4
001882b8: 00431021 addu r2,r2,r3            |Z * 5
001882bc: 00021040 sll r2,r2,0x01           |Z * 10
001882c0: 03e00008 jr r31                   |
001882c4: a482000a sh r2,0x000a(r4)         |Store Z*10 as TCA MP recovery

Return location

Battle.bin
0018b97c - Pre Formula Setup