Difference between revisions of "Current Action Attacker Data Setting"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " 0018ef34: 27bdffe8 addiu r29,r29,0xffe8 0018ef38: afb00010 sw r16,0x0010(r29) 0018ef3c: 00808021 addu r16,r4,r0 r16 = Unit's Data Pointer 0018ef40: afbf0014 sw r31,0x001...")
 
 
Line 1: Line 1:
  0018ef34: 27bdffe8 addiu r29,r29,0xffe8
+
'''0018ef34 - 0018f034'''
  0018ef38: afb00010 sw r16,0x0010(r29)
+
  0018ef3c: 00808021 addu r16,r4,r0 r16 = Unit's Data Pointer
+
'''Parameters''': r4 = Acting unit's data pointer
  0018ef40: afbf0014 sw r31,0x0014(r29)
+
  0018ef44: 92030003 lbu r3,0x0003(r16) Load Unit's Job ID
+
  Store some ability data [[#Notes|See Notes]]
  0018ef48: 3402005d ori r2,r0,0x005d
+
-------------------------------------------------------------------
  0018ef4c: 10620035 beq r3,r2,0x 0018f024 Branch if Job = Mime
+
  0018ef34: 27bdffe8 addiu r29,r29,-0x0018    |
  0018ef50: 00000000 nop
+
  0018ef38: afb00010 sw r16,0x0010(r29)       |
  0018ef54: 3c058019 lui r5,0x8019
+
  0018ef3c: 00808021 addu r16,r4,r0           |{{f/adr|<nowiki>r16 = Acting Unit's Data Pointer</nowiki>}}
  0018ef58: 24a538a6 addiu r5,r5,0x38a6 r5 = Stored Acting Unit Data Pointer
+
  0018ef40: afbf0014 sw r31,0x0014(r29)       |
  0018ef5c: 0c01788b jal 0x0005e22c store attackers data
+
  0018ef44: 92030003 lbu r3,0x0003(r16)       |{{f/load|<nowiki>r3 = Acting unit's job</nowiki>}}
  0018ef60: 2604016e addiu r4,r16,0x016e r4 = Attacker/Self ID? Pointer
+
  0018ef48: 3402005d ori r2,r0,0x005d         |{{f/std|<nowiki>r2 = 0x5d (Mime Job ID)</nowiki>}}
  0018ef64: 92030178 lbu r3,0x0178(r16) Load Unit's ?
+
  0018ef4c: 10620035 beq r3,r2,0x0018f024    {{f/Cond|<nowiki>If Acting unit is not a Mime</nowiki>}} /Else Branch to {{f/loc|<nowiki>END</nowiki>}}
  0018ef68: 34020006 ori r2,r0,0x0006
+
  0018ef50: 00000000 nop                           |{{f/std|<nowiki> </nowiki>}}
  0018ef6c: 1462000d bne r3,r2,0x 0018efa4 Branch if ? != Target-Specific Animation?
+
  0018ef54: 3c058019 lui r5,0x8019                 |{{f/std|<nowiki>r5 = 0x80190000</nowiki>}}
  0018ef70: 00000000 nop
+
  0018ef58: 24a538a6 addiu r5,r5,0x38a6           |{{f/adr|<nowiki>r5 = 0x801938a6 </nowiki>}} {{f/std|<nowiki> 801938a6</nowiki>}}
  0018ef74: 92020179 lbu r2,0x0179(r16) Load Unit's Target ID?
+
  0018ef5c: 0c01788b jal 0x0005e22c               |{{f/jal|Copy_Byte_Data_(20_Bytes)|<nowiki>Copy_Byte_Data_(20_Bytes)</nowiki>}} Copy Attacker 0x16e to 0x181at 0x801938a6 to 0x801938b9
  0018ef78: 00000000 nop
+
  0018ef60: 2604016e addiu r4,r16,0x016e           |{{f/adr|<nowiki>r4 = Attacker 0x16e pointer</nowiki>}}
  0018ef7c: 000218c0 sll r3,r2,0x03 ID * 8
+
  0018ef64: 92030178 lbu r3,0x0178(r16)           |{{f/load|<nowiki>r3 = Acting Unit's Action targeting type</nowiki>}}
  0018ef80: 00621823 subu r3,r3,r2 ID * 7
+
  0018ef68: 34020006 ori r2,r0,0x0006             |{{f/std|<nowiki>r2 = 0x06</nowiki>}}
  0018ef84: 00031980 sll r3,r3,0x06 ID * 448
+
  0018ef6c: 1462000d bne r3,r2,0x0018efa4          {{f/Cond|<nowiki>If Targeting is Target specific</nowiki>}}
  0018ef88: 3c028019 lui r2,0x8019
+
  0018ef70: 00000000 nop                               |{{f/std|<nowiki> </nowiki>}}
  0018ef8c: 244208cc addiu r2,r2,0x08cc
+
  0018ef74: 92020179 lbu r2,0x0179(r16)               |{{f/load|<nowiki>r2 = Acting unit's Action Target ID</nowiki>}}
  0018ef90: 00621821 addu r3,r3,r2 r3 = Target's Data Pointer
+
  0018ef78: 00000000 nop                                   |{{f/std|<nowiki> </nowiki>}}
  0018ef94: 90640047 lbu r4,0x0047(r3) Load Target's X Coordinate
+
  0018ef7c: 000218c0 sll r3,r2,0x03                   |{{f/std|<nowiki>Target ID * 8</nowiki>}}
  0018ef98: 90630048 lbu r3,0x0048(r3) Load Target's Y Coordinate
+
  0018ef80: 00621823 subu r3,r3,r2                     |{{f/std|<nowiki>Target ID * 7</nowiki>}}
  0018ef9c: 08063beb j 0x 0018efac
+
  0018ef84: 00031980 sll r3,r3,0x06                   |{{f/std|<nowiki>Target ID * 0x1c0 (Offset of Target in units data)</nowiki>}}
  0018efa0: 00000000 nop
+
  0018ef88: 3c028019 lui r2,0x8019                     |
  0018efa4: 9204017a lbu r4,0x017a(r16) Load Unit's Target X
+
  0018ef8c: 244208cc addiu r2,r2,0x08cc               |{{f/std|<nowiki>r2 = 0x801908cc</nowiki>}}
  0018efa8: 9203017e lbu r3,0x017e(r16) Load Unit's Target Y
+
  0018ef90: 00621821 addu r3,r3,r2                     |{{f/adr|<nowiki>r3 = Target's Data Pointer</nowiki>}}
  0018efac: 92020047 lbu r2,0x0047(r16) Load Unit's X Coordinate
+
  0018ef94: 90640047 lbu r4,0x0047(r3)                 |{{f/load|<nowiki>r4 = Target's X Coordinate</nowiki>}}
  0018efb0: 00000000 nop
+
  0018ef98: 90630048 lbu r3,0x0048(r3)                 |{{f/load|<nowiki>r5 = Target's Y Coordinate</nowiki>}}
  0018efb4: 00821023 subu r2,r4,r2 X Distance = TX - AX
+
  0018ef9c: 08063beb j 0x0018efac                      {{f/jump|<nowiki>Jump (keeping Target coordinates in memory)</nowiki>}}
  0018efb8: 3c018019 lui r1,0x8019
+
  0018efa0: 00000000 nop                               |{{f/std|<nowiki> </nowiki>}}
  0018efbc: a42238a2 sh r2,0x38a2(r1) Store X Distance
+
  0018efa4: 9204017a lbu r4,0x017a(r16)           {{f/Cond|<nowiki>Else (Tile targeting)</nowiki>}} {{f/load|<nowiki>Load Acting Unit's Targeted X</nowiki>}}
  0018efc0: 92020048 lbu r2,0x0048(r16) Load Unit's Y Coordinate
+
  0018efa8: 9203017e lbu r3,0x017e(r16)               |{{f/load|<nowiki>Load Acting Unit's Targeted Y</nowiki>}}
  0018efc4: 00000000 nop
+
  0018efac: 92020047 lbu r2,0x0047(r16)           |{{f/load|<nowiki>r2 = Acting Unit's X Coordinate</nowiki>}}
  0018efc8: 00621023 subu r2,r3,r2 Y Distance = TY - AY
+
  0018efb0: 00000000 nop                           |
  0018efcc: 3c018019 lui r1,0x8019
+
  0018efb4: 00821023 subu r2,r4,r2                 |{{f/std|<nowiki>r2 =X distance (Targeted X - Acting Unit X)</nowiki>}}
  0018efd0: a42238a4 sh r2,0x38a4(r1) Store Y Distance
+
  0018efb8: 3c018019 lui r1,0x8019                 |
  0018efd4: 96020048 lhu r2,0x0048(r16) Load Unit's Y + Facing
+
  0018efbc: a42238a2 sh r2,0x38a2(r1)             |{{f/store|<nowiki>Store X distance at 0x801938a2</nowiki>}}
  0018efd8: 00000000 nop
+
  0018efc0: 92020048 lbu r2,0x0048(r16)           |{{f/load|<nowiki>r2 = Acting unit's Y coordinates</nowiki>}}
  0018efdc: 00021202 srl r2,r2,0x08
+
  0018efc4: 00000000 nop                           |
  0018efe0: 3042000f andi r2,r2,0x000f r2 = Unit's Facing
+
  0018efc8: 00621023 subu r2,r3,r2                 |{{f/std|<nowiki>r2 = Y distance (Target - Acting unit)</nowiki>}}
  0018efe4: 3c018019 lui r1,0x8019
+
  0018efcc: 3c018019 lui r1,0x8019                 |
  0018efe8: a022389c sb r2,0x389c(r1) Store Attacker's Facing
+
  0018efd0: a42238a4 sh r2,0x38a4(r1)             |{{f/store|<nowiki>Store Y distance at 0x801938a4</nowiki>}}
  0018efec: 92020005 lbu r2,0x0005(r16) Load Unit's ENTD Flags
+
  0018efd4: 96020048 lhu r2,0x0048(r16)           |{{f/load|<nowiki>r2 = Acting unit Y & Facing/Elevation</nowiki>}}
  0018eff0: 00000000 nop
+
  0018efd8: 00000000 nop                           |
  0018eff4: 30420030 andi r2,r2,0x0030 r2 = Unit's Team
+
  0018efdc: 00021202 srl r2,r2,0x08               |{{f/std|<nowiki>r2 = Acting unit's Facing/Elevation</nowiki>}}
  0018eff8: 3c018019 lui r1,0x8019
+
  0018efe0: 3042000f andi r2,r2,0x000f             |{{f/std|<nowiki>r2 = Acting unit's Facing</nowiki>}}
  0018effc: a02238a0 sb r2,0x38a0(r1) Store Attacker's Team
+
  0018efe4: 3c018019 lui r1,0x8019                 |
  0018f000: 9202001d lbu r2,0x001d(r16) Load Unit's RH Weapon
+
  0018efe8: a022389c sb r2,0x389c(r1)             |{{f/store|<nowiki>Store Acting unit's Facing at 0x8019389c</nowiki>}}
  0018f004: 3c018019 lui r1,0x8019
+
  0018efec: 92020005 lbu r2,0x0005(r16)           |{{f/load|<nowiki>r2 = Acting Unit's ENTD Flags</nowiki>}}
  0018f008: a022389e sb r2,0x389e(r1) Store RH Weapon
+
  0018eff0: 00000000 nop                           |
  0018f00c: 9203001f lbu r3,0x001f(r16) Load Unit's LH Weapon
+
  0018eff4: 30420030 andi r2,r2,0x0030             |{{f/std|<nowiki>r2 = Acting Unit's Team</nowiki>}}
  0018f010: 34020001 ori r2,r0,0x0001 r2 = 1
+
  0018eff8: 3c018019 lui r1,0x8019                 |
  0018f014: 3c018019 lui r1,0x8019
+
  0018effc: a02238a0 sb r2,0x38a0(r1)             |{{f/store|<nowiki>StoreActing unit's Team at 0x801938a0</nowiki>}}
  0018f018: a022389d sb r2,0x389d(r1) Store ? = 1
+
  0018f000: 9202001d lbu r2,0x001d(r16)           |{{f/load|<nowiki>r2 = Acting Unit's RH Weapon</nowiki>}}
  0018f01c: 3c018019 lui r1,0x8019
+
  0018f004: 3c018019 lui r1,0x8019                 |
  0018f020: a023389f sb r3,0x389f(r1) Store Unit's LH Weapon
+
  0018f008: a022389e sb r2,0x389e(r1)             |{{f/store|<nowiki>Store Acting unit's Right Hand Weapon ID at 0x8019389e</nowiki>}}
  0018f024: 8fbf0014 lw r31,0x0014(r29)
+
  0018f00c: 9203001f lbu r3,0x001f(r16)           |{{f/load|<nowiki>r3 = Acting Unit's LH Weapon</nowiki>}}
  0018f028: 8fb00010 lw r16,0x0010(r29)
+
  0018f010: 34020001 ori r2,r0,0x0001             |{{f/std|<nowiki>r2 = 0x01</nowiki>}}
  0018f02c: 27bd 0018 addiu r29,r29,0x 0018
+
  0018f014: 3c018019 lui r1,0x8019                 |
  0018f030: 03e00008 jr r31
+
  0018f018: a022389d sb r2,0x389d(r1)             |{{f/store|<nowiki>Set 0x8019389d  = 0x01 (?)</nowiki>}}
  0018f034: 00000000 nop
+
  0018f01c: 3c018019 lui r1,0x8019                 |
 +
  0018f020: a023389f sb r3,0x389f(r1)             |{{f/store|<nowiki>Store Acting unit's Left Hand weapon at 0x8019389f</nowiki>}}
 +
  0018f024: 8fbf0014 lw r31,0x0014(r29)           |
 +
  0018f028: 8fb00010 lw r16,0x0010(r29)          
 +
  0018f02c: 27bd0018 addiu r29,r29,0x0018         
 +
  0018f030: 03e00008 jr r31                      
 +
  0018f034: 00000000 nop                          
 +
=== Notes ===
 +
0x8019389c : Acting unit Facing
 +
0x8019389d : 0x01
 +
0x8019389e : Acting unit Right hand weapon
 +
0x8019389f : Acting unit Left hand weapon
 +
0x801938a0 : Acting unit Team
 +
0x801938a2 : Check targeting type (Attacker 0x178)
 +
  - If = 0x06 : X distance between Attacker and Targeted unit
 +
  - If <> 0x06 : X distance between Attacker and targeted tile
 +
0x801938a4 : Check targeting type (Attacker 0x178)
 +
  - If = 0x06 : Y distance between Attacker and Targeted unit
 +
  - If <> 0x06 : Y distance between Attacker and targeted tile
 +
0x801938a6 to 0x801938b9 : Attacker 0x16e to 0x181 data
 +
=== Return locations ===
 +
0017caa8: [[Prep_Current_Action_Data]]

Latest revision as of 21:46, 26 February 2022

0018ef34 - 0018f034 

Parameters: r4 = Acting unit's data pointer

 Store some ability data See Notes
-------------------------------------------------------------------
0018ef34: 27bdffe8 addiu r29,r29,-0x0018    |
0018ef38: afb00010 sw r16,0x0010(r29)       |
0018ef3c: 00808021 addu r16,r4,r0           |r16 = Acting Unit's Data Pointer
0018ef40: afbf0014 sw r31,0x0014(r29)       |
0018ef44: 92030003 lbu r3,0x0003(r16)       |r3 = Acting unit's job
0018ef48: 3402005d ori r2,r0,0x005d         |r2 = 0x5d (Mime Job ID)
0018ef4c: 10620035 beq r3,r2,0x0018f024     #If Acting unit is not a Mime /Else Branch to END
0018ef50: 00000000 nop                           | 
0018ef54: 3c058019 lui r5,0x8019                 |r5 = 0x80190000
0018ef58: 24a538a6 addiu r5,r5,0x38a6            |r5 = 0x801938a6   801938a6
0018ef5c: 0c01788b jal 0x0005e22c                |-->Copy_Byte_Data_(20_Bytes) Copy Attacker 0x16e to 0x181at 0x801938a6 to 0x801938b9
0018ef60: 2604016e addiu r4,r16,0x016e           |r4 = Attacker 0x16e pointer
0018ef64: 92030178 lbu r3,0x0178(r16)            |r3 = Acting Unit's Action targeting type
0018ef68: 34020006 ori r2,r0,0x0006              |r2 = 0x06
0018ef6c: 1462000d bne r3,r2,0x0018efa4          #If Targeting is Target specific
0018ef70: 00000000 nop                               | 
0018ef74: 92020179 lbu r2,0x0179(r16)                |r2 = Acting unit's Action Target ID
0018ef78: 00000000 nop                                   | 
0018ef7c: 000218c0 sll r3,r2,0x03                    |Target ID * 8
0018ef80: 00621823 subu r3,r3,r2                     |Target ID * 7
0018ef84: 00031980 sll r3,r3,0x06                    |Target ID * 0x1c0 (Offset of Target in units data)
0018ef88: 3c028019 lui r2,0x8019                     |
0018ef8c: 244208cc addiu r2,r2,0x08cc                |r2 = 0x801908cc
0018ef90: 00621821 addu r3,r3,r2                     |r3 = Target's Data Pointer
0018ef94: 90640047 lbu r4,0x0047(r3)                 |r4 = Target's X Coordinate
0018ef98: 90630048 lbu r3,0x0048(r3)                 |r5 = Target's Y Coordinate
0018ef9c: 08063beb j 0x0018efac                      >>Jump (keeping Target coordinates in memory)
0018efa0: 00000000 nop                               | 
0018efa4: 9204017a lbu r4,0x017a(r16)            #Else (Tile targeting) Load Acting Unit's Targeted X
0018efa8: 9203017e lbu r3,0x017e(r16)                |Load Acting Unit's Targeted Y
0018efac: 92020047 lbu r2,0x0047(r16)            |r2 = Acting Unit's X Coordinate
0018efb0: 00000000 nop                           |
0018efb4: 00821023 subu r2,r4,r2                 |r2 =X distance (Targeted X - Acting Unit X)
0018efb8: 3c018019 lui r1,0x8019                 |
0018efbc: a42238a2 sh r2,0x38a2(r1)              |Store X distance at 0x801938a2
0018efc0: 92020048 lbu r2,0x0048(r16)            |r2 = Acting unit's Y coordinates
0018efc4: 00000000 nop                           |
0018efc8: 00621023 subu r2,r3,r2                 |r2 = Y distance (Target - Acting unit)
0018efcc: 3c018019 lui r1,0x8019                 |
0018efd0: a42238a4 sh r2,0x38a4(r1)              |Store Y distance at 0x801938a4
0018efd4: 96020048 lhu r2,0x0048(r16)            |r2 = Acting unit Y & Facing/Elevation
0018efd8: 00000000 nop                           |
0018efdc: 00021202 srl r2,r2,0x08                |r2 = Acting unit's Facing/Elevation
0018efe0: 3042000f andi r2,r2,0x000f             |r2 = Acting unit's Facing
0018efe4: 3c018019 lui r1,0x8019                 |
0018efe8: a022389c sb r2,0x389c(r1)              |Store Acting unit's Facing at 0x8019389c
0018efec: 92020005 lbu r2,0x0005(r16)            |r2 = Acting Unit's ENTD Flags
0018eff0: 00000000 nop                           |
0018eff4: 30420030 andi r2,r2,0x0030             |r2 = Acting Unit's Team
0018eff8: 3c018019 lui r1,0x8019                 |
0018effc: a02238a0 sb r2,0x38a0(r1)              |StoreActing unit's Team at 0x801938a0
0018f000: 9202001d lbu r2,0x001d(r16)            |r2 = Acting Unit's RH Weapon
0018f004: 3c018019 lui r1,0x8019                 |
0018f008: a022389e sb r2,0x389e(r1)              |Store Acting unit's Right Hand Weapon ID at 0x8019389e
0018f00c: 9203001f lbu r3,0x001f(r16)            |r3 = Acting Unit's LH Weapon
0018f010: 34020001 ori r2,r0,0x0001              |r2 = 0x01
0018f014: 3c018019 lui r1,0x8019                 |
0018f018: a022389d sb r2,0x389d(r1)              |Set 0x8019389d  = 0x01 (?)
0018f01c: 3c018019 lui r1,0x8019                 |
0018f020: a023389f sb r3,0x389f(r1)              |Store Acting unit's Left Hand weapon at 0x8019389f
0018f024: 8fbf0014 lw r31,0x0014(r29)            |
0018f028: 8fb00010 lw r16,0x0010(r29)            
0018f02c: 27bd0018 addiu r29,r29,0x0018          
0018f030: 03e00008 jr r31                        
0018f034: 00000000 nop                           

Notes

0x8019389c : Acting unit Facing
0x8019389d : 0x01
0x8019389e : Acting unit Right hand weapon
0x8019389f : Acting unit Left hand weapon
0x801938a0 : Acting unit Team 
0x801938a2 : Check targeting type (Attacker 0x178)
  - If = 0x06 : X distance between Attacker and Targeted unit
  - If <> 0x06 : X distance between Attacker and targeted tile
0x801938a4 : Check targeting type (Attacker 0x178)
  - If = 0x06 : Y distance between Attacker and Targeted unit
  - If <> 0x06 : Y distance between Attacker and targeted tile 
0x801938a6 to 0x801938b9 : Attacker 0x16e to 0x181 data

Return locations

0017caa8: Prep_Current_Action_Data