Difference between revisions of "P01 GetClut"
Jump to navigation
Jump to search
(Created page with " # ROUTINE: COMBINE 16-BIT VALUE (0x23A54) # Parameters: # r4 = (lowValue) 6-bit value to be stored in low 6 bits # r5 = (highValue) 10-bit valu...") |
m (Talcall moved page Combine 16-bit Value (0x23a54) to P01 GetClut) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
# ROUTINE: COMBINE 16-BIT VALUE (0x23A54) | # ROUTINE: COMBINE 16-BIT VALUE (0x23A54) | ||
# Parameters: | # Parameters: | ||
− | # r4 = ( | + | # r4 = Clut X value (limited to multiples of 0x10) |
− | # r5 = ( | + | # r5 = Clut Y value (no multiple limit?) |
# Returns: | # Returns: | ||
− | # r2 = | + | # r2 = Clut ID |
− | # | + | # 0x001f: Clut X |
− | # | + | # 0xffe0: Clut Y |
− | 80023a54: 00051180 sll r2,r5,0x06 # | + | 80023a54: 00051180 sll r2,r5,0x06 # y << 6 |
− | 80023a58: 00042103 sra r4,r4,0x04 # | + | 80023a58: 00042103 sra r4,r4,0x04 # x >> 4 |
− | 80023a5c: 3084003f andi r4,r4,0x003f # ( | + | 80023a5c: 3084003f andi r4,r4,0x003f # (x >> 4) & 0x3f |
− | 80023a60: 00441025 or r2,r2,r4 # ( | + | 80023a60: 00441025 or r2,r2,r4 # (y << 6) | ((x >> 4) & 0x3f) |
− | 80023a64: 03e00008 jr r31 # return (( | + | 80023a64: 03e00008 jr r31 # return ((y << 6) | ((x >> 4) & 0x3f)) & 0xffff; |
80023a68: 3042ffff andi r2,r2,0xffff | 80023a68: 3042ffff andi r2,r2,0xffff |
Latest revision as of 10:05, 14 June 2023
# 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