Difference between revisions of "Remove control based on status"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 0018e1b0: 90820059 lbu r2,0x0059(r4) 0018e1b4: 00000000 nop 0018e1b8: 30420014 andi r2,r2,0x0014 0018e1bc: 1440000b bne r2,r0,0x0018e1ec branc...")
 
m
Line 1: Line 1:
<font face='Courier New'>
+
Parameters : r4 = Targeted unit data pointer
 
   
 
   
  0018e1b0: 90820059 lbu r2,0x0059(r4)
+
Remove ENTD control flag if Targeted Unit has confusion / blood suck / charm / berserk / chicken
  0018e1b4: 00000000 nop
+
If Not ENTD (0x05) is restored by default from Unit 0x1ba (modified ENTD flags)
  0018e1b8: 30420014 andi r2,r2,0x0014
+
If Target is not charmed : restore Team from modified ENTD flag
  0018e1bc: 1440000b bne r2,r0,0x0018e1ec branch if target is confusion/blood suck
+
----------------------------------------------------------------------------------------------------------------
  0018e1c0: 00000000 nop
+
  0018e1b0: 90820059 lbu r2,0x0059(r4)       |{{f/std|<nowiki>r2 = Targeted Unit curent status set 2</nowiki>}}
  0018e1c4: 9082005a lbu r2,0x005a(r4)
+
  0018e1b4: 00000000 nop                     |
  0018e1c8: 00000000 nop
+
  0018e1b8: 30420014 andi r2,r2,0x0014       |{{f/std|r2 <> 0x00 if Targeted Unit has confusion/blood suck}}
  0018e1cc: 3042000c andi r2,r2,0x000c
+
  0018e1bc: 1440000b bne r2,r0,0x0018e1ec     {{f/Cond|If Targeted Unit has neither confusion nor blood suck}}
  0018e1d0: 14400006 bne r2,r0,0x0018e1ec branch if target is berserk/chicken
+
  0018e1c0: 00000000 nop                         |
  0018e1d4: 00000000 nop
+
  0018e1c4: 9082005a lbu r2,0x005a(r4)           |{{f/std|<nowiki>r2 = Targeted Unit current status set 3</nowiki>}}
  0018e1d8: 9082005c lbu r2,0x005c(r4)
+
  0018e1c8: 00000000 nop                         |
  0018e1dc: 00000000 nop
+
  0018e1cc: 3042000c andi r2,r2,0x000c           |{{f/std|r2<> 0x00 if Targeted Unit has berserk or chicken}}
  0018e1e0: 30420020 andi r2,r2,0x0020
+
  0018e1d0: 14400006 bne r2,r0,0x0018e1ec         {{f/Cond|branch if target is berserk/chicken}}
  0018e1e4: 10400006 beq r2,r0,0x0018e200 branch if target is not charmed
+
  0018e1d4: 00000000 nop                             |
  0018e1e8: 00000000 nop
+
  0018e1d8: 9082005c lbu r2,0x005c(r4)               |{{f/std|<nowiki>r2 = Targeted Unit current status set 5</nowiki>}}
  0018e1ec: 90820005 lbu r2,0x0005(r4) load ENTD
+
  0018e1dc: 00000000 nop                             |
  0018e1f0: 00000000 nop
+
  0018e1e0: 30420020 andi r2,r2,0x0020               |{{f/std|r2<> 0x00 if Targeted Unit has charm}}
  0018e1f4: 304200f7 andi r2,r2,0x00f7 remove control flag
+
  0018e1e4: 10400006 beq r2,r0,0x0018e200             {{f/Cond|If Targeted Unit has charm}}
  0018e1f8: 08063885 j 0x0018e214
+
  0018e1e8: 00000000 nop                                 |
  0018e1fc: a0820005 sb r2,0x0005(r4) store new flags
+
  0018e1ec: 90820005 lbu r2,0x0005(r4)       {{f/Cond|E  }} {{f/Cond|E  }}  |{{f/std|<nowiki>r2 = Targeted Unit ENTD flags</nowiki>}}
  0018e200: 908201ba lbu r2,0x01ba(r4) load ENTD modified flags
+
  0018e1f0: 00000000 nop                                 |
  0018e204: 90830005 lbu r3,0x0005(r4) load ENTD flags
+
  0018e1f4: 304200f7 andi r2,r2,0x00f7                   |{{f/std|<nowiki>r2 = Targeted Unit ENTD flags without [Control] flag</nowiki>}}
  0018e208: 30420008 andi r2,r2,0x0008
+
  0018e1f8: 08063885 j 0x0018e214                         {{f/jump|jump avoiding Targeted Unit control restoration}}
  0018e20c: 00621825 or r3,r3,r2
+
  0018e1fc: a0820005 sb r2,0x0005(r4)                     |{{f/store|Store Targeted Unit ENTD disabling unit control}}
  0018e210: a0830005 sb r3,0x0005(r4) store new ENTD flags
+
                                            {{f/Cond|Else Targeted Unit has no status removing control}}
  0018e214: 9082005c lbu r2,0x005c(r4)
+
  0018e200: 908201ba lbu r2,0x01ba(r4)           |{{f/std|<nowiki>r2 = Targeted Unit modified ENTD flags</nowiki>}}
  0018e218: 00000000 nop
+
  0018e204: 90830005 lbu r3,0x0005(r4)           |{{f/std|<nowiki>r3 = Targeted Unit ENTD flags</nowiki>}}
  0018e21c: 30420020 andi r2,r2,0x0020
+
  0018e208: 30420008 andi r2,r2,0x0008           |{{f/std|<nowiki>r2 = 0x08 if modified ENTD flag [control] is enabled</nowiki>}}
  0018e220: 14400007 bne r2,r0,0x0018e240 branch if charmed
+
  0018e20c: 00621825 or r3,r3,r2                 |{{f/std|<nowiki>r3 = Targeted Unit ENTD flags + [Control] if present in modified ENTD flags</nowiki>}}
  0018e224: 00000000 nop
+
  0018e210: a0830005 sb r3,0x0005(r4)             |{{f/store|Restore control if present in modified ENTD flags}}
  0018e228: 90830005 lbu r3,0x0005(r4)
+
  0018e214: 9082005c lbu r2,0x005c(r4)       |{{f/std|<nowiki>r2 = Targeted Unit curent status set 5</nowiki>}}
  0018e22c: 908201ba lbu r2,0x01ba(r4)
+
  0018e218: 00000000 nop                     |
  0018e230: 306300cf andi r3,r3,0x00cf
+
  0018e21c: 30420020 andi r2,r2,0x0020       |{{f/std|<nowiki>r2 = 0x20 if Targeted Unit is charmed</nowiki>}}
  0018e234: 30420030 andi r2,r2,0x0030
+
  0018e220: 14400007 bne r2,r0,0x0018e240     {{f/Cond|If Targeted Unit is not charmed - restore team}}
  0018e238: 00621825 or r3,r3,r2
+
  0018e224: 00000000 nop                         |
  0018e23c: a0830005 sb r3,0x0005(r4) store new ENTD flags
+
  0018e228: 90830005 lbu r3,0x0005(r4)           |{{f/std|<nowiki>r3 = Targeted Unit ENTD flags</nowiki>}}
  0018e240: 03e00008 jr r31
+
  0018e22c: 908201ba lbu r2,0x01ba(r4)           |{{f/std|<nowiki>r2 = Targeted Unit modified ENTD flags</nowiki>}}
 +
  0018e230: 306300cf andi r3,r3,0x00cf           |{{f/std|<nowiki>r3 = Targeted Unit ENTD flags - everything but team flags</nowiki>}}
 +
  0018e234: 30420030 andi r2,r2,0x0030           |{{f/std|<nowiki>r2 = Targeted Unit modified ENTD Team flags</nowiki>}}
 +
  0018e238: 00621825 or r3,r3,r2                 |{{f/std|<nowiki>r3 = ENTD flag upadted with modified ENTD Team</nowiki>}}
 +
  0018e23c: a0830005 sb r3,0x0005(r4)             |{{f/store|Store updated ENTD flags}}
 +
  0018e240: 03e00008 jr r31                   '''END'''
 
  0018e244: 00000000 nop
 
  0018e244: 00000000 nop
</font>
+
=== Return location ===
 +
'''Battle.bin'''
 +
0018e178: [[Post_Ability_Hardcoding%3F]]

Revision as of 19:58, 11 March 2022

Parameters : r4 = Targeted unit data pointer

Remove ENTD control flag if Targeted Unit has confusion / blood suck / charm / berserk / chicken
If Not ENTD (0x05) is restored by default from Unit 0x1ba (modified ENTD flags)
If Target is not charmed : restore Team from modified ENTD flag
----------------------------------------------------------------------------------------------------------------
0018e1b0: 90820059 lbu r2,0x0059(r4)        |r2 = Targeted Unit curent status set 2
0018e1b4: 00000000 nop                      |
0018e1b8: 30420014 andi r2,r2,0x0014        |r2 <> 0x00 if Targeted Unit has confusion/blood suck
0018e1bc: 1440000b bne r2,r0,0x0018e1ec     #If Targeted Unit has neither confusion nor blood suck
0018e1c0: 00000000 nop                          |
0018e1c4: 9082005a lbu r2,0x005a(r4)            |r2 = Targeted Unit current status set 3
0018e1c8: 00000000 nop                          |
0018e1cc: 3042000c andi r2,r2,0x000c            |r2<> 0x00 if Targeted Unit has berserk or chicken
0018e1d0: 14400006 bne r2,r0,0x0018e1ec         #branch if target is berserk/chicken
0018e1d4: 00000000 nop                              |
0018e1d8: 9082005c lbu r2,0x005c(r4)                |r2 = Targeted Unit current status set 5
0018e1dc: 00000000 nop                              |
0018e1e0: 30420020 andi r2,r2,0x0020                |r2<> 0x00 if Targeted Unit has charm
0018e1e4: 10400006 beq r2,r0,0x0018e200             #If Targeted Unit has charm
0018e1e8: 00000000 nop                                  |
0018e1ec: 90820005 lbu r2,0x0005(r4)        #E   #E     |r2 = Targeted Unit ENTD flags
0018e1f0: 00000000 nop                                  |
0018e1f4: 304200f7 andi r2,r2,0x00f7                    |r2 = Targeted Unit ENTD flags without [Control] flag
0018e1f8: 08063885 j 0x0018e214                         >>jump avoiding Targeted Unit control restoration
0018e1fc: a0820005 sb r2,0x0005(r4)                     |Store Targeted Unit ENTD disabling unit control
                                            #Else Targeted Unit has no status removing control
0018e200: 908201ba lbu r2,0x01ba(r4)            |r2 = Targeted Unit modified ENTD flags
0018e204: 90830005 lbu r3,0x0005(r4)            |r3 = Targeted Unit ENTD flags
0018e208: 30420008 andi r2,r2,0x0008            |r2 = 0x08 if modified ENTD flag [control] is enabled
0018e20c: 00621825 or r3,r3,r2                  |r3 = Targeted Unit ENTD flags + [Control] if present in modified ENTD flags
0018e210: a0830005 sb r3,0x0005(r4)             |Restore control if present in modified ENTD flags
0018e214: 9082005c lbu r2,0x005c(r4)        |r2 = Targeted Unit curent status set 5
0018e218: 00000000 nop                      |
0018e21c: 30420020 andi r2,r2,0x0020        |r2 = 0x20 if Targeted Unit is charmed
0018e220: 14400007 bne r2,r0,0x0018e240     #If Targeted Unit is not charmed - restore team
0018e224: 00000000 nop                          |
0018e228: 90830005 lbu r3,0x0005(r4)            |r3 = Targeted Unit ENTD flags
0018e22c: 908201ba lbu r2,0x01ba(r4)            |r2 = Targeted Unit modified ENTD flags
0018e230: 306300cf andi r3,r3,0x00cf            |r3 = Targeted Unit ENTD flags - everything but team flags
0018e234: 30420030 andi r2,r2,0x0030            |r2 = Targeted Unit modified ENTD Team flags
0018e238: 00621825 or r3,r3,r2                  |r3 = ENTD flag upadted with modified ENTD Team
0018e23c: a0830005 sb r3,0x0005(r4)             |Store updated ENTD flags
0018e240: 03e00008 jr r31                   END
0018e244: 00000000 nop

Return location

Battle.bin
0018e178: Post_Ability_Hardcoding?