Difference between revisions of "Sort equipment as weapon/shield/hat/body/other based on item number"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with "uses r2, r3, r4; takes item number (r4) and returns r2 = r3 = item slot (0 = weapon, 1 = shield, 2 = head, 3 = body, 4 = accessory, 5 = item/throwable/other) andi r4, r4, 0x3...")
 
 
Line 1: Line 1:
 
uses r2, r3, r4; takes item number (r4) and returns r2 = r3 = item slot (0 = weapon, 1 = shield, 2 = head, 3 = body, 4 = accessory, 5 = item/throwable/other)
 
uses r2, r3, r4; takes item number (r4) and returns r2 = r3 = item slot (0 = weapon, 1 = shield, 2 = head, 3 = body, 4 = accessory, 5 = item/throwable/other)
  
andi r4, r4, 0x3ff
+
andi r4, r4, 0x3ff<br>
slti r2, r4, 0x007a
+
slti r2, r4, 0x007a<br>
bne r2, r0, 0x001253cc
+
bne r2, r0, 0x001253cc<br>
addu r3, r0, r0
+
addu r3, r0, r0<br>
slti r2, r4, 0x0080
+
slti r2, r4, 0x0080<br>
bne r2, r0, 0x001253cc
+
bne r2, r0, 0x001253cc<br>
ori r3, r0, 0x0005
+
ori r3, r0, 0x0005<br>
slti r2, r4, 0x0090
+
slti r2, r4, 0x0090<br>
bne r2, r0, 0x001253cc
+
bne r2, r0, 0x001253cc<br>
ori r3, r0, 0x0001
+
ori r3, r0, 0x0001<br>
slti r2, r4, 0x00ac
+
slti r2, r4, 0x00ac<br>
bne r2, r0, 0x001253cc
+
bne r2, r0, 0x001253cc<br>
ori r3, r0, 0x0002
+
ori r3, r0, 0x0002<br>
slti r2, r4, 0x00d0
+
slti r2, r4, 0x00d0<br>
bne r2, r0, 0x001253bc
+
bne r2, r0, 0x001253bc<br>
nop
+
nop<br>
j 0x001253cc
+
j 0x001253cc<br>
ori r3, r0, 0x0003
+
ori r3, r0, 0x0003<br>
slti r2, r4, 0x00f0
+
slti r2, r4, 0x00f0<br>
beq r2, r0, 0x001253cc
+
beq r2, r0, 0x001253cc<br>
ori r3, r0, 0x0005
+
ori r3, r0, 0x0005<br>
ori r3, r0, 0x0004
+
ori r3, r0, 0x0004<br>
jr r31
+
jr r31<br>
addu r2, r3, r0
+
addu r2, r3, r0<br>

Latest revision as of 01:17, 1 February 2013

uses r2, r3, r4; takes item number (r4) and returns r2 = r3 = item slot (0 = weapon, 1 = shield, 2 = head, 3 = body, 4 = accessory, 5 = item/throwable/other)

andi r4, r4, 0x3ff
slti r2, r4, 0x007a
bne r2, r0, 0x001253cc
addu r3, r0, r0
slti r2, r4, 0x0080
bne r2, r0, 0x001253cc
ori r3, r0, 0x0005
slti r2, r4, 0x0090
bne r2, r0, 0x001253cc
ori r3, r0, 0x0001
slti r2, r4, 0x00ac
bne r2, r0, 0x001253cc
ori r3, r0, 0x0002
slti r2, r4, 0x00d0
bne r2, r0, 0x001253bc
nop
j 0x001253cc
ori r3, r0, 0x0003
slti r2, r4, 0x00f0
beq r2, r0, 0x001253cc
ori r3, r0, 0x0005
ori r3, r0, 0x0004
jr r31
addu r2, r3, r0