Extract Colors Data
Jump to navigation
Jump to search
# ROUTINE: EXTRACT COLORS DATA # Parameters: # r4 = (colorsPtr) Colors pointer? # r5 = (sectionID) Section ID # r6 = (p3) ? (0 to 15?) Inner section? 80092620: 00c07021 addu r14,r6,r0 # p3 80092624: 00004821 addu r9,r0,r0 # count = 0 80092628: 00051080 sll r2,r5,0x02 # sectionID * 4 8009262c: 00451021 addu r2,r2,r5 # sectionID * 5 80092630: 00021080 sll r2,r2,0x02 # sectionID * 20 80092634: 00451023 subu r2,r2,r5 # sectionID * 19 80092638: 00021180 sll r2,r2,0x06 # sectionID * 1216 8009263c: 00451021 addu r2,r2,r5 # sectionID * 1217 80092640: 00021040 sll r2,r2,0x01 # sectionID * 2434 80092644: 3c03800a lui r3,0x800a 80092648: 24639676 addiu r3,r3,-0x698a # 0x80099676 8009264c: 00436821 addu r13,r2,r3 # (sectionID * 2434) + 0x80099676 80092650: 3c06800e lui r6,0x800e 80092654: 24c64ea4 addiu r6,r6,0x4ea4 # 0x800e4ea4 80092658: 00052a40 sll r5,r5,0x09 # sectionID * 512 8009265c: 00a66021 addu r12,r5,r6 # (sectionID * 512) + 0x800e4ea4 80092660: 24630700 addiu r3,r3,0x0700 # 0x80099d76 80092664: 00435821 addu r11,r2,r3 # (sectionID * 2434) + 0x80099d76 80092668: 00805021 addu r10,r4,r0 # colorPtr = colorsPtr # do { 8009266c: 95440000 lhu r4,0x0000(r10) # color = *colorPtr // Color format (by bit) is: [ABBBBBGG][GGGRRRRR] 80092670: 000e2900 sll r5,r14,0x04 # p3 * 16 80092674: 00a92821 addu r5,r5,r9 # (p3 * 16) + count 80092678: 25290001 addiu r9,r9,0x0001 # count = count + 1 8009267c: 00051840 sll r3,r5,0x01 # ((p3 * 16) + count) * 2 80092680: 006c1021 addu r2,r3,r12 # (((p3 * 16) + count) * 2) + ((sectionID * 512) + 0x800e4ea4) 80092684: 006b1821 addu r3,r3,r11 # (((p3 * 16) + count) * 2) + ((sectionID * 2434) + 0x80099d76) 80092688: 308703e0 andi r7,r4,0x03e0 # color & 0x03e0 8009268c: 00073942 srl r7,r7,0x05 # green = (color & 0x03e0) >> 5 80092690: 30867c00 andi r6,r4,0x7c00 # color & 0x7c00 80092694: 00063282 srl r6,r6,0x0a # blue = (color & 0x7c00) >> 10 80092698: 000443c2 srl r8,r4,0x0f # alpha = color >> 15 8009269c: a4440000 sh r4,0x0000(r2) # *(((p3 * 16) + count) * 2) + ((sectionID * 512) + 0x800e4ea4) = color 800926a0: 000510c0 sll r2,r5,0x03 # ((p3 * 16) + count) * 8 800926a4: 00451023 subu r2,r2,r5 # ((p3 * 16) + count) * 7 800926a8: 01a21021 addu r2,r13,r2 # argbColorPtr = (sectionID * 2434) + 0x80099676 + (((p3 * 16) + count) * 7) 800926ac: a4640000 sh r4,0x0000(r3) # *(((p3 * 16) + count) * 2) + ((sectionID * 2434) + 0x80099d76) = color 800926b0: 3084001f andi r4,r4,0x001f # red = color & 0x001f 800926b4: a0440000 sb r4,0x0000(r2) # *argbColorPtr = red 800926b8: a0470001 sb r7,0x0001(r2) # *(argbColorPtr + 1) = green 800926bc: a0460002 sb r6,0x0002(r2) # *(argbColorPtr + 2) = blue 800926c0: a0480003 sb r8,0x0003(r2) # *(argbColorPtr + 3) = alpha 800926c4: 29220010 slti r2,r9,0x0010 800926c8: 1440ffe8 bne r2,r0,0x8009266c 800926cc: 254a0002 addiu r10,r10,0x0002 # colorPtr = colorPtr + 2 # } while (count < 16); 800926d0: 03e00008 jr r31 800926d4: 00000000 nop