Fix no SD bug and other stuff

This commit is contained in:
giantpune 2009-05-20 22:30:47 +00:00
parent e42e38eca2
commit 4a0c038708
3 changed files with 27 additions and 36 deletions

File diff suppressed because one or more lines are too long

View File

@ -1169,7 +1169,7 @@ bool cfg_load_games()
bool cfg_load_game_num() bool cfg_load_game_num()
{ {
return cfg_parsefile("SD:/config/GXGameCount.cfg", &game_set_num); return cfg_parsefile("SD:/config/GXGameFavorites.cfg", &game_set_num);
} }
bool cfg_save_games()// save per game setings bool cfg_save_games()// save per game setings
@ -1208,9 +1208,9 @@ bool cfg_save_game_num()
FILE *f; FILE *f;
int i; int i;
mkdir("SD:/config/", 0777); mkdir("SD:/config/", 0777);
f = fopen("SD:/config/GXGameCount.cfg", "wb"); f = fopen("SD:/config/GXGameFavorites.cfg", "wb");
if (!f) { if (!f) {
printf("Error saving %s\n", "GXGameCount.cfg"); printf("Error saving %s\n", "GXGameFavorites.cfg");
sleep(1); sleep(1);
return false; return false;
} }

View File

@ -1299,6 +1299,27 @@ int GameWindowPrompt()
Sys_Reboot(); Sys_Reboot();
if(btn1.GetState() == STATE_CLICKED) { //boot if(btn1.GetState() == STATE_CLICKED) { //boot
//////////save game play count////////////////
extern u8 favorite;
extern u8 count;
struct Game_NUM* game_num = CFG_get_game_num(header->id);
if (game_num)
{
favorite = game_num->favorite;
count = game_num->count;//count+=1;
}count+=1;
if(isSdInserted() == 1) {
if (CFG_save_game_num(header->id))
{
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
}
else
{
//WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0);
}
}
////////////end save play count//////////////
choice = 1; choice = 1;
SDCard_deInit(); SDCard_deInit();
} }
@ -3253,8 +3274,6 @@ static int MenuDiscList()
{ {
WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0);
} }
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
} }
////////////end save play count////////////// ////////////end save play count//////////////
@ -3353,36 +3372,8 @@ static int MenuDiscList()
{ {
wiilight(0); wiilight(0);
//////////save game play count//////////////// struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
extern u8 favorite; if (game_cfg)//if there are saved settings for this game use them
extern u8 count;
struct Game_NUM* game_num = CFG_get_game_num(header->id);
if (game_num)
{
favorite = game_num->favorite;
count = game_num->count;//count+=1;
}count+=1;
if(isSdInserted() == 1) {
if (CFG_save_game_num(header->id))
{
//WindowPrompt(LANGUAGE.SuccessfullySaved, 0, LANGUAGE.ok, 0,0,0);
}
else
{
WindowPrompt(LANGUAGE.SaveFailed, 0, LANGUAGE.ok, 0,0,0);
}
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
}
////////////end save play count//////////////
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
if (game_cfg)//if there are saved settings for this game use them
{ {
iosChoice = game_cfg->ios; iosChoice = game_cfg->ios;
} }