*Fixed mess up with lustars merge.

*Added Playcounter Reset to GameSettings (545 fixed the PlayCounter not GameCounter :P)
*Added global PlayCounter reset function (its not used yet)
*Probably fixed the issue some HDDs had ("No partition found")
*Probably fixed cursor disappearing after downloading update
This commit is contained in:
dimok321 2009-06-20 08:19:01 +00:00
parent 92441e56b2
commit cdc9f7afbd
7 changed files with 77 additions and 52 deletions

View File

@ -199,6 +199,7 @@ snprintf(LANGUAGE.ReloadSD, sizeof(LANGUAGE.ReloadSD), "Reload SD");
snprintf(LANGUAGE.RenameGameonWBFS, sizeof(LANGUAGE.RenameGameonWBFS), "Rename Game on WBFS");
snprintf(LANGUAGE.Restart, sizeof(LANGUAGE.Restart), "Restart");
snprintf(LANGUAGE.Restarting, sizeof(LANGUAGE.Restarting), "Restarting...");
snprintf(LANGUAGE.Resetplaycounter, sizeof(LANGUAGE.Resetplaycounter), "Reset Playcounter");
snprintf(LANGUAGE.Return, sizeof(LANGUAGE.Return), "Return");
snprintf(LANGUAGE.released, sizeof(LANGUAGE.released), "Released");
snprintf(LANGUAGE.ReturntoWiiMenu, sizeof(LANGUAGE.ReturntoWiiMenu), "Return to Wii Menu");
@ -210,6 +211,7 @@ snprintf(LANGUAGE.SaveFailed, sizeof(LANGUAGE.SaveFailed), "Save Failed");
snprintf(LANGUAGE.Specialthanksto, sizeof(LANGUAGE.Specialthanksto), "Special thanks to:");
snprintf(LANGUAGE.For, sizeof(LANGUAGE.For), "for");
snprintf(LANGUAGE.theUSBLoaderandreleasingthesourcecode, sizeof(LANGUAGE.theUSBLoaderandreleasingthesourcecode), "for the USB Loader source");
snprintf(LANGUAGE.Screensaver, sizeof(LANGUAGE.Screensaver), "Screensaver");
snprintf(LANGUAGE.secondsleft, sizeof(LANGUAGE.secondsleft), "seconds left");
snprintf(LANGUAGE.Setasbackgroundmusic, sizeof(LANGUAGE.Setasbackgroundmusic), "Set as backgroundmusic?");
snprintf(LANGUAGE.SelectthePartition, sizeof(LANGUAGE.SelectthePartition), "Select the Partition");
@ -998,6 +1000,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.theUSBLoaderandreleasingthesourcecode, val, sizeof(LANGUAGE.theUSBLoaderandreleasingthesourcecode));
return;
}
if (strcmp(name, "Screensaver") == 0) {
strcopy(LANGUAGE.Screensaver, val, sizeof(LANGUAGE.Screensaver));
return;
}
if (strcmp(name, "secondsleft") == 0) {
strcopy(LANGUAGE.secondsleft, val, sizeof(LANGUAGE.secondsleft));
return;
@ -1246,6 +1252,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Restarting, val, sizeof(LANGUAGE.Restarting));
return;
}
if (strcmp(name, "Resetplaycounter") == 0) {
strcopy(LANGUAGE.Resetplaycounter, val, sizeof(LANGUAGE.Resetplaycounter));
return;
}
if (strcmp(name, "available") == 0) {
strcopy(LANGUAGE.available, val, sizeof(LANGUAGE.available));
return;

View File

@ -197,6 +197,7 @@ struct LANGUAGE
char RenameGameonWBFS[50];
char Restart[30];
char Restarting[20];
char Resetplaycounter[50];
char Return[30];
char ReturntoWiiMenu[50];
char Right[30];
@ -207,6 +208,7 @@ struct LANGUAGE
char Specialthanksto[50];
char For[20];
char theUSBLoaderandreleasingthesourcecode[100];
char Screensaver[50];
char secondsleft[50];
char SelectthePartition[50];
char youwanttoformat[50];

View File

@ -11,7 +11,6 @@
#include <string.h>
#include <stdio.h> //CLOCK
#include <time.h>
#include <ogc/machine/processor.h>
#include "libwiigui/gui.h"
#include "libwiigui/gui_gamegrid.h"
@ -1683,34 +1682,12 @@ static int MenuCheck()
if(ret2 == 1) {
Settings.cios = ios249;
} else if(ret2 == 2) {
if(Settings.cios != ios222)
{
HaltGui();
ret2 = Sys_IosReload(222);
if(ret2 < 0)
Sys_IosReload(249);
ResumeGui();
if(ret2 < 0) {
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
WindowPrompt(LANGUAGE.YoudonthavecIOS,LANGUAGE.LoadingincIOS,LANGUAGE.ok, 0,0,0);
WPAD_Flush(0);
WPAD_Disconnect(0);
WPAD_Shutdown();
} else {
Settings.cios = ios222;
load_ehc_module();
}
}
Settings.cios = ios222;
} else {
Sys_LoadMenu();
}
ret2 = DiscWait(LANGUAGE.NoUSBDevice, LANGUAGE.WaitingforUSBDevice, 0, 0, 1);
//reinitialize SD and USB
SDCard_Init();
USBDevice_Init();
Wpad_Init();
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
@ -1748,6 +1725,9 @@ static int MenuCheck()
}
}
SDCard_Init();
USBDevice_Init();
if(shutdown == 1)
Sys_Shutdown();
if(reset == 1)
@ -1901,19 +1881,7 @@ int MainMenu(int menu)
break;
}
bool onlinefix = IsNetworkInit();
if(onlinefix && IOS_GetVersion() == ios2) {
s32 kd_fd, ret;
STACK_ALIGN(u8, kd_buf, 0x20, 32);
kd_fd = IOS_Open("/dev/net/kd/request", 0);
if (kd_fd >= 0) {
ret = IOS_Ioctl(kd_fd, 7, NULL, 0, kd_buf, 0x20);
if(ret >= 0)
onlinefix = false; // fixed no IOS reload needed
IOS_Close(kd_fd);
}
}
bool onlinefix = ShutdownWC24();
if(IOS_GetVersion() != ios2 || onlinefix == true) {
ret = Sys_IosReload(ios2);
if(ret < 0) {

View File

@ -2310,6 +2310,7 @@ int ProgressUpdateWindow()
pfile = fopen(dolpath, "wb");
u8 blockbuffer[BLOCKSIZE] ATTRIBUTE_ALIGN(32);
for (s32 i = 0; i < filesize; i += BLOCKSIZE) {
VIDEO_WaitVSync();
prTxt.SetTextf("%i%%", 100*i/filesize);
if ((Settings.wsprompt == yes) && (CFG.widescreen)) {
progressbarImg.SetTile(80*i/filesize);

View File

@ -478,7 +478,7 @@ int MenuSettings()
options2.SetName(7, "%s",LANGUAGE.Wiilight);
options2.SetName(8, "%s",LANGUAGE.Rumble);
options2.SetName(10, "%s",LANGUAGE.XMLTitles);
options2.SetName(11, "Screensaver");
options2.SetName(11, "%s",LANGUAGE.Screensaver);
for(int i = 0; i <= MAXOPTIONS; i++) options2.SetValue(i, NULL);
optionBrowser2.SetScrollbar(1);
w.Append(&optionBrowser2);
@ -673,14 +673,7 @@ int MenuSettings()
case 9:
break;
case 10:
//HaltGui(); this isn't done on the fly yet. you have to restart the loader for it to take effect
Settings.titlesOverride++;
//if(isInserted(bootDevice)) {
//cfg_save_global();
//}
//CFG_Load();
//__Menu_GetEntries();
//ResumeGui();
break;
case 11:
Settings.screensaver++;
@ -1736,7 +1729,8 @@ int GameSettings(struct discHdr * header)
options3.SetName(7,"%s", LANGUAGE.Patchcountrystrings);
options3.SetName(8,"%s", LANGUAGE.Alternatedol);
options3.SetName(9,"%s", LANGUAGE.Blockiosreload);
options3.SetName(10,"%s", LANGUAGE.Defaultgamesettings);
options3.SetName(10,"%s", LANGUAGE.Resetplaycounter);
options3.SetName(11,"%s", LANGUAGE.Defaultgamesettings);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
@ -1901,6 +1895,7 @@ int GameSettings(struct discHdr * header)
else if (reloadblock == off) options3.SetValue(9,LANGUAGE.OFF);
options3.SetValue(10, NULL);
options3.SetValue(11, NULL);
if(shutdown == 1)
Sys_Shutdown();
@ -1942,6 +1937,24 @@ int GameSettings(struct discHdr * header)
reloadblock = (reloadblock+1) % 2;
break;
case 10:
int result;
result = WindowPrompt(LANGUAGE.Areyousure,0,LANGUAGE.Yes,LANGUAGE.Cancel,0,0);
if(result == 1) {
if(isInserted(bootDevice)) {
struct Game_NUM* game_num = CFG_get_game_num(header->id);
if (game_num) {
favoritevar = game_num->favorite;
playcount = game_num->count;
} else {
favoritevar = 0;
playcount = 0;
}
playcount = 0;
CFG_save_game_num(header->id);
}
}
break;
case 11:
int choice = WindowPrompt(LANGUAGE.Areyousure,0,LANGUAGE.Yes,LANGUAGE.Cancel,0,0);
if(choice == 1) {
videoChoice = Settings.video;

View File

@ -11,8 +11,6 @@
#include "xml/xml.h" /* XML - Lustar*/
#include "cfg.h"
struct SSettings Settings;
@ -1469,7 +1467,7 @@ bool cfg_save_games()
fprintf(f, "errorfix002:%d; ", cfg_game[i].errorfix002);
fprintf(f, "iosreloadblock:%d; ", cfg_game[i].iosreloadblock);
fprintf(f, "patchcountrystrings:%d; ", cfg_game[i].patchcountrystrings);
fprintf(f, "loadalternatedol:%d; ", cfg_game[i].loadalternatedol);
fprintf(f, "loadalternatedol:%d;\n", cfg_game[i].loadalternatedol);
}
fprintf(f, "# END\n");
fclose(f);
@ -1509,6 +1507,39 @@ bool cfg_save_game_num()
return true;
}
bool CFG_reset_all_playcounters()
{
FILE *f;
int i;
char GXGameFavorites_cfg[32];
sprintf(GXGameFavorites_cfg, "%s/config", bootDevice);
mkdir(GXGameFavorites_cfg, 0777);
sprintf(GXGameFavorites_cfg, "%s/config/GXGameFavorites.cfg", bootDevice);
f = fopen(GXGameFavorites_cfg, "w");
if (!f) {
printf("Error saving %s\n", "GXGameFavorites.cfg");
sleep(1);
return false;
}
fprintf(f, "# USB Loader settings file\n");
fprintf(f, "# note: this file is automatically generated\n");
fclose(f);
/* Closing and reopening because of a write issue we are having right now */
f = fopen(GXGameFavorites_cfg, "w");
fprintf(f, "# USB Loader settings file\n");
fprintf(f, "# note: this file is automatically generated\n");
fprintf(f, "# Num Games: %d\n", num_saved_game_num);
for (i=0; i<num_saved_game_num; i++) {
fprintf(f, "game:%s = ", cfg_game_num[i].id);
fprintf(f, "favorite:%d; ", cfg_game_num[i].favorite);
fprintf(f, "count:0;\n");
}
fprintf(f, "# END\n");
fclose(f);
return true;
}
bool cfg_load_global()
{
char GXGlobal_cfg[26];

View File

@ -194,10 +194,11 @@ struct Game_CFG* CFG_get_game_opt(u8 *id);
struct Game_NUM* CFG_get_game_num(u8 *id);
bool CFG_save_game_opt(u8 *id);
bool CFG_save_game_num(u8 *id);
bool CFG_reset_all_playcounters();
bool CFG_forget_game_opt(u8 *id);
bool CFG_forget_game_num(u8 *id);
//Astidof - Begin of modification
enum {
ConsoleLangDefault=0,
jap,
@ -356,7 +357,6 @@ struct SSettings {
void CFG_LoadGlobal(void);
bool cfg_save_global(void);
//Astidof - End of modification
bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool freemem);