Difference between revisions of "Faith Calculation"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Faith Calculation: 00187150: 3c028019 lui r2,0x8019 00187154: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Status 00187158: 00000000 nop 0018715c: 9042005c lbu r2,0x0...")
 
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  Faith Calculation:
+
  No Parameters - Returns Nothing
  00187150: 3c028019 lui r2,0x8019
+
  00187154: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Status
+
Modify Target Curent Action HP damage : '''Damage * [Target Faith]/100 * [Attacker Faith]/100'''
  00187158: 00000000 nop
+
- If A Unit has Faith, his faith value is forced to 100
  0018715c: 9042005c lbu r2,0x005c(r2) Load Attacker's 5th set of Status
+
- If A unit has Innocent, his faith value is forced to 0x00 (resulting in no damage)
  00187160: 00000000 nop
+
-------------------------------------------------------------------------------------------------
  00187164: 30420080 andi r2,r2,0x0080
+
  00187150: 3c028019 lui r2,0x8019           |
  00187168: 10400003 beq r2,r0,0x00187178 Branch if Attacker doesn't have  Faith Status
+
  00187154: 8c422d94 lw r2,0x2d94(r2)         |{{f/adr|<nowiki>r2 = Attacker's Data pointer</nowiki>}}
  0018716c: 34020064 ori r2,r0,0x0064 r2 = 100
+
  00187158: 00000000 nop                     |
  00187170: 3c018019 lui r1,0x8019
+
  0018715c: 9042005c lbu r2,0x005c(r2)       |{{f/load|<nowiki>r2 = Attacker's 5th set of current Status</nowiki>}}
  00187174: a02238d3 sb r2,0x38d3(r1) Store Faith as 100
+
  00187160: 00000000 nop                     |
  00187178: 3c028019 lui r2,0x8019
+
  00187164: 30420080 andi r2,r2,0x0080       |{{f/std|<nowiki>r2 = 0x80 if Attacker has faith</nowiki>}}
  0018717c: 8c422d94 lw r2,0x2d94(r2) Load Attacker's Stats
+
  00187168: 10400003 beq r2,r0,0x00187178     {{f/Cond|If Attacker has Faith}}
  00187180: 00000000 nop
+
  0018716c: 34020064 ori r2,r0,0x0064             |{{f/std|<nowiki>r2 = 0x64 (100)</nowiki>}}
  00187184: 9042005c lbu r2,0x005c(r2) Load Attacker's 5th set of Status
+
  00187170: 3c018019 lui r1,0x8019               |
  00187188: 00000000 nop
+
  00187174: a02238d3 sb r2,0x38d3(r1)             |{{f/store|Forces Current Ability Attacker Faith to 100}} {{f/std|    0x801938d3 / 801938d3}}
  0018718c: 30420040 andi r2,r2,0x0040
+
  00187178: 3c028019 lui r2,0x8019           |
  00187190: 10400003 beq r2,r0,0x001871a0 Branch if Attacker doesn't have  Innocent
+
  0018717c: 8c422d94 lw r2,0x2d94(r2)         |{{f/adr|<nowiki>r2 =  Attacker's Data pointer</nowiki>}}
  00187194: 00000000 nop
+
  00187180: 00000000 nop                     |
  00187198: 3c018019 lui r1,0x8019
+
  00187184: 9042005c lbu r2,0x005c(r2)       |{{f/load|<nowiki>r2 = Attacker's 5th set of current Status</nowiki>}}
  0018719c: a02038d3 sb r0,0x38d3(r1) Store Attacker's Faith as 0
+
  00187188: 00000000 nop                     |
  001871a0: 3c028019 lui r2,0x8019
+
  0018718c: 30420040 andi r2,r2,0x0040       |{{f/std|<nowiki>r2 = 0x40 if Attacker has innocent</nowiki>}}
  001871a4: 8c422d98 lw r2,0x2d98(r2) Load Defender's Stats
+
  00187190: 10400003 beq r2,r0,0x001871a0     {{f/Cond|If Attacker has innocent}}
  001871a8: 00000000 nop
+
  00187194: 00000000 nop                         |
  001871ac: 9042005c lbu r2,0x005c(r2) Load Defender's 5th set of Status
+
  00187198: 3c018019 lui r1,0x8019               |
  001871b0: 00000000 nop
+
  0018719c: a02038d3 sb r0,0x38d3(r1)             |{{f/store|Forces Current Ability Attacker Faith to 0x00}} {{f/std|    0x801938d3 / 801938d3}}
  001871b4: 30420080 andi r2,r2,0x0080
+
  001871a0: 3c028019 lui r2,0x8019           |
  001871b8: 10400003 beq r2,r0,0x001871c8 Branch if Defender doesn't have  Faith
+
  001871a4: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}}
  001871bc: 34020064 ori r2,r0,0x0064 R2 = 100
+
  001871a8: 00000000 nop                     |
  001871c0: 3c018019 lui r1,0x8019
+
  001871ac: 9042005c lbu r2,0x005c(r2)       |{{f/load|<nowiki>r2 = Target's 5th set of current status</nowiki>}}
  001871c4: a02238d2 sb r2,0x38d2(r1) Store Defender's Faith as 100
+
  001871b0: 00000000 nop                     |
  001871c8: 3c028019 lui r2,0x8019
+
  001871b4: 30420080 andi r2,r2,0x0080       |{{f/std|<nowiki>r2 = 0x80 if Target has Faith</nowiki>}}
  001871cc: 8c422d98 lw r2,0x2d98(r2) Load Defender's Stats
+
  001871b8: 10400003 beq r2,r0,0x001871c8     {{f/Cond|If Target has Faith}}
  001871d0: 00000000 nop
+
  001871bc: 34020064 ori r2,r0,0x0064             |{{f/std|<nowiki>r2 = 0x64 (100)</nowiki>}}
  001871d4: 9042005c lbu r2,0x005c(r2) Load Defender's 5th set of Status
+
  001871c0: 3c018019 lui r1,0x8019               |
  001871d8: 00000000 nop
+
  001871c4: a02238d2 sb r2,0x38d2(r1)             |{{f/store|Forces Current Ability Target Faith to 100}} {{f/std|    0x801938d2 / 801938d2}}
  001871dc: 30420040 andi r2,r2,0x0040
+
  001871c8: 3c028019 lui r2,0x8019           |
  001871e0: 10400003 beq r2,r0,0x001871f0 Branch if Defender doesn't have  Innocent
+
  001871cc: 8c422d98 lw r2,0x2d98(r2)         |{{f/adr|<nowiki>r2 = Target data pointer</nowiki>}}
  001871e4: 00000000 nop
+
  001871d0: 00000000 nop                     |
  001871e8: 3c018019 lui r1,0x8019
+
  001871d4: 9042005c lbu r2,0x005c(r2)       |{{f/load|<nowiki>r2 = Target's 5th set of current status</nowiki>}}
  001871ec: a02038d2 sb r0,0x38d2(r1) Store Defender's Faith as 0
+
  001871d8: 00000000 nop                     |
  001871f0: 3c048019 lui r4,0x8019
+
  001871dc: 30420040 andi r2,r2,0x0040       |{{f/std|<nowiki>r2 = 0x40 if Target has Innoncent</nowiki>}}
  001871f4: 8c842d90 lw r4,0x2d90(r4) Current Action Data Pointer
+
  001871e0: 10400003 beq r2,r0,0x001871f0     {{f/Cond|If Target has innocent}}
  001871f8: 3c028019 lui r2,0x8019
+
  001871e4: 00000000 nop                         |
  001871fc: 904238d2 lbu r2,0x38d2(r2) Load Defender's Faith
+
  001871e8: 3c018019 lui r1,0x8019               |
  00187200: 84830004 lh r3,0x0004(r4) Load HP Damage (Reverse Undead comes after this to change it to Healing)
+
  001871ec: a02038d2 sb r0,0x38d2(r1)             |{{f/store|Forces Current Ability Target Faith to 0x00}} {{f/std|    0x801938d2 / 801938d2}}
  00187204: 00000000 nop
+
  001871f0: 3c048019 lui r4,0x8019           |
  00187208: 00620018 mult r3,r2 HP Damage * Defender's Faith
+
  001871f4: 8c842d90 lw r4,0x2d90(r4)         |{{f/adr|<nowiki>r4 = Target Current Action (TCA) data pointer</nowiki>}}
  0018720c: 00001812 mflo r3 Move to R3
+
  001871f8: 3c028019 lui r2,0x8019           |
  00187210: 3c028019 lui r2,0x8019
+
  001871fc: 904238d2 lbu r2,0x38d2(r2)       |{{f/load|<nowiki>r2 = Target Faith (Current ability data)</nowiki>}} {{f/std|    0x801938d2 / 801938d2}}
  00187214: 904238d3 lbu r2,0x38d3(r2) Load Attacker's Faith
+
  00187200: 84830004 lh r3,0x0004(r4)         |{{f/load|<nowiki>r3 = TCA HP damage amount</nowiki>}}
  00187218: 00000000 nop
+
  00187204: 00000000 nop                     |
  0018721c: 00620018 mult r3,r2 HP Damage * Defender's Faith * Attacker's Faith
+
  00187208: 00620018 mult r3,r2               |{{f/std|HP Damage * Target's Faith}}
  00187220: 00001812 mflo r3 Move to R3
+
  0018720c: 00001812 mflo r3                 |{{f/std|<nowiki>r3 = HP Damage * Target's Faith</nowiki>}}
  00187224: 3c0268db lui r2,0x68db R2 = 68db0000
+
  00187210: 3c028019 lui r2,0x8019           |
  00187228: 34428bad ori r2,r2,0x8bad R2 = 68db8bad
+
  00187214: 904238d3 lbu r2,0x38d3(r2)       |{{f/load|<nowiki>r2 = Attacker's Faith (Current ability data)</nowiki>}}
  0018722c: 00620018 mult r3,r2 HP Damage * Defender's Faith * Attacker's Faith * 68db8bad (or /10000)
+
  00187218: 00000000 nop                     |
  00187230: 00031fc3 sra r3,r3,0x1f ???
+
  0018721c: 00620018 mult r3,r2               |{{f/std|HP Damage * Target's Faith * Attacker's Faith}}
  00187234: 00001010 mfhi r2 Move Hi to R2
+
  00187220: 00001812 mflo r3                 |{{f/std|<nowiki>r3 = HP Damage * Target's Faith * Attacker's Faith</nowiki>}}
  00187238: 00021303 sra r2,r2,0x0c ???
+
  00187224: 3c0268db lui r2,0x68db           |
  0018723c: 00431023 subu r2,r2,r3 ???
+
  00187228: 34428bad ori r2,r2,0x8bad         |{{f/std|<nowiki>r2 = 0x68db8bad</nowiki>}} {{f/std|( 0,4096 * 2^32 )}}
  00187240: 03e00008 jr r31
+
  0018722c: 00620018 mult r3,r2               |{{f/std|HP Damage * Target's Faith * Attacker's Faith * 0,4096 * 2^32}}
  00187244: a4820004 sh r2,0x0004(r4) Store new HP Damage
+
  00187230: 00031fc3 sra r3,r3,0x1f           |{{f/std|<nowiki>r3 = highest bit of r3 (for rounding purpose : 0x00 or 0x01)</nowiki>}}
 +
  00187234: 00001010 mfhi r2                 |{{f/std|<nowiki>r2 = HP Damage * Target's Faith * Attacker's Faith * 4096 / 10000</nowiki>}}
 +
  00187238: 00021303 sra r2,r2,0x0c           |{{f/std|<nowiki>r2 = HP Damage * Target's Faith/100 * Attacker's Faith/100</nowiki>}} {{f/std|(r2/4096)}}
 +
  0018723c: 00431023 subu r2,r2,r3           |{{f/std|Eventually rounding down the result}}
 +
  00187240: 03e00008 jr r31                   |
 +
  00187244: a4820004 sh r2,0x0004(r4)         |{{f/store|Store new TCA HP Damage}}
 +
=== Returns locations ===
 +
'''Battle.bin'''
 +
00188828: [[MA_%2B_X|MA + X]]
 +
001889f4: [[Calculate_Accuracy_for_Magical_Spells]]
 +
00188a54: [[Calculate_Accuracy_for_Magical]]
 +
00188c84: [[04_Magic_Gun|Formula 04 : Magic Gun]]
 +
00188dcc: [[08_Dmg_F(MA*Y)|Formula 08 : Dmg F(MA*Y)]]
 +
00188f20: [[0C_Heal_F(MA*Y)|Formula 0c : Heal F(MA*Y)]]
 +
00189030: [[0E_Dmg_(Y)%25_Hit_F(MA%2BX)%25_100%25_Status_Hide_Status|Formula 0e : Dmg (Y)% Hit F(MA+X)% 100% Status Hide Status]]
 +
001892ec: [[1A_Hit_F(MA%2BY)%25_//_-PA/MA/SP_(X)|Formula 1a : Hit F(MA+Y)% // -PA/MA/SP (X)]]

Latest revision as of 20:08, 10 April 2022

No Parameters - Returns Nothing

Modify Target Curent Action HP damage : Damage * [Target Faith]/100 * [Attacker Faith]/100
- If A Unit has Faith, his faith value is forced to 100
- If A unit has Innocent, his faith value is forced to 0x00 (resulting in no damage)
-------------------------------------------------------------------------------------------------
00187150: 3c028019 lui r2,0x8019            |
00187154: 8c422d94 lw r2,0x2d94(r2)         |r2 = Attacker's Data pointer
00187158: 00000000 nop                      |
0018715c: 9042005c lbu r2,0x005c(r2)        |r2 = Attacker's 5th set of current Status
00187160: 00000000 nop                      |
00187164: 30420080 andi r2,r2,0x0080        |r2 = 0x80 if Attacker has faith
00187168: 10400003 beq r2,r0,0x00187178     #If Attacker has Faith
0018716c: 34020064 ori r2,r0,0x0064             |r2 = 0x64 (100)
00187170: 3c018019 lui r1,0x8019                |
00187174: a02238d3 sb r2,0x38d3(r1)             |Forces Current Ability Attacker Faith to 100      0x801938d3 / 801938d3
00187178: 3c028019 lui r2,0x8019            |
0018717c: 8c422d94 lw r2,0x2d94(r2)         |r2 =  Attacker's Data pointer
00187180: 00000000 nop                      |
00187184: 9042005c lbu r2,0x005c(r2)        |r2 = Attacker's 5th set of current Status
00187188: 00000000 nop                      |
0018718c: 30420040 andi r2,r2,0x0040        |r2 = 0x40 if Attacker has innocent
00187190: 10400003 beq r2,r0,0x001871a0     #If Attacker has innocent
00187194: 00000000 nop                          |
00187198: 3c018019 lui r1,0x8019                |
0018719c: a02038d3 sb r0,0x38d3(r1)             |Forces Current Ability Attacker Faith to 0x00      0x801938d3 / 801938d3
001871a0: 3c028019 lui r2,0x8019            |
001871a4: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target data pointer
001871a8: 00000000 nop                      |
001871ac: 9042005c lbu r2,0x005c(r2)        |r2 = Target's 5th set of current status
001871b0: 00000000 nop                      |
001871b4: 30420080 andi r2,r2,0x0080        |r2 = 0x80 if Target has Faith
001871b8: 10400003 beq r2,r0,0x001871c8     #If Target has Faith
001871bc: 34020064 ori r2,r0,0x0064             |r2 = 0x64 (100)
001871c0: 3c018019 lui r1,0x8019                |
001871c4: a02238d2 sb r2,0x38d2(r1)             |Forces Current Ability Target Faith to 100      0x801938d2 / 801938d2
001871c8: 3c028019 lui r2,0x8019            |
001871cc: 8c422d98 lw r2,0x2d98(r2)         |r2 = Target data pointer
001871d0: 00000000 nop                      |
001871d4: 9042005c lbu r2,0x005c(r2)        |r2 = Target's 5th set of current status
001871d8: 00000000 nop                      |
001871dc: 30420040 andi r2,r2,0x0040        |r2 = 0x40 if Target has Innoncent
001871e0: 10400003 beq r2,r0,0x001871f0     #If Target has innocent
001871e4: 00000000 nop                          |
001871e8: 3c018019 lui r1,0x8019                |
001871ec: a02038d2 sb r0,0x38d2(r1)             |Forces Current Ability Target Faith to 0x00      0x801938d2 / 801938d2
001871f0: 3c048019 lui r4,0x8019            |
001871f4: 8c842d90 lw r4,0x2d90(r4)         |r4 = Target Current Action (TCA) data pointer
001871f8: 3c028019 lui r2,0x8019            |
001871fc: 904238d2 lbu r2,0x38d2(r2)        |r2 = Target Faith (Current ability data)      0x801938d2 / 801938d2
00187200: 84830004 lh r3,0x0004(r4)         |r3 = TCA HP damage amount
00187204: 00000000 nop                      |
00187208: 00620018 mult r3,r2               |HP Damage * Target's Faith
0018720c: 00001812 mflo r3                  |r3 = HP Damage * Target's Faith
00187210: 3c028019 lui r2,0x8019            |
00187214: 904238d3 lbu r2,0x38d3(r2)        |r2 = Attacker's Faith (Current ability data)
00187218: 00000000 nop                      |
0018721c: 00620018 mult r3,r2               |HP Damage * Target's Faith * Attacker's Faith
00187220: 00001812 mflo r3                  |r3 = HP Damage * Target's Faith * Attacker's Faith
00187224: 3c0268db lui r2,0x68db            |
00187228: 34428bad ori r2,r2,0x8bad         |r2 = 0x68db8bad ( 0,4096 * 2^32 )
0018722c: 00620018 mult r3,r2               |HP Damage * Target's Faith * Attacker's Faith * 0,4096 * 2^32
00187230: 00031fc3 sra r3,r3,0x1f           |r3 = highest bit of r3 (for rounding purpose : 0x00 or 0x01)
00187234: 00001010 mfhi r2                  |r2 = HP Damage * Target's Faith * Attacker's Faith * 4096 / 10000
00187238: 00021303 sra r2,r2,0x0c           |r2 = HP Damage * Target's Faith/100 * Attacker's Faith/100 (r2/4096)
0018723c: 00431023 subu r2,r2,r3            |Eventually rounding down the result
00187240: 03e00008 jr r31                   |
00187244: a4820004 sh r2,0x0004(r4)         |Store new TCA HP Damage

Returns locations

Battle.bin
00188828: MA + X
001889f4: Calculate_Accuracy_for_Magical_Spells
00188a54: Calculate_Accuracy_for_Magical
00188c84: Formula 04 : Magic Gun
00188dcc: Formula 08 : Dmg F(MA*Y)
00188f20: Formula 0c : Heal F(MA*Y)
00189030: Formula 0e : Dmg (Y)% Hit F(MA+X)% 100% Status Hide Status
001892ec: Formula 1a : Hit F(MA+Y)% // -PA/MA/SP (X)