Demo for Displaying the Strap Usage Screen

Location

$REVOLUTION_SDK_ROOT/build/demos/cntdemo

How to Display the Strap Usage Screen Using Its Image Content File

This demo uses the procedures in the NADK sample demo to explain the use, as well as the structure, of the Image Content File for the Strap Usage Screen (StrapImage.arc).

(Read dvddata as DvdRoot if they are not the same.)

Note:
The image content file for the Strap Usage screen contains 640x480 (4:3) Strap Usage screen images. Applications should either expand or shrink the image data to convert it to a size other than 640x480, if necessary.
If the screen's aspect ratio is 16:9, do not change the width-to-height ratio of the image data for the Strap Usage screen (4:3). Instead, display the image data with a white (RGB = {255,255,255}) border added to each side. Stretching the aspect ratio from 4:3 to 16:9 will change the width-to-height ratio of the image data as well, which may prevent characters from being read properly.

The sequence used to display the Strap Usage screen in this demo does not follow the Wii Programming Guidelines. When using the image content file for the Strap Usage screen in a retail product, properly display the screen following the instructions in the Wii Programming Guidelines and the package for the Strap Usage screen.

1.   Creating the application

Create the source in the same way the disc application (ELF file) is normally created. Running make as usual (without setting any special options) will create a disc application that can be executed with ndrun.

When creating a disc application, use the CNT API to load the image data for the Strap Usage screen, located under dvddata/content3. Image data for the Strap Usage screen is an LZ77-compressed TPL image. After decompressing the loaded image data using the CX API, use it as a texture with the TPL API. (For specific information on how to use these functions, refer to the CNT API Function Reference, the CX API Function Reference, the TPL API Function Reference, and the sample program source code.)


% make
% ndrun bin/RVL/strapcntdemoD.elf

2.   Converting to a NAND application

Set the CNT API to be used for a NAND application and perform a build. (bin/RVL/strapcntdemoD.elf will be created.)


% make NANDAPP=TRUE NOEXPORT=TRUE

Note that the only purpose here is the build, so NOEXPORT is defined.

Convert the ELF file into a DOL file. (bin/RVL/strapcntdemoD.dol will be created.)


% makedol -f bin/RVL/strapcntdemoD.elf -d bin/RVL/strapcntdemoD.dol

Compress the DOL file. (bin/RVL/strapcntdemoD.dol.lz7 will be created)
The system is set so that LZ77 extended compression is specified for the compression format and the size is aligned to a 32-byte boundary using the -A option.


% ntcompress[D].exe -lex -A32 -o bin/RVL/strapcntdemoD.dol.lz7 bin/RVL/strapcntdemoD.dol

Archive the files under the dvddata/content3 directory. (/dvddata/archives/content3.arc will be created.)


% cd ../../../dvddata/content3; darchD -c * ../archives/content3.arc

Package the compressed DOL file and content file to create a WAD file. (strapcntdemoD.wad will be created.)
This demo uses the -T option to specify that the image content for the Strap Usage screen will be shared content. The file content2.arc is specified as a dummy file in order to align the number of contents in the source.


% makeWad -n strapcntdemoD -l bin/RVL/strapcntdemoD.dol.lz7,
cnt/content2.arc,../../../dvddata/archives/content3.arc -gc RABA -g ZZ -T 0,0,1

3.   Preparing for import

Copy the WAD file to the dvddata/viewer directory. (Create these directories if there is a different DvdRoot or the viewer directory does not exist.)
Next, start Nmenu (Nmenu.elf).


% mv strapcntdemoD.wad ../../../dvddata/viewer
% ndrun ../../../RVL/bin/tools/Nmenu.elf	

4.   Importing and executing

Nmenu starts in Import Mode. In Import Mode, the WAD file in DvdRoot/viewer can be imported. Press A to import strapcntdemoD.wad. Next, press B to enter Title List Mode. Pressing the A button at this time causes the application to execute. (Click here for information on Nmenu.)

When the application is executed, the Strap Usage Screen is displayed.
The image type for the Strap Usage screen will be changed during a 5-second interval, and then the screen will fade in and out over a 20-second interval.
You can change the language using the A Button on the GameCube Controller.
The order in which languages are switched is: Japanese -> English -> French -> German -> Italian -> Spanish -> Dutch -> Japanese.

Creating a WAD File for the Master Data

The image content file (content3.arc) created by this demo for the Strap Usage screen is intended only for the demo. It cannot be used when creating master data.
When creating master data, use the {DvdRoot}/archives/StrapImage.arc file, provided as a shared content file, to generate the WAD file.


% makeWad -n strapcntdemoD -l bin/RVL/strapcntdemoD.dol.lz7,
cnt/content2.arc,../../../dvddata/archives/StrapImage.arc -gc RABA -g ZZ -T 0,0,1

Note

The end of the archive file is not 32-byte aligned. Accordingly, a specified 32-byte aligned value is returned as the CNTRead return value for DVD applications, but a different value, the actual size that was read, is returned for NAND applications.

Revision History

2008/07/25 Moved content2.arc from dvddata/archives to cntdemo/cnt.
2008/07/23 Changed the demo name from strapimagedemo to strapcntdemo and moved it under cntdemo.
2008/07/22 Added a note about changing image sizes. Added a note related to the guidelines for displaying the Strap Usage screen.
2008/03/04 Initial version.


CONFIDENTIAL