diff --git a/out/boot.dol b/out/boot.dol index e0e23ba1..e64ca552 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/source/list/ListGenerator.cpp b/source/list/ListGenerator.cpp index fcb0937c..dbf9730c 100644 --- a/source/list/ListGenerator.cpp +++ b/source/list/ListGenerator.cpp @@ -153,7 +153,7 @@ static void Add_GameCube_Game(char *FullPath) if(!fp && strstr(FullPath, "/root") != NULL) //fst folder (extracted game) { *(strstr(FullPath, "/root") + 1) = '\0'; - if(strlen(FullPath) + FST_APPEND_SIZE < MAX_MSG_SIZE) strcat(FullPath, FST_APPEND); + if(strlen(FullPath) + FST_APPEND_SIZE < MAX_MSG_SIZE) strcat(FullPath, FST_APPEND);// append "sys/boot.bin" to end of path fp = fopen(FullPath, "rb"); } if(fp) @@ -168,16 +168,11 @@ static void Add_GameCube_Game(char *FullPath) } if(gc_hdr.magic == GC_MAGIC) { - AddISO((const char*)gc_hdr.id, (const char*)gc_hdr.title, - FullPath, 0x000000, TYPE_GC_GAME); /* Check for disc 2 */ fseek(fp, hdr_offset + 0x06, SEEK_SET); fread(gc_disc, 1, 1, fp); - if(gc_disc[0]) - { - wcslcat(m_cacheList.back().title, L" disc 2", 63); - m_cacheList.back().settings[0] = 1; - } + if(!gc_disc[0])// If not disc 2 add game iso + AddISO((const char*)gc_hdr.id, (const char*)gc_hdr.title, FullPath, 0x000000, TYPE_GC_GAME); } fclose(fp); } diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index b9bfb245..b9a2fdf9 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2040,8 +2040,6 @@ void CMenu::_initCF(void) else // wii, gc, channels { strcpy(id, hdr->id); - if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */ - strcat(id, "_2"); strcpy(catID, id); } @@ -2406,7 +2404,11 @@ bool CMenu::_loadGamecubeList() m_cacheList.CreateList(COVERFLOW_GAMECUBE, gameDir, stringToVector(".iso|.gcm|.ciso|root", '|'), cacheDir, updateCache); m_cfg.remove(GC_DOMAIN, "update_cache"); for(vector::iterator tmp_itr = m_cacheList.begin(); tmp_itr != m_cacheList.end(); tmp_itr++) + { + if(tmp_itr->settings[0] == 1) /* disc 2 */ + continue;// skip gc disc 2 if its still part of the cached list m_gameList.push_back(*tmp_itr); + } return true; } diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index f362f6cc..fe87e864 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -201,6 +201,7 @@ private: TexData m_systemBg; TexData m_wbfsBg; TexData m_gameSettingsBg; + TexData m_promptBg; TexData m_gameBg; TexData m_gameBgLQ; TexData m_mainBg; @@ -437,6 +438,10 @@ private: s16 m_gameBtnBack; s16 m_gameLblUser[5]; int snapbg_x, snapbg_y, snapbg_w, snapbg_h; +// disc 2 prompt menu + s16 m_promptLblQuestion; + s16 m_promptBtnChoice1; + s16 m_promptBtnChoice2; // Parental code menu s16 m_codeLblTitle; s16 m_codeBtnKey[10]; diff --git a/source/menu/menu_categories.cpp b/source/menu/menu_categories.cpp index 62456c5f..73afd987 100644 --- a/source/menu/menu_categories.cpp +++ b/source/menu/menu_categories.cpp @@ -136,8 +136,6 @@ void CMenu::_getGameCategories(void) } else strcpy(id, hdr->id); - if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */ - strcat(id, "_2"); const char *gameCats = m_cat.getString(catDomain, id, "").c_str(); if(strlen(gameCats) > 0) diff --git a/source/menu/menu_config_game.cpp b/source/menu/menu_config_game.cpp index 1043e8cb..902714e1 100644 --- a/source/menu/menu_config_game.cpp +++ b/source/menu/menu_config_game.cpp @@ -177,8 +177,6 @@ void CMenu::_showGameSettings() else { strcpy(id, GameHdr->id); - if(GameHdr->type == TYPE_GC_GAME && GameHdr->settings[0] == 1) /* disc 2 */ - strcat(id, "_2"); } _setBg(m_gameSettingsBg, m_gameSettingsBg); @@ -548,8 +546,6 @@ void CMenu::_gameSettings(const dir_discHdr *hdr, bool disc) else { strcpy(id, GameHdr->id); - if(GameHdr->type == TYPE_GC_GAME && GameHdr->settings[0] == 1) /* disc 2 */ - strcat(id, "_2"); } if(GameHdr->type == TYPE_GC_GAME) diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index fb31431b..309f17db 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -411,8 +411,6 @@ void CMenu::_game(bool launch) else { strcpy(id, hdr->id); - if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */ - strcat(id, "_2"); } m_zoom_banner = m_cfg.getBool(_domainFromView(), "show_full_banner", false); @@ -787,8 +785,6 @@ void CMenu::_game(bool launch) else { strcpy(id, hdr->id); - if(hdr->type == TYPE_GC_GAME && hdr->settings[0] == 1) /* disc 2 */ - strcat(id, "_2"); } if(m_newGame) { @@ -1027,6 +1023,20 @@ void CMenu::_initGameMenu() snapbg_y = m_theme.getInt("GAME/SNAP_BG", "y", 31); snapbg_w = m_theme.getInt("GAME/SNAP_BG", "width", 246); snapbg_h = m_theme.getInt("GAME/SNAP_BG", "height", 170); + + /* gc disc prompt menu */ + m_promptBg = _texture("PROMPT/BG", "texture", theme.bg, false); + m_promptLblQuestion = _addLabel("PROMPT/QUESTION", theme.lblFont, L"", 112, 0, 500, 420, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); + m_promptBtnChoice1 = _addButton("PROMPT/CHOICE1", theme.btnFont, L"", 112, 320, 200, 48, theme.btnFontColor); + m_promptBtnChoice2 = _addButton("PROMPT/CHOICE2", theme.btnFont, L"", 332, 320, 200, 48, theme.btnFontColor); + + _setHideAnim(m_promptLblQuestion, "PROMPT/QUESTION", 0, 0, 0.f, 0.f); + _setHideAnim(m_promptBtnChoice1, "PROMPT/CHOICE1", 0, 0, 1.f, -1.f); + _setHideAnim(m_promptBtnChoice2, "PROMPT/CHOICE2", 0, 0, 1.f, -1.f); + + m_btnMgr.hide(m_promptLblQuestion, true); + m_btnMgr.hide(m_promptBtnChoice1, true); + m_btnMgr.hide(m_promptBtnChoice2, true); } void CMenu::_textGame(void) diff --git a/source/menu/menu_game_boot.cpp b/source/menu/menu_game_boot.cpp index d619f84b..8976c1c3 100644 --- a/source/menu/menu_game_boot.cpp +++ b/source/menu/menu_game_boot.cpp @@ -319,6 +319,64 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc) return; } + /* Set game path */ + char path[256]; + if(disc) + snprintf(path, sizeof(path), "%s", "di"); + else + snprintf(path, sizeof(path), "%s", hdr->path); + + if(loader == NINTENDONT && !disc)// Check if game has multi Discs + { + char disc2Path[256]; + disc2Path[255] = '\0'; + strncpy(disc2Path, path, sizeof(disc2Path) - 1); + char *pathPtr = strrchr(disc2Path, '/'); + if(pathPtr) *pathPtr = 0; + strncpy(disc2Path, fmt("%s/disc2.iso", disc2Path), sizeof(disc2Path) - 1); + // note fst extracted /boot.bin paths will not have disc2.iso + if(fsop_FileExist(disc2Path)) + { + SetupInput(); + _setBg(m_promptBg, m_promptBg); + m_btnMgr.show(m_promptLblQuestion); + m_btnMgr.show(m_promptBtnChoice1); + m_btnMgr.show(m_promptBtnChoice2); + m_btnMgr.setText(m_promptLblQuestion, _t("discq", L"This game has multiple discs. Please select the disc to launch.")); + m_btnMgr.setText(m_promptBtnChoice1, _t("disc1", L"Disc 1")); + m_btnMgr.setText(m_promptBtnChoice2, _t("disc2", L"Disc 2")); + int choice = -1; + while(!m_exit) + { + _mainLoopCommon(); + if(BTN_UP_PRESSED) + m_btnMgr.up(); + else if(BTN_DOWN_PRESSED) + m_btnMgr.down(); + else if(BTN_A_PRESSED) + { + if(m_btnMgr.selected(m_promptBtnChoice1)) + { + choice = 0; + break; + } + else if(m_btnMgr.selected(m_promptBtnChoice2)) + { + choice = 1; + break; + } + } + } + m_btnMgr.hide(m_promptLblQuestion); + m_btnMgr.hide(m_promptBtnChoice1); + m_btnMgr.hide(m_promptBtnChoice2); + if(choice < 0) + return; + if(choice == 1) + snprintf(path, sizeof(path), "%s", disc2Path); + } + } + /* clear coverflow, start wiiflow wait animation, set exit handler */ _launchShutdown(); @@ -329,12 +387,6 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool disc) add_game_to_card(id); /* Get game settings */ - const char *path = NULL; - if(disc) - path = "di"; - else - path = hdr->path; - u8 GClanguage = min(m_gcfg2.getUInt(id, "language", 0), ARRAY_SIZE(CMenu::_GClanguages) - 1u); GClanguage = (GClanguage == 0) ? min(m_cfg.getUInt(GC_DOMAIN, "game_language", 0), ARRAY_SIZE(CMenu::_GlobalGClanguages) - 1u) : GClanguage-1; // language selection only works for PAL games. E and J are always set to english. diff --git a/wii/wiiflow/Languages/english.ini b/wii/wiiflow/Languages/english.ini index 097925a8..e688814a 100644 --- a/wii/wiiflow/Languages/english.ini +++ b/wii/wiiflow/Languages/english.ini @@ -253,6 +253,9 @@ def=Default deltcover=Cover is deleted. deltbanner=Banner is deleted. disabled=Disabled +discq=This game has multiple discs. Please select the disc to launch. +disc1=Disc 1 +disc2=Disc 2 dl1=Cancel dl10=Please donate\nto GameTDB.com dl12=GameTDB diff --git a/wii/wiiflow/Languages/german.ini b/wii/wiiflow/Languages/german.ini index 92343786..ad9c5449 100644 --- a/wii/wiiflow/Languages/german.ini +++ b/wii/wiiflow/Languages/german.ini @@ -253,6 +253,9 @@ def=Standard deltcover=Cover wurde gelöscht. deltbanner=Banner wurde gelöscht. disabled=Deaktiviert +discq=This game has multiple discs. Please select the disc to launch. +disc1=Disc 1 +disc2=Disc 2 dl1=Abbrechen dl10=Bitte spendet\nan GameTDB.com dl12=GameTDB diff --git a/wii/wiiflow/Languages/italian.ini b/wii/wiiflow/Languages/italian.ini index 8424cbf5..14adc42f 100644 --- a/wii/wiiflow/Languages/italian.ini +++ b/wii/wiiflow/Languages/italian.ini @@ -243,6 +243,9 @@ def=Predefinito deltbanner=Banner eliminato. deltcover=Copertina eliminata. disabled=Disattivato +discq=This game has multiple discs. Please select the disc to launch. +disc1=Disc 1 +disc2=Disc 2 dl1=Annulla dl10=Per piacere donate\na GameTDB.com dl12=GameTDB diff --git a/wii/wiiflow/Languages/korean.ini b/wii/wiiflow/Languages/korean.ini index b806985f..83acd7d7 100644 --- a/wii/wiiflow/Languages/korean.ini +++ b/wii/wiiflow/Languages/korean.ini @@ -253,6 +253,9 @@ def=기본 deltcover=커버가 삭제되었습니다. deltbanner=배너가 삭제되었습니다. disabled=비활성화 +discq=This game has multiple discs. Please select the disc to launch. +disc1=Disc 1 +disc2=Disc 2 dl1=취소 dl10=GameTDB.com에\n기부해 주세요 dl12=GameTDB diff --git a/wii/wiiflow/Languages/spanish.ini b/wii/wiiflow/Languages/spanish.ini index fcc206e3..9d4dddda 100644 --- a/wii/wiiflow/Languages/spanish.ini +++ b/wii/wiiflow/Languages/spanish.ini @@ -250,6 +250,9 @@ def=Por defecto deltcover=Se ha eliminado la portada. deltbanner=Se ha eliminado el banner. disabled=Desactivado +discq=This game has multiple discs. Please select the disc to launch. +disc1=Disc 1 +disc2=Disc 2 dl1=Cancelar dl10=Por favor dona\na GameTDB.com dl12=GameTDB