-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)
This commit is contained in:
fix94.1 2012-04-14 19:43:37 +00:00
parent 3967b7b3c8
commit 37b6ebbc26
3 changed files with 18 additions and 1 deletions

View File

@ -643,7 +643,10 @@ void CMenu::_launch(dir_discHdr *hdr)
path.erase(3,1); path.erase(3,1);
arguments.push_back(path); arguments.push_back(path);
arguments.push_back(title); 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("/")]); m_cfg.setString("EMULATOR", "current_item", &hdr->path[std::string(hdr->path).find_last_of("/")]);
} }
else else

View File

@ -50,6 +50,7 @@ bool Plugin::AddPlugin(Config &plugin)
magicWords.push_back(magic); magicWords.push_back(magic);
sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &caseColor); sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &caseColor);
caseColors.push_back(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()); string bannerfilepath = sfmt("%s/%s", pluginsDir.c_str(), plugin.getString("PLUGIN","bannerSound","").c_str());
ifstream infile; ifstream infile;
@ -75,6 +76,16 @@ bool Plugin::AddPlugin(Config &plugin)
return false; 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) u8* Plugin::GetBannerSound(u32 magic)
{ {
for(banner_pos = 0; banner_pos < magicWords.size(); banner_pos++) for(banner_pos = 0; banner_pos < magicWords.size(); banner_pos++)

View File

@ -24,6 +24,7 @@ public:
u8* GetBannerSound(u32 magic); u8* GetBannerSound(u32 magic);
u32 GetBannerSoundSize(); u32 GetBannerSoundSize();
char* GetDolName(u32 magic); char* GetDolName(u32 magic);
bool UseReturnLoader(u32 magic);
void init(string); void init(string);
void Cleanup(); void Cleanup();
void EndAdd(); void EndAdd();
@ -34,6 +35,8 @@ private:
safe_vector<u32> magicWords; safe_vector<u32> magicWords;
safe_vector<string> DolName; safe_vector<string> DolName;
safe_vector<u32> caseColors; safe_vector<u32> caseColors;
safe_vector<bool> ReturnLoader;
u8 banner_pos; u8 banner_pos;
string pluginsDir; string pluginsDir;
bool adding; bool adding;