Difference between revisions of "00180f40 - 00180fe0"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "<font face='Courier New'> 00180e00: 00004021 addu r8,r0,r0 00180e04: 00004821 addu r9,r0,r0 00180e08: 340a0063 ori r10,r0,0x0063 00180e0c: 00002821 addu r5,r0,r0 00180e...")
 
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<font face='Courier New'>
+
Parameters : r4 = Target data pointer
 
   
 
   
  00180e00: 00004021 addu r8,r0,r0
+
  Returns nothing
  00180e04: 00004821 addu r9,r0,r0
+
00180e08: 340a0063 ori r10,r0,0x0063
+
  Disable all innate status, status immunities, current status, inflict status, and status CT (Morbolization prep)
  00180e0c: 00002821 addu r5,r0,r0
+
  Note : Preventing status from being canceled here is not sufficient, there's another routine that might do it.
  00180e10: 340b00ff ori r11,r0,0x00ff
+
  -------------------------------------------------------------------------------------------------------------
  00180e14: 3c068019 lui r6,0x8019
+
  00180f40: 27bdffd8 addiu r29,r29,-0x0028    |
  00180e18: 24c608cc addiu r6,r6,0x08cc
+
  00180f44: afb10014 sw r17,0x0014(r29)      |
  00180e1c: 00803821 addu r7,r4,r0
+
  00180f48: 00808821 addu r17,r4,r0           |{{f/adr|<nowiki>r17 = Unit data pointer</nowiki>}}
  00180e20: 90c20183 lbu r2,0x0183(r6) ability to exists check
+
  00180f4c: afb00010 sw r16,0x0010(r29)       |
  00180e24: 00000000 nop
+
  00180f50: 00008021 addu r16,r0,r0           |{{f/std|<nowiki>r16 = 0x00 (loop counter)</nowiki>}}
00180e28: 104b001b beq r2,r11,0x00180e98
+
  00180f54: afb3001c sw r19,0x001c(r29)       |
00180e2c: 00000000 nop
+
  00180f58: 34130080 ori r19,r0,0x0080        |{{f/std|<nowiki>r19 = 0x80 (will be used as bitmask)</nowiki>}}
00180e30: 10400019 beq r2,r0,0x00180e98
+
  00180f5c: afbf0020 sw r31,0x0020(r29)       |
  00180e34: 00000000 nop
+
  00180f60: afb20018 sw r18,0x0018(r29)      |
00180e38: 90c30163 lbu r3,0x0163(r6) load war trophy
+
  00180f64: 9232018a lbu r18,0x018a(r17)     |{{f/load|<nowiki>r18 = Unit Raw iD (without 0xff check)</nowiki>}}
  00180e3c: 00000000 nop
+
                                            {{f/bloop|LOOP - through each status (40 iterations)}}
00180e40: 10600004 beq r3,r0,0x00180e54 branch if no war trophy
+
  00180f68: 06010002 bgez r16,0x00180f74          {{f/Cond|If loop counter < 0}}    {{f/std|Never ?}}
  00180e44: 00000000 nop
+
  00180f6c: 02001021 addu r2,r16,r0              |{{f/std|<nowiki>r2 = loop counter</nowiki>}}
00180e48: a0e30000 sb r3,0x0000(r7) store war trophy
+
  00180f70: 26020007 addiu r2,r16,0x0007              |{{f/std|<nowiki>r2 = counter + 0x07</nowiki>}}
  00180e4c: 24e70001 addiu r7,r7,0x0001
+
  00180f74: 000210c3 sra r2,r2,0x03              |{{f/std|<nowiki>r2 = This iteration status set (counter / 8)</nowiki>}}
00180e50: 25080001 addiu r8,r8,0x0001
+
  00180f78: 32030007 andi r3,r16,0x0007          |{{f/std|<nowiki>r3 = Status bit position in its set</nowiki>}}
  00180e54: 90c20164 lbu r2,0x0164(r6) load bonus money
+
  00180f7c: 02221021 addu r2,r17,r2              |{{f/adr|This iteration Status set pointer}}
00180e58: 00000000 nop
+
  00180f80: 90420058 lbu r2,0x0058(r2)           |{{f/load|This iteration set of Current status}}
  00180e5c: 00021840 sll r3,r2,0x01
+
  00180f84: 00731807 srav r3,r19,r3               |{{f/std|<nowiki>r3 = This iteration bitmask</nowiki>}}
  00180e60: 00621821 addu r3,r3,r2
+
  00180f88: 00431024 and r2,r2,r3                |{{f/std|r2 <> 0x00 if this iteration status is enabled in Unit current status}}
  00180e64: 000318c0 sll r3,r3,0x03
+
  00180f8c: 10400004 beq r2,r0,0x00180fa0        {{f/Cond|If This iteration status is in Unit current status}}
  00180e68: 00621821 addu r3,r3,r2
+
  00180f90: 26040001 addiu r4,r16,0x0001              |{{f/std|<nowiki>r4 = Status number + 1</nowiki>}}
00180e6c: 00031880 sll r3,r3,0x02
+
  00180f94: 00002821 addu r5,r0,r0                   |{{f/std|<nowiki>r5 = Removal flag (for incoming routine)</nowiki>}}
00180e70: 90c20002 lbu r2,0x0002(r6) load party ID
+
  00180f98: 0c01a3a0 jal 0x00068e80                  |{{f/jal|Special_Status_Flag_Enabling|Special_Status_Flag_Enabling%3F}}
  00180e74: 00000000 nop
+
  00180f9c: 02403021 addu r6,r18,r0                   |{{f/std|<nowiki>r6 = Unit ID</nowiki>}}
00180e78: 104b0007 beq r2,r11,0x00180e98 branch if enemy unit
+
  00180fa0: 26100001 addiu r16,r16,0x0001         |{{f/std|counter + 1}}
  00180e7c: 01234821 addu r9,r9,r3
+
  00180fa4: 2a020028 slti r2,r16,0x0028          |{{f/std|check counter limit}}
  00180e80: 90c30022 lbu r3,0x0022(r6) load level
+
  00180fa8: 1440ffef bne r2,r0,0x00180f68    {{f/eloop|Loop 40 times}}
  00180e84: 00000000 nop
+
  00180fac: 2624004e addiu r4,r17,0x004e      |{{f/adr|Unit innate status pointer}}
  00180e88: 006a102b sltu r2,r3,r10 set if less than previous units level
+
  00180fb0: 0c017991 jal 0x0005e644          |{{f/jal|Data_Nullifying|Data_Nullifying}} Nullify Innate status, status immunities and current status
00180e8c: 10400002 beq r2,r0,0x00180e98 branch if not
+
  00180fb4: 3405001f ori r5,r0,0x001f        |{{f/std|<nowiki>r5 = size of data to nullify</nowiki>}}
00180e90: 00000000 nop
+
  00180fb8: 262401bb addiu r4,r17,0x01bb      |{{f/adr|Unit inflicted status pointer}}
00180e94: 00605021 addu r10,r3,r0 r10 = lowest level?
+
  00180fbc: 0c017991 jal 0x0005e644          |{{f/jal|Data_Nullifying|Data_Nullifying}} Nullify inflicted status
  00180e98: 24a50001 addiu r5,r5,0x0001
+
  00180fc0: 34050005 ori r5,r0,0x0005        |{{f/std|<nowiki>r5 = size of data to nullify</nowiki>}}
00180e9c: 28a20015 slti r2,r5,0x0015
+
  00180fc4: 8fbf0020 lw r31,0x0020(r29)
  00180ea0: 1440ffdf bne r2,r0,0x00180e20 all units
+
  00180fc8: 8fb3001c lw r19,0x001c(r29)
  00180ea4: 24c601c0 addiu r6,r6,0x01c0
+
  00180fcc: 8fb20018 lw r18,0x0018(r29)
  00180ea8: 01002821 addu r5,r8,r0
+
  00180fd0: 8fb10014 lw r17,0x0014(r29)
00180eac: 28a20015 slti r2,r5,0x0015
+
  00180fd4: 8fb00010 lw r16,0x0010(r29)
  00180eb0: 10400007 beq r2,r0,0x00180ed0
+
  00180fd8: 27bd0028 addiu r29,r29,0x0028
00180eb4: a0880015 sb r8,0x0015(r4)
+
  00180fdc: 03e00008 jr r31
  00180eb8: 00a41821 addu r3,r5,r4
+
  00180fe0: 00000000 nop
00180ebc: a0600000 sb r0,0x0000(r3)
+
===Return location===
  00180ec0: 24a50001 addiu r5,r5,0x0001
+
  '''Battle.bin'''
  00180ec4: 28a20015 slti r2,r5,0x0015
+
  0018c290: [[Attack_Finalisation_%26_Reaction_Flagging]]
  00180ec8: 1440fffc bne r2,r0,0x00180ebc
 
  00180ecc: 24630001 addiu r3,r3,0x0001
 
  00180ed0: 3c028019 lui r2,0x8019
 
  00180ed4: 94423844 lhu r2,0x3844(r2)
 
  00180ed8: ac890018 sw r9,0x0018(r4)
 
00180edc: 00021840 sll r3,r2,0x01
 
  00180ee0: 00621821 addu r3,r3,r2
 
  00180ee4: 000318c0 sll r3,r3,0x03
 
  00180ee8: 00621821 addu r3,r3,r2
 
00180eec: 3c028019 lui r2,0x8019
 
00180ef0: 90423898 lbu r2,0x3898(r2)
 
  00180ef4: 00031880 sll r3,r3,0x02
 
00180ef8: 14400007 bne r2,r0,0x00180f18
 
00180efc: ac83001c sw r3,0x001c(r4)
 
  00180f00: 3c038019 lui r3,0x8019
 
  00180f04: 90633920 lbu r3,0x3920(r3)
 
  00180f08: 314500ff andi r5,r10,0x00ff
 
00180f0c: 00a3102b sltu r2,r5,r3
 
00180f10: 14400003 bne r2,r0,0x00180f20
 
00180f14: 00651823 subu r3,r3,r5
 
00180f18: 080603ce j 0x00180f38
 
00180f1c: ac800020 sw r0,0x0020(r4)
 
  00180f20: 00031040 sll r2,r3,0x01
 
  00180f24: 00431021 addu r2,r2,r3
 
  00180f28: 000210c0 sll r2,r2,0x03
 
00180f2c: 00431021 addu r2,r2,r3
 
  00180f30: 00021080 sll r2,r2,0x02
 
  00180f34: ac820020 sw r2,0x0020(r4)
 
00180f38: 03e00008 jr r31
 
00180f3c: 00000000 nop
 
</font>
 

Latest revision as of 16:51, 14 July 2024

Parameters : r4 = Target data pointer

Returns nothing

Disable all innate status, status immunities, current status, inflict status, and status CT (Morbolization prep)
Note : Preventing status from being canceled here is not sufficient, there's another routine that might do it.
-------------------------------------------------------------------------------------------------------------
00180f40: 27bdffd8 addiu r29,r29,-0x0028    |
00180f44: afb10014 sw r17,0x0014(r29)       |
00180f48: 00808821 addu r17,r4,r0           |r17 = Unit data pointer
00180f4c: afb00010 sw r16,0x0010(r29)       |
00180f50: 00008021 addu r16,r0,r0           |r16 = 0x00 (loop counter)
00180f54: afb3001c sw r19,0x001c(r29)       |
00180f58: 34130080 ori r19,r0,0x0080        |r19 = 0x80 (will be used as bitmask)
00180f5c: afbf0020 sw r31,0x0020(r29)       |
00180f60: afb20018 sw r18,0x0018(r29)       |
00180f64: 9232018a lbu r18,0x018a(r17)      |r18 = Unit Raw iD (without 0xff check)
                                            @LOOP - through each status (40 iterations)
00180f68: 06010002 bgez r16,0x00180f74          #If loop counter < 0    Never ?
00180f6c: 02001021 addu r2,r16,r0               |r2 = loop counter
00180f70: 26020007 addiu r2,r16,0x0007              |r2 = counter + 0x07
00180f74: 000210c3 sra r2,r2,0x03               |r2 = This iteration status set (counter / 8)
00180f78: 32030007 andi r3,r16,0x0007           |r3 = Status bit position in its set
00180f7c: 02221021 addu r2,r17,r2               |This iteration Status set pointer
00180f80: 90420058 lbu r2,0x0058(r2)            |This iteration set of  Current status
00180f84: 00731807 srav r3,r19,r3               |r3 = This iteration bitmask
00180f88: 00431024 and r2,r2,r3                 |r2 <> 0x00 if this iteration status is enabled in Unit current status
00180f8c: 10400004 beq r2,r0,0x00180fa0         #If This iteration status is in Unit current status
00180f90: 26040001 addiu r4,r16,0x0001              |r4 = Status number + 1
00180f94: 00002821 addu r5,r0,r0                    |r5 = Removal flag (for incoming routine)
00180f98: 0c01a3a0 jal 0x00068e80                   |-->Special_Status_Flag_Enabling%3F
00180f9c: 02403021 addu r6,r18,r0                   |r6 = Unit ID
00180fa0: 26100001 addiu r16,r16,0x0001         |counter + 1
00180fa4: 2a020028 slti r2,r16,0x0028           |check counter limit
00180fa8: 1440ffef bne r2,r0,0x00180f68     Λ Loop 40 times
00180fac: 2624004e addiu r4,r17,0x004e      |Unit innate status pointer
00180fb0: 0c017991 jal 0x0005e644           |-->Data_Nullifying Nullify Innate status, status immunities and current status
00180fb4: 3405001f ori r5,r0,0x001f         |r5 = size of data to nullify
00180fb8: 262401bb addiu r4,r17,0x01bb      |Unit inflicted status pointer
00180fbc: 0c017991 jal 0x0005e644           |-->Data_Nullifying Nullify inflicted status
00180fc0: 34050005 ori r5,r0,0x0005         |r5 = size of data to nullify
00180fc4: 8fbf0020 lw r31,0x0020(r29)
00180fc8: 8fb3001c lw r19,0x001c(r29)
00180fcc: 8fb20018 lw r18,0x0018(r29)
00180fd0: 8fb10014 lw r17,0x0014(r29)
00180fd4: 8fb00010 lw r16,0x0010(r29)
00180fd8: 27bd0028 addiu r29,r29,0x0028
00180fdc: 03e00008 jr r31
00180fe0: 00000000 nop

Return location

Battle.bin
0018c290: Attack_Finalisation_&_Reaction_Flagging