Installation de DevKitProTout d'abord, récupérer la dernière version de DevKitPro à cette adresse :
ici
Configuration de DevKitPro1. Créer un dossier C:\DEVS\WII\HelloWorld dans l'explorateur Windows
2. Copier le contenu de C:\devkitPro\examples\wii\template (squelette d'une application) dans C:\DEVS\WII\HelloWorld
3. Créer un fichier make.txt dans C:\DEVS\WII\HelloWorld et copier/coller le code suivant :
Code
@echo off
make.exe
pause
4. Renommer le fichier make.txt en make.bat dans l'explorateur Windows
5. Renommer template.pnproj en HelloWorld.pnproj dans l'explorateur Windows (attention "case-sensitive" (IMG:
style_emoticons/default/wink.gif) )
6. Lancer HelloWorld.pnproj
7. Renommer le nom du projet template en HelloWorld dans la fenêtre Projects. Faire de même pour le fichier template.c en HelloWorld.c
8. Tool > make, vous devriez obtenir dans la fenêtre Output une sortie dans le genre :
Code
template.c
linking ... HelloWorld.elf
output ... HelloWorld.dol
> Process Exit Code: 0
> Time Taken: 00:04
Modification du HelloWorld1.Double cliquer sur le fichier HelloWorld.c, vous obtenez :
Code
#include
#include
#include
#include
static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
int main(int argc, char **argv)
{
????// Initialise the video system
????VIDEO_Init();
????
????// This function initialises the attached controllers
????WPAD_Init();
????
????// Obtain the preferred video mode from the system
????// This will correspond to the settings in the Wii menu
????rmode = VIDEO_GetPreferredMode(NULL);
????// Allocate memory for the display in the uncached region
????xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
????
????// Initialise the console, required for printf
????console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
????
????// Set up the video registers with the chosen mode
????VIDEO_Configure(rmode);
????
????// Tell the video hardware where our display memory is
????VIDEO_SetNextFramebuffer(xfb);
????
????// Make the display visible
????VIDEO_SetBlack(FALSE);
????// Flush the video register changes to the hardware
????VIDEO_Flush();
????// Wait for Video setup to complete
????VIDEO_WaitVSync();
????if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
????// The console understands VT terminal escape codes
????// This positions the cursor on row 2, column 0
????// we can use variables for this with format codes too
????// e.g. printf ("\x1b[%d;%dH", row, column );
????while(1)
????{
????????// Call WPAD_ScanPads each loop, this reads the latest controller states
????????WPAD_ScanPads();
????????// WPAD_ButtonsDown tells us which buttons were pressed in this loop
????????// this is a "one shot" state which will not fire again until the button has been released
????????u32 pressed = WPAD_ButtonsHeld(WPAD_CHAN_0);
????????// We return to the launcher application via exit
????????if ( pressed & WPAD_BUTTON_HOME ) exit(0);
????????// Wait for the next frame
????????VIDEO_WaitVSync();
????}
????
????return 0;
}
2. Ajouter avant le
while(1) la ligne de code suivante :
Code
printf("\x1b[16;30Hhttp://www.wii-addict.fr");
Cette ligne de code permet d'afficher à l'écran la chaine de caractère "http://www.wii-addict.fr" sur la 16ième ligne et à partir de la 30ième colonnes.
3. Sauvegarder les modification et compiler votre projet (Tool > make)
4. Copier le fichier HelloWorld.dol dans le repertoire /apps/HelloWorld/ de votre carte SD en le renommant boot.dol (il existe un moyen de configurer l'application afin qu'elle envoie par WiFi le boot.dol vers la Wii, n'ayant pas de carte WiFi je ne peux pas testé (IMG:
style_emoticons/default/wink.gif) )
5. Lancer le tout par la chaine homebrew (IMG:
style_emoticons/default/wink.gif) et Appuyer sur le bouton Home de la WiiMote pour revenir au menu de la chaine Homebrew (IMG:
style_emoticons/default/smile.gif)