From 37b6ebbc26b59e805a28d70badec7ad161655cfa Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Sat, 14 Apr 2012 19:43:37 +0000 Subject: [PATCH] -added new option for plugins, "ReturnLoader", if enabled it will use the WiiFlowLoader.dol (http://www.mediafire.com/?lcvlra9vco8a91j) in the plugins dir to return to wiiflow (needed for some emus) --- source/menu/menu_game.cpp | 5 ++++- source/plugin/plugin.cpp | 11 +++++++++++ source/plugin/plugin.hpp | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/source/menu/menu_game.cpp b/source/menu/menu_game.cpp index 16a71d7c..50f44a8b 100644 --- a/source/menu/menu_game.cpp +++ b/source/menu/menu_game.cpp @@ -643,7 +643,10 @@ void CMenu::_launch(dir_discHdr *hdr) path.erase(3,1); arguments.push_back(path); arguments.push_back(title); - arguments.push_back(wiiflow_dol); + if(m_plugin.UseReturnLoader(hdr->hdr.magic)) + arguments.push_back(sfmt("%s/WiiFlowLoader.dol",m_pluginsDir.c_str())); + else + arguments.push_back(wiiflow_dol); m_cfg.setString("EMULATOR", "current_item", &hdr->path[std::string(hdr->path).find_last_of("/")]); } else diff --git a/source/plugin/plugin.cpp b/source/plugin/plugin.cpp index 84af2fc1..bffc97d2 100644 --- a/source/plugin/plugin.cpp +++ b/source/plugin/plugin.cpp @@ -50,6 +50,7 @@ bool Plugin::AddPlugin(Config &plugin) magicWords.push_back(magic); sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &caseColor); caseColors.push_back(caseColor); + ReturnLoader.push_back(plugin.getBool("PLUGIN","ReturnLoader")); string bannerfilepath = sfmt("%s/%s", pluginsDir.c_str(), plugin.getString("PLUGIN","bannerSound","").c_str()); ifstream infile; @@ -75,6 +76,16 @@ bool Plugin::AddPlugin(Config &plugin) return false; } +bool Plugin::UseReturnLoader(u32 magic) +{ + for(u8 pos = 0; pos < magicWords.size(); pos++) + { + if(magic == magicWords[pos]) + return ReturnLoader[pos]; + } + return false; +} + u8* Plugin::GetBannerSound(u32 magic) { for(banner_pos = 0; banner_pos < magicWords.size(); banner_pos++) diff --git a/source/plugin/plugin.hpp b/source/plugin/plugin.hpp index 4d4f1b21..31c5cdc3 100644 --- a/source/plugin/plugin.hpp +++ b/source/plugin/plugin.hpp @@ -24,6 +24,7 @@ public: u8* GetBannerSound(u32 magic); u32 GetBannerSoundSize(); char* GetDolName(u32 magic); + bool UseReturnLoader(u32 magic); void init(string); void Cleanup(); void EndAdd(); @@ -34,6 +35,8 @@ private: safe_vector magicWords; safe_vector DolName; safe_vector caseColors; + safe_vector ReturnLoader; + u8 banner_pos; string pluginsDir; bool adding;