diff --git a/Languages/czech.lang b/Languages/czech.lang index fa2ae9b6..5e1d53a9 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -2337,9 +2337,6 @@ msgstr "Aktualizace" msgid "Update Files" msgstr "Zaktualizuj soubory" -msgid "Update Path" -msgstr "Cesta pro aktualizaci" - msgid "Update all Language Files" msgstr "Zaktualizuj vsechny jazykové soubory" diff --git a/Languages/danish.lang b/Languages/danish.lang index 17952aaa..85277dad 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -2337,9 +2337,6 @@ msgstr "Opdatér" msgid "Update Files" msgstr "Opdatér filer" -msgid "Update Path" -msgstr "Sti til opdateringer" - msgid "Update all Language Files" msgstr "Opdatér alle sprogfiler" diff --git a/Languages/dutch.lang b/Languages/dutch.lang index e7f1dd52..e2c0db47 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -2337,9 +2337,6 @@ msgstr "Updaten" msgid "Update Files" msgstr "Bestanden Updaten" -msgid "Update Path" -msgstr "Updatelocatie" - msgid "Update all Language Files" msgstr "Alle taalbestanden updaten" diff --git a/Languages/english.lang b/Languages/english.lang index 5e8fac5f..51364e85 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -2337,9 +2337,6 @@ msgstr "" msgid "Update Files" msgstr "" -msgid "Update Path" -msgstr "" - msgid "Update all Language Files" msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index 54a5308e..c60ccdb7 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -2337,9 +2337,6 @@ msgstr "Päivitä" msgid "Update Files" msgstr "Päivitä tiedostot" -msgid "Update Path" -msgstr "Päivityspolku" - msgid "Update all Language Files" msgstr "Päivitä kaikki kielitiedostot" diff --git a/Languages/french.lang b/Languages/french.lang index a4fa0d2e..a89b8ebb 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -2337,9 +2337,6 @@ msgstr "Mise à jour" msgid "Update Files" msgstr "MàJ Fichiers" -msgid "Update Path" -msgstr "Dossier de mise à jour" - msgid "Update all Language Files" msgstr "Mise à jour des fichiers de langue" diff --git a/Languages/german.lang b/Languages/german.lang index 3e7bd498..c7ed6a55 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -2337,9 +2337,6 @@ msgstr "Update" msgid "Update Files" msgstr "Aktualisieren" -msgid "Update Path" -msgstr "Updates" - msgid "Update all Language Files" msgstr "Sprachdateien aktualisieren" diff --git a/Languages/greek.lang b/Languages/greek.lang index ebf3fb28..c5c7285b 100644 --- a/Languages/greek.lang +++ b/Languages/greek.lang @@ -2337,9 +2337,6 @@ msgstr "Aναβάθμιση" msgid "Update Files" msgstr "Αναβάθμιση αρχείων" -msgid "Update Path" -msgstr "Μονοπάτι αρχείων αναβάθμισης." - msgid "Update all Language Files" msgstr "Αναβάθμιση όλων των μεταφράσεων" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index b5105177..1c04a040 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -2340,9 +2340,6 @@ msgstr "Frissítés" msgid "Update Files" msgstr "Fájlok frissítése" -msgid "Update Path" -msgstr "Frissítés Útvonala" - msgid "Update all Language Files" msgstr "Minden nyelvi fájl frissítése" diff --git a/Languages/italian.lang b/Languages/italian.lang index 60efe105..11810ae9 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -2340,9 +2340,6 @@ msgstr "Aggiornamenti" msgid "Update Files" msgstr "Aggiorna i files" -msgid "Update Path" -msgstr "Percorso aggiornamenti" - msgid "Update all Language Files" msgstr "Aggiorna tutte le traduzioni" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index e5df8eee..4956a417 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -2340,9 +2340,6 @@ msgstr "更新" msgid "Update Files" msgstr "すべて更新" -msgid "Update Path" -msgstr "GXのdol" - msgid "Update all Language Files" msgstr "全言語ファイルを更新" diff --git a/Languages/korean.lang b/Languages/korean.lang index 453ae48e..26e95877 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -2340,9 +2340,6 @@ msgstr "업데이트" msgid "Update Files" msgstr "파일 업데이트" -msgid "Update Path" -msgstr "경로 업데이트" - msgid "Update all Language Files" msgstr "모든 언어 파일 업데이트" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index a3d33887..0fadcee3 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -2337,9 +2337,6 @@ msgstr "Oppdater" msgid "Update Files" msgstr "Oppdater filer" -msgid "Update Path" -msgstr "Oppdatering sti" - msgid "Update all Language Files" msgstr "Oppdater alle språkfiler" diff --git a/Languages/polish.lang b/Languages/polish.lang index bdbdddff..e816c068 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -2337,9 +2337,6 @@ msgstr "Aktualizacja" msgid "Update Files" msgstr "Zaktualizuj pliki" -msgid "Update Path" -msgstr "Sciezka aktualizacji" - msgid "Update all Language Files" msgstr "Zaktualizuj wszystkie pliki jezykowe" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 98299291..3e7c8eee 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -2337,9 +2337,6 @@ msgstr "Atualizações" msgid "Update Files" msgstr "Atualizar arquivos" -msgid "Update Path" -msgstr "Atualização" - msgid "Update all Language Files" msgstr "Atualizar todos os arquivos de Idioma" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 6e6e4459..1f5ef4bd 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -2337,9 +2337,6 @@ msgstr "Actualizações" msgid "Update Files" msgstr "Actualizar ficheiros" -msgid "Update Path" -msgstr "Cam. Actualização" - msgid "Update all Language Files" msgstr "Actualizar todos os ficheiros de Idioma" diff --git a/Languages/russian.lang b/Languages/russian.lang index a6438e1a..dda4a445 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -2337,9 +2337,6 @@ msgstr "Обновление" msgid "Update Files" msgstr "Обновить файлы" -msgid "Update Path" -msgstr "Путь к обновлениям" - msgid "Update all Language Files" msgstr "Обновить все языковые файлы" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index b49edf7f..ff49fd9a 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -2337,9 +2337,6 @@ msgstr "升级" msgid "Update Files" msgstr "升级文件" -msgid "Update Path" -msgstr "升级文件存放路径" - msgid "Update all Language Files" msgstr "升级全部语言文件" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index 3037b6b8..793edad7 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -2337,9 +2337,6 @@ msgstr "Actualizar" msgid "Update Files" msgstr "Archivos" -msgid "Update Path" -msgstr "Ruta Actualización" - msgid "Update all Language Files" msgstr "Actualizar todos los archivos de Idiomas" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index e224ec7f..e2d3730d 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -2337,9 +2337,6 @@ msgstr "Uppdatera" msgid "Update Files" msgstr "Uppdatera Filer" -msgid "Update Path" -msgstr "Sökväg till uppdatering" - msgid "Update all Language Files" msgstr "Uppdatera alla språk-filer" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index c83b488e..0ba6569a 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -2337,9 +2337,6 @@ msgstr "更新" msgid "Update Files" msgstr "更新檔案" -msgid "Update Path" -msgstr "更新路徑" - msgid "Update all Language Files" msgstr "更新所有語言檔案" diff --git a/Languages/thai.lang b/Languages/thai.lang index 9ed87198..b09f996f 100644 --- a/Languages/thai.lang +++ b/Languages/thai.lang @@ -2337,9 +2337,6 @@ msgstr "อัพเดท" msgid "Update Files" msgstr "อัพเดทไฟล์" -msgid "Update Path" -msgstr "ที่อยู่ Update" - msgid "Update all Language Files" msgstr "อัพเดทภาษาทั้งหมด" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index aeb7aa40..61a4e0ff 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -2337,9 +2337,6 @@ msgstr "Güncelleme" msgid "Update Files" msgstr "Dosyaları Güncelle" -msgid "Update Path" -msgstr "Güncelleme Yolu" - msgid "Update all Language Files" msgstr "Tüm Dil Dosyalarını Güncelle" diff --git a/source/StartUpProcess.cpp b/source/StartUpProcess.cpp index 9e1edb22..88fb4b2b 100644 --- a/source/StartUpProcess.cpp +++ b/source/StartUpProcess.cpp @@ -218,6 +218,21 @@ bool StartUpProcess::USBSpinUp() int StartUpProcess::Run(int argc, char *argv[]) { + // A normal launch should always have the first arg be the path + char *ptr = strrchr(argv[0], '/'); + if (ptr && (argv[0][2] == ':' || argv[0][3] == ':')) + { + *ptr = 0; + // HBC doesn't specify the USB port + if (strncmp(argv[0], "usb", 3) == 0) + { + snprintf(Settings.BootDevice, sizeof(Settings.BootDevice), "usb1"); + snprintf(Settings.ConfigPath, sizeof(Settings.ConfigPath), "usb1:%s/", argv[0] + 4); + } + else if (strncmp(argv[0], "sd", 2) == 0) + snprintf(Settings.ConfigPath, sizeof(Settings.ConfigPath), "%s/", argv[0]); + gprintf("Loader path: %s\n", Settings.ConfigPath); + } int quickGameBoot = ParseArguments(argc, argv); StartUpProcess Process; diff --git a/source/menu/GameBrowseMenu.cpp b/source/menu/GameBrowseMenu.cpp index b25482bf..0d2d5052 100644 --- a/source/menu/GameBrowseMenu.cpp +++ b/source/menu/GameBrowseMenu.cpp @@ -931,7 +931,7 @@ int GameBrowseMenu::MainLoop() gprintf("\tgameCntBtn clicked\n"); gamecntBtn->ResetState(); - int choice = WindowPrompt(0, fmt("%s %sGameList ?", tr( "Save Game List to" ), Settings.update_path), "TXT", "CSV", tr( "Back" )); + int choice = WindowPrompt(0, fmt("%s %sGameList ?", tr( "Save Game List to" ), Settings.ConfigPath), "TXT", "CSV", tr( "Back" )); if (choice) { if (save_gamelist(choice == 2)) diff --git a/source/network/ImageDownloader.cpp b/source/network/ImageDownloader.cpp index c520f179..70f1751a 100644 --- a/source/network/ImageDownloader.cpp +++ b/source/network/ImageDownloader.cpp @@ -412,7 +412,7 @@ void ImageDownloader::DownloadImage(const char *url, const char *gameID, const c void ImageDownloader::CreateCSVLog() { char path[200]; - snprintf(path, sizeof(path), "%s/MissingImages.csv", Settings.update_path); + snprintf(path, sizeof(path), "%s/MissingImages.csv", Settings.ConfigPath); FILE *f = fopen(path, "wb"); if(!f) return; diff --git a/source/network/update.cpp b/source/network/update.cpp index dc567da9..6b9675ec 100644 --- a/source/network/update.cpp +++ b/source/network/update.cpp @@ -145,7 +145,7 @@ static void UpdateIconPng() downloadfile("https://raw.githubusercontent.com/wiidev/usbloadergx/updates/icon.png", &file); if (file.size > 0) { - snprintf(iconpath, sizeof(iconpath), "%sicon.png", Settings.update_path); + snprintf(iconpath, sizeof(iconpath), "%sicon.png", Settings.ConfigPath); FILE *pfile = fopen(iconpath, "wb"); if (pfile) { @@ -163,7 +163,7 @@ static void UpdateMetaXml() downloadfile("https://raw.githubusercontent.com/wiidev/usbloadergx/updates/meta.xml", &file); if (file.size > 0) { - snprintf(xmlpath, sizeof(xmlpath), "%smeta.xml", Settings.update_path); + snprintf(xmlpath, sizeof(xmlpath), "%smeta.xml", Settings.ConfigPath); FILE *pfile = fopen(xmlpath, "wb"); if (pfile) { @@ -217,8 +217,8 @@ static int ApplicationDownload(void) snprintf(tmppath, sizeof(tmppath), "%s/ULNR.wad", Settings.BootDevice); #else char realpath[250]; - snprintf(realpath, sizeof(realpath), "%sboot.dol", Settings.update_path); - snprintf(tmppath, sizeof(tmppath), "%sboot.tmp", Settings.update_path); + snprintf(realpath, sizeof(realpath), "%sboot.dol", Settings.ConfigPath); + snprintf(tmppath, sizeof(tmppath), "%sboot.tmp", Settings.ConfigPath); #endif int ret = DownloadFileToPath(DownloadURL.c_str(), tmppath); @@ -282,12 +282,6 @@ int UpdateApp() return -1; } - if (!CreateSubfolder(Settings.update_path)) - { - WindowPrompt(tr("Error:"), tr("Can't create directory"), tr("OK")); - return -1; - } - int choice = WindowPrompt(tr("What do you want to update?"), 0, "USB Loader GX", tr("WiiTDB.xml"), tr("Language Files"), tr("Cancel")); if (choice == 0) return 0; diff --git a/source/prompts/gameinfo.cpp b/source/prompts/gameinfo.cpp index 4738b6fd..39b12860 100644 --- a/source/prompts/gameinfo.cpp +++ b/source/prompts/gameinfo.cpp @@ -1118,14 +1118,13 @@ char *readable_size(float size, char *buf) bool save_gamelist(bool bCSV) // save gamelist { mainWindow->SetState(STATE_DISABLED); - CreateSubfolder(Settings.update_path); // Save the game list char tmp[256]; if(bCSV) - snprintf(tmp, sizeof(tmp), "%sGameList.csv", Settings.update_path); + snprintf(tmp, sizeof(tmp), "%sGameList.csv", Settings.ConfigPath); else - snprintf(tmp, sizeof(tmp), "%sGameList.txt", Settings.update_path); + snprintf(tmp, sizeof(tmp), "%sGameList.txt", Settings.ConfigPath); FILE *f = fopen(tmp, "w"); if (!f) diff --git a/source/settings/CGameSettings.cpp b/source/settings/CGameSettings.cpp index 7d0db2c8..67868dd4 100644 --- a/source/settings/CGameSettings.cpp +++ b/source/settings/CGameSettings.cpp @@ -175,8 +175,6 @@ bool CGameSettings::Save() if(ptr) ptr[0] = 0; - CreateSubfolder(filepath); - FILE * f = fopen(ConfigPath.c_str(), "w"); if (!f) return false; diff --git a/source/settings/CGameStatistics.cpp b/source/settings/CGameStatistics.cpp index 2d6abb2c..7358d219 100644 --- a/source/settings/CGameStatistics.cpp +++ b/source/settings/CGameStatistics.cpp @@ -138,9 +138,6 @@ bool CGameStatistics::Save() if(ptr) ptr[0] = 0; - if(!CreateSubfolder(filepath)) - return false; - FILE * f = fopen(ConfigPath.c_str(), "w"); if (!f) return false; diff --git a/source/settings/CSettings.cpp b/source/settings/CSettings.cpp index 5cb3cd4d..31e4bbfb 100644 --- a/source/settings/CSettings.cpp +++ b/source/settings/CSettings.cpp @@ -44,7 +44,7 @@ CSettings::CSettings() { CONF_Init(); strcpy(BootDevice, "sd:"); - snprintf(ConfigPath, sizeof(ConfigPath), "%s/config/", BootDevice); + snprintf(ConfigPath, sizeof(ConfigPath), "%s/apps/usbloader_gx/", BootDevice); this->SetDefault(); FirstTimeRun = true; } @@ -61,9 +61,8 @@ void CSettings::SetDefault() snprintf(disc_path, sizeof(disc_path), "%simages/disc/", ConfigPath); snprintf(titlestxt_path, sizeof(titlestxt_path), "%s", ConfigPath); snprintf(languagefiles_path, sizeof(languagefiles_path), "%slanguage/", ConfigPath); - snprintf(update_path, sizeof(update_path), "%s/apps/usbloader_gx/", BootDevice); - snprintf(BNRCachePath, sizeof(BNRCachePath), "%s/apps/usbloader_gx/cache_bnr/", BootDevice); - snprintf(GameHeaderCachePath, sizeof(GameHeaderCachePath), "%s/apps/usbloader_gx/cache/", BootDevice); + snprintf(BNRCachePath, sizeof(BNRCachePath), "%scache_bnr/", ConfigPath); + snprintf(GameHeaderCachePath, sizeof(GameHeaderCachePath), "%scache/", ConfigPath); snprintf(homebrewapps_path, sizeof(homebrewapps_path), "%s/apps/", BootDevice); snprintf(Cheatcodespath, sizeof(Cheatcodespath), "%s/codes/", BootDevice); snprintf(TxtCheatcodespath, sizeof(TxtCheatcodespath), "%s/txtcodes/", BootDevice); @@ -317,8 +316,6 @@ bool CSettings::Save() char filedest[300]; snprintf(filedest, sizeof(filedest), "%sGXGlobal.cfg", ConfigPath); - if(!CreateSubfolder(ConfigPath)) return false; - FILE * file = fopen(filedest, "w"); if (!file) return false; @@ -367,7 +364,6 @@ bool CSettings::Save() fprintf(file, "ogg_path = %s\n", ogg_path); fprintf(file, "wiilight = %d\n", wiilight); fprintf(file, "gameDisplay = %d\n", gameDisplay); - fprintf(file, "update_path = %s\n", update_path); fprintf(file, "homebrewapps_path = %s\n", homebrewapps_path); fprintf(file, "BNRCachePath = %s\n", BNRCachePath); fprintf(file, "GameHeaderCachePath = %s\n", GameHeaderCachePath); @@ -1271,11 +1267,6 @@ bool CSettings::SetSetting(char *name, char *value) strlcpy(ogg_path, value, sizeof(ogg_path)); return true; } - else if (strcmp(name, "update_path") == 0) - { - strlcpy(update_path, value, sizeof(update_path)); - return true; - } else if (strcmp(name, "homebrewapps_path") == 0) { strlcpy(homebrewapps_path, value, sizeof(homebrewapps_path)); @@ -1497,63 +1488,42 @@ bool CSettings::SetSetting(char *name, char *value) bool CSettings::FindConfig() { - bool found = false; - char CheckDevice[73]; char CheckPath[300]; + std::string device(ConfigPath); + char *ptr = strchr(device.c_str(), ':'); + if (ptr) + { + *ptr = 0; + snprintf(BootDevice, sizeof(BootDevice), "%s:", device.c_str()); + snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath); - // Enumerate the devices supported by libogc. - for (int i = SD; (i < MAXDEVICES) && !found; ++i) + FILE *fp = fopen(CheckPath, "ab+"); + if (fp) + { + fclose(fp); + return true; + } + } + + // Enumerate the devices supported by libogc + char CheckDevice[73]; + for (int i = SD; i < MAXDEVICES; ++i) { snprintf(CheckDevice, sizeof(CheckDevice), "%s:", DeviceName[i]); + // Check for the config file in the apps directory + strlcpy(BootDevice, CheckDevice, sizeof(BootDevice)); + snprintf(ConfigPath, sizeof(ConfigPath), "%s/apps/usbloader_gx/", BootDevice); + snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath); - if(!found) + FILE *fp = fopen(CheckPath, "ab+"); + if (fp) { - // Check for the config file in the apps directory. - strlcpy(BootDevice, CheckDevice, sizeof(BootDevice)); - snprintf(ConfigPath, sizeof(ConfigPath), "%s/apps/usbloader_gx/", BootDevice); - snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath); - found = CheckFile(CheckPath); - } - if(!found) - { - // Check for the config file in the config directory. - strlcpy(BootDevice, CheckDevice, sizeof(BootDevice)); - snprintf(ConfigPath, sizeof(ConfigPath), "%s/config/", BootDevice); - snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath); - found = CheckFile(CheckPath); + fclose(fp); + return true; } } - FILE * testFp = NULL; - //! No existing config so try to find a place where we can write it too - for (int i = SD; (i < MAXDEVICES) && !found; ++i) - { - sprintf(CheckDevice, "%s:", DeviceName[i]); - - if (!found) - { - // Check if we can write to the apps directory. - strlcpy(BootDevice, CheckDevice, sizeof(BootDevice)); - snprintf(ConfigPath, sizeof(ConfigPath), "%s/apps/usbloader_gx/", BootDevice); - snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath); - testFp = fopen(CheckPath, "wb"); - found = (testFp != NULL); - if(testFp) fclose(testFp); - } - if (!found) - { - // Check if we can write to the config directory. - strlcpy(BootDevice, CheckDevice, sizeof(BootDevice)); - snprintf(ConfigPath, sizeof(ConfigPath), "%s/config/", BootDevice); - CreateSubfolder(ConfigPath); - snprintf(CheckPath, sizeof(CheckPath), "%sGXGlobal.cfg", ConfigPath); - testFp = fopen(CheckPath, "wb"); - found = (testFp != NULL); - if(testFp) fclose(testFp); - } - } - - return found; + return false; } void CSettings::ParseLine(char *line) diff --git a/source/settings/CSettings.h b/source/settings/CSettings.h index d048bf50..9078af29 100644 --- a/source/settings/CSettings.h +++ b/source/settings/CSettings.h @@ -78,7 +78,6 @@ class CSettings char BcaCodepath[100]; char WipCodepath[100]; char dolpath[100]; - char update_path[100]; char homebrewapps_path[100]; char WDMpath[100]; char WiinnertagPath[100]; diff --git a/source/settings/menus/CustomPathsSM.cpp b/source/settings/menus/CustomPathsSM.cpp index b945ae26..8d576afc 100644 --- a/source/settings/menus/CustomPathsSM.cpp +++ b/source/settings/menus/CustomPathsSM.cpp @@ -50,7 +50,6 @@ CustomPathsSM::CustomPathsSM() Options->SetName(Idx++, tr("Disc Artwork Path")); Options->SetName(Idx++, tr("Theme Path")); Options->SetName(Idx++, tr("Titles Path")); - Options->SetName(Idx++, tr("Update Path")); Options->SetName(Idx++, tr("GCT Cheatcodes Path")); Options->SetName(Idx++, tr("TXT Cheatcodes Path")); Options->SetName(Idx++, tr("DOL Path")); @@ -94,9 +93,6 @@ void CustomPathsSM::SetOptionValues() //! Settings: Titles Path Options->SetValue(Idx++, Settings.titlestxt_path); - //! Settings: Update Path - Options->SetValue(Idx++, Settings.update_path); - //! Settings: GCT Cheatcodes Path Options->SetValue(Idx++, Settings.Cheatcodespath); @@ -217,13 +213,6 @@ int CustomPathsSM::GetMenuInternal() } } - //! Settings: Update Path - else if (ret == ++Idx) - { - titleTxt->SetText(tr( "Update Path" )); - ChangePath(Settings.update_path, sizeof(Settings.update_path)); - } - //! Settings: GCT Cheatcodes Path else if (ret == ++Idx) { diff --git a/source/settings/menus/FeatureSettingsMenu.cpp b/source/settings/menus/FeatureSettingsMenu.cpp index b0b36584..ae16181f 100644 --- a/source/settings/menus/FeatureSettingsMenu.cpp +++ b/source/settings/menus/FeatureSettingsMenu.cpp @@ -600,7 +600,7 @@ int FeatureSettingsMenu::GetMenuInternal() if(WindowPrompt(tr( "EmuNAND WAD Manager" ), fmt(tr("%i WAD file(s) not processed!"), wadList->GetFilecount()), tr("Save List"), tr( "OK" ))) { char path[200]; - snprintf(path, sizeof(path), "%s/wad_manager_errors.txt", Settings.update_path); + snprintf(path, sizeof(path), "%s/wad_manager_errors.txt", Settings.ConfigPath); FILE *f = fopen(path, "a"); if(f) diff --git a/source/settings/meta.cpp b/source/settings/meta.cpp index 9a0fb067..56e96afe 100644 --- a/source/settings/meta.cpp +++ b/source/settings/meta.cpp @@ -25,12 +25,12 @@ distribution. #include "settings/CSettings.h" #include "svnrev.h" -int updateMetaXML (void) +int updateMetaXML() { HomebrewXML MetaXML; char filepath[255]; - snprintf(filepath, sizeof(filepath), "%s/meta.xml", Settings.update_path); - if(!MetaXML.LoadHomebrewXMLData(filepath)) + snprintf(filepath, sizeof(filepath), "%smeta.xml", Settings.ConfigPath); + if (!MetaXML.LoadHomebrewXMLData(filepath)) return 0; char line[50]; @@ -47,22 +47,19 @@ int updateMetaXML (void) return ret; } -int editMetaArguments (void) +int editMetaArguments() { char metapath[255] = ""; char metatmppath[255] = ""; - - snprintf(metapath, sizeof(metapath), "%s/meta.xml", Settings.update_path); - snprintf(metatmppath, sizeof(metatmppath), "%s/meta.tmp", Settings.update_path); + snprintf(metapath, sizeof(metapath), "%smeta.xml", Settings.ConfigPath); + snprintf(metatmppath, sizeof(metatmppath), "%smeta.tmp", Settings.ConfigPath); FILE *source = fopen(metapath, "rb"); - if(!source) - { + if (!source) return 0; - } FILE *destination = fopen(metatmppath, "wb"); - if(!destination) + if (!destination) { fclose(source); return 0; @@ -70,23 +67,23 @@ int editMetaArguments (void) const int max_line_size = 255; char *line = new char[max_line_size]; - while (fgets(line, max_line_size, source) != NULL) + while (fgets(line, max_line_size, source) != NULL) { // delete commented lines - if( strstr(line, " ") != NULL) + if (strstr(line, " ") != NULL) { strcpy(line, ""); } // delete commented lines (old version) - if( strstr(line, "") != NULL) + if (strstr(line, "") != NULL) { strcpy(line, ""); } // generate argurments - if(strstr(line, "") != NULL) + if (strstr(line, "") != NULL) { fputs(line, destination); snprintf(line, max_line_size, " --bootios=%d\n", Settings.BootIOS); @@ -96,14 +93,14 @@ int editMetaArguments (void) snprintf(line, max_line_size, " --mountusb=%d\n", Settings.USBAutoMount); fputs(line, destination); - while(strstr(line, "") == NULL) + while (strstr(line, "") == NULL) { fgets(line, max_line_size, source); // advance one line - if(feof(source)) + if (feof(source)) { fclose(source); fclose(destination); - delete [] line; + delete[] line; return 0; } } @@ -113,7 +110,7 @@ int editMetaArguments (void) fclose(source); fclose(destination); - delete [] line; + delete[] line; if(CopyFile(metatmppath, metapath) <0) return 0; diff --git a/source/settings/meta.h b/source/settings/meta.h index 98bb6fac..d1a893f1 100644 --- a/source/settings/meta.h +++ b/source/settings/meta.h @@ -24,7 +24,7 @@ #ifndef _META_H_ #define _META_H_ -int updateMetaXML(void); -int editMetaArguments(void); +int updateMetaXML(); +int editMetaArguments(); #endif diff --git a/source/sys.cpp b/source/sys.cpp index c64f0d42..609d15f7 100644 --- a/source/sys.cpp +++ b/source/sys.cpp @@ -239,7 +239,7 @@ void Sys_LoadHBC(void) bool RebootApp(void) { - // be sure to use current settings as arguments + // Be sure to use current settings as arguments editMetaArguments(); #ifdef FULLCHANNEL @@ -251,12 +251,12 @@ bool RebootApp(void) // Load meta.xml arguments char filepath[255]; HomebrewXML MetaXML; - snprintf(filepath, sizeof(filepath), "%s/meta.xml", Settings.update_path); + snprintf(filepath, sizeof(filepath), "%smeta.xml", Settings.ConfigPath); MetaXML.LoadHomebrewXMLData(filepath); u8 *buffer = NULL; u32 filesize = 0; - snprintf(filepath, sizeof(filepath), "%s/boot.dol", Settings.update_path); + snprintf(filepath, sizeof(filepath), "%sboot.dol", Settings.ConfigPath); LoadFileToMem(filepath, &buffer, &filesize); if(!buffer) { @@ -299,12 +299,6 @@ void ScreenShot() // Create the full pathname. snprintf(fullPath, sizeof(fullPath), "%s%s", Settings.ConfigPath, filename); - if(!CreateSubfolder(Settings.ConfigPath)) - { - gprintf("Can't create screenshot folder\n"); - return; - } - TakeScreenshot(fullPath); }