diff --git a/out/bins/ext_booter.bin b/out/bins/ext_booter.bin index 5aea9c67..c62a581b 100644 Binary files a/out/bins/ext_booter.bin and b/out/bins/ext_booter.bin differ diff --git a/out/boot.dol b/out/boot.dol index fa82c674..da53a010 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/source/config/config.cpp b/source/config/config.cpp index 47c07c4c..be8f9aab 100644 --- a/source/config/config.cpp +++ b/source/config/config.cpp @@ -98,7 +98,7 @@ bool Config::hasDomain(const string &domain) const void Config::copyDomain(const string &dst, const string &src) { - m_domains[dst] = m_domains[src]; + m_domains[upperCase(dst)] = m_domains[upperCase(src)]; } const string &Config::firstDomain(void) diff --git a/source/defines.h b/source/defines.h index 9014dbfe..ac7faadc 100644 --- a/source/defines.h +++ b/source/defines.h @@ -6,7 +6,7 @@ #else #define APP_NAME "WiiFlow Lite" #endif -#define APP_VERSION "5.3.0 beta 1" +#define APP_VERSION "5.3.0 beta 2" #define APP_DATA_DIR "wiiflow" #ifdef APP_WIIFLOW diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 80c5431f..06e4153f 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -475,6 +475,8 @@ void CMenu::_Theme_Cleanup(void) m_nextBg = NULL; TexHandle.Cleanup(m_curBg); m_lqBg = NULL; + TexHandle.Cleanup(sfbgimg); + TexHandle.Cleanup(m_mainAltBg); /* Buttons */ TexHandle.Cleanup(theme.btnTexL); TexHandle.Cleanup(theme.btnTexR); @@ -664,9 +666,7 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt) { string domain = fmt("%s_%i", cf_domain, version); string domainSel = fmt("%s_%i_S", cf_domain, version); - bool smallflow = (strcmp(cf_domain, "_SMALLFLOW") == 0); - bool shortflow = (strcmp(cf_domain, "_SHORTFLOW") == 0); - bool sideflow = (strcmp(cf_domain, "_SIDEFLOW") == 0); + bool smallflow = strcasecmp(cf_domain, "_SMALLFLOW") == 0; bool sf = otherScrnFmt; int max_fsaa = m_coverflow.getInt(domain, "max_fsaa", 3); @@ -696,11 +696,10 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt) float def_cvr_posX = smallflow ? 1.f : 1.6f; float def_cvr_posY = smallflow ? -0.8f : -1.f; - float def_cvr_posX1 = sideflow ? .10f : 0.f; CoverFlow.setCoverPos(false, _getCFV3D(domain, "left_pos", Vector3D(-def_cvr_posX, def_cvr_posY, 0.f), sf), _getCFV3D(domain, "right_pos", Vector3D(def_cvr_posX, def_cvr_posY, 0.f), sf), - _getCFV3D(domain, "center_pos", Vector3D(def_cvr_posX1, def_cvr_posY, 1.f), sf), + _getCFV3D(domain, "center_pos", Vector3D(def_cvr_posX, def_cvr_posY, 1.f), sf), _getCFV3D(domain, "row_center_pos", Vector3D(0.f, def_cvr_posY, 0.f), sf)); if(smallflow) @@ -750,11 +749,10 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt) m_coverflow.getVector3D(domainSel, "right_delta_angle")); float angleY = smallflow ? 0.f : 70.f; - float angleZ = sideflow ? 90.f : 0.f; CoverFlow.setAngles(false, m_coverflow.getVector3D(domain, "left_angle", Vector3D(0.f, angleY, 0.f)), m_coverflow.getVector3D(domain, "right_angle", Vector3D(0.f, -angleY, 0.f)), - m_coverflow.getVector3D(domain, "center_angle", Vector3D(0.f, 0.f, angleZ)), + m_coverflow.getVector3D(domain, "center_angle", Vector3D(0.f, 0.f, 0.f)), m_coverflow.getVector3D(domain, "row_center_angle")); angleY = smallflow ? 0.f : 90.f; @@ -763,7 +761,7 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt) CoverFlow.setAngles(true, m_coverflow.getVector3D(domainSel, "left_angle", Vector3D(angleX, angleY, 0.f)), m_coverflow.getVector3D(domainSel, "right_angle", Vector3D(angleX, -angleY, 0.f)), - m_coverflow.getVector3D(domainSel, "center_angle", Vector3D(0.f, angleY1, angleZ)), + m_coverflow.getVector3D(domainSel, "center_angle", Vector3D(0.f, angleY1, 0.f)), m_coverflow.getVector3D(domainSel, "row_center_angle")); angleX = smallflow ? 0.f : 20.f; @@ -860,9 +858,7 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt) m_coverflow.getVector3D(domainSel, "top_angle"), m_coverflow.getVector3D(domainSel, "bottom_angle")); - Vector3D def_cvr_scale = smallflow ? Vector3D(0.66f, 0.25f, 1.f) - : (shortflow ? Vector3D(1.f, 0.66f, 1.f) - : Vector3D(1.f, 1.f, 1.f)); + Vector3D def_cvr_scale = smallflow ? Vector3D(0.66f, 0.25f, 1.f) : Vector3D(1.f, 1.f, 1.f); CoverFlow.setCoverScale(false, m_coverflow.getVector3D(domain, "left_scale", def_cvr_scale), diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index 760fcb16..38d83522 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -97,7 +97,7 @@ private: u8 m_numCFVersions; u8 m_numPlugins; u8 m_max_source_btn; - const char *cf_domain; + char cf_domain[16]; bool m_use_source;// source_menu.ini found & ok to use source menu/flow bool m_multisource;// multi select source menu bool m_sourceflow;// in sourceflow view @@ -1022,8 +1022,6 @@ private: void _showCF(bool refreshList = false); void _refreshExplorer(s8 direction = 0); void _setSrcOptions(void); - bool _sideCover(const char *magic); - bool _shortCover(const char *magic); void _updateSourceBtns(void); void _updatePluginText(void); void _updatePluginCheckboxes(void); diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 2010df3a..80ef3f50 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -43,6 +43,7 @@ extern const u32 gc_ogg_size; bool m_zoom_banner = false; bool m_banner_loaded = false; +bool m_set_bg = false; s16 m_gameBtnPlayFull; s16 m_gameBtnBackFull; s16 m_gameBtnToggle; @@ -316,8 +317,6 @@ void CMenu::_hideGame(bool instant) void CMenu::_showGame(void) { - bool faPrevLoaded = m_fa.isLoaded(); - const dir_discHdr *GameHdr = CoverFlow.getHdr(); const char *coverDir = NULL; const char *Path = NULL; @@ -336,11 +335,12 @@ void CMenu::_showGame(void) _setBg(*bg, *bglq); CoverFlow.hideCover(); } - else if(faPrevLoaded) + else if(m_set_bg) { CoverFlow.showCover(); _setMainBg(); } + m_set_bg = true; } void CMenu::_cleanupBanner(bool gamechange) @@ -383,14 +383,18 @@ static const char *getVideoDefaultPath(const string &videoDir) bool CMenu::_startVideo() { const dir_discHdr *GameHdr = CoverFlow.getHdr(); + + const char *videoId = NULL; char curId3[4]; memset(curId3, 0, 4); - const char *videoId = CoverFlow.getFilenameId(GameHdr);//title.ext if(!NoGameID(GameHdr->type)) { //id3 memcpy(curId3, GameHdr->id, 3); videoId = curId3; } + else + videoId = CoverFlow.getFilenameId(GameHdr);//title.ext + //dev:/wiiflow/trailers/{coverfolder}/title.ext.thp or dev:/wiiflow/trailers/id3.thp const char *videoPath = getVideoPath(m_videoDir, videoId); const char *THP_Path = fmt("%s.thp", videoPath); @@ -429,6 +433,7 @@ bool CMenu::_startVideo() void CMenu::_game(bool launch) { m_banner_loaded = false; + m_set_bg = false; bool coverFlipped = false; int cf_version = 1; string domain; @@ -551,14 +556,10 @@ void CMenu::_game(bool launch) /* display game info screen */ else if(BTN_PLUS_PRESSED && hdr->type != TYPE_HOMEBREW && hdr->type != TYPE_SOURCE && !coverFlipped && !m_video_playing) { - bool faLoaded = m_fa.isLoaded(); - _hideGame();// stops trailer movie and unloads fanart + _hideGame(); m_banner.SetShowBanner(false); _gameinfo(); - if(faLoaded) - _showGame();// reloads fanart - else - _setMainBg();// show custom bg if available + _showGame(); m_banner.SetShowBanner(true); } /* play or stop a trailer video */ diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 80ecd35f..5d7afe82 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -48,6 +48,7 @@ void CMenu::_setMainBg() _setSrcFlowBg(); else { + TexHandle.Cleanup(m_mainAltBg); string fn = m_cfg.getString("general", "main_background", ""); if(fn.length() > 0) { @@ -215,40 +216,54 @@ void CMenu::_showCF(bool refreshList) if(m_cfg.getBool("GENERAL", "save_favorites_mode", false)) m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false); - /* set CoverFlow domain to _COVERFLOW, _SMALLFLOW, _SIDEFLOW, _SHORTFLOW, or _FLATFLOW */ - cf_domain = "_COVERFLOW"; + strcpy(cf_domain, "_COVERFLOW"); if(!m_sourceflow && m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true)) - cf_domain = "_SMALLFLOW"; + strcpy(cf_domain, "_SMALLFLOW"); if(m_sourceflow && m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox", true)) - cf_domain = "_SMALLFLOW"; + strcpy(cf_domain, "_SMALLFLOW"); if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow) { m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); + /* check if homebrew plugin */ if(enabledPluginsCount == 1 && m_cfg.getBool(PLUGIN_ENABLED, "48425257") && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox")) - cf_domain = "_smallflow"; + strcpy(cf_domain, "_SMALLFLOW"); else if(enabledPluginsCount > 0) { - int sdc = 0; - int shc = 0; - int flatmode_cnt = 0; - for(u8 i = 0; m_plugin.PluginExist(i); ++i) + /* load platform.ini */ + Config m_platform; + m_platform.load(fmt("%s/platform.ini", m_pluginDataDir.c_str()) ); + if(m_platform.loaded()) { - if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i))) + string flow_domain; + for(u8 i = 0; m_plugin.PluginExist(i); ++i) { - if(!m_plugin.GetBoxMode(i)) - flatmode_cnt++; - else if(_sideCover(m_plugin.PluginMagicWord)) - sdc++; - else if(_shortCover(m_plugin.PluginMagicWord)) - shc++; + if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i))) + { + strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8); + flow_domain = m_platform.getString("FLOWS", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord)); + break; + } } + if(!flow_domain.empty()) + { + bool match = true; + for(u8 i = 0; m_plugin.PluginExist(i); ++i) + { + if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i))) + { + strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8); + if(flow_domain != m_platform.getString("FLOWS", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord))) + { + match = false; + break; + } + } + } + if(match) + snprintf(cf_domain, sizeof(cf_domain), "%s", flow_domain.c_str()); + } + m_platform.unload(); } - if(sdc == enabledPluginsCount) - cf_domain = "_SIDEFLOW"; - else if(shc == enabledPluginsCount) - cf_domain = "_SHORTFLOW"; - if(flatmode_cnt == enabledPluginsCount) - cf_domain = "_FLATFLOW"; } } @@ -352,14 +367,6 @@ int CMenu::main(void) _showCF(true); continue; } - if(m_current_view == COVERFLOW_HOMEBREW && m_prev_view != 0) - { - m_current_view = m_prev_view; - m_prev_view = 0; - m_cfg.setUInt("GENERAL", "sources", m_current_view); - _showCF(true); - continue; - } if(m_use_source)//if source_menu enabled { _hideMain(); diff --git a/source/menu/menu_source.cpp b/source/menu/menu_source.cpp index 0f24967c..0c61d79d 100644 --- a/source/menu/menu_source.cpp +++ b/source/menu/menu_source.cpp @@ -183,6 +183,7 @@ void CMenu::_srcTierBack(bool home) void CMenu::_setSrcFlowBg(void) { + TexHandle.Cleanup(sfbgimg); string fn = m_source.getString("general", "background", ""); if(fn.length() > 0) { @@ -699,54 +700,6 @@ bool CMenu::_Source() return newSource; } -static const char sideCovers[5][9] = { -"534e5854", //Snes9X-Next -"534e4553", //SNES9xGX -"4e4f3634", //Not64 -"57493634", //Wii64 -"513053xx" //QuakeGX Serverloader wild cards -}; - -static const char shortCovers[13][9] = { -"474d4254", //Gambatte -"474d4264", //Gambatte GB -"474d4274", //Gambatte GBC -"56425854", //VBA-Next -"56424158", //VbaGX -"56424168", //VbaGX GB -"56424178", //VbaGX GBC -"56424188", //VbaGX GBA -"4d45445e", //WiiMednafen GB -"4d45446e", //WiiMednafen GBC -"4d45447e", //WiiMednafen GBA -"57495358", //WiiSX - playstation -"51304dxx" //QuakeGX Modloader wild cards -}; - -bool CMenu::_sideCover(const char *magic) -{ - if(magic == NULL) - return false; - for(i = 0; i < ARRAY_SIZE(sideCovers); i++) - { - if((sideCovers[i][6] == 'x' && strncasecmp(magic, sideCovers[i], 6) == 0) || strncasecmp(magic, sideCovers[i], 8) == 0) - return true; - } - return false; -} - -bool CMenu::_shortCover(const char *magic) -{ - if(magic == NULL) - return false; - for(i = 0; i < ARRAY_SIZE(shortCovers); i++) - { - if((shortCovers[i][6] == 'x' && strncasecmp(magic, shortCovers[i], 6) == 0) || strncasecmp(magic, shortCovers[i], 8) == 0) - return true; - } - return false; -} - void CMenu::_setSrcOptions(void) { m_cfg.setString("GENERAL", "main_background", m_source.getString(btn_selected, "background", ""));