P01 GetClut
Jump to navigation
Jump to search
# ROUTINE: COMBINE 16-BIT VALUE (0x23A54) # Parameters: # r4 = (lowValue) 6-bit value to be stored in low 6 bits # r5 = (highValue) 10-bit value to be stored in high 10 bits # Returns: # r2 = Combined 16-bit value # (Bits 0 to 5) lowValue # (Bits 6 to 15) highValue 80023a54: 00051180 sll r2,r5,0x06 # p2 << 6 80023a58: 00042103 sra r4,r4,0x04 # p1 >> 4 80023a5c: 3084003f andi r4,r4,0x003f # (p1 >> 4) & 0x3f 80023a60: 00441025 or r2,r2,r4 # (p2 << 6) | ((p1 >> 4) & 0x3f) 80023a64: 03e00008 jr r31 # return ((p2 << 6) | ((p1 >> 4) & 0x3f)) & 0xffff; 80023a68: 3042ffff andi r2,r2,0xffff