Added a macron in case any particular title happens to require it. The network init prompt won't show up at all when network has already been initialized. Ocarina should work for people that still had the problem with recent revisions (it fixed it for me, but only when using SD, not SDHC).

This commit is contained in:
lustar.mii 2009-10-18 21:23:54 +00:00
parent 06e5f81c3a
commit 08ce514727
10 changed files with 42 additions and 90 deletions

File diff suppressed because one or more lines are too long

View File

@ -34,10 +34,6 @@ void USBDevice_deInit() {
fatUnmount("USB:/");
}
int isSdInserted() {
return __io_sdhc.isInserted() || __io_wiisd.isInserted();
}
int isInserted(const char *path) {
if (!strncmp(path, "USB:", 4))
return 1;
@ -48,9 +44,9 @@ int SDCard_Init() {
//closing all open Files write back the cache and then shutdown em!
fatUnmount("SD:/");
//right now mounts first FAT-partition
if (fatMount("SD", &__io_sdhc, 0, CACHE, SDHC_SECTOR_SIZE))
if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS))
return 1;
else if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS))
else if (fatMount("SD", &__io_sdhc, 0, CACHE, SDHC_SECTOR_SIZE))
return 1;
return -1;
}

View File

@ -7,7 +7,6 @@ extern "C" {
int USBDevice_Init();
void USBDevice_deInit();
int isSdInserted();
int isInserted(const char *path);
int SDCard_Init();
void SDCard_deInit();

Binary file not shown.

View File

@ -1062,7 +1062,6 @@ int MenuDiscList() {
startat = gameCarousel->GetSelectedOption();
offset = gameCarousel->GetOffset();
}
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
HaltGui(); // to fix endless rumble when clicking on the SD icon when rumble is disabled because rumble is set to on in Global_Default()
CFG_Load();
@ -1074,7 +1073,6 @@ int MenuDiscList() {
}
else if (DownloadBtn.GetState() == STATE_CLICKED) {
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
choice = WindowPrompt(tr("Cover Download"), 0, tr("Normal Covers"), tr("3D Covers"), tr("Disc Images"), tr("Back")); // ask for download choice
if (choice != 0) {
@ -1133,7 +1131,6 @@ int MenuDiscList() {
else if (favoriteBtn.GetState() == STATE_CLICKED) {
Settings.fave=!Settings.fave;
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
cfg_save_global();
}
@ -1228,7 +1225,6 @@ int MenuDiscList() {
else if (abcBtn.GetState() == STATE_CLICKED) {
if (Settings.sort != all) {
Settings.sort=all;
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
cfg_save_global();
}
@ -1243,7 +1239,6 @@ int MenuDiscList() {
else if (countBtn.GetState() == STATE_CLICKED) {
if (Settings.sort != pcount) {
Settings.sort=pcount;
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
cfg_save_global();
}

View File

@ -18,6 +18,7 @@
#include "network/networkops.h"
#include "network/http.h"
#include "prompts/PromptWindows.h"
#include "prompts/gameinfo.h"
#include "mload/mload.h"
#include "fatmounter.h"
#include "listfiles.h"
@ -1380,7 +1381,6 @@ int GameWindowPrompt() {
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
}
else if (btnFavorite1.GetState() == STATE_CLICKED) {//switch favorite
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 1);
SetFavoriteImages(&btnFavoriteImg1, &btnFavoriteImg2, &btnFavoriteImg3, &btnFavoriteImg4, &btnFavoriteImg5, &imgFavorite, &imgNotFavorite);
@ -1388,7 +1388,6 @@ int GameWindowPrompt() {
btnFavorite1.ResetState();
}
else if (btnFavorite2.GetState() == STATE_CLICKED) {//switch favorite
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 2);
SetFavoriteImages(&btnFavoriteImg1, &btnFavoriteImg2, &btnFavoriteImg3, &btnFavoriteImg4, &btnFavoriteImg5, &imgFavorite, &imgNotFavorite);
@ -1396,7 +1395,6 @@ int GameWindowPrompt() {
btnFavorite2.ResetState();
}
else if (btnFavorite3.GetState() == STATE_CLICKED) {//switch favorite
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 3);
SetFavoriteImages(&btnFavoriteImg1, &btnFavoriteImg2, &btnFavoriteImg3, &btnFavoriteImg4, &btnFavoriteImg5, &imgFavorite, &imgNotFavorite);
@ -1404,7 +1402,6 @@ int GameWindowPrompt() {
btnFavorite3.ResetState();
}
else if (btnFavorite4.GetState() == STATE_CLICKED) {//switch favorite
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 4);
SetFavoriteImages(&btnFavoriteImg1, &btnFavoriteImg2, &btnFavoriteImg3, &btnFavoriteImg4, &btnFavoriteImg5, &imgFavorite, &imgNotFavorite);
@ -1412,7 +1409,6 @@ int GameWindowPrompt() {
btnFavorite4.ResetState();
}
else if (btnFavorite5.GetState() == STATE_CLICKED) {//switch favorite
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
SetFavorite(&btnFavorite1, &btnFavorite2, &btnFavorite3, &btnFavorite4, &btnFavorite5, header->id, 5);
SetFavoriteImages(&btnFavoriteImg1, &btnFavoriteImg2, &btnFavoriteImg3, &btnFavoriteImg4, &btnFavoriteImg5, &imgFavorite, &imgNotFavorite);
@ -1823,7 +1819,7 @@ bool SearchMissingImages(int choice2) {
__Menu_GetEntries();
ResumeGui();
if (cntMissFiles > 0) { //&& !IsNetworkInit()) {
if (cntMissFiles > 0) {
NetworkInitPrompt();
}
@ -1837,6 +1833,10 @@ bool SearchMissingImages(int choice2) {
* NetworkInitPrompt
***************************************************************************/
bool NetworkInitPrompt() {
if (IsNetworkInit())
return true;
bool success = true;
GuiWindow promptWindow(472,320);
@ -2548,23 +2548,9 @@ int ProgressUpdateWindow() {
}
//make the URL to get XML based on our games
char XMLurl[3540]; // NET_BUFFER_SIZE in http.c needs to be set to size of XMLurl + 40
char filename[10];
__Menu_GetEntries(1);
snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s&ID=",Settings.db_language);
unsigned int i;
for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i];
if (i<500) {
//snprintf(filename,sizeof(filename),"%c%c%c", header->id[1], header->id[2], header->id[3]);
//strncat(XMLurl,filename,3);
snprintf(filename,sizeof(filename),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
strncat(XMLurl,filename,6);
if ((i!=gameCnt-1)&&(i<500))
strncat(XMLurl, ",",1);
}
}
__Menu_GetEntries();
char XMLurl[3540];
build_XML_URL(XMLurl,sizeof(XMLurl));
if (IsNetworkInit() && ret >= 0) {
updatemode = WindowPrompt(tr("What do you want to update?"), 0, "USBLoader GX", tr("WiiTDB Files"), tr("Languagefile"), tr("Cancel"));
@ -2869,22 +2855,8 @@ int ProgressUpdateWindow() {
//make the URL to get XML based on our games
char XMLurl[3540];
char filename[10];
__Menu_GetEntries(1);
snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s&ID=",Settings.db_language);
unsigned int i;
for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i];
if (i<500) {
//snprintf(filename,sizeof(filename),"%c%c%c", header->id[1], header->id[2], header->id[3]);
//strncat(XMLurl, filename,3 );
snprintf(filename,sizeof(filename),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
strncat(XMLurl,filename,6);
if ((i!=gameCnt-1)&&(i<500))
strncat(XMLurl, ",",1);
}
}
__Menu_GetEntries();
build_XML_URL(XMLurl,sizeof(XMLurl));
char dolpath[150];
// char dolpathsuccess[150];//use coverspath as a folder for the update wad so we dont make a new folder and have to delete it
snprintf(dolpath, sizeof(dolpath), "%sULNR.wad", Settings.covers_path);

View File

@ -1086,25 +1086,9 @@ bool save_XML_URL() { // save xml url as as txt file for people without wifi
sleep(1);
return false;
}
//make sure that all games are added to the gamelist
__Menu_GetEntries(1);
char XMLurl[3540];
char filename[10];
snprintf(XMLurl,sizeof(XMLurl),"http://wiitdb.com/wiitdb.zip?LANG=%s&ID=", Settings.db_language);
unsigned int i;
for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i];
if (i<500) {
//snprintf(filename,sizeof(filename),"%c%c%c", header->id[1], header->id[2], header->id[3]);
//strncat(XMLurl, filename,3 );
snprintf(filename,sizeof(filename),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
strncat(XMLurl,filename,6);
if ((i!=gameCnt-1)&&(i<500))
strncat(XMLurl, ",",1);
}
}
build_XML_URL(XMLurl,sizeof(XMLurl));
fprintf(f, "# USB Loader Has Saved this file\n");
fprintf(f, "# This URL was created based on your list of games and language settings.\n");
@ -1118,7 +1102,6 @@ bool save_XML_URL() { // save xml url as as txt file for people without wifi
fclose(f);
__Menu_GetEntries();
return true;
}
@ -1129,3 +1112,24 @@ void MemInfoPrompt()
strlcpy(meminfotxt,MemInfo(),sizeof(meminfotxt));
WindowPrompt(0,meminfotxt, tr("OK"));
}
void build_XML_URL(char *XMLurl, int XMLurlsize) {
__Menu_GetEntries(1);
// NET_BUFFER_SIZE in http.c needs to be set to size of XMLurl + 40
char url[3540];
char filename[10];
snprintf(url,sizeof(url),"http://wiitdb.com/wiitdb.zip?LANG=%s&ID=", Settings.db_language);
unsigned int i;
for (i = 0; i < gameCnt ; i++) {
struct discHdr* header = &gameList[i];
if (i<500) {
snprintf(filename,sizeof(filename),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
strncat(url,filename,6);
if ((i!=gameCnt-1)&&(i<500))
strncat(url, ",",1);
}
}
strlcpy(XMLurl,url,XMLurlsize);
__Menu_GetEntries();
}

View File

@ -9,6 +9,7 @@
#define _GAMEINFO_H_
int showGameInfo(char *ID);
void build_XML_URL(char *XMLurl, int XMLurlsize);
bool save_XML_URL();
bool save_gamelist(int txt);
void MemInfoPrompt();

View File

@ -551,7 +551,6 @@ int MenuSettings() {
switch (ret)
{
case 0:
//if(isSdInserted()) {
if (isInserted(bootDevice)) {
if ( Settings.godmode == 1) {
w.SetEffect(EFFECT_FADE, -20);
@ -1130,7 +1129,6 @@ int MenuSettings() {
switch (ret)
{
case 0:
//if(isSdInserted())
if (isInserted(bootDevice)) {
w.SetEffect(EFFECT_FADE, -20);
while (w.GetEffect()>0) usleep(50);
@ -1293,7 +1291,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(Settings.covers_path, entered, sizeof(Settings.covers_path));
WindowPrompt(tr("Cover Path Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
@ -1319,7 +1316,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(Settings.covers2d_path, entered, sizeof(Settings.covers2d_path));
WindowPrompt(tr("Cover Path Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
@ -1345,7 +1341,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(Settings.disc_path, entered, sizeof(Settings.disc_path));
WindowPrompt(tr("Disc Path Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
@ -1370,7 +1365,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(CFG.theme_path, entered, sizeof(CFG.theme_path));
WindowPrompt(tr("Theme Path Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
} else {
@ -1430,7 +1424,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(Settings.titlestxt_path, entered, sizeof(Settings.titlestxt_path));
WindowPrompt(tr("WiiTDB Path changed."),0,tr("OK"));
// if(isSdInserted()) {
if (isInserted(bootDevice)) {
cfg_save_global();
HaltGui();
@ -1524,7 +1517,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(Settings.dolpath, entered, sizeof(Settings.dolpath));
WindowPrompt(tr("DOL path changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
@ -1550,7 +1542,6 @@ int MenuSettings() {
strncat (entered, "/", 1);
strlcpy(Settings.homebrewapps_path, entered, sizeof(Settings.homebrewapps_path));
WindowPrompt(tr("Homebrew Appspath changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
@ -1601,7 +1592,6 @@ int MenuSettings() {
w.Remove(&MainButton2);
w.Remove(&MainButton3);
w.Remove(&MainButton4);
// if(isSdInserted() && Settings.godmode) {
if (isInserted(bootDevice) && Settings.godmode) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1639,7 +1629,6 @@ int MenuSettings() {
if (Settings.godmode) {
int choice = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("Cancel"));
if (choice == 1) {
// if(isSdInserted())
if (isInserted(bootDevice)) {
char GXGlobal_cfg[26];
sprintf(GXGlobal_cfg, "%s/config/GXGlobal.cfg", bootDevice);
@ -1692,7 +1681,6 @@ int MenuSettings() {
else if (backBtn.GetState() == STATE_CLICKED) {
//Add the procedure call to save the global configuration
// if(isSdInserted()) {
if (isInserted(bootDevice)) {
cfg_save_global();
}

View File

@ -232,7 +232,6 @@ bool MenuOGG() {
strncat (entered, "/", 1);
strlcpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path));
WindowPrompt(tr("Backgroundmusic Path changed."),0,tr("OK"));
// if(isSdInserted()) {
if (isInserted(bootDevice)) {
if (!strcmp("", Settings.oggload_path)) {
sprintf(Settings.ogg_path, "notset");
@ -549,7 +548,6 @@ int MenuLanguageSelect() {
strncat (entered, "/", 1);
strlcpy(Settings.languagefiles_path, entered, sizeof(Settings.languagefiles_path));
WindowPrompt(tr("Languagepath changed."),0,tr("OK"));
// if(isSdInserted()) {
if (isInserted(bootDevice)) {
cfg_save_global();
returnhere = 1;
@ -569,7 +567,6 @@ int MenuLanguageSelect() {
if (ret>=0) {
choice = WindowPrompt(tr("Do you want to change language?"), 0, tr("Yes"), tr("Cancel"));
if (choice == 1) {
// if(isSdInserted()) {
if (isInserted(bootDevice)) {
snprintf(Settings.language_path, sizeof(Settings.language_path), "%s%s", Settings.languagefiles_path, GetFileName(ret));
cfg_save_global();