C0 Expansion log ----------------- TabSpace=4 ==Bit Map======================================== |UpperWord | | | |0000 0000 mcmc ZZss sstt ttRR RRRR REEE | | S T || shift shift Reserved typE | | settilesiZe | ================================================= Attributes in order: MirrorS, ClampS, MirrorT, ClampT, SetTileSize(mip-map division), ShiftS, ShiftT, Reserved, Type, Min_Level, DetailAddress, BaseAddress Table 13-3 Shift Encoding /pro-man/pro13/13-04.htm --------|-----------|---------------------------- Shift | | Value |Shift |Detail Texels per Base Texel --------|-----------|---------------------------- 0 no shift 1x1 1 >>1 0.5x0.5 2 >>2 0.25x0.25 3 >>3 0.125x0.125 4 >>4 0.0625x0.625 //Below this point basically doesnt work 5 >>5 0.03125x0.03125 6 >>6 0.015625x0.015625 7 >>7 0.0078125x0.0078125 8 >>8 0.00390625x0.00390625 9 >>9 0.001953125x0.001953125 10 >>10 0.0009765625x0.0009765625 11 <<5 32x32 //Heavy Moiring, not recomeded 12 <<4 16x16 //Used in Surface for S direction. 0 is used for T direction 13 <<3 8x8 14 <<2 4x4 //Optimum for most detail map uses. 15 <<1 2x2 Types ============================= | Type0 = LOD | | Type1 = Detail | | Type2 = Default PG | | Type3 = Tilex1 | | Type4 = Tilex2 | ============================= Example Type0/2 Source ====================== //int length = total texels in mipmap //G_TX_LOADTILE = 0. Load tile into available tile. //gDPLoadTLUT_pal16((*glistp)++, pal, dram) gDPSetTextureImage((*glistp)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram); gDPTileSync((*glistp)++); gDPSetTile((*glistp)++ 0, 0, 0, (256+(((pal)&0xf)*16)), G_TX_LOADTILE, 0 , 0, 0, 0, 0, 0, 0); gDPLoadSync((*glistp)++); gDPLoadTLUTCmd((*glistp)++, G_TX_LOADTILE, 15); gDPPipeSync((*glistp)++) //end LoadTlut gDPSetTextureImage((*glistp)++, im->fmt, im->siz, 1, osVirtualToPhysical((unsigned short *)tbuf)); gDPSetTile((*glistp)++, im->fmt, im->siz, NA, 0, G_TX_LOADTILE, NA, NA, NA, NA, NA, NA, NA); /* Wait until all primitives are done */ gDPLoadSync((*glistp)++); gDPLoadBlock((*glistp)++, G_TX_LOADTILE, 0, 0, length, 0x0); // load new tile at 0,0 to img.length PipeSync() if (type0) SetPrimColour(MIN_LEVEL=0, PRIM_LOD_FRAC=0, R=255, G=255, B=255, A=255) SetTextureLUT(im->fmt) //load mip-maps for (tile = 0; tile <= level; tile ++) { Tmask = maskt-tile; Tshift = tile; Smask = masks-tile; Sshift = tile; gDPSetTile((*glistp)++,im->fmt, im->siz, (mipmap[tile].w*txlsize >> 4), (mipmap[tile].addr >> 3), tile+startTile, pal, cmt, Tmask, Tshift, cms, Smask, Sshift); gDPSetTileSize((*glistp)++,tile+startTile, (0 <