Difference between revisions of "Poison and Regen"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
  Poison and Regen:
+
  '''BATTLE.BIN''' :  - Poison and Regen
  0018d7c8: 27bdffe8 addiu r29,r29,0xffe8
+
------------------------------------------------------------------------------------------
  0018d7cc: afb00010 sw r16,0x0010(r29)
+
Parameter : r4 = Pointer to unit battle data (801908cc)
  0018d7d0: afbf0014 sw r31,0x0014(r29)
+
Return : r2 = 0x80 if unit is poisoned (damage attack type)
  0018d7d4: 0c063691 jal 0x0018da44 [[Crystal, Dead, Jump, Petrify, Treasure check]]
+
          r2 = 0x40 if unit has regen (heal attack type)
  0018d7d8: 00808021 addu r16,r4,r0
+
          r2 = 0x00 if nothing happens here
  0018d7dc: 1440001d bne r2,r0,0x0018d854 Branch to end if unit has Crystal,  Dead, Jump, Petrify or Treasure
+
------------------------------------------------------------------------------------------
  0018d7e0: 00001021 addu r2,r0,r0 r2 = 0
+
  0018d7c8: 27bdffe8 addiu r29,r29,-0x0018    |
  0018d7e4: 0c063681 jal 0x0018da04 [[Target pointers]]
+
  0018d7cc: afb00010 sw r16,0x0010(r29)       |
  0018d7e8: 02002021 addu r4,r16,r0
+
  0018d7d0: afbf0014 sw r31,0x0014(r29)       |
  0018d7ec: 9203005b lbu r3,0x005b(r16) Load Attacker's 4th set of Current  status
+
  0018d7d4: 0c063691 jal 0x0018da44           |{{f/jal|Crystal, Dead, Jump, Petrify, Treasure check|Crystal, Dead, Jump, Petrify, Treasure check}}
  0018d7f0: 00000000 nop
+
  0018d7d8: 00808021 addu r16,r4,r0           |{{f/std|Preserve unit data pointer}}
  0018d7f4: 30620080 andi r2,r3,0x0080
+
  0018d7dc: 1440001d bne r2,r0,0x0018d854     {{f/Cond|If unit has Crystal,  Dead, Jump, Petrify or Treasure : branch to }} {{f/loc|END}} {{f/std|return 0x00}}
  0018d7f8: 10400008 beq r2,r0,0x0018d81c Branch if unit isn't Poisoned
+
  0018d7e0: 00001021 addu r2,r0,r0             |
  0018d7fc: 00000000 nop
+
  0018d7e4: 0c063681 jal 0x0018da04           |{{f/jal|Set_Action_Target_Variables|Set_Action_Target_Variables}} {{f/std|Set  80192d90 and 80192d98 and initialize data}}
  0018d800: 9602002a lhu r2,0x002a(r16) Load Max HP
+
  0018d7e8: 02002021 addu r4,r16,r0           |{{f/std|Send unit data pointer}}
  0018d804: 3c038019 lui r3,0x8019
+
  0018d7ec: 9203005b lbu r3,0x005b(r16)       |{{f/load|Load Attacker's 4th set of Current  status}}
  0018d808: 8c632d90 lw r3,0x2d90(r3) Load Current Action Data Pointer
+
  0018d7f0: 00000000 nop                       |
  0018d80c: 000210c2 srl r2,r2,0x03 Max HP / 8
+
  0018d7f4: 30620080 andi r2,r3,0x0080         |
  0018d810: a4620004 sh r2,0x0004(r3) Store has HP Damage
+
  0018d7f8: 10400008 beq r2,r0,0x0018d81c     {{f/Cond|If Unit is poisoned}}
  0018d814: 08063610 j 0x0018d840
+
  0018d7fc: 00000000 nop                           |
  0018d818: 34020080 ori r2,r0,0x0080 Attack Flag (Damage)
+
  0018d800: 9602002a lhu r2,0x002a(r16)           |{{f/load|Unit Max HP}}
  0018d81c: 30620040 andi r2,r3,0x0040
+
  0018d804: 3c038019 lui r3,0x8019                 |
  0018d820: 10400008 beq r2,r0,0x0018d844 Branch if unit doesn't have Regen
+
  0018d808: 8c632d90 lw r3,0x2d90(r3)             |{{f/adr|Current Action Data Pointer}}
  0018d824: 00000000 nop
+
  0018d80c: 000210c2 srl r2,r2,0x03               |{{f/std|Max HP / 8}}
  0018d828: 9602002a lhu r2,0x002a(r16) Load Max HP
+
  0018d810: a4620004 sh r2,0x0004(r3)             |{{f/store|Store Max HP/8 as HP Damage}}
  0018d82c: 3c038019 lui r3,0x8019
+
  0018d814: 08063610 j 0x0018d840                 {{f/jump|Avoid regen and jump to store attack type}}
  0018d830: 8c632d90 lw r3,0x2d90(r3) Load Current Action Data Pointer
+
  0018d818: 34020080 ori r2,r0,0x0080             |{{f/std|Attack Flag (Damage)}}
  0018d834: 000210c2 srl r2,r2,0x03 Max HP / 8
+
  0018d81c: 30620040 andi r2,r3,0x0040         |
  0018d838: a4620006 sh r2,0x0006(r3) Store has Healing
+
  0018d820: 10400008 beq r2,r0,0x0018d844     {{f/Cond|Branch if unit doesn't have Regen}}
  0018d83c: 34020040 ori r2,r0,0x0040 Attack Flag (Heal)
+
  0018d824: 00000000 nop                           |
  0018d840: a0620025 sb r2,0x0025(r3) Store Attack Flag
+
  0018d828: 9602002a lhu r2,0x002a(r16)           |{{f/load|Unit Max HP}}
  0018d844: 3c028019 lui r2,0x8019
+
  0018d82c: 3c038019 lui r3,0x8019                 |
  0018d848: 8c422d90 lw r2,0x2d90(r2) Load Current Action Data Pointer
+
  0018d830: 8c632d90 lw r3,0x2d90(r3)             |{{f/adr|Load Current Action Data Pointer}}
  0018d84c: 00000000 nop
+
  0018d834: 000210c2 srl r2,r2,0x03               |{{f/std|Max HP / 8}}
  0018d850: 90420025 lbu r2,0x0025(r2) Load Attack Flag
+
  0018d838: a4620006 sh r2,0x0006(r3)             |{{f/store|Store has Healing}}
  0018d854: 8fbf0014 lw r31,0x0014(r29)
+
  0018d83c: 34020040 ori r2,r0,0x0040             |{{f/std|Attack Flag (Heal)}}
  0018d858: 8fb00010 lw r16,0x0010(r29)
+
  0018d840: a0620025 sb r2,0x0025(r3)         |{{f/store|Store Attack Flag}}
  0018d85c: 27bd0018 addiu r29,r29,0x0018
+
  0018d844: 3c028019 lui r2,0x8019             |
  0018d860: 03e00008 jr r31 Return to Routine
+
  0018d848: 8c422d90 lw r2,0x2d90(r2)         |{{f/adr|Load Current Action Data Pointer}}
 +
  0018d84c: 00000000 nop                       |
 +
  0018d850: 90420025 lbu r2,0x0025(r2)         |{{f/load|Load and return Attack Flag}}
 +
  0018d854: 8fbf0014 lw r31,0x0014(r29)       |
 +
  0018d858: 8fb00010 lw r16,0x0010(r29)       |
 +
  0018d85c: 27bd0018 addiu r29,r29,0x0018     |
 +
  0018d860: 03e00008 jr r31                   {{f/jump|Return to Routine}}
 
  0018d864: 00000000 nop
 
  0018d864: 00000000 nop
 +
===Return locations===
 +
'''BATTLE.BIN'''
 +
  00182ea4: [[AI_End_of_turn,_in_between_turn,_etc.]]

Latest revision as of 20:29, 14 March 2024

BATTLE.BIN :  - Poison and Regen
------------------------------------------------------------------------------------------
Parameter : r4 = Pointer to unit battle data (801908cc)
Return : r2 = 0x80 if unit is poisoned (damage attack type)
         r2 = 0x40 if unit has regen (heal attack type)
         r2 = 0x00 if nothing happens here
------------------------------------------------------------------------------------------
0018d7c8: 27bdffe8 addiu r29,r29,-0x0018     |
0018d7cc: afb00010 sw r16,0x0010(r29)        |
0018d7d0: afbf0014 sw r31,0x0014(r29)        |
0018d7d4: 0c063691 jal 0x0018da44            |-->Crystal, Dead, Jump, Petrify, Treasure check
0018d7d8: 00808021 addu r16,r4,r0            |Preserve unit data pointer
0018d7dc: 1440001d bne r2,r0,0x0018d854      #If unit has Crystal,  Dead, Jump, Petrify or Treasure : branch to  END return 0x00
0018d7e0: 00001021 addu r2,r0,r0             |
0018d7e4: 0c063681 jal 0x0018da04            |-->Set_Action_Target_Variables Set  80192d90 and 80192d98 and initialize data
0018d7e8: 02002021 addu r4,r16,r0            |Send unit data pointer
0018d7ec: 9203005b lbu r3,0x005b(r16)        |Load Attacker's 4th set of Current  status
0018d7f0: 00000000 nop                       |
0018d7f4: 30620080 andi r2,r3,0x0080         |
0018d7f8: 10400008 beq r2,r0,0x0018d81c      #If Unit is poisoned
0018d7fc: 00000000 nop                           |
0018d800: 9602002a lhu r2,0x002a(r16)            |Unit Max HP
0018d804: 3c038019 lui r3,0x8019                 |
0018d808: 8c632d90 lw r3,0x2d90(r3)              |Current Action Data Pointer
0018d80c: 000210c2 srl r2,r2,0x03                |Max HP / 8
0018d810: a4620004 sh r2,0x0004(r3)              |Store Max HP/8 as HP Damage
0018d814: 08063610 j 0x0018d840                  >>Avoid regen and jump to store attack type
0018d818: 34020080 ori r2,r0,0x0080              |Attack Flag (Damage)
0018d81c: 30620040 andi r2,r3,0x0040         |
0018d820: 10400008 beq r2,r0,0x0018d844      #Branch if unit doesn't have Regen
0018d824: 00000000 nop                           |
0018d828: 9602002a lhu r2,0x002a(r16)            |Unit Max HP
0018d82c: 3c038019 lui r3,0x8019                 |
0018d830: 8c632d90 lw r3,0x2d90(r3)              |Load Current Action Data Pointer
0018d834: 000210c2 srl r2,r2,0x03                |Max HP / 8
0018d838: a4620006 sh r2,0x0006(r3)              |Store has Healing
0018d83c: 34020040 ori r2,r0,0x0040              |Attack Flag (Heal)
0018d840: a0620025 sb r2,0x0025(r3)          |Store Attack Flag
0018d844: 3c028019 lui r2,0x8019             |
0018d848: 8c422d90 lw r2,0x2d90(r2)          |Load Current Action Data Pointer
0018d84c: 00000000 nop                       |
0018d850: 90420025 lbu r2,0x0025(r2)         |Load and return Attack Flag
0018d854: 8fbf0014 lw r31,0x0014(r29)        |
0018d858: 8fb00010 lw r16,0x0010(r29)        |
0018d85c: 27bd0018 addiu r29,r29,0x0018      |
0018d860: 03e00008 jr r31                    >>Return to Routine
0018d864: 00000000 nop

Return locations

BATTLE.BIN
 00182ea4: AI_End_of_turn,_in_between_turn,_etc.