Difference between revisions of "Get unit data pointer"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
m (Nyzer moved page Get unit data pointer? to Get unit data pointer: Fucking question marks)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  Get unit data pointer?
+
  Alternate documentation here: [[Get Existent Battle Unit Pointer]]
 +
 
 
  001810d4: 2c820015 sltiu r2,r4,0x0015 ID < 21
 
  001810d4: 2c820015 sltiu r2,r4,0x0015 ID < 21
 
  001810d8: 1040000c beq r2,r0,0x0018110c Skip if unit invalid
 
  001810d8: 1040000c beq r2,r0,0x0018110c Skip if unit invalid
Line 15: Line 16:
 
  00181108: 00002821 addu r5,r0,r0 clear r5 if unit ID doesn't exist.
 
  00181108: 00002821 addu r5,r0,r0 clear r5 if unit ID doesn't exist.
 
  0018110c: 03e00008 jr r31
 
  0018110c: 03e00008 jr r31
 +
00181110: 00a01021 addu r2,r5,r0 return current unit data pointer in r2
 +
 +
== Return Locations ==
 +
 +
001813ec: - [[Player Skill Set]]

Latest revision as of 06:03, 25 December 2024

Alternate documentation here: Get Existent Battle Unit Pointer
001810d4: 2c820015 sltiu r2,r4,0x0015		ID < 21
001810d8: 1040000c beq r2,r0,0x0018110c		Skip if unit invalid
001810dc: 00002821 addu r5,r0,r0		return invalid r5
001810e0: 000410c0 sll r2,r4,0x03		ID*8
001810e4: 00441023 subu r2,r2,r4		ID*7
001810e8: 00021180 sll r2,r2,0x06		ID*0x1c0
001810ec: 3c038019 lui r3,0x8019
001810f0: 246308cc addiu r3,r3,0x08cc		unit data pointer
001810f4: 00432821 addu r5,r2,r3		r5 = current unit data pointer
001810f8: 90a30001 lbu r3,0x0001(r5)		r3 = unit ID
001810fc: 340200ff ori r2,r0,0x00ff
00181100: 14620002 bne r3,r2,0x0018110c		branch if unit ID != ff
00181104: 00000000 nop
00181108: 00002821 addu r5,r0,r0		clear r5 if unit ID doesn't exist.
0018110c: 03e00008 jr r31
00181110: 00a01021 addu r2,r5,r0		return current unit data pointer in r2

Return Locations

001813ec: - Player Skill Set