piratesmack said:
Ben. said:
Secondly why would I choose this over Mplayer CE?
Better pirate detection, etc, etc
Read my third edited point. And really your reasoning is literally a little bit wank. There are NO merits of using this over Mplayer CE. People don't waste your time. Stick to one of the real media solutions.
EDIT:
To the poster above me, I really wouldn't get your hopes up.
Yeah, you're right.
Nobody use this!
CODE
#include
#include
#include
#include
#include
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