$REVOLUTION_SDK_ROOT/build/demos/nanddemo
Demonstrates the procedures for creating a banner file. In this sample, the banner file is created by the following steps:
Also, in this sample TexConv.exe and the TPL function are used for the creation of save banner image and save icon image.
Its usage and the steps to display will be described below.
[Procedures]
TexConv (TCS file) (TPL file)
For the TexConv argument, specify the TCS script file instead of specifying the TGA file directly.path = ./
file 0 = banner.tga
image 0 = 0, 0, RGB5A3
texture 0 = 0, x
path = ./
file 0 = icon01.tga
file 1 = icon02.tga
file 2 = icon03.tga
file 3 = icon04.tga
image 0 = 0, 0, RGB5A3
image 1 = 1, 1, RGB5A3
image 2 = 2, 2, RGB5A3
image 3 = 3, 3, RGB5A3
texture 0 = 0, x
texture 1 = 1, x
texture 2 = 2, x
texture 3 = 3, x
path. file. The image format to be converted is specified with image. Always specify RGB5A3 here.x on the right side of texture indicates the CLUT index. Because a CLUT does not exist for RGB5A3, it is set to x).NANDBanner structure using the functions below.static NANDBanner s_bnr ATTRIBUTE_ALIGN(32);
static TPLPalettePtr tplIcons;
static TPLDescriptorPtr tdpIcons;
NANDBanner structure.)TPLGetPalette(&tplIcons, "banner_wii.tpl");
tdpIcons = TPLGet(tplIcons, (u32) 0);
memcpy(s_bnr.bannerTexture, tdpIcons->textureHeader->data, NAND_BANNER_TEXTURE_SIZE);
NANDBanner structure.NANDBanner structure.)
TPLReleasePalette(&tplIcons);
TPLGetPalette(&tplIcons, "icon_yoshi.tpl");
for (i=0; i<ICONS; i++)
{
tdpIcons = TPLGet(tplIcons, (u32)i);
memcpy(s_bnr.iconTexture[i], tdpIcons->textureHeader->data, NAND_BANNER_ICON_SIZE);
NANDSetIconSpeed(&s_bnr, i, NAND_BANNER_ICON_ANIM_SPEED_SLOW);
}
NANDSetIconSpeed(&s_bnr, ICONS, NAND_BANNER_ICON_ANIM_SPEED_END);
s_bnr.flag |= NAND_BANNER_FLAG_ANIM_BOUNCE;
NANDBanner structure's icon image data.NANDBanner structure as follows.NANDBanner structure.)
memcpy(s_bnr.bannerTexture, (RGB5A3, 192x64 image data), NAND_BANNER_TEXTURE_SIZE);
NANDBanner structure.)memcpy(s_bnr.iconTexture[i], (RGB5A3, 48x48 image data), NAND_BANNER_ICON_SIZE);
TPLGet, NANDBanner, NANDInitBanner, NANDGetIconSpeed, NANDSetIconSpeed
2006/10/25 Initial version.
CONFIDENTIAL