P01 GetClut
(Redirected from Combine 16-bit Value (0x23a54))
Jump to navigation
Jump to search
# ROUTINE: COMBINE 16-BIT VALUE (0x23A54) # Parameters: # r4 = Clut X value (limited to multiples of 0x10) # r5 = Clut Y value (no multiple limit?) # Returns: # r2 = Clut ID # 0x001f: Clut X # 0xffe0: Clut Y 80023a54: 00051180 sll r2,r5,0x06 # y << 6 80023a58: 00042103 sra r4,r4,0x04 # x >> 4 80023a5c: 3084003f andi r4,r4,0x003f # (x >> 4) & 0x3f 80023a60: 00441025 or r2,r2,r4 # (y << 6) | ((x >> 4) & 0x3f) 80023a64: 03e00008 jr r31 # return ((y << 6) | ((x >> 4) & 0x3f)) & 0xffff; 80023a68: 3042ffff andi r2,r2,0xffff