Get Item Type from Item Number
Jump to navigation
Jump to search
# Parameters: # r4 = item_number # Return: # 0x00 - Weapon # 0x01 - Shield # 0x02 - Headgear # 0x03 - Bodygear # 0x04 - Accessory # 0x05 - Cannot Equip (Shurikens, Bombs, and Chemist items) 00125374: 308403ff andi r4,r4,0x03ff # item_number &= 0x3ff 00125378: 2882007a slti r2,r4,0x007a # if item_number is less than 0x7a: 0012537c: 14400013 bne r2,r0,0x001253cc # return 0x00 00125380: 00001821 addu r3,r0,r0 # 00125384: 28820080 slti r2,r4,0x0080 # if item_number is less than 0x80: 00125388: 14400010 bne r2,r0,0x001253cc # return 0x05 0012538c: 34030005 ori r3,r0,0x0005 # 00125390: 28820090 slti r2,r4,0x0090 # if item_number is less than 0x90: 00125394: 1440000d bne r2,r0,0x001253cc # return 0x01 00125398: 34030001 ori r3,r0,0x0001 # 0012539c: 288200ac slti r2,r4,0x00ac # if item_number is less than 0xac: 001253a0: 1440000a bne r2,r0,0x001253cc # return 0x02 001253a4: 34030002 ori r3,r0,0x0002 # 001253a8: 288200d0 slti r2,r4,0x00d0 # if item_number is less than 0xd0: 001253ac: 10400003 beq r2,r0,0x001253bc # 001253b0: 00000000 nop # 001253b4: 080494f3 j 0x001253cc # 001253b8: 34030003 ori r3,r0,0x0003 # return 0x03 001253bc: 288200f0 slti r2,r4,0x00f0 # if item_number is greater than 0xf0: 001253c0: 10400002 beq r2,r0,0x001253cc # return 0x05 001253c4: 34030005 ori r3,r0,0x0005 # 001253c8: 34030004 ori r3,r0,0x0004 # return 0x04 001253cc: 03e00008 jr r31 # 001253d0: 00601021 addu r2,r3,r0 #
Return Locations
WORLD.bin 0x0012157c: 00121568 - 00121650 0x001221fc: 001221d8 - 00122278 0x001245a0: Can Unit equip Item ID 0x00124d18: 00124c54 - 00124f10 0x00125164: 0012502c - 00125370 0x00125274: 0012502c - 00125370