The default language is now detected so if your language is available on the Wii you don't need to set it in the loader. The database language follows the main language setting, you don't need to set the Game language in addition to enabling "title from xml" to see titles/synopsis anymore. Fixed titles reloading when the GUI language changed. Added new accessories and icons on the game info page. The homebrew browser slide factor now goes up to 11.

This commit is contained in:
lustar.mii 2009-08-01 07:40:22 +00:00
parent 38261886c4
commit 8fef0223c5
35 changed files with 310 additions and 135 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="false"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="false"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="true"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e></ViewState></pd> <pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="false"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="false"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="false"></e><e p="gui\source\patches" x="false"></e></ViewState></pd>

View File

@ -353,6 +353,9 @@ extern const u32 Wiimote1_png_size;
extern const u8 Wiimote2_png[]; extern const u8 Wiimote2_png[];
extern const u32 Wiimote2_png_size; extern const u32 Wiimote2_png_size;
extern const u8 Wiimote4_png[];
extern const u32 Wiimote4_png_size;
extern const u8 wifi1_png[]; extern const u8 wifi1_png[];
extern const u32 wifi1_png_size; extern const u32 wifi1_png_size;
@ -365,11 +368,20 @@ extern const u32 wifi3_png_size;
extern const u8 wifi4_png[]; extern const u8 wifi4_png[];
extern const u32 wifi4_png_size; extern const u32 wifi4_png_size;
//extern const u8 wifi6_png[];
//extern const u32 wifi6_png_size;
extern const u8 wifi8_png[]; extern const u8 wifi8_png[];
extern const u32 wifi8_png_size; extern const u32 wifi8_png_size;
extern const u8 Wiimote4_png[]; extern const u8 wifi12_png[];
extern const u32 Wiimote4_png_size; extern const u32 wifi12_png_size;
extern const u8 wifi16_png[];
extern const u32 wifi16_png_size;
extern const u8 wifi32_png[];
extern const u32 wifi32_png_size;
extern const u8 norating_png[]; extern const u8 norating_png[];
extern const u32 norating_png_size; extern const u32 norating_png_size;
@ -424,6 +436,26 @@ extern const u32 wheel_png_size;
extern const u8 wheelR_png[]; extern const u8 wheelR_png[];
extern const u32 wheelR_png_size; extern const u32 wheelR_png_size;
extern const u8 zapper_png[];
extern const u32 zapper_png_size;
extern const u8 zapperR_png[];
extern const u32 zapperR_png_size;
extern const u8 wiispeak_png[];
extern const u32 wiispeak_png_size;
extern const u8 wiispeakR_png[];
extern const u32 wiispeakR_png_size;
extern const u8 nintendods_png[];
extern const u32 nintendods_png_size;
extern const u8 nintendodsR_png[];
extern const u32 nintendodsR_png_size;
/*
extern const u8 vitalitysensor_png[];
extern const u32 vitalitysensor_png_size;
extern const u8 vitalitysensor_png[];
extern const u32 vitalitysensorR_png_size;
*/
extern const u8 esrb_ec_png[]; extern const u8 esrb_ec_png[];
extern const u32 esrb_ec_png_size; extern const u32 esrb_ec_png_size;

View File

@ -337,16 +337,16 @@ int MenuHomebrewBrowse() {
MainButton4.StopEffect(); MainButton4.StopEffect();
if (slidedirection == RIGHT) { if (slidedirection == RIGHT) {
MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 60);
MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 60);
MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 60);
MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 60);
while (MainButton1.GetEffect()>0) usleep(50); while (MainButton1.GetEffect()>0) usleep(50);
} else if (slidedirection == LEFT) { } else if (slidedirection == LEFT) {
MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 60);
MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 60);
MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 60);
MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 60);
while (MainButton1.GetEffect()>0) usleep(50); while (MainButton1.GetEffect()>0) usleep(50);
} }
@ -590,15 +590,15 @@ int MenuHomebrewBrowse() {
MainButton3.SetEffect(EFFECT_FADE, 20); MainButton3.SetEffect(EFFECT_FADE, 20);
MainButton4.SetEffect(EFFECT_FADE, 20); MainButton4.SetEffect(EFFECT_FADE, 20);
} else if (slidedirection == LEFT) { } else if (slidedirection == LEFT) {
MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 60);
MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 60);
MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 60);
MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 60);
} else if (slidedirection == RIGHT) { } else if (slidedirection == RIGHT) {
MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 60);
MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 60);
MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 60);
MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 60);
} }
mainWindow->Append(&w); mainWindow->Append(&w);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -1069,6 +1069,7 @@ int MenuDiscList() {
break; break;
case 'J': case 'J':
case 'W':
sprintf(gameregion,"NTSC J"); sprintf(gameregion,"NTSC J");
break; break;
@ -1076,12 +1077,13 @@ int MenuDiscList() {
sprintf(gameregion,"NTSC K"); sprintf(gameregion,"NTSC K");
break; break;
case 'P': case 'P':
case 'D': case 'D':
case 'F': case 'F':
case 'X': case 'I':
case 'S': case 'S':
case 'H':
case 'X':
case 'Y': case 'Y':
sprintf(gameregion," PAL "); sprintf(gameregion," PAL ");
break; break;
@ -1275,7 +1277,9 @@ int MenuDiscList() {
//re-evaluate header now in case they changed games while on the game prompt //re-evaluate header now in case they changed games while on the game prompt
header = &gameList[gameSelected]; header = &gameList[gameSelected];
int settret = GameSettings(header); int settret = GameSettings(header);
menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed) /* unneeded for now, kept in case database gets a separate language setting
//menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed)
*/
HaltGui(); HaltGui();
if (Settings.gameDisplay==list) mainWindow->Append(gameBrowser); if (Settings.gameDisplay==list) mainWindow->Append(gameBrowser);
else if (Settings.gameDisplay==grid) mainWindow->Append(gameGrid); else if (Settings.gameDisplay==grid) mainWindow->Append(gameGrid);
@ -1648,8 +1652,6 @@ static int MenuCheck() {
partitionEntry partitions[MAX_PARTITIONS]; partitionEntry partitions[MAX_PARTITIONS];
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true);
wbfsinit = WBFS_Init(WBFS_DEVICE_USB); wbfsinit = WBFS_Init(WBFS_DEVICE_USB);
if (wbfsinit < 0) { if (wbfsinit < 0) {

View File

@ -1991,10 +1991,6 @@ ProgressDownloadWindow(int choice2) {
} }
} }
// get Wii's language setting
char sysLanguage[3];
GetLanguageToLangCode(sysLanguage);
//int server = 1; //int server = 1;
while (i < cntMissFiles) { while (i < cntMissFiles) {
tries=0; tries=0;
@ -2025,6 +2021,7 @@ ProgressDownloadWindow(int choice2) {
//Creates URL depending from which Country the game is //Creates URL depending from which Country the game is
switch (missingFiles[i][3]) { switch (missingFiles[i][3]) {
case 'J': case 'J':
case 'W':
sprintf(URLFile,"%sJA/%s",server3d,missingFiles[i]); sprintf(URLFile,"%sJA/%s",server3d,missingFiles[i]);
break; break;
case 'K': case 'K':
@ -2040,7 +2037,7 @@ ProgressDownloadWindow(int choice2) {
case 'H': case 'H':
case 'X': case 'X':
case 'Y': case 'Y':
sprintf(URLFile,"%s%s/%s",server3d,sysLanguage,missingFiles[i]); sprintf(URLFile,"%s%s/%s",server3d,Settings.db_language,missingFiles[i]);
break; break;
case 'E': case 'E':
sprintf(URLFile,"%sUS/%s",server3d,missingFiles[i]); sprintf(URLFile,"%sUS/%s",server3d,missingFiles[i]);
@ -2069,6 +2066,7 @@ ProgressDownloadWindow(int choice2) {
//Creates URL depending from which Country the game is //Creates URL depending from which Country the game is
switch (missingFiles[i][3]) { switch (missingFiles[i][3]) {
case 'J': case 'J':
case 'W':
sprintf(URLFile,"%sJA/%s",serverDisc,missingFiles[i]); sprintf(URLFile,"%sJA/%s",serverDisc,missingFiles[i]);
break; break;
case 'K': case 'K':
@ -2084,7 +2082,7 @@ ProgressDownloadWindow(int choice2) {
case 'H': case 'H':
case 'X': case 'X':
case 'Y': case 'Y':
sprintf(URLFile,"%s%s/%s",serverDisc,sysLanguage,missingFiles[i]); sprintf(URLFile,"%s%s/%s",serverDisc,Settings.db_language,missingFiles[i]);
break; break;
case 'E': case 'E':
sprintf(URLFile,"%sUS/%s",serverDisc,missingFiles[i]); sprintf(URLFile,"%sUS/%s",serverDisc,missingFiles[i]);
@ -2111,6 +2109,7 @@ ProgressDownloadWindow(int choice2) {
//Creates URL depending from which Country the game is //Creates URL depending from which Country the game is
switch (missingFiles[i][3]) { switch (missingFiles[i][3]) {
case 'J': case 'J':
case 'W':
sprintf(URLFile,"%sJA/%s",server2d,missingFiles[i]); sprintf(URLFile,"%sJA/%s",server2d,missingFiles[i]);
break; break;
case 'K': case 'K':
@ -2126,7 +2125,7 @@ ProgressDownloadWindow(int choice2) {
case 'H': case 'H':
case 'X': case 'X':
case 'Y': case 'Y':
sprintf(URLFile,"%s%s/%s",server2d,sysLanguage,missingFiles[i]); sprintf(URLFile,"%s%s/%s",server2d,Settings.db_language,missingFiles[i]);
break; break;
case 'E': case 'E':
sprintf(URLFile,"%sUS/%s",server2d,missingFiles[i]); sprintf(URLFile,"%sUS/%s",server2d,missingFiles[i]);
@ -2395,15 +2394,11 @@ int ProgressUpdateWindow() {
} }
} }
// get Wii's language setting
char sysLanguage[3];
GetLanguageToLangCode(sysLanguage);
//make the URL to get XML based on our games //make the URL to get XML based on our games
char XMLurl[2040]; char XMLurl[2040];
char filename[10]; char filename[10];
__Menu_GetEntries(1); __Menu_GetEntries(1);
snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s?ID=",sysLanguage); snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s?ID=",Settings.db_language);
unsigned int i; unsigned int i;
for (i = 0; i < gameCnt ; i++) { for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i]; struct discHdr* header = &gameList[i];
@ -2664,15 +2659,11 @@ int ProgressUpdateWindow() {
} }
} }
// get Wii's language setting
char sysLanguage[3];
GetLanguageToLangCode(sysLanguage);
//make the URL to get XML based on our games //make the URL to get XML based on our games
char XMLurl[2040]; char XMLurl[2040];
char filename[10]; char filename[10];
__Menu_GetEntries(1); __Menu_GetEntries(1);
snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s?ID=",sysLanguage); snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s?ID=",Settings.db_language);
unsigned int i; unsigned int i;
for (i = 0; i < gameCnt ; i++) { for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i]; struct discHdr* header = &gameList[i];
@ -3002,47 +2993,6 @@ char * GetMissingFiles() {
/* get the language setting from the Wii settings and return a language code */
void GetLanguageToLangCode(char *langcode) {
switch (CONF_GetLanguage()) {
case CONF_LANG_JAPANESE:
sprintf(langcode, "JA");
break;
case CONF_LANG_ENGLISH:
sprintf(langcode, "EN");
break;
case CONF_LANG_GERMAN:
sprintf(langcode, "DE");
break;
case CONF_LANG_FRENCH:
sprintf(langcode, "FR");
break;
case CONF_LANG_SPANISH:
sprintf(langcode, "ES");
break;
case CONF_LANG_ITALIAN:
sprintf(langcode, "IT");
break;
case CONF_LANG_DUTCH:
sprintf(langcode, "NL");
break;
/*
case CONF_LANG_PORTUGUESE:
sprintf(langcode, "PO");
break;
*/
case CONF_LANG_SIMP_CHINESE:
sprintf(langcode, "EN"); // default to EN for chinese
break;
case CONF_LANG_TRAD_CHINESE:
sprintf(langcode, "EN"); // default to EN for chinese
break;
case CONF_LANG_KOREAN:
sprintf(langcode, "KO");
break;
}
}
/**************************************************************************** /****************************************************************************
* HBCWindowPrompt * HBCWindowPrompt

View File

@ -28,7 +28,6 @@ bool NetworkInitPrompt();
char * GetMissingFiles(); char * GetMissingFiles();
int WindowScreensaver(); int WindowScreensaver();
int CodeDownload(const char *id); int CodeDownload(const char *id);
void GetLanguageToLangCode(char *langcode);
int HBCWindowPrompt(const char *name, const char *coder, const char *version, int HBCWindowPrompt(const char *name, const char *coder, const char *version,
const char *release_date, const char *long_description, const char *release_date, const char *long_description,
const char *iconPath, u64 filesize); const char *iconPath, u64 filesize);

View File

@ -59,15 +59,19 @@ int showGameInfo(char *ID) {
int wifiY=0; int wifiY=0;
int intputX=200, inputY=-30, txtXOffset=90; int intputX=200, inputY=-30, txtXOffset=90;
u8 nunchuk=0, u8 nunchuk=0,
classiccontroller=0, classiccontroller=0,
balanceboard=0, balanceboard=0,
dancepad=0, dancepad=0,
guitar=0, guitar=0,
gamecube=0, gamecube=0,
wheel=0, wheel=0,
motionplus=0, motionplus=0,
drums=0, drums=0,
microphone=0; microphone=0,
zapper=0,
nintendods=0,
wiispeak=0,
vitalitysensor=0;
int newline=1; int newline=1;
u8 page=1; u8 page=1;
@ -87,6 +91,10 @@ int showGameInfo(char *ID) {
GuiImage * wheelImg = NULL; GuiImage * wheelImg = NULL;
GuiImage * balanceboardImg = NULL; GuiImage * balanceboardImg = NULL;
GuiImage * microphoneImg = NULL; GuiImage * microphoneImg = NULL;
GuiImage * zapperImg = NULL;
GuiImage * nintendodsImg = NULL;
GuiImage * wiispeakImg = NULL;
GuiImage * vitalitysensorImg = NULL;
GuiImage * gcImg = NULL; GuiImage * gcImg = NULL;
GuiImage * dialogBoxImg1 = NULL; GuiImage * dialogBoxImg1 = NULL;
GuiImage * dialogBoxImg2 = NULL; GuiImage * dialogBoxImg2 = NULL;
@ -108,6 +116,10 @@ int showGameInfo(char *ID) {
GuiImageData * balanceboardImgData = NULL; GuiImageData * balanceboardImgData = NULL;
GuiImageData * dancepadImgData = NULL; GuiImageData * dancepadImgData = NULL;
GuiImageData * microphoneImgData = NULL; GuiImageData * microphoneImgData = NULL;
GuiImageData * zapperImgData = NULL;
GuiImageData * nintendodsImgData = NULL;
GuiImageData * wiispeakImgData = NULL;
GuiImageData * vitalitysensorImgData = NULL;
GuiImageData * gamecubeImgData = NULL; GuiImageData * gamecubeImgData = NULL;
GuiImageData * ratingImgData = NULL; GuiImageData * ratingImgData = NULL;
GuiImageData * cover = NULL; GuiImageData * cover = NULL;
@ -213,8 +225,16 @@ int showGameInfo(char *ID) {
wheel=1; wheel=1;
if (strcmp(gameinfo.accessoriesReq[i],"balanceboard")==0) if (strcmp(gameinfo.accessoriesReq[i],"balanceboard")==0)
balanceboard=1; balanceboard=1;
if (strcmp(gameinfo.accessoriesReq[i],"microphone")==0) if (strcmp(gameinfo.accessoriesReq[i],"microphone")==0)
microphone=1; microphone=1;
if (strcmp(gameinfo.accessoriesReq[i],"zapper")==0)
zapper=1;
if (strcmp(gameinfo.accessoriesReq[i],"nintendods")==0)
nintendods=1;
if (strcmp(gameinfo.accessoriesReq[i],"wiispeak")==0)
wiispeak=1;
if (strcmp(gameinfo.accessoriesReq[i],"vitalitysensor")==0)
vitalitysensor=1;
if (strcmp(gameinfo.accessoriesReq[i],"gamecube")==0) if (strcmp(gameinfo.accessoriesReq[i],"gamecube")==0)
gamecube=1; gamecube=1;
} }
@ -244,6 +264,18 @@ int showGameInfo(char *ID) {
if (microphone) microphoneImgData = new GuiImageData(microphoneR_png); if (microphone) microphoneImgData = new GuiImageData(microphoneR_png);
else microphoneImgData = new GuiImageData(microphone_png); else microphoneImgData = new GuiImageData(microphone_png);
if (zapper) zapperImgData = new GuiImageData(zapperR_png);
else zapperImgData = new GuiImageData(zapper_png);
if (wiispeak) wiispeakImgData = new GuiImageData(wiispeakR_png);
else wiispeakImgData = new GuiImageData(wiispeak_png);
if (nintendods) nintendodsImgData = new GuiImageData(nintendodsR_png);
else nintendodsImgData = new GuiImageData(nintendods_png);
//if (vitalitysensor) vitalitysensorImgData = new GuiImageData(vitalitysensorR_png);
//else vitalitysensorImgData = new GuiImageData(vitalitysensor_png);
if (balanceboard) balanceboardImgData = new GuiImageData(balanceboardR_png); if (balanceboard) balanceboardImgData = new GuiImageData(balanceboardR_png);
else balanceboardImgData = new GuiImageData(balanceboard_png); else balanceboardImgData = new GuiImageData(balanceboard_png);
@ -270,6 +302,14 @@ int showGameInfo(char *ID) {
balanceboard=1; balanceboard=1;
if (strcmp(gameinfo.accessories[i],"microphone")==0) if (strcmp(gameinfo.accessories[i],"microphone")==0)
microphone=1; microphone=1;
if (strcmp(gameinfo.accessories[i],"zapper")==0)
zapper=1;
if (strcmp(gameinfo.accessories[i],"nintendods")==0)
nintendods=1;
if (strcmp(gameinfo.accessories[i],"wiispeak")==0)
wiispeak=1;
if (strcmp(gameinfo.accessories[i],"vitalitysensor")==0)
vitalitysensor=1;
if (strcmp(gameinfo.accessories[i],"gamecube")==0) if (strcmp(gameinfo.accessories[i],"gamecube")==0)
gamecube=1; gamecube=1;
} }
@ -393,6 +433,40 @@ int showGameInfo(char *ID) {
gameinfoWindow.Append(microphoneImg); gameinfoWindow.Append(microphoneImg);
intputX += (CFG.widescreen ? microphoneImg->GetWidth() * .8 : microphoneImg->GetWidth())+5; intputX += (CFG.widescreen ? microphoneImg->GetWidth() * .8 : microphoneImg->GetWidth())+5;
} }
if (zapper==1) {
zapperImg = new GuiImage( zapperImgData);
zapperImg->SetWidescreen(CFG.widescreen);
zapperImg->SetPosition(intputX , inputY);
zapperImg->SetAlignment(0,4);
gameinfoWindow.Append(zapperImg);
intputX += (CFG.widescreen ? zapperImg->GetWidth() * .8 : zapperImg->GetWidth())+5;
}
if (wiispeak==1) {
wiispeakImg = new GuiImage(wiispeakImgData);
wiispeakImg->SetWidescreen(CFG.widescreen);
wiispeakImg->SetPosition(intputX , inputY);
wiispeakImg->SetAlignment(0,4);
gameinfoWindow.Append(wiispeakImg);
intputX += (CFG.widescreen ? wiispeakImg->GetWidth() * .8 : wiispeakImg->GetWidth())+5;
}
if (nintendods==1) {
nintendodsImg = new GuiImage(nintendodsImgData);
nintendodsImg->SetWidescreen(CFG.widescreen);
nintendodsImg->SetPosition(intputX , inputY);
nintendodsImg->SetAlignment(0,4);
gameinfoWindow.Append(nintendodsImg);
intputX += (CFG.widescreen ? nintendodsImg->GetWidth() * .8 : nintendodsImg->GetWidth())+5;
}
/*
if (vitalitysensor==1) {
vitalitysensorImg = new GuiImage(vitalitysensorImgData);
vitalitysensorImg->SetWidescreen(CFG.widescreen);
vitalitysensorImg->SetPosition(intputX , inputY);
vitalitysensorImg->SetAlignment(0,4);
gameinfoWindow.Append(vitalitysensorImg);
intputX += (CFG.widescreen ? vitalitysensorImg->GetWidth() * .8 : vitalitysensorImg->GetWidth())+5;
}
*/
if (dancepad==1) { if (dancepad==1) {
dancepadImg = new GuiImage(dancepadImgData); dancepadImg = new GuiImage(dancepadImgData);
dancepadImg->SetWidescreen(CFG.widescreen); dancepadImg->SetWidescreen(CFG.widescreen);
@ -420,14 +494,23 @@ int showGameInfo(char *ID) {
wifiplayersImgData= new GuiImageData(wifi4_png); wifiplayersImgData= new GuiImageData(wifi4_png);
} }
if (atoi(gameinfo.wifiplayers)>4) { if (atoi(gameinfo.wifiplayers)>4) {
//wifiplayersImgData= new GuiImageData(wifi6_png);
wifiplayersImgData= new GuiImageData(wifi8_png); wifiplayersImgData= new GuiImageData(wifi8_png);
} }
/*if (atoi(gameinfo.wifiplayers)>8){ uncomment this when we actually have these images and it is needed /*
wifiplayersImgData= new GuiImageData(wifi12_png);} if (atoi(gameinfo.wifiplayers)>6) {
if (atoi(gameinfo.wifiplayers)>12){ wifiplayersImgData= new GuiImageData(wifi8_png);
wifiplayersImgData= new GuiImageData(wifi16_png);} }
if (atoi(gameinfo.wifiplayers)>16){ */
wifiplayersImgData= new GuiImageData(wifi32_png);}*/ if (atoi(gameinfo.wifiplayers)>8) {
wifiplayersImgData= new GuiImageData(wifi12_png);
}
if (atoi(gameinfo.wifiplayers)>12) {
wifiplayersImgData= new GuiImageData(wifi16_png);
}
if (atoi(gameinfo.wifiplayers)>16) {
wifiplayersImgData= new GuiImageData(wifi32_png);
}
wifiplayersImg = new GuiImage(wifiplayersImgData); wifiplayersImg = new GuiImage(wifiplayersImgData);
wifiplayersImg->SetWidescreen(CFG.widescreen); wifiplayersImg->SetWidescreen(CFG.widescreen);
wifiplayersImg->SetPosition(intputX , inputY); wifiplayersImg->SetPosition(intputX , inputY);
@ -821,6 +904,10 @@ int showGameInfo(char *ID) {
delete wheelImg; delete wheelImg;
delete balanceboardImg; delete balanceboardImg;
delete microphoneImg; delete microphoneImg;
delete zapperImg;
delete wiispeakImg;
delete nintendodsImg;
delete vitalitysensorImg;
delete gcImg; delete gcImg;
delete dialogBoxImg1; delete dialogBoxImg1;
delete dialogBoxImg2; delete dialogBoxImg2;
@ -842,6 +929,10 @@ int showGameInfo(char *ID) {
delete balanceboardImgData; delete balanceboardImgData;
delete dancepadImgData; delete dancepadImgData;
delete microphoneImgData; delete microphoneImgData;
delete zapperImgData;
delete wiispeakImgData;
delete nintendodsImgData;
delete vitalitysensorImgData;
delete gamecubeImgData; delete gamecubeImgData;
delete ratingImgData; delete ratingImgData;
delete cover; delete cover;
@ -899,11 +990,8 @@ bool save_XML_URL() { // save xml url as as txt file for people without wifi
char XMLurl[2040]; char XMLurl[2040];
char filename[10]; char filename[10];
// get Wii's language setting
char sysLanguage[3];
GetLanguageToLangCode(sysLanguage);
snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s?ID=",sysLanguage); snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s?ID=", Settings.db_language);
unsigned int i; unsigned int i;
for (i = 0; i < gameCnt ; i++) { for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i]; struct discHdr* header = &gameList[i];

View File

@ -16,12 +16,14 @@
#include "filelist.h" #include "filelist.h"
#include "listfiles.h" #include "listfiles.h"
#include "sys.h" #include "sys.h"
#include "cfg.h"
#define MAXOPTIONS 12 #define MAXOPTIONS 12
/*** Extern functions ***/ /*** Extern functions ***/
extern void ResumeGui(); extern void ResumeGui();
extern void HaltGui(); extern void HaltGui();
extern bool OpenXMLDatabase(bool openfile, bool loadtitles, bool freemem); extern bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool keepopen);
extern void title_set(char *id, char *title);
/*** Extern variables ***/ /*** Extern variables ***/
extern GuiWindow * mainWindow; extern GuiWindow * mainWindow;
@ -31,6 +33,9 @@ extern GuiImageData * pointer[4];
extern GuiImageData * background; extern GuiImageData * background;
extern u8 shutdown; extern u8 shutdown;
extern u8 reset; extern u8 reset;
extern struct discHdr * gameList;
extern u32 gameCnt;
/**************************************************************************** /****************************************************************************
* MenuSettings * MenuSettings
@ -42,8 +47,10 @@ int MenuSettings() {
bool exit = false; bool exit = false;
// backup game language setting // backup game language setting
int opt_lang = 0; char opt_lang[100];
opt_lang = Settings.language; strcpy(opt_lang,Settings.language_path);
// backup title override setting
int opt_override = Settings.titlesOverride;
enum { enum {
FADE, FADE,
@ -1563,7 +1570,6 @@ int MenuSettings() {
remove(GXGlobal_cfg); remove(GXGlobal_cfg);
} }
gettextCleanUp(); gettextCleanUp();
//lang_default();
CFG_Load(); CFG_Load();
menu = MENU_SETTINGS; menu = MENU_SETTINGS;
pageToDisplay = 0; pageToDisplay = 0;
@ -1686,11 +1692,11 @@ int MenuSettings() {
// if language has changed, reload titles // if language has changed, reload titles
int opt_langnew = 0; char opt_langnew[100];
opt_langnew = Settings.language; strcpy(opt_langnew,Settings.language_path);
if (Settings.titlesOverride==1 && opt_lang != opt_langnew) { int opt_overridenew = Settings.titlesOverride;
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory if (strcmp(opt_lang,opt_langnew) || (opt_override != opt_overridenew && Settings.titlesOverride==1)) {
menu = MENU_DISCLIST; OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, false, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory
} }
HaltGui(); HaltGui();
@ -1856,7 +1862,7 @@ int GameSettings(struct discHdr * header) {
optionBrowser2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); optionBrowser2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
int opt_lang = languageChoice; // backup language setting //int opt_lang = languageChoice; // backup language setting
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
int pageToDisplay = 1; int pageToDisplay = 1;
@ -2200,13 +2206,15 @@ int GameSettings(struct discHdr * header) {
if (isInserted(bootDevice)) { if (isInserted(bootDevice)) {
if (CFG_save_game_opt(header->id)) { if (CFG_save_game_opt(header->id)) {
// if language has changed, reload titles /* commented because the database language now depends on the main language setting, this could be enabled again if there is a separate language setting for the database
// if game language has changed when saving game settings, reload titles
int opt_langnew = 0; int opt_langnew = 0;
game_cfg = CFG_get_game_opt(header->id); game_cfg = CFG_get_game_opt(header->id);
if (game_cfg) opt_langnew = game_cfg->language; if (game_cfg) opt_langnew = game_cfg->language;
if (Settings.titlesOverride==1 && opt_lang != opt_langnew) if (Settings.titlesOverride==1 && opt_lang != opt_langnew)
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory
// titles are refreshed in menu.cpp as soon as this function returns // titles are refreshed in menu.cpp as soon as this function returns
*/
WindowPrompt(tr("Successfully Saved"), 0, tr("OK")); WindowPrompt(tr("Successfully Saved"), 0, tr("OK"));
} else { } else {
WindowPrompt(tr("Save Failed"), 0, tr("OK")); WindowPrompt(tr("Save Failed"), 0, tr("OK"));
@ -2404,12 +2412,14 @@ int GameSettings(struct discHdr * header) {
parentalcontrolChoice = 0; parentalcontrolChoice = 0;
sprintf(alternatedname, " "); sprintf(alternatedname, " ");
CFG_forget_game_opt(header->id); CFG_forget_game_opt(header->id);
/* commented because the database language now depends on the main language setting, this could be enabled again if there is a separate language setting for the database
// if default language is different than language from main settings, reload titles // if default language is different than language from main settings, reload titles
int opt_langnew = 0; int opt_langnew = 0;
opt_langnew = Settings.language; opt_langnew = Settings.language;
if (Settings.titlesOverride==1 && opt_lang != opt_langnew) if (Settings.titlesOverride==1 && opt_lang != opt_langnew)
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory
// titles are refreshed in menu.cpp as soon as this function returns // titles are refreshed in menu.cpp as soon as this function returns
*/
} }
pageToDisplay = 1; pageToDisplay = 1;
@ -2435,7 +2445,16 @@ int GameSettings(struct discHdr * header) {
s32 thetimeofbg = bgMusic->GetPlayTime(); s32 thetimeofbg = bgMusic->GetPlayTime();
bgMusic->Stop(); bgMusic->Stop();
choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0); choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0);
if (!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { /*
// if language has changed, reload titles
int opt_langnew = 0;
game_cfg = CFG_get_game_opt(header->id);
if (game_cfg) opt_langnew = game_cfg->language;
if (Settings.titlesOverride==1 && opt_lang != opt_langnew)
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, false, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory
// titles are refreshed in menu.cpp as soon as this function returns
*/
if (!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play(); bgMusic->Play();
} else { } else {
bgMusic->PlayOggFile(Settings.ogg_path); bgMusic->PlayOggFile(Settings.ogg_path);

View File

@ -576,7 +576,6 @@ int MenuLanguageSelect() {
WindowPrompt(tr("File not found."),tr("Loading standard language."),tr("OK")); WindowPrompt(tr("File not found."),tr("Loading standard language."),tr("OK"));
} }
gettextCleanUp(); gettextCleanUp();
//lang_default();
CFG_Load(); CFG_Load();
returnhere = 2; returnhere = 2;
break; break;

View File

@ -8,6 +8,7 @@
#include <mxml.h> #include <mxml.h>
#include "language/gettext.h" #include "language/gettext.h"
#include "listfiles.h"
#include "xml/xml.h" /* XML - Lustar*/ #include "xml/xml.h" /* XML - Lustar*/
#include "cfg.h" #include "cfg.h"
@ -1644,9 +1645,22 @@ void CFG_Load(void) {
snprintf(pathname, sizeof(pathname), "%sGXtheme.cfg", CFG.theme_path); snprintf(pathname, sizeof(pathname), "%sGXtheme.cfg", CFG.theme_path);
cfg_parsefile(pathname, &theme_set); //finally set theme information cfg_parsefile(pathname, &theme_set); //finally set theme information
snprintf(pathname, sizeof(pathname), Settings.language_path); // set GUI language, use Wii's language setting if language is set to default
gettextLoadLanguage(pathname); int wiilang;
bool langisdefault = false;
wiilang = CONF_GetLanguage();
if (!strcmp("notset", Settings.language_path)) {
snprintf(Settings.language_path, sizeof(Settings.language_path), "%s%s.lang", Settings.languagefiles_path, map_get_name(map_language, wiilang + 1)); // + 1 because because CONF_LANG starts at 0
if (!checkfile(Settings.language_path)) {
sprintf(Settings.language_path, "notset");
}
gettextLoadLanguage(Settings.language_path);
langisdefault = true;
}
snprintf(pathname, sizeof(pathname), Settings.language_path);
gettextLoadLanguage(pathname);
// cfg_parsefile(pathname, &language_set); // cfg_parsefile(pathname, &language_set);
snprintf(pathname, sizeof(pathname), "%s/config/GXGameSettings.cfg", bootDevice); snprintf(pathname, sizeof(pathname), "%s/config/GXGameSettings.cfg", bootDevice);
@ -1658,16 +1672,39 @@ void CFG_Load(void) {
Global_Default(); //global default depends on theme information Global_Default(); //global default depends on theme information
CFG_LoadGlobal(); CFG_LoadGlobal();
// use GUI language for the database (Settings.db_language is used for game info/titles and covers)
char * languagefile;
languagefile = strrchr(Settings.language_path, '/')+1;
int mainlangid = -1;
int i;
for (i=0; map_language[i].name != NULL; i++) {
if (strstr(languagefile, map_language[i].name) != NULL) {
mainlangid = i - 1; // - 1 because CONF_LANG starts at 0
break;
}
}
GetLanguageToLangCode(&mainlangid, Settings.db_language);
// set language code for languages that are not available on the Wii
if (!strcmp(Settings.db_language,"")) {
if (strstr(languagefile, "portuguese") != NULL)
strcpy(Settings.db_language,"PO");
}
// open database if needed, load titles if needed
OpenXMLDatabase(Settings.titlestxt_path,Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true);
//moved this to the HDD wait screen to avoid the garbled green screen while it is loading *maybe* // titles.txt loaded after database to override database titles with custom titles
//OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true);
// loaded after database to override database titles with custom titles
//took out this titles.txt shit because it is useless now. teh xml has all the titles in it //took out this titles.txt shit because it is useless now. teh xml has all the titles in it
//snprintf(pathname, sizeof(pathname), "%stitles.txt", Settings.titlestxt_path); //snprintf(pathname, sizeof(pathname), "%stitles.txt", Settings.titlestxt_path);
//cfg_parsefile(pathname, &title_set); //cfg_parsefile(pathname, &title_set);
// cfg_parsearg(argc, argv); // cfg_parsearg(argc, argv);
// if GUI language is set to default Settings.language_path needs to remain "notset" (if the detected setting was kept detection wouldn't work next time)
if (langisdefault)
sprintf(Settings.language_path, "notset");
} }
void CFG_LoadGlobal(void) { void CFG_LoadGlobal(void) {
@ -1682,3 +1719,44 @@ void CFG_Cleanup(void) {
cfg_title = NULL; cfg_title = NULL;
} }
} }
/* map language id (or Wii language settting if langid is set to -1) to language code. CONF_LANG_JAPANESE = 0, not 1 */
void GetLanguageToLangCode(int *langid, char *langcode) {
if (langid < 0)
*langid = CONF_GetLanguage();
switch (*langid) {
case CONF_LANG_JAPANESE:
sprintf(langcode, "JA");
break;
case CONF_LANG_ENGLISH:
sprintf(langcode, "EN");
break;
case CONF_LANG_GERMAN:
sprintf(langcode, "DE");
break;
case CONF_LANG_FRENCH:
sprintf(langcode, "FR");
break;
case CONF_LANG_SPANISH:
sprintf(langcode, "ES");
break;
case CONF_LANG_ITALIAN:
sprintf(langcode, "IT");
break;
case CONF_LANG_DUTCH:
sprintf(langcode, "NL");
break;
case CONF_LANG_SIMP_CHINESE:
sprintf(langcode, "EN"); // default to EN for chinese
break;
case CONF_LANG_TRAD_CHINESE:
sprintf(langcode, "EN"); // default to EN for chinese
break;
case CONF_LANG_KOREAN:
sprintf(langcode, "KO");
break;
}
}

View File

@ -191,7 +191,6 @@ extern "C" {
void CFG_Default(int widescreen); // -1 = non forced mode void CFG_Default(int widescreen); // -1 = non forced mode
void CFG_Load(void); void CFG_Load(void);
void lang_defualt();
struct Game_CFG* CFG_get_game_opt(u8 *id); struct Game_CFG* CFG_get_game_opt(u8 *id);
struct Game_NUM* CFG_get_game_num(u8 *id); struct Game_NUM* CFG_get_game_num(u8 *id);
bool CFG_save_game_opt(u8 *id); bool CFG_save_game_opt(u8 *id);
@ -369,9 +368,12 @@ extern "C" {
void CFG_LoadGlobal(void); void CFG_LoadGlobal(void);
bool cfg_save_global(void); bool cfg_save_global(void);
void GetLanguageToLangCode(int *langid, char *langcode);
bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool freemem); bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool openfile, bool loadtitles, bool freemem);
char *get_title(struct discHdr *header); char *get_title(struct discHdr *header);
char *cfg_get_title(u8 *id) ;
void title_set(char *id, char *title);
u8 get_block(struct discHdr *header); u8 get_block(struct discHdr *header);
void CFG_Cleanup(void); void CFG_Cleanup(void);

View File

@ -12,14 +12,17 @@ Load game information from XML - Lustar
//#include "xml.h" //#include "xml.h"
/* config */ /* config */
static bool xmldebug = false; static bool xmldebug = false;
static char xmlcfg_filename[100] = "wiitdb.zip"; static char xmlcfg_filename[100] = "wiitdb.zip";
static int xmlmaxsize = 1572864; static int xmlmaxsize = 1572864;
extern struct SSettings Settings; // for loader GX extern struct SSettings Settings; // for loader GX
extern void title_set(char *id, char *title);
extern char* trimcopy(char *dest, char *src, int size);
struct gameXMLinfo gameinfo; struct gameXMLinfo gameinfo;
struct gameXMLinfo gameinfo_reset; struct gameXMLinfo gameinfo_reset;
@ -75,13 +78,16 @@ bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool op
snprintf(pathname, sizeof(pathname), "%swiitdb.zip", pathname); snprintf(pathname, sizeof(pathname), "%swiitdb.zip", pathname);
if (openfile) opensuccess = OpenXMLFile(pathname); if (openfile) opensuccess = OpenXMLFile(pathname);
} }
if (!opensuccess) { if (!opensuccess && openfile) {
CloseXMLDatabase(); CloseXMLDatabase();
return false; return false;
} }
if (loadtitles) LoadTitlesFromXML(argdblang, argJPtoEN); if (loadtitles) LoadTitlesFromXML(argdblang, argJPtoEN);
if (!keepopen) CloseXMLDatabase(); if (!keepopen) CloseXMLDatabase();
} } else {
if (loadtitles) LoadTitlesFromXML(argdblang, argJPtoEN);
if (!keepopen) CloseXMLDatabase();
}
return true; return true;
} }
@ -200,6 +206,9 @@ char *GetLangSettingFromGame(char *gameid) {
/* convert language text into ISO 639 two-letter language code */ /* convert language text into ISO 639 two-letter language code */
char *ConvertLangTextToCode(char *languagetxt) { char *ConvertLangTextToCode(char *languagetxt) {
// do not convert if languagetext seems to be a two-letter language code
if (strlen(languagetxt) == 2)
return languagetxt;
int i; int i;
for (i=0;i<=10;i++) { for (i=0;i<=10;i++) {
if (!strcasecmp(languagetxt,langlist[i])) // case insensitive comparison if (!strcasecmp(languagetxt,langlist[i])) // case insensitive comparison
@ -566,15 +575,16 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt)
if (!strcmp(gameinfo.region,"")) { if (!strcmp(gameinfo.region,"")) {
if (gameid[3] == 'E') strlcpy(gameinfo.region,"NTSC-U",sizeof(gameinfo.region)); if (gameid[3] == 'E') strlcpy(gameinfo.region,"NTSC-U",sizeof(gameinfo.region));
if (gameid[3] == 'J') strlcpy(gameinfo.region,"NTSC-J",sizeof(gameinfo.region)); if (gameid[3] == 'J') strlcpy(gameinfo.region,"NTSC-J",sizeof(gameinfo.region));
if (gameid[3] == 'W') strlcpy(gameinfo.region,"NTSC-J",sizeof(gameinfo.region));
if (gameid[3] == 'K') strlcpy(gameinfo.region,"NTSC-K",sizeof(gameinfo.region)); if (gameid[3] == 'K') strlcpy(gameinfo.region,"NTSC-K",sizeof(gameinfo.region));
if (gameid[3] == 'P') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'P') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'X') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'Y') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'D') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'D') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'F') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'F') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'S') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'I') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'I') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'S') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'H') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region)); if (gameid[3] == 'H') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'X') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
if (gameid[3] == 'Y') strlcpy(gameinfo.region,"PAL",sizeof(gameinfo.region));
} }
// free memory // free memory

View File

@ -64,10 +64,6 @@ extern "C" {
char *MemInfo(); char *MemInfo();
void GetTextFromNode(mxml_node_t *currentnode, mxml_node_t *topnode, char *nodename, void GetTextFromNode(mxml_node_t *currentnode, mxml_node_t *topnode, char *nodename,
char *attributename, char *value, int descend, char *dest, int destsize); char *attributename, char *value, int descend, char *dest, int destsize);
void title_set(char *id, char *title);
char* trimcopy(char *dest, char *src, int size);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif