Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcm to iso #1264

Merged
merged 2 commits into from Nov 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Source/Android/assets/Dolphin.ini
@@ -1,8 +1,8 @@
[General]
GCMPathes = 0
ISOPaths = 0
LastFilename =

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

ShowLag = False
RecursiveGCMPaths = False
RecursiveISOPaths = False
NANDRoot = //sdcard/dolphin-emu/Wii
WirelessMac =
[Core]
Expand All @@ -14,7 +14,7 @@ Fastmem = False
DSPThread = False
DSPHLE = True
SkipIdle = True
DefaultGCM =
DefaultISO =
DVDRoot =
Apploader =
EnableCheats = False
Expand Down
Expand Up @@ -133,7 +133,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

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);

// Check to see if a path set in the Dolphin config
Expand All @@ -142,9 +142,9 @@ private void FolderSelected()
boolean pathNotPresent = true;
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;
}
Expand All @@ -157,8 +157,8 @@ private void FolderSelected()
// User doesn't have this path in the config, so add it.
if (pathNotPresent)
{
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", Integer.toString(intDirectories+1));
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), currentDir.getPath());
NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPaths", Integer.toString(intDirectories+1));
NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPath" + Integer.toString(intDirectories), currentDir.getPath());
}

((GameListActivity)getActivity()).SwitchPage(0);
Expand Down
Expand Up @@ -263,16 +263,16 @@ public boolean onOptionsItemSelected(MenuItem item)
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
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);

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.
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", "0");
NativeLibrary.SetConfig("Dolphin.ini", "General", "ISOPaths", "0");

// Now finally, clear the game list.
((GameListFragment) getFragmentManager().findFragmentById(R.id.content_frame)).clearGameList();
Expand Down
Expand Up @@ -63,15 +63,15 @@ public void clearGameList()
private void fill()
{
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);

// Extensions to filter by.
Set<String> exts = new HashSet<String>(Arrays.asList(".dff", ".dol", ".elf", ".gcm", ".gcz", ".iso", ".wad", ".wbfs"));

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[] dirs = currentDir.listFiles();
try
Expand Down
18 changes: 9 additions & 9 deletions Source/Core/Core/Boot/Boot.cpp
Expand Up @@ -293,9 +293,9 @@ bool CBoot::BootUp()
{
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);
}

Expand Down Expand Up @@ -343,9 +343,9 @@ bool CBoot::BootUp()
{
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);
}

Expand All @@ -357,10 +357,10 @@ bool CBoot::BootUp()
VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, 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());
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM);
NOTICE_LOG(BOOT, "Loading default ISO %s", _StartupPara.m_strDefaultISO.c_str());
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
}
else VolumeHandler::SetVolumeDirectory(_StartupPara.m_strFilename, elfWii);

Expand Down Expand Up @@ -390,8 +390,8 @@ bool CBoot::BootUp()
// load default image or create virtual drive from directory
if (!_StartupPara.m_strDVDRoot.empty())
VolumeHandler::SetVolumeDirectory(_StartupPara.m_strDVDRoot, true);
else if (!_StartupPara.m_strDefaultGCM.empty())
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultGCM);
else if (!_StartupPara.m_strDefaultISO.empty())
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);

DVDInterface::SetDiscInside(VolumeHandler::IsValid());
break;
Expand Down
24 changes: 12 additions & 12 deletions Source/Core/Core/ConfigManager.cpp
Expand Up @@ -178,19 +178,19 @@ void SConfig::SaveGeneralSettings(IniFile& ini)
// Clear removed folders
int oldPaths;
int numPaths = (int)m_ISOFolder.size();
general->Get("GCMPathes", &oldPaths, 0);
general->Get("ISOPaths", &oldPaths, 0);
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++)
{
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("WirelessMac", m_WirelessMac);

Expand Down Expand Up @@ -292,7 +292,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("DSPThread", m_LocalCoreStartupParameter.bDSPThread);
core->Set("DSPHLE", m_LocalCoreStartupParameter.bDSPHLE);
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("Apploader", m_LocalCoreStartupParameter.m_strApploader);
core->Set("EnableCheats", m_LocalCoreStartupParameter.bEnableCheats);
Expand Down Expand Up @@ -388,19 +388,19 @@ void SConfig::LoadGeneralSettings(IniFile& ini)
#endif

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;
general->Get(StringFromFormat("GCMPath%i", i), &tmpPath, "");
general->Get(StringFromFormat("ISOPath%i", i), &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);
m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath);
Expand Down Expand Up @@ -512,7 +512,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("DSPHLE", &m_LocalCoreStartupParameter.bDSPHLE, true);
core->Get("CPUThread", &m_LocalCoreStartupParameter.bCPUThread, 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("Apploader", &m_LocalCoreStartupParameter.m_strApploader);
core->Get("EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/ConfigManager.h
Expand Up @@ -32,7 +32,7 @@ struct SConfig : NonCopyable
// name of the last used filename
std::string m_LastFilename;

// gcm folder
// ISO folder
std::vector<std::string> m_ISOFolder;
bool m_RecursiveISOFolder;

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/CoreParameter.h
Expand Up @@ -221,7 +221,7 @@ struct SCoreStartupParameter
std::string m_strFilename;
std::string m_strBootROM;
std::string m_strSRAM;
std::string m_strDefaultGCM;
std::string m_strDefaultISO;
std::string m_strDVDRoot;
std::string m_strApploader;
std::string m_strUniqueID;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinWX/ConfigMain.cpp
Expand Up @@ -501,7 +501,7 @@ void CConfigMain::InitializeGUIValues()

// Paths
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));
ApploaderPath->SetPath(StrToWxStr(startup_params.m_strApploader));
NANDRoot->SetPath(StrToWxStr(SConfig::GetInstance().m_NANDPath));
Expand Down Expand Up @@ -1272,7 +1272,7 @@ void CConfigMain::RecursiveDirectoryChanged(wxCommandEvent& 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))
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/DolphinWX/FrameTools.cpp
Expand Up @@ -635,10 +635,10 @@ void CFrame::BootGame(const std::string& filename)
if (m_GameListCtrl->GetSelectedISO()->IsValid())
bootfile = m_GameListCtrl->GetSelectedISO()->GetFileName();
}
else if (!StartUp.m_strDefaultGCM.empty() &&
File::Exists(StartUp.m_strDefaultGCM))
else if (!StartUp.m_strDefaultISO.empty() &&
File::Exists(StartUp.m_strDefaultISO))
{
bootfile = StartUp.m_strDefaultGCM;
bootfile = StartUp.m_strDefaultISO;
}
else
{
Expand Down Expand Up @@ -1801,7 +1801,7 @@ void CFrame::UpdateGUI()
if (m_GameListCtrl->IsEnabled())
{
// 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)
m_ToolBar->EnableTool(IDM_PLAY, true);
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/DolphinWX/GameListCtrl.cpp
Expand Up @@ -877,7 +877,7 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)

// First we have to decide a starting value when we append it
if (selected_iso->GetFileName() == SConfig::GetInstance().
m_LocalCoreStartupParameter.m_strDefaultGCM)
m_LocalCoreStartupParameter.m_strDefaultISO)
popupMenu->FindItem(IDM_SETDEFAULTISO)->Check();

popupMenu->AppendSeparator();
Expand Down Expand Up @@ -992,14 +992,14 @@ void CGameListCtrl::OnSetDefaultISO(wxCommandEvent& event)
if (event.IsChecked())
{
// 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();
SConfig::GetInstance().SaveSettings();
}
else
{
// Otherwise blank the value and save it
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = "";
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultISO = "";
SConfig::GetInstance().SaveSettings();
}
}
Expand Down