Code: Select all
#include <iostream>
#include <stdlib.h>
#include <gccore.h>
#include <wiiuse/WPAD.h>
using namespace std;
//--------------------------------------------------------//
static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
//--------------------------------------------------------//
bool fcomplete = false; //FOREST COMPLETE
bool crcomplete = false; //CROSSROADS COMPLETE
bool ccomplete = false; //CASTLE COMPLETE
int CrossRoads()
{
cout <<"\n\nThere are (2) monsters to fight in this Path, There is a Grizzly and a Fox:"<<endl;
cout <<"\nWHICH ONE DO YOU CHOOSE:"<<endl;
crcomplete = true;
return 0;
}
int Forest()
{
cout <<"\n\nI haven't made this yet!!"<<endl;
fcomplete = true;
return 0;
}
//--------------------------------------------------------//
int main(int argc, char **argv){
//--------------------------------------------------------//
Video_INIT();
//--------------------------------------------------------//
WPAD_Init();
//--------------------------------------------------------//
rmode = VIDEO_GetPreferredMode(NULL);
//--------------------------------------------------------//
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
//--------------------------------------------------------//
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
//--------------------------------------------------------//
VIDEO_Configure(rmode);
//--------------------------------------------------------//
VIDEO_SetNextFramebuffer(xfb);
//--------------------------------------------------------//
VIDEO_SetBlack(FALSE);
//--------------------------------------------------------//
VIDEO_Flush();
//--------------------------------------------------------//
VIDEO_WaitVSync();
//--------------------------------------------------------//
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
//--------------------------------------------------------//
cout <<"Welcome to ADVENTURE WORDLS"<<endl;
cout <<"\n\nYou are standing in the middle of a marshy land, there are many paths going off in their directions.\nWhich Path Do You Choose"<<endl;
cout <<"HOME. Exit Game."<<endl;
cout <<"1. CrossRoads Path(QUEST)"<<endl;
if (!crcomplete && !fcomplete)
{
cout <<"\n"<<endl;
}
if (crcomplete && !fcomplete)
{
cout <<"1. CrossRoads Path(COMPLETED)"<<endl;
cout <<"2. Forest Path(QUEST)"<<endl;
}
while(1) {
// Call WPAD_ScanPads each5 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 ) exit(0);
if ( pressed & WPAD_BUTTON_ONE ) CrossRoads();
if ( pressed & WPAD_BUTTON_TWO ) Forest();
// Wait for the next frame
VIDEO_WaitVSync();
}
return 0;
}