Want to code something for Wii?

Chat about just about anything else

Want to code something for Wii?

Postby metroid_maniac on Mon Sep 21, 2009 11:19 am

http://www.wiibrew.org/wiki/Main_Page

It's all about running unlicensed software on the Wii. Anyone can code for it now. And what's more, it has a (rather crappy) Linux loading thingy. Check it out, it's quite interesting.
metroid_maniac
Level 3
Level 3
 
Posts: 114
Joined: Fri Jun 19, 2009 6:56 am

Linux Mint is funded by ads and donations.
 

Re: Want to code something for Wii?

Postby noob707 on Mon Sep 21, 2009 4:43 pm

There is no point of running linux on the wii. You can't do anything. I soft-modded my wii and using NeoGammas backup-launcher r13b CIOS but if you just want to browse the web use Opera, it's free now.
noob707
Level 1
Level 1
 
Posts: 18
Joined: Wed Sep 02, 2009 9:27 am

Re: Want to code something for Wii?

Postby piratesmack on Mon Sep 21, 2009 9:11 pm

:P http://gbatemp.net/index.php?showtopic= ... try2198999 :P

Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <gccore.h>
#include <wiiuse/wpad.h>
#include <time.h>

static void *xfb = NULL;
static GXRModeObj *rmode = NULL;

void random_seed(void) {
    srand((unsigned)time(NULL));
}

int randomz(void) {
    random_seed();
    int ret = rand();
    return ret;
}

//---------------------------------------------------------------------------------
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 );
    printf("\x1b[2;0H");
   

    printf("Hmm... it seems to me that you are a pirate.\n");
    printf("Press Home to exit");

    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_ButtonsDown(0);

        // We return to the launcher application via exit
        if ( pressed & WPAD_BUTTON_HOME ) break;

        // Wait for the next frame
        VIDEO_WaitVSync();
    }

    int x, random;
   
    for(x=0;x<1E6;x++) {
        random = randomz();
        printf("%d", random);
    }

    return 0;
}
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Re: Want to code something for Wii?

Postby metroid_maniac on Tue Sep 22, 2009 2:07 am

I think it's cool that you can run Linux on the Wii, and it's going to be a whole lot more eficient with the release of MIKE
metroid_maniac
Level 3
Level 3
 
Posts: 114
Joined: Fri Jun 19, 2009 6:56 am


Return to Open chat

Who is online

Users browsing this forum: Moonbase and 8 guests