Difference between revisions of "Transfer Last Ability Used CT"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " Transfer Last Ability Used CT 0005e778: 84830170 lh r3,0x0170(r4) Load Unit's Last Attack Used ID 0005e77c: 00000000 nop 0005e780: 000310c0 sll r2,r3,0x03 ID * 8 0005e7...")
 
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  Transfer Last Ability Used CT
+
Parameters : r4 = Acting unit data pointer
  0005e778: 84830170 lh r3,0x0170(r4) Load Unit's Last Attack Used ID
+
  0005e77c: 00000000 nop
+
  Transfer Last Ability Used (Acting unit 0x170) CT (Ability data2 0x0c) in Attacker 0x18b (Ability CT)
  0005e780: 000310c0 sll r2,r3,0x03 ID * 8
+
-----------------------------------------------------------------------------------------------------
  0005e784: 00431023 subu r2,r2,r3 ID * 7
+
  0005e778: 84830170 lh r3,0x0170(r4)         |{{f/load|<nowiki>r3 = Acting Unit's Last Attack Used ID</nowiki>}}
  0005e788: 00021040 sll r2,r2,0x01 ID * 14
+
  0005e77c: 00000000 nop                     |
  0005e78c: 3c018006 lui r1,0x8006
+
  0005e780: 000310c0 sll r2,r3,0x03           |{{f/std|<nowiki>r2 = Last Attack Used ID *8</nowiki>}}
  0005e790: 00220821 addu r1,r1,r2
+
  0005e784: 00431023 subu r2,r2,r3           |{{f/std|<nowiki>r2 = Last Attack Used ID *7</nowiki>}}
  0005e794: 9022fbfc lbu r2,-0x0404(r1) Load Ability's CT
+
  0005e788: 00021040 sll r2,r2,0x01           |{{f/std|<nowiki>r2 = Last Attack Used ID *14 (= Ability offset in ability data 2)</nowiki>}}
  0005e798: 00000000 nop
+
  0005e78c: 3c018006 lui r1,0x8006           |
  0005e79c: 3042007f andi r2,r2,0x007f
+
  0005e790: 00220821 addu r1,r1,r2           |
  0005e7a0: 03e00008 jr r31
+
  0005e794: 9022fbfc lbu r2,-0x0404(r1)       |{{f/load|<nowiki>r2 = Acting unit's last used Ability's CT</nowiki>}} {{f/std|<nowiki>8005fbf0 + 0x0c</nowiki>}}
  0005e7a4: a082018b sb r2,0x018b(r4) Store Ability's CT
+
  0005e798: 00000000 nop                     |
 +
  0005e79c: 3042007f andi r2,r2,0x007f       |{{f/std|<nowiki>r2 = last used ability CT (limited to 128)</nowiki>}}
 +
  0005e7a0: 03e00008 jr r31                   |
 +
  0005e7a4: a082018b sb r2,0x018b(r4)         |{{f/store|<nowiki>Store Acting unit's last used Ability's CT in Unit's ability CT (Unit data 0x18b)</nowiki>}}
 +
=== Return Locations ===
 +
==== SCUS_942.21 ====
 +
0005e840: [[Status_infliction/removal%3F]]
 +
 
 +
==== BATTLE.BIN ====
 +
00182c54: [[In_between_turn_control_routine]]
 +
001838a4: [[Calculate AT List]]

Latest revision as of 00:06, 10 July 2023

Parameters : r4 = Acting unit data pointer

Transfer Last Ability Used (Acting unit 0x170) CT (Ability data2 0x0c) in Attacker 0x18b (Ability CT)
-----------------------------------------------------------------------------------------------------
0005e778: 84830170 lh r3,0x0170(r4)         |r3 = Acting Unit's Last Attack Used ID
0005e77c: 00000000 nop                      |
0005e780: 000310c0 sll r2,r3,0x03           |r2 = Last Attack Used ID *8
0005e784: 00431023 subu r2,r2,r3            |r2 = Last Attack Used ID *7
0005e788: 00021040 sll r2,r2,0x01           |r2 = Last Attack Used ID *14 (= Ability offset in ability data 2)
0005e78c: 3c018006 lui r1,0x8006            |
0005e790: 00220821 addu r1,r1,r2            |
0005e794: 9022fbfc lbu r2,-0x0404(r1)       |r2 = Acting unit's last used Ability's CT 8005fbf0 + 0x0c
0005e798: 00000000 nop                      |
0005e79c: 3042007f andi r2,r2,0x007f        |r2 = last used ability CT (limited to 128)
0005e7a0: 03e00008 jr r31                   |
0005e7a4: a082018b sb r2,0x018b(r4)         |Store Acting unit's last used Ability's CT in Unit's ability CT (Unit data 0x18b)

Return Locations

SCUS_942.21

0005e840: Status_infliction/removal?

BATTLE.BIN

00182c54: In_between_turn_control_routine
001838a4: Calculate AT List