summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Src/ConfigMain.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-03-27 13:19:23 +1100
committerskidau <skidau@gmail.com>2013-03-27 13:19:23 +1100
commit7784fa4c67cc8d2545f45694d83805e7e89cd583 (patch)
tree7724133aabe971ec417d1dea0977a525bb8debfb /Source/Core/DolphinWX/Src/ConfigMain.cpp
parentd33c19b0cd2bae982c8d35e86a9d3551f9e5c72f (diff)
parent5cea0d9defeaa23e7af94adf7615a44fb2c9c173 (diff)
Merge branch 'master' into wii-network
# By Ryan Houdek (185) and others # Via degasus (12) and others * master: (625 commits) Revert "Don't open/close file for every file operation." as it was crashing PokePark in Windows builds. Array overrun fixed in VertexShaderCache for the DX11 plugin. Fixed DSPTool build. Windows build fix Go back to assuming every HID device is a wiimote on Windows. Fixed issue 6117. Unfixed issue 6031. VideoSoftware: Improve fog range adjustment by using less magic and more comments. revert RasterFont for VideoSoftware ogl: fix virtual xfb Windows build fix from web interface... Adjusted the audio loop criteria, using >= on the Wii and == on GC. This fixes the audio static that occurred in Wii games after hours of play. Forced the exception check only for ARAM DMA transfers. Removed the Eternal Darkness boot hack and replaced it with an exception check. VideoSoftware: Implement fog range adjustment, fixing issue 6147. implement 4xSSAA for OGL move ogl-only settings into backend Fix description of disable fog, and move it to enhancements tab. Reverted rd76ca5783743 as it was made obsolete by r1d550f4496e4. Removed the tracking of the FIFO Writes as it was made obsolete by r1d550f4496e4. Forced the external exception check to occur sooner by changing the downcount. Mark the Direct3D9 backend deprecated. Prefer D3D11 and OpenGL over D3D9 by default. ... Conflicts: CMakeLists.txt Source/Core/Common/Common.vcxproj.filters Source/Core/Common/Src/CommonPaths.h Source/Core/Core/Core.vcxproj.filters Source/Core/Core/Src/Core.cpp Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp Source/VSProps/Dolphin.Win32.props Source/VSProps/Dolphin.x64.props
Diffstat (limited to 'Source/Core/DolphinWX/Src/ConfigMain.cpp')
-rw-r--r--Source/Core/DolphinWX/Src/ConfigMain.cpp74
1 files changed, 45 insertions, 29 deletions
diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp
index dc044afe09..cbd780e6aa 100644
--- a/Source/Core/DolphinWX/Src/ConfigMain.cpp
+++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp
@@ -33,6 +33,7 @@
#include "IPC_HLE/WII_IPC_HLE.h"
#include "NANDContentLoader.h"
+#include "WxUtils.h"
#include "Globals.h" // Local
#include "ConfigMain.h"
#include "ConfigManager.h"
@@ -52,6 +53,21 @@ using std::function;
#define TEXT_BOX(page, text) new wxStaticText(page, wxID_ANY, text, wxDefaultPosition, wxDefaultSize)
+struct CPUCore
+{
+ int CPUid;
+ const char *name;
+};
+const CPUCore CPUCores[] = {
+ {0, "Interpreter (VERY slow)"},
+#ifdef _M_ARM
+ {3, "Arm JIT (experimental)"},
+#else
+ {1, "JIT Recompiler (recommended)"},
+ {2, "JITIL experimental recompiler"},
+#endif
+};
+
extern CFrame* main_frame;
// keep these in sync with CConfigMain::InitializeGUILists
@@ -100,7 +116,6 @@ static const wxLanguage langIds[] =
#define EXIDEV_AM_BB_STR _trans("AM-Baseboard")
#define EXIDEV_GECKO_STR "USBGecko"
-#define CSTR_TRANS(a) wxString(wxGetTranslation(wxT(a))).mb_str()
#define WXSTR_TRANS(a) wxString(wxGetTranslation(wxT(a)))
#ifdef WIN32
//only used with xgettext to be picked up as translatable string.
@@ -188,7 +203,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
// Update selected ISO paths
for(u32 i = 0; i < SConfig::GetInstance().m_ISOFolder.size(); i++)
{
- ISOPaths->Append(wxString(SConfig::GetInstance().m_ISOFolder[i].c_str(), *wxConvCurrent));
+ ISOPaths->Append(StrToWxStr(SConfig::GetInstance().m_ISOFolder[i]));
}
}
@@ -241,7 +256,6 @@ void CConfigMain::UpdateGUI()
PathsPage->Disable();
}
}
-
void CConfigMain::InitializeGUILists()
{
// General page
@@ -253,10 +267,9 @@ void CConfigMain::InitializeGUILists()
arrayStringFor_Framelimit.Add(wxString::Format(wxT("%i"), i));
// Emulator Engine
- arrayStringFor_CPUEngine.Add(_("Interpreter (VERY slow)"));
- arrayStringFor_CPUEngine.Add(_("JIT Recompiler (recommended)"));
- arrayStringFor_CPUEngine.Add(_("JITIL experimental recompiler"));
-
+ for (unsigned int a = 0; a < (sizeof(CPUCores) / sizeof(CPUCore)); ++a)
+ arrayStringFor_CPUEngine.Add(_(CPUCores[a].name));
+
// DSP Engine
arrayStringFor_DSPEngine.Add(_("DSP HLE emulation (fast)"));
arrayStringFor_DSPEngine.Add(_("DSP LLE recompiler"));
@@ -329,7 +342,9 @@ void CConfigMain::InitializeGUIValues()
UseFPSForLimiting->SetValue(SConfig::GetInstance().b_UseFPS);
// General - Advanced
- CPUEngine->SetSelection(startup_params.iCPUCore);
+ for (unsigned int a = 0; a < (sizeof(CPUCores) / sizeof(CPUCore)); ++a)
+ if (CPUCores[a].CPUid == startup_params.iCPUCore)
+ CPUEngine->SetSelection(a);
_NTSCJ->SetValue(startup_params.bForceNTSCJ);
@@ -477,10 +492,10 @@ void CConfigMain::InitializeGUIValues()
// Paths
RecursiveISOPath->SetValue(SConfig::GetInstance().m_RecursiveISOFolder);
- DefaultISO->SetPath(wxString(startup_params.m_strDefaultGCM.c_str(), *wxConvCurrent));
- DVDRoot->SetPath(wxString(startup_params.m_strDVDRoot.c_str(), *wxConvCurrent));
- ApploaderPath->SetPath(wxString(startup_params.m_strApploader.c_str(), *wxConvCurrent));
- NANDRoot->SetPath(wxString(SConfig::GetInstance().m_NANDPath.c_str(), *wxConvCurrent));
+ DefaultISO->SetPath(StrToWxStr(startup_params.m_strDefaultGCM));
+ DVDRoot->SetPath(StrToWxStr(startup_params.m_strDVDRoot));
+ ApploaderPath->SetPath(StrToWxStr(startup_params.m_strApploader));
+ NANDRoot->SetPath(StrToWxStr(SConfig::GetInstance().m_NANDPath));
}
void CConfigMain::InitializeGUITooltips()
@@ -860,7 +875,7 @@ void CConfigMain::OnOk(wxCommandEvent& WXUNUSED (event))
{
Close();
- // Save the config. Dolphin crashes to often to save the settings on closing only
+ // Save the config. Dolphin crashes too often to only save the settings on closing
SConfig::GetInstance().SaveSettings();
}
@@ -888,7 +903,7 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
break;
// Core - Advanced
case ID_CPUENGINE:
- SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUEngine->GetSelection();
+ SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore = CPUCores[CPUEngine->GetSelection()].CPUid;
if (main_frame->g_pCodeWindow)
main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER,
SConfig::GetInstance().m_LocalCoreStartupParameter.iCPUCore?false:true);
@@ -958,10 +973,10 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
break;
case ID_BACKEND:
- VolumeSlider->Enable(SupportsVolumeChanges(std::string(BackendSelection->GetStringSelection().mb_str())));
- Latency->Enable(std::string(BackendSelection->GetStringSelection().mb_str()) == BACKEND_OPENAL);
- DPL2Decoder->Enable(std::string(BackendSelection->GetStringSelection().mb_str()) == BACKEND_OPENAL);
- SConfig::GetInstance().sBackend = BackendSelection->GetStringSelection().mb_str();
+ VolumeSlider->Enable(SupportsVolumeChanges(WxStrToStr(BackendSelection->GetStringSelection())));
+ Latency->Enable(WxStrToStr(BackendSelection->GetStringSelection()) == BACKEND_OPENAL);
+ DPL2Decoder->Enable(WxStrToStr(BackendSelection->GetStringSelection()) == BACKEND_OPENAL);
+ SConfig::GetInstance().sBackend = WxStrToStr(BackendSelection->GetStringSelection());
AudioCommon::UpdateSoundStream();
break;
@@ -982,9 +997,9 @@ void CConfigMain::AddAudioBackends()
for (std::vector<std::string>::const_iterator iter = backends.begin();
iter != backends.end(); ++iter)
{
- BackendSelection->Append(wxString::FromAscii((*iter).c_str()));
+ BackendSelection->Append(StrToWxStr(*iter));
int num = BackendSelection->\
- FindString(wxString::FromAscii(SConfig::GetInstance().sBackend.c_str()));
+ FindString(StrToWxStr(SConfig::GetInstance().sBackend));
BackendSelection->SetSelection(num);
}
}
@@ -1046,12 +1061,12 @@ void CConfigMain::GCSettingsChanged(wxCommandEvent& event)
void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
{
- std::string filename = std::string(wxFileSelector(
+ std::string filename = WxStrToStr(wxFileSelector(
_("Choose a file to open"),
- wxString::FromUTF8(File::GetUserPath(D_GCUSER_IDX).c_str()),
+ StrToWxStr(File::GetUserPath(D_GCUSER_IDX)),
isSlotA ? wxT(GC_MEMCARDA) : wxT(GC_MEMCARDB),
wxEmptyString,
- _("Gamecube Memory Cards (*.raw,*.gcp)") + wxString(wxT("|*.raw;*.gcp"))).mb_str());
+ _("Gamecube Memory Cards (*.raw,*.gcp)") + wxString(wxT("|*.raw;*.gcp"))));
if (!filename.empty())
{
@@ -1242,7 +1257,7 @@ void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event)
SConfig::GetInstance().m_ISOFolder.clear();
for (unsigned int i = 0; i < ISOPaths->GetCount(); i++)
- SConfig::GetInstance().m_ISOFolder.push_back(std::string(ISOPaths->GetStrings()[i].mb_str()));
+ SConfig::GetInstance().m_ISOFolder.push_back(WxStrToStr(ISOPaths->GetStrings()[i]));
}
void CConfigMain::RecursiveDirectoryChanged(wxCommandEvent& WXUNUSED (event))
@@ -1253,24 +1268,25 @@ void CConfigMain::RecursiveDirectoryChanged(wxCommandEvent& WXUNUSED (event))
void CConfigMain::DefaultISOChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
- SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = DefaultISO->GetPath().mb_str();
+ SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = WxStrToStr(DefaultISO->GetPath());
}
void CConfigMain::DVDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
- SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot = DVDRoot->GetPath().mb_str();
+ SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot = WxStrToStr(DVDRoot->GetPath());
}
void CConfigMain::ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
- SConfig::GetInstance().m_LocalCoreStartupParameter.m_strApploader = ApploaderPath->GetPath().mb_str();
+ SConfig::GetInstance().m_LocalCoreStartupParameter.m_strApploader = WxStrToStr(ApploaderPath->GetPath());
}
void CConfigMain::NANDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
std::string NANDPath =
- SConfig::GetInstance().m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, std::string(NANDRoot->GetPath().mb_str()));
- NANDRoot->SetPath(wxString(NANDPath.c_str(), *wxConvCurrent));
+ SConfig::GetInstance().m_NANDPath =
+ File::GetUserPath(D_WIIROOT_IDX, WxStrToStr(NANDRoot->GetPath()));
+ NANDRoot->SetPath(StrToWxStr(NANDPath));
SConfig::GetInstance().m_SYSCONF->UpdateLocation();
DiscIO::cUIDsys::AccessInstance().UpdateLocation();
DiscIO::CSharedContent::AccessInstance().UpdateLocation();