Create options to quick boot GAME(skip game prompt), and invert the left/right direction in game prompt (switch previous/next)

This commit is contained in:
giantpune 2009-05-05 06:24:23 +00:00
parent ce921b5bb9
commit 3bd5652da2
6 changed files with 172 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,8 @@ u8 languageChoice = 0;
u8 viChoice = 0; u8 viChoice = 0;
u8 iosChoice = 0; u8 iosChoice = 0;
u8 parentalcontrolChoice = 0; u8 parentalcontrolChoice = 0;
u8 xflip = 0;
u8 qboot = 0;
#define TITLE_MAX 65 #define TITLE_MAX 65
@ -199,6 +201,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
CFG.parentalcontrol = 0; CFG.parentalcontrol = 0;
CFG.maxcharacters = 38; CFG.maxcharacters = 38;
CFG.godmode = 0; CFG.godmode = 0;
CFG.xflip = 0;
//all alignments are left top here //all alignments are left top here
THEME.selection_x = 200; THEME.selection_x = 200;
@ -708,6 +711,20 @@ void global_cfg_set(char *name, char *val)
} }
return; return;
} }
else if (strcmp(name, "xflip") == 0) {
int i;
if (sscanf(val, "%d", &i) == 1) {
Settings.xflip = i;
}
return;
}
else if (strcmp(name, "qboot") == 0) {
int i;
if (sscanf(val, "%d", &i) == 1) {
Settings.qboot = i;
}
return;
}
} }
// split line to part1 delimiter part2 // split line to part1 delimiter part2
@ -873,6 +890,8 @@ bool cfg_save_global()// save global settings
fprintf(f, "tooltips = %d\n ", Settings.tooltips); fprintf(f, "tooltips = %d\n ", Settings.tooltips);
fprintf(f, "password = %s\n ", Settings.unlockCode); fprintf(f, "password = %s\n ", Settings.unlockCode);
fprintf(f, "cios = %d\n ", Settings.cios); fprintf(f, "cios = %d\n ", Settings.cios);
fprintf(f, "xflip = %d\n ", Settings.xflip);
fprintf(f, "qboot = %d\n ", Settings.qboot);
fclose(f); fclose(f);
return true; return true;
} }
@ -935,6 +954,7 @@ void game_set(char *name, char *val)
game->parentalcontrol = opt_c; game->parentalcontrol = opt_c;
} }
} }
} }
// next opt // next opt
if (np) p = np + 1; else p = NULL; if (np) p = np + 1; else p = NULL;
@ -984,6 +1004,8 @@ bool cfg_load_global()
Settings.vpatch = off; Settings.vpatch = off;
Settings.language = ConsoleLangDefault; Settings.language = ConsoleLangDefault;
Settings.ocarina = off; Settings.ocarina = off;
Settings.xflip = off;
Settings.qboot = off;
Settings.hddinfo = HDDInfo; Settings.hddinfo = HDDInfo;
Settings.sinfo = ((THEME.showID) ? GameID : Neither); Settings.sinfo = ((THEME.showID) ? GameID : Neither);
Settings.rumble = RumbleOn; Settings.rumble = RumbleOn;

View File

@ -62,6 +62,7 @@ struct CFG
short parentalcontrol; short parentalcontrol;
short maxcharacters; short maxcharacters;
short godmode; short godmode;
short xflip;
char unlockCode[20]; char unlockCode[20];
char covers_path[100]; char covers_path[100];
char theme_path[100]; char theme_path[100];
@ -132,6 +133,8 @@ extern u8 languageChoice;
extern u8 viChoice; extern u8 viChoice;
extern u8 iosChoice; extern u8 iosChoice;
extern u8 parentalcontrolChoice; extern u8 parentalcontrolChoice;
extern u8 xflip;
extern u8 qboot;
struct Game_CFG struct Game_CFG
{ {
@ -226,12 +229,17 @@ enum {
v0, v0,
}; };
enum {
no,
yes,
};
/*
enum { enum {
ParentalControlOff, ParentalControlOff,
ParentalControlLevel1, ParentalControlLevel1,
ParentalControlLevel2, ParentalControlLevel2,
ParentalControlLevel3 ParentalControlLevel3
}; };*/
struct SSettings { struct SSettings {
int video; int video;
@ -242,11 +250,13 @@ struct SSettings {
int sinfo; int sinfo;
int hddinfo; int hddinfo;
int rumble; int rumble;
int xflip;
int volume; int volume;
int tooltips; int tooltips;
char unlockCode[20]; char unlockCode[20];
int parentalcontrol; int parentalcontrol;
int cios; int cios;
int qboot;
}; };
void CFG_LoadGlobal(void); void CFG_LoadGlobal(void);

View File

@ -92,7 +92,9 @@ DefaultSettings()
Settings.tooltips = TooltipsOn; Settings.tooltips = TooltipsOn;
snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b"); snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b");
Settings.parentalcontrol = 0; Settings.parentalcontrol = 0;
Settings.cios = ios249; Settings.cios = ios249;
Settings.xflip = no;
Settings.qboot = no;
CFG_LoadGlobal(); CFG_LoadGlobal();
} }

View File

@ -1043,8 +1043,8 @@ int GameWindowPrompt()
choice = 3; choice = 3;
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50); promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
} }
else if(btnRight.GetState() == STATE_CLICKED) {//next game else if((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == no)){//next game
promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50); promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50);
changed = 1; changed = 1;
gameSelected = (gameSelected + 1) % gameCnt; gameSelected = (gameSelected + 1) % gameCnt;
@ -1052,13 +1052,30 @@ int GameWindowPrompt()
break; break;
} }
else if(btnLeft.GetState() == STATE_CLICKED) {//previous game else if((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == no)){//previous game
promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50); promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50);
changed = 2; changed = 2;
gameSelected = (gameSelected - 1 + gameCnt) % gameCnt; gameSelected = (gameSelected - 1 + gameCnt) % gameCnt;
btnLeft.ResetState(); btnLeft.ResetState();
break; break;
} }
else if((btnRight.GetState() == STATE_CLICKED) && (Settings.xflip == yes)){//next game
promptWindow.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 50);
changed = 1;
gameSelected = (gameSelected - 1 + gameCnt) % gameCnt;
btnRight.ResetState();
break;
}
else if((btnLeft.GetState() == STATE_CLICKED) && (Settings.xflip == yes)){//previous game
promptWindow.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 50);
changed = 2;
gameSelected = (gameSelected + 1) % gameCnt;
btnLeft.ResetState();
break;
}
} }
@ -2711,8 +2728,101 @@ static int MenuDiscList()
strncat(text, "...", 3); strncat(text, "...", 3);
} }
if (Settings.qboot == yes)//quickboot game
{
bool returnHere = true; wiilight(0);
int ios2;
switch(iosChoice)
{
case i249:
ios2 = 0;
break;
case i222:
ios2 = 1;
break;
default:
ios2 = 0;
break;
}
// if we have used the network or cios222 we need to reload the disklist
if(networkisinitialized == 1 || ios2 == 1 || Settings.cios == ios222) {
WPAD_Flush(0);
WPAD_Disconnect(0);
WPAD_Shutdown();
WDVD_Close();
USBStorage_Deinit();
if(ios2 == 1) {
ret = IOS_ReloadIOS(222);
if(ret < 0) {
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
WindowPrompt("You don't have cIOS222!","Loading in cIOS249!","OK", 0);
WPAD_Flush(0);
WPAD_Disconnect(0);
WPAD_Shutdown();
IOS_ReloadIOS(249);
ios2 = 0;
}
} else {
ret = IOS_ReloadIOS(249);
}
ret = WBFS_Init(WBFS_DEVICE_USB);
PAD_Init();
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
ret = Disc_Init();
ret = WBFS_Open();
}
/* Set USB mode */
ret = Disc_SetUSB(header->id, ios2);
if (ret < 0) {
sprintf(text, "Error: %i", ret);
WindowPrompt(
"Failed to set USB:",
text,
"OK",0);
}
else {
/* Open disc */
ret = Disc_Open();
if (ret < 0) {
sprintf(text, "Error: %i", ret);
WindowPrompt(
"Failed to boot:",
text,
"OK",0);
}
else {
menu = MENU_EXIT;
}
}
}
break;
bool returnHere = true;// prompt to start game
while (returnHere) while (returnHere)
{ {
returnHere = false; returnHere = false;
@ -3281,8 +3391,8 @@ static int MenuSettings()
sprintf(options2.name[0], "Tooltips"); sprintf(options2.name[0], "Tooltips");
sprintf(options2.name[1], "Password"); sprintf(options2.name[1], "Password");
sprintf(options2.name[2], "Boot Loader in"); sprintf(options2.name[2], "Boot Loader in");
sprintf(options2.name[3], " "); sprintf(options2.name[3], "Flip X");
sprintf(options2.name[4], " "); sprintf(options2.name[4], "Quick Boot");
sprintf(options2.name[5], " "); sprintf(options2.name[5], " ");
sprintf(options2.name[6], " "); sprintf(options2.name[6], " ");
sprintf(options2.name[7], " "); sprintf(options2.name[7], " ");
@ -3399,6 +3509,10 @@ static int MenuSettings()
Settings.tooltips = 0; Settings.tooltips = 0;
if ( Settings.cios > 1 ) if ( Settings.cios > 1 )
Settings.cios = 0; Settings.cios = 0;
if ( Settings.xflip > 1 )
Settings.xflip = 0;
if ( Settings.qboot > 1 )
Settings.qboot = 0;
if (Settings.tooltips == TooltipsOn) sprintf (options2.value[0],"On"); if (Settings.tooltips == TooltipsOn) sprintf (options2.value[0],"On");
else if (Settings.tooltips == TooltipsOff) sprintf (options2.value[0],"Off"); else if (Settings.tooltips == TooltipsOff) sprintf (options2.value[0],"Off");
@ -3410,8 +3524,12 @@ static int MenuSettings()
if (Settings.cios == ios249) sprintf (options2.value[2],"cIOS 249"); if (Settings.cios == ios249) sprintf (options2.value[2],"cIOS 249");
else if (Settings.cios == ios222) sprintf (options2.value[2],"cIOS 222"); else if (Settings.cios == ios222) sprintf (options2.value[2],"cIOS 222");
sprintf (options2.value[3]," "); if (Settings.xflip == no) sprintf (options2.value[3],"No");
sprintf (options2.value[4]," "); else if (Settings.xflip == yes) sprintf (options2.value[3],"Yes");
if (Settings.qboot == no) sprintf (options2.value[4],"No");
else if (Settings.qboot == yes) sprintf (options2.value[4],"Yes");
sprintf (options2.value[5]," "); sprintf (options2.value[5]," ");
sprintf (options2.value[6]," "); sprintf (options2.value[6]," ");
sprintf (options2.value[7]," "); sprintf (options2.value[7]," ");
@ -3455,6 +3573,12 @@ static int MenuSettings()
case 2: case 2:
Settings.cios++; Settings.cios++;
break; break;
case 3:
Settings.xflip++;
break;
case 4:
Settings.qboot++;
break;
} }
} }
@ -3919,7 +4043,7 @@ int MainMenu(int menu)
int currentMenu = menu; int currentMenu = menu;
char imgPath[100]; char imgPath[100];
#ifdef HW_RVL #ifdef HW_RVL
snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path);
pointer[0] = new GuiImageData(imgPath, player1_point_png); pointer[0] = new GuiImageData(imgPath, player1_point_png);
snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path);
@ -4016,7 +4140,6 @@ int MainMenu(int menu)
vol = 80; vol = 80;
break; break;
} }
} }

View File

@ -69,3 +69,5 @@ u32 Wpad_WaitButtons(void)
return buttons; return buttons;
} }