Merge pull request #1264 from Stevoisiak/GCM-to-ISO

Gcm to iso
This commit is contained in:
Ryan Houdek 2014-11-02 11:29:41 -06:00
commit 1c41acaddd
11 changed files with 45 additions and 45 deletions

View File

@ -1,8 +1,8 @@
[General] [General]
GCMPathes = 0 ISOPaths = 0
LastFilename = LastFilename =
ShowLag = False ShowLag = False
RecursiveGCMPaths = False RecursiveISOPaths = False
NANDRoot = //sdcard/dolphin-emu/Wii NANDRoot = //sdcard/dolphin-emu/Wii
WirelessMac = WirelessMac =
[Core] [Core]
@ -14,7 +14,7 @@ Fastmem = False
DSPThread = False DSPThread = False
DSPHLE = True DSPHLE = True
SkipIdle = True SkipIdle = True
DefaultGCM = DefaultISO =
DVDRoot = DVDRoot =
Apploader = Apploader =
EnableCheats = False EnableCheats = False

View File

@ -133,7 +133,7 @@ public final class FolderBrowser extends ListFragment
private void FolderSelected() private void FolderSelected()
{ {
String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0"); String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "ISOPaths", "0");
int intDirectories = Integer.parseInt(Directories); int intDirectories = Integer.parseInt(Directories);
// Check to see if a path set in the Dolphin config // Check to see if a path set in the Dolphin config
@ -142,9 +142,9 @@ public final class FolderBrowser extends ListFragment
boolean pathNotPresent = true; boolean pathNotPresent = true;
for (int i = 0; i < intDirectories; i++) for (int i = 0; i < intDirectories; i++)
{ {
String gcmPath = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + i, ""); String isoPath = NativeLibrary.GetConfig("Dolphin.ini", "General", "ISOPath" + i, "");
if (gcmPath.equals(currentDir.getPath())) if (isoPath.equals(currentDir.getPath()))
{ {
pathNotPresent = false; pathNotPresent = false;
} }
@ -157,8 +157,8 @@ public final class FolderBrowser extends ListFragment
// User doesn't have this path in the config, so add it. // User doesn't have this path in the config, so add it.
if (pathNotPresent) if (pathNotPresent)
{ {
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", Integer.toString(intDirectories+1)); NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPaths", Integer.toString(intDirectories+1));
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), currentDir.getPath()); NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPath" + Integer.toString(intDirectories), currentDir.getPath());
} }
((GameListActivity)getActivity()).SwitchPage(0); ((GameListActivity)getActivity()).SwitchPage(0);

View File

@ -263,16 +263,16 @@ public final class GameListActivity extends Activity
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) public void onClick(DialogInterface dialog, int which)
{ {
String directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0"); String directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "ISOPaths", "0");
int intDirs = Integer.parseInt(directories); int intDirs = Integer.parseInt(directories);
for (int i = 0; i < intDirs; i++) for (int i = 0; i < intDirs; i++)
{ {
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + i, ""); NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPath" + i, "");
} }
// Since we flushed all paths, we signify this in the ini. // Since we flushed all paths, we signify this in the ini.
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", "0"); NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPaths", "0");
// Now finally, clear the game list. // Now finally, clear the game list.
((GameListFragment) getFragmentManager().findFragmentById(R.id.content_frame)).clearGameList(); ((GameListFragment) getFragmentManager().findFragmentById(R.id.content_frame)).clearGameList();

View File

@ -63,7 +63,7 @@ public final class GameListFragment extends ListFragment
private void fill() private void fill()
{ {
List<GameListItem> fls = new ArrayList<GameListItem>(); List<GameListItem> fls = new ArrayList<GameListItem>();
String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0"); String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "ISOPaths", "0");
int intDirectories = Integer.parseInt(Directories); int intDirectories = Integer.parseInt(Directories);
// Extensions to filter by. // Extensions to filter by.
@ -71,7 +71,7 @@ public final class GameListFragment extends ListFragment
for (int a = 0; a < intDirectories; ++a) for (int a = 0; a < intDirectories; ++a)
{ {
String BrowseDir = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + a, ""); String BrowseDir = NativeLibrary.GetConfig("Dolphin.ini", "General", "ISOPath" + a, "");
File currentDir = new File(BrowseDir); File currentDir = new File(BrowseDir);
File[] dirs = currentDir.listFiles(); File[] dirs = currentDir.listFiles();
try try

View File

@ -293,9 +293,9 @@ bool CBoot::BootUp()
{ {
BS2Success = EmulatedBS2(dolWii); BS2Success = EmulatedBS2(dolWii);
} }
else if (!VolumeHandler::IsWii() && !_StartupPara.m_strDefaultGCM.empty()) else if (!VolumeHandler::IsWii() && !_StartupPara.m_strDefaultISO.empty())
{ {
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM); VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
BS2Success = EmulatedBS2(dolWii); BS2Success = EmulatedBS2(dolWii);
} }
@ -343,9 +343,9 @@ bool CBoot::BootUp()
{ {
BS2Success = EmulatedBS2(elfWii); BS2Success = EmulatedBS2(elfWii);
} }
else if (!VolumeHandler::IsWii() && !_StartupPara.m_strDefaultGCM.empty()) else if (!VolumeHandler::IsWii() && !_StartupPara.m_strDefaultISO.empty())
{ {
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM); VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
BS2Success = EmulatedBS2(elfWii); BS2Success = EmulatedBS2(elfWii);
} }
@ -357,10 +357,10 @@ bool CBoot::BootUp()
VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, elfWii); VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, elfWii);
BS2Success = EmulatedBS2(elfWii); BS2Success = EmulatedBS2(elfWii);
} }
else if (!_StartupPara.m_strDefaultGCM.empty()) else if (!_StartupPara.m_strDefaultISO.empty())
{ {
NOTICE_LOG(BOOT, "Loading default ISO %s", _StartupPara.m_strDefaultGCM.c_str()); NOTICE_LOG(BOOT, "Loading default ISO %s", _StartupPara.m_strDefaultISO.c_str());
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM); VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
} }
else VolumeHandler::SetVolumeDirectory(_StartupPara.m_strFilename, elfWii); else VolumeHandler::SetVolumeDirectory(_StartupPara.m_strFilename, elfWii);
@ -390,8 +390,8 @@ bool CBoot::BootUp()
// load default image or create virtual drive from directory // load default image or create virtual drive from directory
if (!_StartupPara.m_strDVDRoot.empty()) if (!_StartupPara.m_strDVDRoot.empty())
VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, true); VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, true);
else if (!_StartupPara.m_strDefaultGCM.empty()) else if (!_StartupPara.m_strDefaultISO.empty())
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM); VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
DVDInterface::SetDiscInside(VolumeHandler::IsValid()); DVDInterface::SetDiscInside(VolumeHandler::IsValid());
break; break;

View File

@ -178,19 +178,19 @@ void SConfig::SaveGeneralSettings(IniFile& ini)
// Clear removed folders // Clear removed folders
int oldPaths; int oldPaths;
int numPaths = (int)m_ISOFolder.size(); int numPaths = (int)m_ISOFolder.size();
general->Get("GCMPathes", &oldPaths, 0); general->Get("ISOPaths", &oldPaths, 0);
for (int i = numPaths; i < oldPaths; i++) for (int i = numPaths; i < oldPaths; i++)
{ {
ini.DeleteKey("General", StringFromFormat("GCMPath%i", i)); ini.DeleteKey("General", StringFromFormat("ISOPath%i", i));
} }
general->Set("GCMPathes", numPaths); general->Set("ISOPaths", numPaths);
for (int i = 0; i < numPaths; i++) for (int i = 0; i < numPaths; i++)
{ {
general->Set(StringFromFormat("GCMPath%i", i), m_ISOFolder[i]); general->Set(StringFromFormat("ISOPath%i", i), m_ISOFolder[i]);
} }
general->Set("RecursiveGCMPaths", m_RecursiveISOFolder); general->Set("RecursiveISOPaths", m_RecursiveISOFolder);
general->Set("NANDRootPath", m_NANDPath); general->Set("NANDRootPath", m_NANDPath);
general->Set("WirelessMac", m_WirelessMac); general->Set("WirelessMac", m_WirelessMac);
@ -292,7 +292,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("DSPThread", m_LocalCoreStartupParameter.bDSPThread); core->Set("DSPThread", m_LocalCoreStartupParameter.bDSPThread);
core->Set("DSPHLE", m_LocalCoreStartupParameter.bDSPHLE); core->Set("DSPHLE", m_LocalCoreStartupParameter.bDSPHLE);
core->Set("SkipIdle", m_LocalCoreStartupParameter.bSkipIdle); core->Set("SkipIdle", m_LocalCoreStartupParameter.bSkipIdle);
core->Set("DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM); core->Set("DefaultISO", m_LocalCoreStartupParameter.m_strDefaultISO);
core->Set("DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot); core->Set("DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot);
core->Set("Apploader", m_LocalCoreStartupParameter.m_strApploader); core->Set("Apploader", m_LocalCoreStartupParameter.m_strApploader);
core->Set("EnableCheats", m_LocalCoreStartupParameter.bEnableCheats); core->Set("EnableCheats", m_LocalCoreStartupParameter.bEnableCheats);
@ -388,19 +388,19 @@ void SConfig::LoadGeneralSettings(IniFile& ini)
#endif #endif
m_ISOFolder.clear(); m_ISOFolder.clear();
int numGCMPaths; int numISOPaths;
if (general->Get("GCMPathes", &numGCMPaths, 0)) if (general->Get("ISOPaths", &numISOPaths, 0))
{ {
for (int i = 0; i < numGCMPaths; i++) for (int i = 0; i < numISOPaths; i++)
{ {
std::string tmpPath; std::string tmpPath;
general->Get(StringFromFormat("GCMPath%i", i), &tmpPath, ""); general->Get(StringFromFormat("ISOPath%i", i), &tmpPath, "");
m_ISOFolder.push_back(std::move(tmpPath)); m_ISOFolder.push_back(std::move(tmpPath));
} }
} }
general->Get("RecursiveGCMPaths", &m_RecursiveISOFolder, false); general->Get("RecursiveISOPaths", &m_RecursiveISOFolder, false);
general->Get("NANDRootPath", &m_NANDPath); general->Get("NANDRootPath", &m_NANDPath);
m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath); m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath);
@ -512,7 +512,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("DSPHLE", &m_LocalCoreStartupParameter.bDSPHLE, true); core->Get("DSPHLE", &m_LocalCoreStartupParameter.bDSPHLE, true);
core->Get("CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true); core->Get("CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
core->Get("SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true); core->Get("SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true);
core->Get("DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM); core->Get("DefaultISO", &m_LocalCoreStartupParameter.m_strDefaultISO);
core->Get("DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot); core->Get("DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot);
core->Get("Apploader", &m_LocalCoreStartupParameter.m_strApploader); core->Get("Apploader", &m_LocalCoreStartupParameter.m_strApploader);
core->Get("EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false); core->Get("EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false);

View File

@ -32,7 +32,7 @@ struct SConfig : NonCopyable
// name of the last used filename // name of the last used filename
std::string m_LastFilename; std::string m_LastFilename;
// gcm folder // ISO folder
std::vector<std::string> m_ISOFolder; std::vector<std::string> m_ISOFolder;
bool m_RecursiveISOFolder; bool m_RecursiveISOFolder;

View File

@ -222,7 +222,7 @@ struct SCoreStartupParameter
std::string m_strFilename; std::string m_strFilename;
std::string m_strBootROM; std::string m_strBootROM;
std::string m_strSRAM; std::string m_strSRAM;
std::string m_strDefaultGCM; std::string m_strDefaultISO;
std::string m_strDVDRoot; std::string m_strDVDRoot;
std::string m_strApploader; std::string m_strApploader;
std::string m_strUniqueID; std::string m_strUniqueID;

View File

@ -501,7 +501,7 @@ void CConfigMain::InitializeGUIValues()
// Paths // Paths
RecursiveISOPath->SetValue(SConfig::GetInstance().m_RecursiveISOFolder); RecursiveISOPath->SetValue(SConfig::GetInstance().m_RecursiveISOFolder);
DefaultISO->SetPath(StrToWxStr(startup_params.m_strDefaultGCM)); DefaultISO->SetPath(StrToWxStr(startup_params.m_strDefaultISO));
DVDRoot->SetPath(StrToWxStr(startup_params.m_strDVDRoot)); DVDRoot->SetPath(StrToWxStr(startup_params.m_strDVDRoot));
ApploaderPath->SetPath(StrToWxStr(startup_params.m_strApploader)); ApploaderPath->SetPath(StrToWxStr(startup_params.m_strApploader));
NANDRoot->SetPath(StrToWxStr(SConfig::GetInstance().m_NANDPath)); NANDRoot->SetPath(StrToWxStr(SConfig::GetInstance().m_NANDPath));
@ -1284,7 +1284,7 @@ void CConfigMain::RecursiveDirectoryChanged(wxCommandEvent& WXUNUSED (event))
void CConfigMain::DefaultISOChanged(wxFileDirPickerEvent& WXUNUSED (event)) void CConfigMain::DefaultISOChanged(wxFileDirPickerEvent& WXUNUSED (event))
{ {
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = WxStrToStr(DefaultISO->GetPath()); SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultISO = WxStrToStr(DefaultISO->GetPath());
} }
void CConfigMain::DVDRootChanged(wxFileDirPickerEvent& WXUNUSED (event)) void CConfigMain::DVDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))

View File

@ -639,10 +639,10 @@ void CFrame::BootGame(const std::string& filename)
if (m_GameListCtrl->GetSelectedISO()->IsValid()) if (m_GameListCtrl->GetSelectedISO()->IsValid())
bootfile = m_GameListCtrl->GetSelectedISO()->GetFileName(); bootfile = m_GameListCtrl->GetSelectedISO()->GetFileName();
} }
else if (!StartUp.m_strDefaultGCM.empty() && else if (!StartUp.m_strDefaultISO.empty() &&
File::Exists(StartUp.m_strDefaultGCM)) File::Exists(StartUp.m_strDefaultISO))
{ {
bootfile = StartUp.m_strDefaultGCM; bootfile = StartUp.m_strDefaultISO;
} }
else else
{ {
@ -1831,7 +1831,7 @@ void CFrame::UpdateGUI()
if (m_GameListCtrl->IsEnabled()) if (m_GameListCtrl->IsEnabled())
{ {
// Prepare to load Default ISO, enable play button // Prepare to load Default ISO, enable play button
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty()) if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultISO.empty())
{ {
if (m_ToolBar) if (m_ToolBar)
m_ToolBar->EnableTool(IDM_PLAY, true); m_ToolBar->EnableTool(IDM_PLAY, true);

View File

@ -924,7 +924,7 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
// First we have to decide a starting value when we append it // First we have to decide a starting value when we append it
if (selected_iso->GetFileName() == SConfig::GetInstance(). if (selected_iso->GetFileName() == SConfig::GetInstance().
m_LocalCoreStartupParameter.m_strDefaultGCM) m_LocalCoreStartupParameter.m_strDefaultISO)
popupMenu->FindItem(IDM_SETDEFAULTISO)->Check(); popupMenu->FindItem(IDM_SETDEFAULTISO)->Check();
popupMenu->AppendSeparator(); popupMenu->AppendSeparator();
@ -1039,14 +1039,14 @@ void CGameListCtrl::OnSetDefaultISO(wxCommandEvent& event)
if (event.IsChecked()) if (event.IsChecked())
{ {
// Write the new default value and save it the ini file // Write the new default value and save it the ini file
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultISO =
iso->GetFileName(); iso->GetFileName();
SConfig::GetInstance().SaveSettings(); SConfig::GetInstance().SaveSettings();
} }
else else
{ {
// Otherwise blank the value and save it // Otherwise blank the value and save it
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = ""; SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultISO = "";
SConfig::GetInstance().SaveSettings(); SConfig::GetInstance().SaveSettings();
} }
} }