2013-04-18 03:43:35 +00:00
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2008-12-08 05:30:24 +00:00
2013-01-13 21:39:53 +00:00
# include <algorithm>
2013-03-29 14:31:15 +00:00
# include <functional>
2014-02-17 10:18:15 +00:00
# include <string>
# include <vector>
2014-02-22 22:36:30 +00:00
# include <wx/checkbox.h>
# include <wx/choice.h>
# include <wx/filepicker.h>
# include <wx/gbsizer.h>
# include <wx/listbox.h>
# include <wx/menu.h>
# include <wx/msgdlg.h>
# include <wx/notebook.h>
# include <wx/panel.h>
# include <wx/radiobox.h>
# include <wx/sizer.h>
# include <wx/slider.h>
2011-01-28 18:39:30 +00:00
# include <wx/spinbutt.h>
2014-02-22 22:36:30 +00:00
# include <wx/spinctrl.h>
# include <wx/stattext.h>
2008-12-08 05:30:24 +00:00
2014-03-28 00:56:05 +00:00
# include "AudioCommon/AudioCommon.h"
2014-02-17 10:18:15 +00:00
# include "Common/CommonPaths.h"
2014-09-08 01:06:58 +00:00
# include "Common/CommonTypes.h"
2014-02-17 10:18:15 +00:00
# include "Common/FileSearch.h"
# include "Common/SysConf.h"
# include "Core/ConfigManager.h"
# include "Core/Core.h"
2015-01-27 01:24:47 +00:00
# include "Core/HotkeyManager.h"
2014-02-22 22:36:30 +00:00
# include "Core/Movie.h"
2014-02-17 10:18:15 +00:00
# include "Core/NetPlayProto.h"
# include "Core/HW/EXI.h"
# include "Core/HW/GCMemcard.h"
# include "Core/HW/SI.h"
# include "Core/HW/DSPHLE/DSPHLE.h"
# include "Core/HW/DSPLLE/DSPLLE.h"
# include "Core/IPC_HLE/WII_IPC_HLE.h"
2015-02-19 15:29:21 +00:00
# include "Core/PowerPC/PowerPC.h"
2014-02-17 10:18:15 +00:00
# include "DiscIO/NANDContentLoader.h"
# include "DolphinWX/ConfigMain.h"
# include "DolphinWX/Frame.h"
# include "DolphinWX/Globals.h"
# include "DolphinWX/HotkeyDlg.h"
2015-01-27 01:24:47 +00:00
# include "DolphinWX/InputConfigDiag.h"
2014-02-17 10:18:15 +00:00
# include "DolphinWX/Main.h"
# include "DolphinWX/WxUtils.h"
2014-02-22 22:36:30 +00:00
# include "DolphinWX/Debugger/CodeWindow.h"
2014-02-17 10:18:15 +00:00
2015-01-27 01:24:47 +00:00
# include "InputCommon/InputConfig.h"
2014-02-17 10:18:15 +00:00
# include "VideoCommon/VideoBackendBase.h"
2011-01-31 01:28:32 +00:00
2014-03-06 04:02:34 +00:00
# define TEXT_BOX(page, text) new wxStaticText(page, wxID_ANY, text)
2011-01-25 03:30:12 +00:00
2013-03-06 03:25:45 +00:00
struct CPUCore
{
2014-07-07 03:30:06 +00:00
int CPUid ;
2013-03-06 03:25:45 +00:00
const char * name ;
} ;
const CPUCore CPUCores [ ] = {
2014-07-07 03:30:06 +00:00
{ 0 , wxTRANSLATE ( " Interpreter (VERY slow) " ) } ,
2014-10-13 03:49:07 +00:00
# ifdef _M_X86_64
2014-07-07 03:30:06 +00:00
{ 1 , wxTRANSLATE ( " JIT Recompiler (recommended) " ) } ,
{ 2 , wxTRANSLATE ( " JITIL Recompiler (slower, experimental) " ) } ,
2014-10-13 03:49:07 +00:00
# elif defined(_M_ARM_32)
{ 3 , wxTRANSLATE ( " Arm JIT (experimental) " ) } ,
# elif defined(_M_ARM_64)
{ 4 , wxTRANSLATE ( " Arm64 JIT (experimental) " ) } ,
2013-03-06 03:25:45 +00:00
# endif
} ;
2011-01-10 19:26:36 +00:00
// keep these in sync with CConfigMain::InitializeGUILists
static const wxLanguage langIds [ ] =
{
wxLANGUAGE_DEFAULT ,
2011-03-14 13:33:11 +00:00
wxLANGUAGE_ARABIC ,
2011-08-20 21:05:43 +00:00
wxLANGUAGE_CATALAN ,
wxLANGUAGE_CHINESE_SIMPLIFIED ,
wxLANGUAGE_CHINESE_TRADITIONAL ,
wxLANGUAGE_CZECH ,
wxLANGUAGE_DUTCH ,
2011-01-10 19:26:36 +00:00
wxLANGUAGE_ENGLISH ,
2011-12-18 20:03:57 +00:00
wxLANGUAGE_FARSI ,
2011-01-10 19:26:36 +00:00
wxLANGUAGE_FRENCH ,
2011-08-20 21:05:43 +00:00
wxLANGUAGE_GERMAN ,
2011-01-10 23:12:22 +00:00
wxLANGUAGE_GREEK ,
2011-08-20 21:05:43 +00:00
wxLANGUAGE_HEBREW ,
2011-01-12 13:14:50 +00:00
wxLANGUAGE_HUNGARIAN ,
2011-08-20 21:05:43 +00:00
wxLANGUAGE_ITALIAN ,
wxLANGUAGE_JAPANESE ,
wxLANGUAGE_KOREAN ,
wxLANGUAGE_NORWEGIAN_BOKMAL ,
wxLANGUAGE_POLISH ,
2011-02-11 02:38:23 +00:00
wxLANGUAGE_PORTUGUESE ,
2011-01-16 16:18:11 +00:00
wxLANGUAGE_PORTUGUESE_BRAZILIAN ,
2011-08-20 21:05:43 +00:00
wxLANGUAGE_RUSSIAN ,
wxLANGUAGE_SERBIAN ,
2011-01-10 19:26:36 +00:00
wxLANGUAGE_SPANISH ,
2013-04-23 11:44:33 +00:00
wxLANGUAGE_SWEDISH ,
2011-01-20 03:02:51 +00:00
wxLANGUAGE_TURKISH ,
2011-01-10 19:26:36 +00:00
} ;
2009-10-19 15:14:48 +00:00
// Strings for Device Selections
2014-02-17 04:51:41 +00:00
# define DEV_NONE_STR _trans("<Nothing>")
# define DEV_DUMMY_STR _trans("Dummy")
# define EXIDEV_MEMCARD_STR _trans("Memory Card")
2014-03-29 06:19:04 +00:00
# define EXIDEV_MEMDIR_STR _trans("GCI Folder")
2014-02-17 04:51:41 +00:00
# define EXIDEV_MIC_STR _trans("Mic")
# define EXIDEV_BBA_STR "BBA"
2015-01-20 12:41:46 +00:00
# define EXIDEV_AGP_STR "Advance Game Port"
2014-02-17 04:51:41 +00:00
# define EXIDEV_AM_BB_STR _trans("AM-Baseboard")
# define EXIDEV_GECKO_STR "USBGecko"
2011-01-06 13:57:46 +00:00
# ifdef WIN32
//only used with xgettext to be picked up as translatable string.
2013-10-29 05:23:17 +00:00
//win32 does not have wx on its path, the provided wxALL_FILES
2011-01-06 13:57:46 +00:00
//translation does not work there.
# define unusedALL_FILES wxTRANSLATE("All files (*.*)|*.*");
# endif
2008-12-08 05:30:24 +00:00
BEGIN_EVENT_TABLE ( CConfigMain , wxDialog )
EVT_CLOSE ( CConfigMain : : OnClose )
2010-06-05 01:38:22 +00:00
EVT_BUTTON ( wxID_OK , CConfigMain : : OnOk )
2009-01-04 21:29:23 +00:00
2009-01-22 07:42:17 +00:00
2009-10-23 15:26:35 +00:00
EVT_CHECKBOX ( ID_CPUTHREAD , CConfigMain : : CoreSettingsChanged )
2008-12-08 05:30:24 +00:00
EVT_CHECKBOX ( ID_IDLESKIP , CConfigMain : : CoreSettingsChanged )
EVT_CHECKBOX ( ID_ENABLECHEATS , CConfigMain : : CoreSettingsChanged )
2009-06-18 11:23:37 +00:00
EVT_CHOICE ( ID_FRAMELIMIT , CConfigMain : : CoreSettingsChanged )
2010-06-05 01:38:22 +00:00
EVT_RADIOBOX ( ID_CPUENGINE , CConfigMain : : CoreSettingsChanged )
2011-06-02 19:32:34 +00:00
EVT_CHECKBOX ( ID_NTSCJ , CConfigMain : : CoreSettingsChanged )
2014-12-31 18:24:14 +00:00
EVT_SLIDER ( ID_OVERCLOCK , CConfigMain : : CoreSettingsChanged )
EVT_CHECKBOX ( ID_ENABLEOVERCLOCK , CConfigMain : : CoreSettingsChanged )
2010-06-05 01:38:22 +00:00
2011-01-29 04:16:05 +00:00
EVT_RADIOBOX ( ID_DSPENGINE , CConfigMain : : AudioSettingsChanged )
EVT_CHECKBOX ( ID_ENABLE_THROTTLE , CConfigMain : : AudioSettingsChanged )
2013-01-11 03:03:09 +00:00
EVT_CHECKBOX ( ID_DPL2DECODER , CConfigMain : : AudioSettingsChanged )
2011-01-29 04:16:05 +00:00
EVT_CHOICE ( ID_BACKEND , CConfigMain : : AudioSettingsChanged )
EVT_SLIDER ( ID_VOLUME , CConfigMain : : AudioSettingsChanged )
2011-01-28 18:39:30 +00:00
2010-06-05 01:38:22 +00:00
EVT_CHECKBOX ( ID_INTERFACE_CONFIRMSTOP , CConfigMain : : DisplaySettingsChanged )
EVT_CHECKBOX ( ID_INTERFACE_USEPANICHANDLERS , CConfigMain : : DisplaySettingsChanged )
2012-11-16 20:16:50 +00:00
EVT_CHECKBOX ( ID_INTERFACE_ONSCREENDISPLAYMESSAGES , CConfigMain : : DisplaySettingsChanged )
2010-06-05 01:38:22 +00:00
EVT_CHOICE ( ID_INTERFACE_LANG , CConfigMain : : DisplaySettingsChanged )
EVT_BUTTON ( ID_HOTKEY_CONFIG , CConfigMain : : DisplaySettingsChanged )
2009-01-14 16:36:43 +00:00
2009-01-04 21:29:23 +00:00
EVT_CHOICE ( ID_GC_SRAM_LNG , CConfigMain : : GCSettingsChanged )
2011-06-02 19:32:34 +00:00
EVT_CHECKBOX ( ID_GC_ALWAYS_HLE_BS2 , CConfigMain : : GCSettingsChanged )
2010-06-05 01:38:22 +00:00
2009-02-02 22:29:33 +00:00
EVT_CHOICE ( ID_GC_EXIDEVICE_SLOTA , CConfigMain : : GCSettingsChanged )
EVT_BUTTON ( ID_GC_EXIDEVICE_SLOTA_PATH , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_EXIDEVICE_SLOTB , CConfigMain : : GCSettingsChanged )
EVT_BUTTON ( ID_GC_EXIDEVICE_SLOTB_PATH , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_EXIDEVICE_SP1 , CConfigMain : : GCSettingsChanged )
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_CHECKBOX ( ID_WII_IPL_SSV , CConfigMain : : WiiSettingsChanged )
EVT_CHECKBOX ( ID_WII_IPL_E60 , CConfigMain : : WiiSettingsChanged )
EVT_CHOICE ( ID_WII_IPL_AR , CConfigMain : : WiiSettingsChanged )
EVT_CHOICE ( ID_WII_IPL_LNG , CConfigMain : : WiiSettingsChanged )
2010-06-05 01:38:22 +00:00
2010-01-11 11:56:17 +00:00
EVT_CHECKBOX ( ID_WII_SD_CARD , CConfigMain : : WiiSettingsChanged )
EVT_CHECKBOX ( ID_WII_KEYBOARD , CConfigMain : : WiiSettingsChanged )
2008-12-09 05:37:15 +00:00
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_LISTBOX ( ID_ISOPATHS , CConfigMain : : ISOPathsSelectionChanged )
2010-06-05 01:38:22 +00:00
EVT_CHECKBOX ( ID_RECURSIVEISOPATH , CConfigMain : : RecursiveDirectoryChanged )
2008-12-08 05:30:24 +00:00
EVT_BUTTON ( ID_ADDISOPATH , CConfigMain : : AddRemoveISOPaths )
EVT_BUTTON ( ID_REMOVEISOPATH , CConfigMain : : AddRemoveISOPaths )
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_FILEPICKER_CHANGED ( ID_DEFAULTISO , CConfigMain : : DefaultISOChanged )
EVT_DIRPICKER_CHANGED ( ID_DVDROOT , CConfigMain : : DVDRootChanged )
2009-12-10 09:16:10 +00:00
EVT_FILEPICKER_CHANGED ( ID_APPLOADERPATH , CConfigMain : : ApploaderPathChanged )
2011-05-24 19:12:18 +00:00
EVT_DIRPICKER_CHANGED ( ID_NANDROOT , CConfigMain : : NANDRootChanged )
2009-01-14 16:36:43 +00:00
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
END_EVENT_TABLE ( )
2009-01-04 21:53:41 +00:00
2011-01-31 02:38:36 +00:00
CConfigMain : : CConfigMain ( wxWindow * parent , wxWindowID id , const wxString & title ,
const wxPoint & position , const wxSize & size , long style )
2008-12-08 05:30:24 +00:00
: wxDialog ( parent , id , title , position , size , style )
{
2009-01-04 21:53:41 +00:00
// Control refreshing of the ISOs list
2008-12-08 05:30:24 +00:00
bRefreshList = false ;
2009-02-03 15:03:34 +00:00
2008-12-08 05:30:24 +00:00
CreateGUIControls ( ) ;
2009-01-04 21:53:41 +00:00
// Update selected ISO paths
2014-03-10 11:30:55 +00:00
for ( const std : : string & folder : SConfig : : GetInstance ( ) . m_ISOFolder )
2008-12-08 05:30:24 +00:00
{
2013-10-29 05:09:01 +00:00
ISOPaths - > Append ( StrToWxStr ( folder ) ) ;
2008-12-08 05:30:24 +00:00
}
}
CConfigMain : : ~ CConfigMain ( )
{
}
2009-01-04 21:53:41 +00:00
2011-01-29 04:16:05 +00:00
void CConfigMain : : SetSelectedTab ( int tab )
{
// TODO : this is just a quick and dirty way to do it, possible cleanup
switch ( tab )
{
case ID_AUDIOPAGE :
2011-03-15 14:37:04 +00:00
Notebook - > SetSelection ( 2 ) ;
2011-01-29 04:16:05 +00:00
break ;
}
}
2009-02-02 22:29:33 +00:00
// Used to restrict changing of some options while emulator is running
2009-01-04 21:53:41 +00:00
void CConfigMain : : UpdateGUI ( )
{
2014-07-07 22:47:57 +00:00
if ( Core : : IsRunning ( ) )
2009-01-04 21:53:41 +00:00
{
2009-01-15 06:48:15 +00:00
// Disable the Core stuff on GeneralPage
2009-10-23 15:26:35 +00:00
CPUThread - > Disable ( ) ;
2009-01-15 06:48:15 +00:00
SkipIdle - > Disable ( ) ;
EnableCheats - > Disable ( ) ;
2013-10-29 05:23:17 +00:00
2010-06-05 01:38:22 +00:00
CPUEngine - > Disable ( ) ;
2011-06-02 19:32:34 +00:00
_NTSCJ - > Disable ( ) ;
2011-01-31 02:38:36 +00:00
2011-01-28 18:39:30 +00:00
// Disable stuff on AudioPage
2011-01-29 04:16:05 +00:00
DSPEngine - > Disable ( ) ;
2013-01-12 13:05:30 +00:00
DPL2Decoder - > Disable ( ) ;
2013-01-16 01:56:08 +00:00
Latency - > Disable ( ) ;
2010-06-05 01:38:22 +00:00
// Disable stuff on GamecubePage
2009-02-02 22:29:33 +00:00
GCSystemLang - > Disable ( ) ;
2011-06-02 19:32:34 +00:00
GCAlwaysHLE_BS2 - > Disable ( ) ;
2010-06-05 01:38:22 +00:00
// Disable stuff on WiiPage
2010-01-11 11:56:17 +00:00
WiiScreenSaver - > Disable ( ) ;
2014-10-13 22:24:35 +00:00
WiiPAL60 - > Disable ( ) ;
2010-01-11 11:56:17 +00:00
WiiAspectRatio - > Disable ( ) ;
WiiSystemLang - > Disable ( ) ;
2009-04-16 05:29:45 +00:00
2010-06-05 01:38:22 +00:00
// Disable stuff on PathsPage
2009-01-04 21:53:41 +00:00
PathsPage - > Disable ( ) ;
}
}
2010-02-06 16:20:54 +00:00
void CConfigMain : : InitializeGUILists ( )
2008-12-08 05:30:24 +00:00
{
2010-06-05 01:38:22 +00:00
// General page
2009-06-09 21:27:45 +00:00
// Framelimit
2011-01-05 17:56:08 +00:00
arrayStringFor_Framelimit . Add ( _ ( " Off " ) ) ;
arrayStringFor_Framelimit . Add ( _ ( " Auto " ) ) ;
2014-07-24 12:16:17 +00:00
for ( int i = 5 ; i < = 120 ; i + = 5 ) // from 5 to 120
2014-05-17 17:17:28 +00:00
arrayStringFor_Framelimit . Add ( wxString : : Format ( " %i " , i ) ) ;
2010-02-06 16:20:54 +00:00
2010-06-05 01:38:22 +00:00
// Emulator Engine
2014-02-12 15:00:34 +00:00
for ( const CPUCore & CPUCores_a : CPUCores )
2013-10-29 05:09:01 +00:00
arrayStringFor_CPUEngine . Add ( wxGetTranslation ( CPUCores_a . name ) ) ;
2013-10-29 05:23:17 +00:00
// DSP Engine
2011-01-29 04:16:05 +00:00
arrayStringFor_DSPEngine . Add ( _ ( " DSP HLE emulation (fast) " ) ) ;
arrayStringFor_DSPEngine . Add ( _ ( " DSP LLE recompiler " ) ) ;
arrayStringFor_DSPEngine . Add ( _ ( " DSP LLE interpreter (slow) " ) ) ;
2013-10-29 05:23:17 +00:00
2014-06-07 02:30:39 +00:00
// GameCube page
2010-06-05 01:38:22 +00:00
// GC Language arrayStrings
2011-01-08 15:05:59 +00:00
arrayStringFor_GCSystemLang . Add ( _ ( " English " ) ) ;
arrayStringFor_GCSystemLang . Add ( _ ( " German " ) ) ;
arrayStringFor_GCSystemLang . Add ( _ ( " French " ) ) ;
arrayStringFor_GCSystemLang . Add ( _ ( " Spanish " ) ) ;
arrayStringFor_GCSystemLang . Add ( _ ( " Italian " ) ) ;
arrayStringFor_GCSystemLang . Add ( _ ( " Dutch " ) ) ;
2013-10-29 05:23:17 +00:00
2010-06-05 01:38:22 +00:00
// Wii page
2010-02-06 16:20:54 +00:00
// Sensorbar Position
2011-01-05 04:35:46 +00:00
arrayStringFor_WiiSensBarPos . Add ( _ ( " Bottom " ) ) ;
arrayStringFor_WiiSensBarPos . Add ( _ ( " Top " ) ) ;
2013-10-29 05:23:17 +00:00
2010-02-06 16:20:54 +00:00
// Aspect ratio
2014-05-17 17:17:28 +00:00
arrayStringFor_WiiAspectRatio . Add ( " 4:3 " ) ;
arrayStringFor_WiiAspectRatio . Add ( " 16:9 " ) ;
2013-10-29 05:23:17 +00:00
2010-06-05 01:38:22 +00:00
// Wii Language arrayStrings
2011-01-08 15:05:59 +00:00
arrayStringFor_WiiSystemLang = arrayStringFor_GCSystemLang ;
2011-01-05 04:35:46 +00:00
arrayStringFor_WiiSystemLang . Insert ( _ ( " Japanese " ) , 0 ) ;
arrayStringFor_WiiSystemLang . Add ( _ ( " Simplified Chinese " ) ) ;
arrayStringFor_WiiSystemLang . Add ( _ ( " Traditional Chinese " ) ) ;
arrayStringFor_WiiSystemLang . Add ( _ ( " Korean " ) ) ;
2011-01-08 15:05:59 +00:00
// GUI language arrayStrings
2011-01-10 19:26:36 +00:00
// keep these in sync with the langIds array at the beginning of this file
2011-01-08 15:05:59 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " <System> " ) ) ;
2011-03-14 13:33:11 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Arabic " ) ) ;
2011-08-20 21:05:43 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Catalan " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Chinese (Simplified) " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Chinese (Traditional) " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Czech " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Dutch " ) ) ;
2011-01-08 15:05:59 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " English " ) ) ;
2011-12-18 20:03:57 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Farsi " ) ) ;
2011-01-08 15:05:59 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " French " ) ) ;
2011-08-20 21:05:43 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " German " ) ) ;
2011-01-10 23:12:22 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Greek " ) ) ;
2011-08-20 21:05:43 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Hebrew " ) ) ;
2011-01-12 13:14:50 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Hungarian " ) ) ;
2011-08-20 21:05:43 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Italian " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Japanese " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Korean " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Norwegian Bokmaal " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Polish " ) ) ;
2011-02-11 02:38:23 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Portuguese " ) ) ;
2011-01-16 16:18:11 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Portuguese (Brazilian) " ) ) ;
2011-08-20 21:05:43 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Russian " ) ) ;
arrayStringFor_InterfaceLang . Add ( _ ( " Serbian " ) ) ;
2011-01-08 20:49:26 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Spanish " ) ) ;
2013-04-23 11:44:33 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Swedish " ) ) ;
2011-01-20 03:02:51 +00:00
arrayStringFor_InterfaceLang . Add ( _ ( " Turkish " ) ) ;
2010-02-06 16:20:54 +00:00
}
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : InitializeGUIValues ( )
{
2010-11-03 06:28:47 +00:00
const SCoreStartupParameter & startup_params = SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter ;
2013-10-29 05:23:17 +00:00
2010-02-06 16:20:54 +00:00
// General - Basic
2010-11-03 06:28:47 +00:00
CPUThread - > SetValue ( startup_params . bCPUThread ) ;
SkipIdle - > SetValue ( startup_params . bSkipIdle ) ;
EnableCheats - > SetValue ( startup_params . bEnableCheats ) ;
2010-02-06 16:20:54 +00:00
Framelimit - > SetSelection ( SConfig : : GetInstance ( ) . m_Framelimit ) ;
2014-12-31 18:24:14 +00:00
int ocFactor = ( int ) ( log2f ( SConfig : : GetInstance ( ) . m_OCFactor ) * 25.f + 100.f + 0.5f ) ;
EnableOC - > SetValue ( SConfig : : GetInstance ( ) . m_OCEnable ) ;
OCSlider - > SetValue ( ocFactor ) ;
UpdateCPUClock ( ) ;
2010-02-06 16:20:54 +00:00
// General - Advanced
2013-03-06 03:25:45 +00:00
for ( unsigned int a = 0 ; a < ( sizeof ( CPUCores ) / sizeof ( CPUCore ) ) ; + + a )
if ( CPUCores [ a ] . CPUid = = startup_params . iCPUCore )
CPUEngine - > SetSelection ( a ) ;
2011-06-03 00:55:58 +00:00
_NTSCJ - > SetValue ( startup_params . bForceNTSCJ ) ;
2010-11-03 06:28:47 +00:00
2010-04-12 01:33:10 +00:00
2010-06-05 01:38:22 +00:00
// Display - Interface
2010-11-03 06:28:47 +00:00
ConfirmStop - > SetValue ( startup_params . bConfirmStop ) ;
UsePanicHandlers - > SetValue ( startup_params . bUsePanicHandlers ) ;
2012-11-16 20:16:50 +00:00
OnScreenDisplayMessages - > SetValue ( startup_params . bOnScreenDisplayMessages ) ;
2010-06-05 01:38:22 +00:00
// need redesign
2011-01-31 02:38:36 +00:00
for ( unsigned int i = 0 ; i < sizeof ( langIds ) / sizeof ( wxLanguage ) ; i + + )
{
2011-01-10 19:26:36 +00:00
if ( langIds [ i ] = = SConfig : : GetInstance ( ) . m_InterfaceLanguage )
{
InterfaceLang - > SetSelection ( i ) ;
break ;
}
2011-01-28 18:39:30 +00:00
}
2011-01-29 04:16:05 +00:00
// Audio DSP Engine
if ( startup_params . bDSPHLE )
DSPEngine - > SetSelection ( 0 ) ;
else
2014-02-23 14:14:27 +00:00
DSPEngine - > SetSelection ( SConfig : : GetInstance ( ) . m_DSPEnableJIT ? 1 : 2 ) ;
2011-01-28 18:39:30 +00:00
// Audio
2013-01-17 01:16:56 +00:00
VolumeSlider - > Enable ( SupportsVolumeChanges ( SConfig : : GetInstance ( ) . sBackend ) ) ;
VolumeSlider - > SetValue ( SConfig : : GetInstance ( ) . m_Volume ) ;
2014-05-17 17:17:28 +00:00
VolumeText - > SetLabel ( wxString : : Format ( " %d %% " , SConfig : : GetInstance ( ) . m_Volume ) ) ;
2015-01-07 10:57:20 +00:00
DPL2Decoder - > Enable ( std : : string ( SConfig : : GetInstance ( ) . sBackend ) = = BACKEND_OPENAL
| | std : : string ( SConfig : : GetInstance ( ) . sBackend ) = = BACKEND_PULSEAUDIO ) ;
2013-01-11 03:03:09 +00:00
DPL2Decoder - > SetValue ( startup_params . bDPL2Decoder ) ;
2013-01-17 01:16:56 +00:00
Latency - > Enable ( std : : string ( SConfig : : GetInstance ( ) . sBackend ) = = BACKEND_OPENAL ) ;
2013-01-16 01:56:08 +00:00
Latency - > SetValue ( startup_params . iLatency ) ;
2011-01-29 04:16:05 +00:00
// add backends to the list
AddAudioBackends ( ) ;
2010-06-05 01:38:22 +00:00
2014-06-07 02:30:39 +00:00
// GameCube - IPL
2010-11-03 06:28:47 +00:00
GCSystemLang - > SetSelection ( startup_params . SelectedLanguage ) ;
2011-06-02 19:32:34 +00:00
GCAlwaysHLE_BS2 - > SetValue ( startup_params . bHLE_BS2 ) ;
2010-02-06 16:20:54 +00:00
2014-06-07 02:30:39 +00:00
// GameCube - Devices
2011-01-31 02:38:36 +00:00
wxArrayString SlotDevices ;
SlotDevices . Add ( _ ( DEV_NONE_STR ) ) ;
SlotDevices . Add ( _ ( DEV_DUMMY_STR ) ) ;
SlotDevices . Add ( _ ( EXIDEV_MEMCARD_STR ) ) ;
2014-03-29 06:19:04 +00:00
SlotDevices . Add ( _ ( EXIDEV_MEMDIR_STR ) ) ;
2015-01-20 12:41:46 +00:00
SlotDevices . Add ( _ ( EXIDEV_GECKO_STR ) ) ;
SlotDevices . Add ( _ ( EXIDEV_AGP_STR ) ) ;
2014-03-29 06:19:04 +00:00
2011-01-31 02:38:36 +00:00
# if HAVE_PORTAUDIO
SlotDevices . Add ( _ ( EXIDEV_MIC_STR ) ) ;
# endif
wxArrayString SP1Devices ;
SP1Devices . Add ( _ ( DEV_NONE_STR ) ) ;
SP1Devices . Add ( _ ( DEV_DUMMY_STR ) ) ;
SP1Devices . Add ( _ ( EXIDEV_BBA_STR ) ) ;
SP1Devices . Add ( _ ( EXIDEV_AM_BB_STR ) ) ;
for ( int i = 0 ; i < 3 ; + + i )
{
bool isMemcard = false ;
// Add strings to the wxChoice list, the third wxChoice is the SP1 slot
if ( i = = 2 )
GCEXIDevice [ i ] - > Append ( SP1Devices ) ;
else
GCEXIDevice [ i ] - > Append ( SlotDevices ) ;
switch ( SConfig : : GetInstance ( ) . m_EXIDevice [ i ] )
{
case EXIDEVICE_NONE :
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 0 ] ) ;
break ;
2011-10-09 10:18:15 +00:00
case EXIDEVICE_MEMORYCARD :
2011-01-31 02:38:36 +00:00
isMemcard = GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 2 ] ) ;
break ;
2014-03-29 06:19:04 +00:00
case EXIDEVICE_MEMORYCARDFOLDER :
2015-01-20 12:41:46 +00:00
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 3 ] ) ;
break ;
case EXIDEVICE_GECKO :
2011-01-31 02:38:36 +00:00
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 4 ] ) ;
break ;
2015-01-20 12:41:46 +00:00
case EXIDEVICE_AGP :
isMemcard = GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 5 ] ) ;
break ;
2014-03-29 06:19:04 +00:00
case EXIDEVICE_MIC :
2015-01-20 12:41:46 +00:00
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 6 ] ) ;
2014-03-29 06:19:04 +00:00
break ;
2011-01-31 02:38:36 +00:00
case EXIDEVICE_ETH :
GCEXIDevice [ i ] - > SetStringSelection ( SP1Devices [ 2 ] ) ;
break ;
case EXIDEVICE_AM_BASEBOARD :
GCEXIDevice [ i ] - > SetStringSelection ( SP1Devices [ 3 ] ) ;
break ;
case EXIDEVICE_DUMMY :
default :
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 1 ] ) ;
break ;
}
if ( ! isMemcard & & i < 2 )
GCMemcardPath [ i ] - > Disable ( ) ;
}
2010-06-05 01:38:22 +00:00
// Wii - Misc
2010-02-06 16:20:54 +00:00
WiiScreenSaver - > SetValue ( ! ! SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.SSV " ) ) ;
2014-10-13 22:24:35 +00:00
WiiPAL60 - > SetValue ( ! ! SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.E60 " ) ) ;
2010-02-06 16:20:54 +00:00
WiiAspectRatio - > SetSelection ( SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.AR " ) ) ;
WiiSystemLang - > SetSelection ( SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.LNG " ) ) ;
2013-10-29 05:23:17 +00:00
2010-06-05 01:38:22 +00:00
// Wii - Devices
2010-02-06 16:20:54 +00:00
WiiSDCard - > SetValue ( SConfig : : GetInstance ( ) . m_WiiSDCard ) ;
WiiKeyboard - > SetValue ( SConfig : : GetInstance ( ) . m_WiiKeyboard ) ;
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
// Paths
2010-06-05 01:38:22 +00:00
RecursiveISOPath - > SetValue ( SConfig : : GetInstance ( ) . m_RecursiveISOFolder ) ;
2014-10-20 21:49:33 +00:00
DefaultISO - > SetPath ( StrToWxStr ( startup_params . m_strDefaultISO ) ) ;
2013-02-28 04:37:38 +00:00
DVDRoot - > SetPath ( StrToWxStr ( startup_params . m_strDVDRoot ) ) ;
ApploaderPath - > SetPath ( StrToWxStr ( startup_params . m_strApploader ) ) ;
NANDRoot - > SetPath ( StrToWxStr ( SConfig : : GetInstance ( ) . m_NANDPath ) ) ;
2010-02-06 16:20:54 +00:00
}
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : InitializeGUITooltips ( )
{
// General - Basic
2015-01-02 02:37:11 +00:00
CPUThread - > SetToolTip ( _ ( " Splits the CPU and GPU threads so they can be run on separate cores. \n Provides major speed improvements on most modern PCs, but can cause occasional crashes/glitches. " ) ) ;
SkipIdle - > SetToolTip ( _ ( " Attempt to detect and skip wait-loops. \n If unsure, leave this checked. " ) ) ;
EnableCheats - > SetToolTip ( _ ( " Enables the use of Action Replay and Gecko cheats. " ) ) ;
Framelimit - > SetToolTip ( _ ( " Limits the game speed to the specified number of frames per second (full speed is 60 for NTSC and 50 for PAL). " ) ) ;
2010-02-06 16:20:54 +00:00
// General - Advanced
2015-01-02 02:37:11 +00:00
_NTSCJ - > SetToolTip ( _ ( " Forces NTSC-J mode for using the Japanese ROM font. \n If left unchecked, Dolphin defaults to NTSC-U and automatically enables this setting when playing Japanese games. " ) ) ;
2010-06-05 01:38:22 +00:00
// Display - Interface
2011-01-05 04:35:46 +00:00
ConfirmStop - > SetToolTip ( _ ( " Show a confirmation box before stopping a game. " ) ) ;
2015-01-02 02:37:11 +00:00
UsePanicHandlers - > SetToolTip ( _ ( " Show a message box when a potentially serious error has occurred. \n Disabling this may avoid annoying and non-fatal messages, but it may result in major crashes having no explanation at all. " ) ) ;
OnScreenDisplayMessages - > SetToolTip ( _ ( " Display messages over the emulation screen area. \n These messages include memory card writes, video backend and CPU information, and JIT cache clearing. " ) ) ;
2010-04-12 01:33:10 +00:00
2011-01-05 04:35:46 +00:00
InterfaceLang - > SetToolTip ( _ ( " Change the language of the user interface. \n Requires restart. " ) ) ;
2010-04-12 01:33:10 +00:00
2015-01-02 02:37:11 +00:00
// Audio - Backend
BackendSelection - > SetToolTip ( _ ( " Changing this will have no effect while the emulator is running. " ) ) ;
// GameCube - IPL
GCSystemLang - > SetToolTip ( _ ( " Sets the GameCube system language. " ) ) ;
2011-01-29 04:16:05 +00:00
2014-06-07 02:30:39 +00:00
// GameCube - Devices
2015-01-02 02:37:11 +00:00
GCEXIDevice [ 2 ] - > SetToolTip ( _ ( " Serial Port 1 - This is the port which devices such as the net adapter use. " ) ) ;
// Wii - Misc
WiiScreenSaver - > SetToolTip ( _ ( " Dims the screen after five minutes of inactivity. " ) ) ;
WiiPAL60 - > SetToolTip ( _ ( " Sets the Wii display mode to 60Hz (480i) instead of 50Hz (576i) for PAL games. \n May not work for all games. " ) ) ;
WiiSystemLang - > SetToolTip ( _ ( " Sets the Wii system language. " ) ) ;
2010-06-05 01:38:22 +00:00
// Wii - Devices
2015-01-02 02:37:11 +00:00
WiiSDCard - > SetToolTip ( _ ( " Saved to /Wii/sd.raw (default size is 128mb) " ) ) ;
WiiKeyboard - > SetToolTip ( _ ( " May cause slow down in Wii Menu and some games. " ) ) ;
2013-01-11 03:03:09 +00:00
# if defined(__APPLE__)
2015-01-02 02:37:11 +00:00
DPL2Decoder - > SetToolTip ( _ ( " Enables Dolby Pro Logic II emulation using 5.1 surround. Not available on OS X. " ) ) ;
2013-08-18 07:09:01 +00:00
# else
2015-01-07 10:57:20 +00:00
DPL2Decoder - > SetToolTip ( _ ( " Enables Dolby Pro Logic II emulation using 5.1 surround. OpenAL or Pulse backends only. " ) ) ;
2013-01-11 03:03:09 +00:00
# endif
2013-01-12 13:05:30 +00:00
2015-01-02 02:37:11 +00:00
Latency - > SetToolTip ( _ ( " Sets the latency (in ms). Higher values may reduce audio crackling. OpenAL backend only. " ) ) ;
2010-02-06 16:20:54 +00:00
}
2010-04-22 04:28:34 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : CreateGUIControls ( )
{
InitializeGUILists ( ) ;
2013-10-29 05:23:17 +00:00
2009-01-22 07:42:17 +00:00
// Create the notebook and pages
2014-03-06 04:02:34 +00:00
Notebook = new wxNotebook ( this , ID_NOTEBOOK ) ;
wxPanel * const GeneralPage = new wxPanel ( Notebook , ID_GENERALPAGE ) ;
wxPanel * const DisplayPage = new wxPanel ( Notebook , ID_DISPLAYPAGE ) ;
wxPanel * const AudioPage = new wxPanel ( Notebook , ID_AUDIOPAGE ) ;
wxPanel * const GamecubePage = new wxPanel ( Notebook , ID_GAMECUBEPAGE ) ;
wxPanel * const WiiPage = new wxPanel ( Notebook , ID_WIIPAGE ) ;
2014-12-31 18:24:14 +00:00
wxPanel * const AdvancedPage = new wxPanel ( Notebook , ID_ADVANCEDPAGE ) ;
2014-03-06 04:02:34 +00:00
PathsPage = new wxPanel ( Notebook , ID_PATHSPAGE ) ;
2008-12-25 07:28:41 +00:00
2011-01-05 04:35:46 +00:00
Notebook - > AddPage ( GeneralPage , _ ( " General " ) ) ;
2011-06-02 19:32:34 +00:00
Notebook - > AddPage ( DisplayPage , _ ( " Interface " ) ) ;
2011-01-28 18:39:30 +00:00
Notebook - > AddPage ( AudioPage , _ ( " Audio " ) ) ;
2014-06-07 02:30:39 +00:00
Notebook - > AddPage ( GamecubePage , _ ( " GameCube " ) ) ;
2011-01-05 04:35:46 +00:00
Notebook - > AddPage ( WiiPage , _ ( " Wii " ) ) ;
Notebook - > AddPage ( PathsPage , _ ( " Paths " ) ) ;
2014-12-31 18:24:14 +00:00
Notebook - > AddPage ( AdvancedPage , _ ( " Advanced " ) ) ;
2011-01-29 04:16:05 +00:00
2009-01-04 21:53:41 +00:00
// General page
2009-02-02 22:29:33 +00:00
// Core Settings - Basic
2014-03-06 04:02:34 +00:00
CPUThread = new wxCheckBox ( GeneralPage , ID_CPUTHREAD , _ ( " Enable Dual Core (speedup) " ) ) ;
SkipIdle = new wxCheckBox ( GeneralPage , ID_IDLESKIP , _ ( " Enable Idle Skipping (speedup) " ) ) ;
EnableCheats = new wxCheckBox ( GeneralPage , ID_ENABLECHEATS , _ ( " Enable Cheats " ) ) ;
2009-08-03 18:35:25 +00:00
// Framelimit
2014-03-06 04:02:34 +00:00
Framelimit = new wxChoice ( GeneralPage , ID_FRAMELIMIT , wxDefaultPosition , wxDefaultSize , arrayStringFor_Framelimit ) ;
2009-02-02 22:29:33 +00:00
// Core Settings - Advanced
2011-01-31 01:28:32 +00:00
CPUEngine = new wxRadioBox ( GeneralPage , ID_CPUENGINE , _ ( " CPU Emulator Engine " ) , wxDefaultPosition , wxDefaultSize , arrayStringFor_CPUEngine , 0 , wxRA_SPECIFY_ROWS ) ;
2014-03-06 04:02:34 +00:00
_NTSCJ = new wxCheckBox ( GeneralPage , ID_NTSCJ , _ ( " Force Console as NTSC-J " ) ) ;
2009-01-14 16:36:43 +00:00
2011-01-29 04:16:05 +00:00
// Populate the General settings
2010-06-05 01:38:22 +00:00
wxBoxSizer * sFramelimit = new wxBoxSizer ( wxHORIZONTAL ) ;
2011-06-02 19:32:34 +00:00
sFramelimit - > Add ( TEXT_BOX ( GeneralPage , _ ( " Framelimit: " ) ) , 0 , wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM , 5 ) ;
sFramelimit - > Add ( Framelimit , 0 , wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND , 5 ) ;
2014-12-31 18:24:14 +00:00
2011-01-31 17:15:21 +00:00
wxStaticBoxSizer * const sbBasic = new wxStaticBoxSizer ( wxVERTICAL , GeneralPage , _ ( " Basic Settings " ) ) ;
sbBasic - > Add ( CPUThread , 0 , wxALL , 5 ) ;
sbBasic - > Add ( SkipIdle , 0 , wxALL , 5 ) ;
sbBasic - > Add ( EnableCheats , 0 , wxALL , 5 ) ;
2011-06-02 19:32:34 +00:00
sbBasic - > Add ( sFramelimit ) ;
2009-08-03 18:35:25 +00:00
2011-01-31 17:15:21 +00:00
wxStaticBoxSizer * const sbAdvanced = new wxStaticBoxSizer ( wxVERTICAL , GeneralPage , _ ( " Advanced Settings " ) ) ;
2010-06-05 01:38:22 +00:00
sbAdvanced - > Add ( CPUEngine , 0 , wxALL , 5 ) ;
2011-06-02 19:32:34 +00:00
sbAdvanced - > Add ( _NTSCJ , 0 , wxALL , 5 ) ;
2009-01-14 16:36:43 +00:00
2011-01-31 01:28:32 +00:00
wxBoxSizer * const sGeneralPage = new wxBoxSizer ( wxVERTICAL ) ;
2010-05-30 08:22:04 +00:00
sGeneralPage - > Add ( sbBasic , 0 , wxEXPAND | wxALL , 5 ) ;
sGeneralPage - > Add ( sbAdvanced , 0 , wxEXPAND | wxALL , 5 ) ;
GeneralPage - > SetSizer ( sGeneralPage ) ;
2011-01-29 04:16:05 +00:00
2010-05-30 08:22:04 +00:00
// Interface Language
2014-03-06 04:02:34 +00:00
InterfaceLang = new wxChoice ( DisplayPage , ID_INTERFACE_LANG , wxDefaultPosition , wxDefaultSize , arrayStringFor_InterfaceLang ) ;
2010-05-30 08:22:04 +00:00
// Hotkey configuration
2014-03-06 04:02:34 +00:00
HotkeyConfig = new wxButton ( DisplayPage , ID_HOTKEY_CONFIG , _ ( " Hotkeys " ) , wxDefaultPosition , wxDefaultSize , wxBU_EXACTFIT ) ;
2011-01-29 04:16:05 +00:00
// Interface settings
2014-03-06 04:02:34 +00:00
ConfirmStop = new wxCheckBox ( DisplayPage , ID_INTERFACE_CONFIRMSTOP , _ ( " Confirm on Stop " ) ) ;
UsePanicHandlers = new wxCheckBox ( DisplayPage , ID_INTERFACE_USEPANICHANDLERS , _ ( " Use Panic Handlers " ) ) ;
OnScreenDisplayMessages = new wxCheckBox ( DisplayPage , ID_INTERFACE_ONSCREENDISPLAYMESSAGES , _ ( " On-Screen Display Messages " ) ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
wxBoxSizer * sInterface = new wxBoxSizer ( wxHORIZONTAL ) ;
2011-01-25 03:30:12 +00:00
sInterface - > Add ( TEXT_BOX ( DisplayPage , _ ( " Language: " ) ) , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2011-02-04 23:44:11 +00:00
sInterface - > Add ( InterfaceLang , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2010-05-30 08:22:04 +00:00
sInterface - > AddStretchSpacer ( ) ;
sInterface - > Add ( HotkeyConfig , 0 , wxALIGN_RIGHT | wxALL , 5 ) ;
2013-01-13 21:39:53 +00:00
// theme selection
auto const theme_selection = new wxChoice ( DisplayPage , wxID_ANY ) ;
2013-01-17 02:22:00 +00:00
CFileSearch : : XStringVector theme_dirs ;
theme_dirs . push_back ( File : : GetUserPath ( D_THEMES_IDX ) ) ;
2013-09-12 01:55:16 +00:00
theme_dirs . push_back ( File : : GetSysDirectory ( ) + THEMES_DIR ) ;
2013-01-17 02:22:00 +00:00
CFileSearch cfs ( CFileSearch : : XStringVector ( 1 , " * " ) , theme_dirs ) ;
2013-01-13 21:39:53 +00:00
auto const & sv = cfs . GetFileNames ( ) ;
std : : for_each ( sv . begin ( ) , sv . end ( ) , [ theme_selection ] ( const std : : string & filename )
{
std : : string name , ext ;
2014-03-09 20:14:26 +00:00
SplitPath ( filename , nullptr , & name , & ext ) ;
2013-01-13 21:39:53 +00:00
name + = ext ;
2013-04-02 04:17:15 +00:00
auto const wxname = StrToWxStr ( name ) ;
if ( - 1 = = theme_selection - > FindString ( wxname ) )
theme_selection - > Append ( wxname ) ;
2013-01-13 21:39:53 +00:00
} ) ;
2013-10-29 05:23:17 +00:00
2013-04-02 04:17:15 +00:00
theme_selection - > SetStringSelection ( StrToWxStr ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . theme_name ) ) ;
2013-01-13 21:39:53 +00:00
2013-01-13 22:27:02 +00:00
// std::function = avoid error on msvc
2014-05-17 16:49:00 +00:00
theme_selection - > Bind ( wxEVT_CHOICE , std : : function < void ( wxEvent & ) > ( [ theme_selection ] ( wxEvent & )
2013-01-13 21:39:53 +00:00
{
2013-04-02 04:17:15 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . theme_name = WxStrToStr ( theme_selection - > GetStringSelection ( ) ) ;
2013-01-13 21:39:53 +00:00
main_frame - > InitBitmaps ( ) ;
2013-02-22 20:27:28 +00:00
main_frame - > UpdateGameList ( ) ;
2013-01-13 22:13:38 +00:00
} ) ) ;
2013-01-13 21:39:53 +00:00
auto const scInterface = new wxBoxSizer ( wxHORIZONTAL ) ;
2013-01-10 05:22:28 +00:00
scInterface - > Add ( TEXT_BOX ( DisplayPage , _ ( " Theme: " ) ) , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2013-01-13 21:39:53 +00:00
scInterface - > Add ( theme_selection , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2013-01-10 05:22:28 +00:00
scInterface - > AddStretchSpacer ( ) ;
2013-01-13 21:39:53 +00:00
2011-01-31 17:15:21 +00:00
sbInterface = new wxStaticBoxSizer ( wxVERTICAL , DisplayPage , _ ( " Interface Settings " ) ) ;
sbInterface - > Add ( ConfirmStop , 0 , wxALL , 5 ) ;
sbInterface - > Add ( UsePanicHandlers , 0 , wxALL , 5 ) ;
2012-11-16 20:16:50 +00:00
sbInterface - > Add ( OnScreenDisplayMessages , 0 , wxALL , 5 ) ;
2013-01-10 05:22:28 +00:00
sbInterface - > Add ( scInterface , 0 , wxEXPAND | wxALL , 5 ) ;
2010-05-30 08:22:04 +00:00
sbInterface - > Add ( sInterface , 0 , wxEXPAND | wxALL , 5 ) ;
sDisplayPage = new wxBoxSizer ( wxVERTICAL ) ;
sDisplayPage - > Add ( sbInterface , 0 , wxEXPAND | wxALL , 5 ) ;
DisplayPage - > SetSizer ( sDisplayPage ) ;
2010-06-05 01:38:22 +00:00
2013-10-29 05:23:17 +00:00
2011-01-29 04:16:05 +00:00
// Audio page
2014-03-06 04:02:34 +00:00
DSPEngine = new wxRadioBox ( AudioPage , ID_DSPENGINE , _ ( " DSP Emulator Engine " ) , wxDefaultPosition , wxDefaultSize , arrayStringFor_DSPEngine , 0 , wxRA_SPECIFY_ROWS ) ;
2013-01-11 03:03:09 +00:00
DPL2Decoder = new wxCheckBox ( AudioPage , ID_DPL2DECODER , _ ( " Dolby Pro Logic II decoder " ) ) ;
2015-02-15 19:43:31 +00:00
VolumeSlider = new wxSlider ( AudioPage , ID_VOLUME , 0 , 0 , 100 , wxDefaultPosition , wxDefaultSize , wxSL_VERTICAL | wxSL_INVERSE ) ;
2014-05-17 17:17:28 +00:00
VolumeText = new wxStaticText ( AudioPage , wxID_ANY , " " ) ;
2014-03-06 04:02:34 +00:00
BackendSelection = new wxChoice ( AudioPage , ID_BACKEND , wxDefaultPosition , wxDefaultSize , wxArrayBackends , 0 , wxDefaultValidator , wxEmptyString ) ;
Latency = new wxSpinCtrl ( AudioPage , ID_LATENCY , " " , wxDefaultPosition , wxDefaultSize , wxSP_ARROW_KEYS , 0 , 30 ) ;
2013-01-16 01:56:08 +00:00
2014-05-17 16:49:00 +00:00
Latency - > Bind ( wxEVT_SPINCTRL , & CConfigMain : : AudioSettingsChanged , this ) ;
2011-01-29 04:16:05 +00:00
2014-07-07 22:47:57 +00:00
if ( Core : : IsRunning ( ) )
2013-01-03 21:40:18 +00:00
{
2013-01-16 01:56:08 +00:00
Latency - > Disable ( ) ;
2013-01-03 21:40:18 +00:00
BackendSelection - > Disable ( ) ;
2013-01-11 08:42:03 +00:00
DPL2Decoder - > Disable ( ) ;
2013-01-03 21:40:18 +00:00
}
2011-01-29 04:16:05 +00:00
// Create sizer and add items to dialog
wxStaticBoxSizer * sbAudioSettings = new wxStaticBoxSizer ( wxVERTICAL , AudioPage , _ ( " Sound Settings " ) ) ;
sbAudioSettings - > Add ( DSPEngine , 0 , wxALL | wxEXPAND , 5 ) ;
2013-01-11 03:03:09 +00:00
sbAudioSettings - > Add ( DPL2Decoder , 0 , wxALL , 5 ) ;
2011-01-29 04:16:05 +00:00
wxStaticBoxSizer * sbVolume = new wxStaticBoxSizer ( wxVERTICAL , AudioPage , _ ( " Volume " ) ) ;
2015-02-15 19:43:31 +00:00
sbVolume - > Add ( VolumeSlider , 1 , wxLEFT | wxRIGHT , 13 ) ;
sbVolume - > Add ( VolumeText , 0 , wxALIGN_CENTER | wxALL , 5 ) ;
2011-01-29 04:16:05 +00:00
wxGridBagSizer * sBackend = new wxGridBagSizer ( ) ;
2015-02-15 19:43:31 +00:00
sBackend - > Add ( TEXT_BOX ( AudioPage , _ ( " Audio Backend: " ) ) , wxGBPosition ( 0 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2011-02-04 23:44:11 +00:00
sBackend - > Add ( BackendSelection , wxGBPosition ( 0 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2015-02-15 19:43:31 +00:00
sBackend - > Add ( TEXT_BOX ( AudioPage , _ ( " Latency: " ) ) , wxGBPosition ( 1 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2013-01-16 01:56:08 +00:00
sBackend - > Add ( Latency , wxGBPosition ( 1 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2011-01-29 04:16:05 +00:00
wxStaticBoxSizer * sbBackend = new wxStaticBoxSizer ( wxHORIZONTAL , AudioPage , _ ( " Backend Settings " ) ) ;
2011-02-04 23:44:11 +00:00
sbBackend - > Add ( sBackend , 0 , wxEXPAND ) ;
2011-01-29 04:16:05 +00:00
wxBoxSizer * sAudio = new wxBoxSizer ( wxHORIZONTAL ) ;
2015-02-15 19:43:31 +00:00
sAudio - > Add ( sbAudioSettings , 1 , wxEXPAND | wxALL , 5 ) ;
sAudio - > Add ( sbVolume , 0 , wxEXPAND | wxALL , 5 ) ;
2011-01-29 04:16:05 +00:00
sAudioPage = new wxBoxSizer ( wxVERTICAL ) ;
2015-02-15 19:43:31 +00:00
sAudioPage - > Add ( sAudio , 0 , wxALL | wxEXPAND ) ;
sAudioPage - > Add ( sbBackend , 0 , wxALL | wxEXPAND , 5 ) ;
2011-01-29 04:16:05 +00:00
AudioPage - > SetSizerAndFit ( sAudioPage ) ;
2010-06-05 01:38:22 +00:00
2014-06-07 02:30:39 +00:00
// GameCube page
2010-02-06 16:20:54 +00:00
// IPL settings
2014-03-06 04:02:34 +00:00
GCSystemLang = new wxChoice ( GamecubePage , ID_GC_SRAM_LNG , wxDefaultPosition , wxDefaultSize , arrayStringFor_GCSystemLang ) ;
GCAlwaysHLE_BS2 = new wxCheckBox ( GamecubePage , ID_GC_ALWAYS_HLE_BS2 , _ ( " Skip BIOS " ) ) ;
2014-10-18 03:18:59 +00:00
if ( ! File : : Exists ( File : : GetUserPath ( D_GCUSER_IDX ) + DIR_SEP + USA_DIR + DIR_SEP GC_IPL ) & &
! File : : Exists ( File : : GetSysDirectory ( ) + GC_SYS_DIR + DIR_SEP + USA_DIR + DIR_SEP GC_IPL ) & &
! File : : Exists ( File : : GetUserPath ( D_GCUSER_IDX ) + DIR_SEP + JAP_DIR + DIR_SEP GC_IPL ) & &
! File : : Exists ( File : : GetSysDirectory ( ) + GC_SYS_DIR + DIR_SEP + JAP_DIR + DIR_SEP GC_IPL ) & &
! File : : Exists ( File : : GetUserPath ( D_GCUSER_IDX ) + DIR_SEP + EUR_DIR + DIR_SEP GC_IPL ) & &
! File : : Exists ( File : : GetSysDirectory ( ) + GC_SYS_DIR + DIR_SEP + EUR_DIR + DIR_SEP GC_IPL ) )
{
GCAlwaysHLE_BS2 - > Disable ( ) ;
GCAlwaysHLE_BS2 - > SetToolTip ( _ ( " Put BIOS roms in User/GC/{region}. " ) ) ;
}
2010-06-05 01:38:22 +00:00
// Device settings
2009-02-02 22:29:33 +00:00
// EXI Devices
2010-06-05 01:38:22 +00:00
wxStaticText * GCEXIDeviceText [ 3 ] ;
2011-01-25 03:30:12 +00:00
GCEXIDeviceText [ 0 ] = TEXT_BOX ( GamecubePage , _ ( " Slot A " ) ) ;
GCEXIDeviceText [ 1 ] = TEXT_BOX ( GamecubePage , _ ( " Slot B " ) ) ;
2014-05-17 17:17:28 +00:00
GCEXIDeviceText [ 2 ] = TEXT_BOX ( GamecubePage , " SP1 " ) ;
2011-01-31 02:38:36 +00:00
GCEXIDevice [ 0 ] = new wxChoice ( GamecubePage , ID_GC_EXIDEVICE_SLOTA ) ;
GCEXIDevice [ 1 ] = new wxChoice ( GamecubePage , ID_GC_EXIDEVICE_SLOTB ) ;
GCEXIDevice [ 2 ] = new wxChoice ( GamecubePage , ID_GC_EXIDEVICE_SP1 ) ;
2014-05-17 17:17:28 +00:00
GCMemcardPath [ 0 ] = new wxButton ( GamecubePage , ID_GC_EXIDEVICE_SLOTA_PATH , " ... " ,
2014-03-06 04:02:34 +00:00
wxDefaultPosition , wxDefaultSize , wxBU_EXACTFIT ) ;
2014-05-17 17:17:28 +00:00
GCMemcardPath [ 1 ] = new wxButton ( GamecubePage , ID_GC_EXIDEVICE_SLOTB_PATH , " ... " ,
2014-03-06 04:02:34 +00:00
wxDefaultPosition , wxDefaultSize , wxBU_EXACTFIT ) ;
2011-01-29 04:16:05 +00:00
2014-06-07 02:30:39 +00:00
// Populate the GameCube page
2010-06-05 01:38:22 +00:00
sGamecubeIPLSettings = new wxGridBagSizer ( ) ;
2011-06-02 19:32:34 +00:00
sGamecubeIPLSettings - > Add ( GCAlwaysHLE_BS2 , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2011-01-25 03:30:12 +00:00
sGamecubeIPLSettings - > Add ( TEXT_BOX ( GamecubePage , _ ( " System Language: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 1 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM , 5 ) ;
sGamecubeIPLSettings - > Add ( GCSystemLang , wxGBPosition ( 1 , 1 ) , wxDefaultSpan , wxLEFT | wxRIGHT | wxBOTTOM , 5 ) ;
2011-06-02 19:32:34 +00:00
2011-01-31 17:15:21 +00:00
sbGamecubeIPLSettings = new wxStaticBoxSizer ( wxVERTICAL , GamecubePage , _ ( " IPL Settings " ) ) ;
2009-01-04 21:53:41 +00:00
sbGamecubeIPLSettings - > Add ( sGamecubeIPLSettings ) ;
2011-01-31 17:15:21 +00:00
wxStaticBoxSizer * sbGamecubeDeviceSettings = new wxStaticBoxSizer ( wxVERTICAL , GamecubePage , _ ( " Device Settings " ) ) ;
2011-06-02 19:32:34 +00:00
wxGridBagSizer * sbGamecubeEXIDevSettings = new wxGridBagSizer ( 10 , 10 ) ;
2009-02-02 22:29:33 +00:00
for ( int i = 0 ; i < 3 ; + + i )
{
2011-06-02 19:32:34 +00:00
sbGamecubeEXIDevSettings - > Add ( GCEXIDeviceText [ i ] , wxGBPosition ( i , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL ) ;
2015-02-15 19:43:31 +00:00
sbGamecubeEXIDevSettings - > Add ( GCEXIDevice [ i ] , wxGBPosition ( i , 1 ) , wxGBSpan ( 1 , ( i < 2 ) ? 1 : 2 ) , wxALIGN_CENTER_VERTICAL ) ;
if ( i < 2 )
sbGamecubeEXIDevSettings - > Add ( GCMemcardPath [ i ] , wxGBPosition ( i , 2 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL ) ;
2013-09-07 04:06:03 +00:00
if ( NetPlay : : IsNetPlayRunning ( ) )
GCEXIDevice [ i ] - > Disable ( ) ;
2009-02-02 22:29:33 +00:00
}
2011-06-02 19:32:34 +00:00
sbGamecubeDeviceSettings - > Add ( sbGamecubeEXIDevSettings , 0 , wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
sGamecubePage = new wxBoxSizer ( wxVERTICAL ) ;
2015-02-15 19:43:31 +00:00
sGamecubePage - > Add ( sbGamecubeIPLSettings , 0 , wxEXPAND | wxALL , 5 ) ;
sGamecubePage - > Add ( sbGamecubeDeviceSettings , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
GamecubePage - > SetSizer ( sGamecubePage ) ;
2009-01-04 21:53:41 +00:00
// Wii page
2010-06-05 01:38:22 +00:00
// Misc Settings
2014-03-06 04:02:34 +00:00
WiiScreenSaver = new wxCheckBox ( WiiPage , ID_WII_IPL_SSV , _ ( " Enable Screen Saver " ) ) ;
2014-10-13 22:24:35 +00:00
WiiPAL60 = new wxCheckBox ( WiiPage , ID_WII_IPL_E60 , _ ( " Use PAL60 Mode (EuRGB60) " ) ) ;
2014-03-06 04:02:34 +00:00
WiiAspectRatio = new wxChoice ( WiiPage , ID_WII_IPL_AR , wxDefaultPosition , wxDefaultSize , arrayStringFor_WiiAspectRatio ) ;
WiiSystemLang = new wxChoice ( WiiPage , ID_WII_IPL_LNG , wxDefaultPosition , wxDefaultSize , arrayStringFor_WiiSystemLang ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
// Device Settings
2014-03-06 04:02:34 +00:00
WiiSDCard = new wxCheckBox ( WiiPage , ID_WII_SD_CARD , _ ( " Insert SD Card " ) ) ;
WiiKeyboard = new wxCheckBox ( WiiPage , ID_WII_KEYBOARD , _ ( " Connect USB Keyboard " ) ) ;
2010-01-11 11:56:17 +00:00
2011-01-29 04:16:05 +00:00
// Populate the Wii Page
2010-06-05 01:38:22 +00:00
sWiiIPLSettings = new wxGridBagSizer ( ) ;
2009-01-04 21:53:41 +00:00
sWiiIPLSettings - > Add ( WiiScreenSaver , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2014-10-13 22:24:35 +00:00
sWiiIPLSettings - > Add ( WiiPAL60 , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2011-01-25 03:30:12 +00:00
sWiiIPLSettings - > Add ( TEXT_BOX ( WiiPage , _ ( " Aspect Ratio: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 2 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2010-11-03 06:28:47 +00:00
sWiiIPLSettings - > Add ( WiiAspectRatio , wxGBPosition ( 2 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2011-01-25 03:30:12 +00:00
sWiiIPLSettings - > Add ( TEXT_BOX ( WiiPage , _ ( " System Language: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 3 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2010-11-03 06:28:47 +00:00
sWiiIPLSettings - > Add ( WiiSystemLang , wxGBPosition ( 3 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2011-01-31 17:15:21 +00:00
sbWiiIPLSettings = new wxStaticBoxSizer ( wxVERTICAL , WiiPage , _ ( " Misc Settings " ) ) ;
2009-01-04 21:53:41 +00:00
sbWiiIPLSettings - > Add ( sWiiIPLSettings ) ;
2010-01-11 11:56:17 +00:00
2011-01-31 17:15:21 +00:00
sbWiiDeviceSettings = new wxStaticBoxSizer ( wxVERTICAL , WiiPage , _ ( " Device Settings " ) ) ;
2010-01-11 11:56:17 +00:00
sbWiiDeviceSettings - > Add ( WiiSDCard , 0 , wxALL , 5 ) ;
sbWiiDeviceSettings - > Add ( WiiKeyboard , 0 , wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
sWiiPage = new wxBoxSizer ( wxVERTICAL ) ;
2015-02-15 19:43:31 +00:00
sWiiPage - > Add ( sbWiiIPLSettings , 0 , wxEXPAND | wxALL , 5 ) ;
sWiiPage - > Add ( sbWiiDeviceSettings , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
WiiPage - > SetSizer ( sWiiPage ) ;
2009-01-04 21:53:41 +00:00
2013-10-29 05:23:17 +00:00
2009-01-04 21:53:41 +00:00
// Paths page
2014-03-06 04:02:34 +00:00
ISOPaths = new wxListBox ( PathsPage , ID_ISOPATHS , wxDefaultPosition , wxDefaultSize , arrayStringFor_ISOPaths , wxLB_SINGLE ) ;
RecursiveISOPath = new wxCheckBox ( PathsPage , ID_RECURSIVEISOPATH , _ ( " Search Subfolders " ) ) ;
AddISOPath = new wxButton ( PathsPage , ID_ADDISOPATH , _ ( " Add... " ) ) ;
RemoveISOPath = new wxButton ( PathsPage , ID_REMOVEISOPATH , _ ( " Remove " ) ) ;
2015-02-14 21:00:15 +00:00
RemoveISOPath - > Disable ( ) ;
2010-06-05 01:38:22 +00:00
2011-01-31 01:28:32 +00:00
DefaultISO = new wxFilePickerCtrl ( PathsPage , ID_DEFAULTISO , wxEmptyString , _ ( " Choose a default ISO: " ) ,
2014-10-25 19:48:08 +00:00
_ ( " All GC/Wii files (elf, dol, gcm, iso, wbfs, ciso, gcz, wad) " ) + wxString : : Format ( " |*.elf;*.dol;*.gcm;*.iso;*.wbfs;*.ciso;*.gcz;*.wad|%s " , wxGetTranslation ( wxALL_FILES ) ) ,
2015-02-15 19:43:31 +00:00
wxDefaultPosition , wxDefaultSize , wxFLP_USE_TEXTCTRL | wxFLP_OPEN ) ;
2011-01-31 01:28:32 +00:00
DVDRoot = new wxDirPickerCtrl ( PathsPage , ID_DVDROOT , wxEmptyString , _ ( " Choose a DVD root directory: " ) , wxDefaultPosition , wxDefaultSize , wxDIRP_USE_TEXTCTRL ) ;
ApploaderPath = new wxFilePickerCtrl ( PathsPage , ID_APPLOADERPATH , wxEmptyString , _ ( " Choose file to use as apploader: (applies to discs constructed from directories only) " ) ,
2014-05-17 17:17:28 +00:00
_ ( " apploader (.img) " ) + wxString : : Format ( " |*.img|%s " , wxGetTranslation ( wxALL_FILES ) ) ,
2015-02-15 19:43:31 +00:00
wxDefaultPosition , wxDefaultSize , wxFLP_USE_TEXTCTRL | wxFLP_OPEN ) ;
2011-05-24 19:12:18 +00:00
NANDRoot = new wxDirPickerCtrl ( PathsPage , ID_NANDROOT , wxEmptyString , _ ( " Choose a NAND root directory: " ) , wxDefaultPosition , wxDefaultSize , wxDIRP_USE_TEXTCTRL ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
// Populate the settings
wxBoxSizer * sISOButtons = new wxBoxSizer ( wxHORIZONTAL ) ;
2015-02-15 19:43:31 +00:00
sISOButtons - > Add ( RecursiveISOPath , 0 , wxALL | wxALIGN_CENTER , 0 ) ;
2010-06-05 01:38:22 +00:00
sISOButtons - > AddStretchSpacer ( ) ;
2009-01-04 21:53:41 +00:00
sISOButtons - > Add ( AddISOPath , 0 , wxALL , 0 ) ;
sISOButtons - > Add ( RemoveISOPath , 0 , wxALL , 0 ) ;
2011-01-31 17:15:21 +00:00
sbISOPaths = new wxStaticBoxSizer ( wxVERTICAL , PathsPage , _ ( " ISO Directories " ) ) ;
2015-02-15 19:43:31 +00:00
sbISOPaths - > Add ( ISOPaths , 1 , wxEXPAND | wxALL , 0 ) ;
sbISOPaths - > Add ( sISOButtons , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
sOtherPaths = new wxGridBagSizer ( ) ;
2011-01-25 03:30:12 +00:00
sOtherPaths - > Add ( TEXT_BOX ( PathsPage , _ ( " Default ISO: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 0 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( DefaultISO , wxGBPosition ( 0 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
2011-01-25 03:30:12 +00:00
sOtherPaths - > Add ( TEXT_BOX ( PathsPage , _ ( " DVD Root: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 1 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( DVDRoot , wxGBPosition ( 1 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
2011-01-25 03:30:12 +00:00
sOtherPaths - > Add ( TEXT_BOX ( PathsPage , _ ( " Apploader: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 2 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( ApploaderPath , wxGBPosition ( 2 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
2011-05-24 19:12:18 +00:00
sOtherPaths - > Add ( TEXT_BOX ( PathsPage , _ ( " Wii NAND Root: " ) ) ,
2015-02-15 19:43:31 +00:00
wxGBPosition ( 3 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( NANDRoot , wxGBPosition ( 3 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
2010-04-20 13:19:36 +00:00
sOtherPaths - > AddGrowableCol ( 1 ) ;
2010-06-05 01:38:22 +00:00
// Populate the Paths page
sPathsPage = new wxBoxSizer ( wxVERTICAL ) ;
2015-02-15 19:43:31 +00:00
sPathsPage - > Add ( sbISOPaths , 1 , wxEXPAND | wxALL , 5 ) ;
sPathsPage - > Add ( sOtherPaths , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
PathsPage - > SetSizer ( sPathsPage ) ;
2009-01-04 21:53:41 +00:00
2008-12-25 07:28:41 +00:00
wxBoxSizer * sMain = new wxBoxSizer ( wxVERTICAL ) ;
2015-02-15 19:43:31 +00:00
sMain - > Add ( Notebook , 1 , wxEXPAND | wxALL , 5 ) ;
2011-03-16 22:22:21 +00:00
sMain - > Add ( CreateButtonSizer ( wxOK ) , 0 , wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM , 5 ) ;
2009-01-15 06:48:15 +00:00
2014-12-31 18:24:14 +00:00
wxStaticBoxSizer * sbCPUOptions = new wxStaticBoxSizer ( wxVERTICAL , AdvancedPage , _ ( " CPU Options " ) ) ;
wxBoxSizer * bOverclockEnable = new wxBoxSizer ( wxHORIZONTAL ) ;
wxBoxSizer * bOverclock = new wxBoxSizer ( wxHORIZONTAL ) ;
wxBoxSizer * bOverclockDesc = new wxBoxSizer ( wxHORIZONTAL ) ;
EnableOC = new wxCheckBox ( AdvancedPage , ID_ENABLEOVERCLOCK , _ ( " Enable CPU Clock Override " ) ) ;
OCSlider = new wxSlider ( AdvancedPage , ID_OVERCLOCK , 100 , 0 , 150 , wxDefaultPosition , wxDefaultSize , wxSL_HORIZONTAL ) ;
wxStaticText * OCDescription = new wxStaticText ( AdvancedPage , wxID_ANY ,
_ ( " Higher values can make variable-framerate games \n "
" run at a higher framerate, at the expense of CPU. \n "
" Lower values can make variable-framerate games \n "
" run at a lower framerate, saving CPU. \n \n "
" WARNING: Changing this from the default (100%) \n "
" can and will break games and cause glitches. \n "
" Do so at your own risk. Please do not report \n "
" bugs that occur with a non-default clock. \n " ) ) ;
OCText = new wxStaticText ( AdvancedPage , wxID_ANY , " " ) ;
bOverclockEnable - > Add ( EnableOC ) ;
bOverclock - > Add ( OCSlider , 1 , wxALL , 5 ) ;
bOverclock - > Add ( OCText , 1 , wxALL , 5 ) ;
bOverclockDesc - > Add ( OCDescription , 1 , wxALL , 5 ) ;
sbCPUOptions - > Add ( bOverclockEnable ) ;
sbCPUOptions - > Add ( bOverclock ) ;
sbCPUOptions - > Add ( bOverclockDesc ) ;
wxBoxSizer * const sAdvancedPage = new wxBoxSizer ( wxVERTICAL ) ;
sAdvancedPage - > Add ( sbCPUOptions , 0 , wxEXPAND | wxALL , 5 ) ;
AdvancedPage - > SetSizer ( sAdvancedPage ) ;
2010-02-06 16:20:54 +00:00
InitializeGUIValues ( ) ;
InitializeGUITooltips ( ) ;
2009-01-04 21:53:41 +00:00
UpdateGUI ( ) ;
2011-03-16 22:22:21 +00:00
SetSizerAndFit ( sMain ) ;
2008-12-08 05:30:24 +00:00
Center ( ) ;
2011-03-16 22:22:21 +00:00
SetFocus ( ) ;
2008-12-08 05:30:24 +00:00
}
2015-02-15 19:43:31 +00:00
void CConfigMain : : OnClose ( wxCloseEvent & WXUNUSED ( event ) )
2008-12-08 05:30:24 +00:00
{
2011-03-16 22:22:21 +00:00
EndModal ( ( bRefreshList ) ? wxID_OK : wxID_CANCEL ) ;
2010-06-05 01:38:22 +00:00
}
2008-12-08 05:30:24 +00:00
2015-02-15 19:43:31 +00:00
void CConfigMain : : OnOk ( wxCommandEvent & WXUNUSED ( event ) )
2010-06-05 01:38:22 +00:00
{
Close ( ) ;
2008-12-08 05:30:24 +00:00
2013-03-09 03:47:56 +00:00
// Save the config. Dolphin crashes too often to only save the settings on closing
2008-12-08 05:30:24 +00:00
SConfig : : GetInstance ( ) . SaveSettings ( ) ;
}
2014-12-31 18:24:14 +00:00
void CConfigMain : : UpdateCPUClock ( )
{
bool wii = SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bWii ;
int percent = ( int ) ( roundf ( SConfig : : GetInstance ( ) . m_OCFactor * 100.f ) ) ;
int clock = ( int ) ( roundf ( SConfig : : GetInstance ( ) . m_OCFactor * ( wii ? 729.f : 486.f ) ) ) ;
OCText - > SetLabel ( SConfig : : GetInstance ( ) . m_OCEnable ? wxString : : Format ( " %d %% (%d mhz) " , percent , clock ) : " " ) ;
}
2010-06-05 01:38:22 +00:00
// Core settings
2008-12-08 05:30:24 +00:00
void CConfigMain : : CoreSettingsChanged ( wxCommandEvent & event )
{
2014-09-27 19:54:07 +00:00
SCoreStartupParameter & startup_params = SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter ;
2008-12-08 05:30:24 +00:00
switch ( event . GetId ( ) )
{
2010-06-05 01:38:22 +00:00
// Core - Basic
case ID_CPUTHREAD :
2014-07-07 22:47:57 +00:00
if ( Core : : IsRunning ( ) )
2014-05-23 13:45:14 +00:00
return ;
2014-09-27 19:54:07 +00:00
startup_params . bCPUThread = CPUThread - > IsChecked ( ) ;
2009-01-04 21:53:41 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_IDLESKIP :
2014-09-27 19:54:07 +00:00
startup_params . bSkipIdle = SkipIdle - > IsChecked ( ) ;
2009-02-02 22:29:33 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_ENABLECHEATS :
2014-09-27 19:54:07 +00:00
startup_params . bEnableCheats = EnableCheats - > IsChecked ( ) ;
2010-04-12 01:33:10 +00:00
break ;
2009-06-18 11:23:37 +00:00
case ID_FRAMELIMIT :
2010-06-05 01:38:22 +00:00
SConfig : : GetInstance ( ) . m_Framelimit = Framelimit - > GetSelection ( ) ;
2009-06-09 21:27:45 +00:00
break ;
2010-06-05 01:38:22 +00:00
// Core - Advanced
case ID_CPUENGINE :
2014-09-27 19:54:07 +00:00
startup_params . iCPUCore = CPUCores [ CPUEngine - > GetSelection ( ) ] . CPUid ;
2010-06-05 01:38:22 +00:00
if ( main_frame - > g_pCodeWindow )
2014-09-27 19:54:07 +00:00
{
2015-02-19 15:29:21 +00:00
bool using_interp = ( startup_params . iCPUCore = = PowerPC : : CORE_INTERPRETER ) ;
2014-09-27 19:54:07 +00:00
main_frame - > g_pCodeWindow - > GetMenuBar ( ) - > Check ( IDM_INTERPRETER , using_interp ) ;
}
2008-12-08 05:30:24 +00:00
break ;
2011-06-02 19:32:34 +00:00
case ID_NTSCJ :
2014-09-27 19:54:07 +00:00
startup_params . bForceNTSCJ = _NTSCJ - > IsChecked ( ) ;
2011-06-02 19:32:34 +00:00
break ;
2014-12-31 18:24:14 +00:00
case ID_ENABLEOVERCLOCK :
SConfig : : GetInstance ( ) . m_OCEnable = EnableOC - > IsChecked ( ) ;
OCSlider - > Enable ( SConfig : : GetInstance ( ) . m_OCEnable ) ;
UpdateCPUClock ( ) ;
break ;
case ID_OVERCLOCK :
// Vaguely exponential scaling?
SConfig : : GetInstance ( ) . m_OCFactor = exp2f ( ( OCSlider - > GetValue ( ) - 100.f ) / 25.f ) ;
UpdateCPUClock ( ) ;
break ;
2010-06-05 01:38:22 +00:00
}
}
// Display and Interface settings
void CConfigMain : : DisplaySettingsChanged ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
// Display - Interface
case ID_INTERFACE_CONFIRMSTOP :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bConfirmStop = ConfirmStop - > IsChecked ( ) ;
break ;
case ID_INTERFACE_USEPANICHANDLERS :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bUsePanicHandlers = UsePanicHandlers - > IsChecked ( ) ;
SetEnableAlert ( UsePanicHandlers - > IsChecked ( ) ) ;
break ;
2012-11-16 20:16:50 +00:00
case ID_INTERFACE_ONSCREENDISPLAYMESSAGES :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bOnScreenDisplayMessages = OnScreenDisplayMessages - > IsChecked ( ) ;
SetEnableAlert ( OnScreenDisplayMessages - > IsChecked ( ) ) ;
break ;
2010-06-05 01:38:22 +00:00
case ID_INTERFACE_LANG :
2011-01-10 19:26:36 +00:00
if ( SConfig : : GetInstance ( ) . m_InterfaceLanguage ! = langIds [ InterfaceLang - > GetSelection ( ) ] )
2011-01-13 02:05:58 +00:00
SuccessAlertT ( " You must restart Dolphin in order for the change to take effect. " ) ;
2011-01-10 19:26:36 +00:00
SConfig : : GetInstance ( ) . m_InterfaceLanguage = langIds [ InterfaceLang - > GetSelection ( ) ] ;
2010-06-05 01:38:22 +00:00
break ;
case ID_HOTKEY_CONFIG :
{
2015-01-27 01:24:47 +00:00
bool was_init = false ;
InputConfig * const hotkey_plugin = HotkeyManagerEmu : : GetConfig ( ) ;
// check if game is running
if ( g_controller_interface . IsInit ( ) )
{
was_init = true ;
}
else
{
# if defined(HAVE_X11) && HAVE_X11
Window win = X11Utils : : XWindowFromHandle ( GetHandle ( ) ) ;
HotkeyManagerEmu : : Initialize ( reinterpret_cast < void * > ( win ) ) ;
# else
HotkeyManagerEmu : : Initialize ( reinterpret_cast < void * > ( GetHandle ( ) ) ) ;
# endif
}
2015-02-11 14:07:16 +00:00
InputConfigDialog m_ConfigFrame ( this , * hotkey_plugin , _ ( " Dolphin Hotkeys " ) ) ;
2015-01-27 01:24:47 +00:00
m_ConfigFrame . ShowModal ( ) ;
// if game isn't running
if ( ! was_init )
{
HotkeyManagerEmu : : Shutdown ( ) ;
}
2010-06-05 01:38:22 +00:00
}
2011-03-15 13:38:52 +00:00
// Update the GUI in case menu accelerators were changed
main_frame - > UpdateGUI ( ) ;
2010-06-05 01:38:22 +00:00
break ;
2008-12-08 05:30:24 +00:00
}
}
2011-01-28 18:39:30 +00:00
void CConfigMain : : AudioSettingsChanged ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
2011-01-29 04:16:05 +00:00
case ID_DSPENGINE :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bDSPHLE = DSPEngine - > GetSelection ( ) = = 0 ;
2014-02-23 14:14:27 +00:00
SConfig : : GetInstance ( ) . m_DSPEnableJIT = DSPEngine - > GetSelection ( ) = = 1 ;
2013-01-17 01:16:56 +00:00
AudioCommon : : UpdateSoundStream ( ) ;
2011-01-28 18:39:30 +00:00
break ;
2011-06-02 19:32:34 +00:00
2011-01-29 04:16:05 +00:00
case ID_VOLUME :
2013-01-17 01:16:56 +00:00
SConfig : : GetInstance ( ) . m_Volume = VolumeSlider - > GetValue ( ) ;
AudioCommon : : UpdateSoundStream ( ) ;
2014-05-17 17:17:28 +00:00
VolumeText - > SetLabel ( wxString : : Format ( " %d %% " , VolumeSlider - > GetValue ( ) ) ) ;
2011-01-29 04:16:05 +00:00
break ;
2011-06-02 19:32:34 +00:00
2013-01-11 03:03:09 +00:00
case ID_DPL2DECODER :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bDPL2Decoder = DPL2Decoder - > IsChecked ( ) ;
break ;
2011-01-31 02:38:36 +00:00
case ID_BACKEND :
2013-02-28 04:37:38 +00:00
VolumeSlider - > Enable ( SupportsVolumeChanges ( WxStrToStr ( BackendSelection - > GetStringSelection ( ) ) ) ) ;
Latency - > Enable ( WxStrToStr ( BackendSelection - > GetStringSelection ( ) ) = = BACKEND_OPENAL ) ;
2015-01-07 10:57:20 +00:00
DPL2Decoder - > Enable ( WxStrToStr ( BackendSelection - > GetStringSelection ( ) ) = = BACKEND_OPENAL
| | WxStrToStr ( BackendSelection - > GetStringSelection ( ) ) = = BACKEND_PULSEAUDIO ) ;
2013-04-03 14:22:39 +00:00
// Don't save the translated BACKEND_NULLSOUND string
SConfig : : GetInstance ( ) . sBackend = BackendSelection - > GetSelection ( ) ?
WxStrToStr ( BackendSelection - > GetStringSelection ( ) ) : BACKEND_NULLSOUND ;
2013-01-17 01:16:56 +00:00
AudioCommon : : UpdateSoundStream ( ) ;
2011-06-02 19:32:34 +00:00
break ;
2013-01-12 13:05:30 +00:00
case ID_LATENCY :
2013-01-16 01:56:08 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iLatency = Latency - > GetValue ( ) ;
2013-01-12 13:05:30 +00:00
break ;
2011-01-29 04:16:05 +00:00
default :
break ;
}
}
void CConfigMain : : AddAudioBackends ( )
{
2014-02-12 15:00:34 +00:00
for ( const std : : string & backend : AudioCommon : : GetSoundBackends ( ) )
2011-01-29 04:16:05 +00:00
{
2014-02-12 15:00:34 +00:00
BackendSelection - > Append ( wxGetTranslation ( StrToWxStr ( backend ) ) ) ;
2013-03-29 16:05:22 +00:00
int num = BackendSelection - >
2013-02-28 08:39:06 +00:00
FindString ( StrToWxStr ( SConfig : : GetInstance ( ) . sBackend ) ) ;
2011-01-29 04:16:05 +00:00
BackendSelection - > SetSelection ( num ) ;
2011-01-28 18:39:30 +00:00
}
}
2009-09-02 21:00:45 +00:00
2011-01-29 04:16:05 +00:00
bool CConfigMain : : SupportsVolumeChanges ( std : : string backend )
{
//FIXME: this one should ask the backend whether it supports it.
// but getting the backend from string etc. is probably
// too much just to enable/disable a stupid slider...
2014-08-23 18:18:00 +00:00
return ( backend = = BACKEND_COREAUDIO | |
2011-01-29 04:16:05 +00:00
backend = = BACKEND_OPENAL | |
2013-01-09 23:39:19 +00:00
backend = = BACKEND_XAUDIO2 ) ;
2011-01-29 04:16:05 +00:00
}
2009-02-02 22:29:33 +00:00
// GC settings
2009-02-23 09:34:28 +00:00
// -----------------------
2008-12-08 05:30:24 +00:00
void CConfigMain : : GCSettingsChanged ( wxCommandEvent & event )
{
2009-02-28 21:30:43 +00:00
int exidevice = 0 ;
2008-12-08 05:30:24 +00:00
switch ( event . GetId ( ) )
{
2014-06-07 02:30:39 +00:00
// GameCube - IPL
2008-12-08 05:30:24 +00:00
case ID_GC_SRAM_LNG :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . SelectedLanguage = GCSystemLang - > GetSelection ( ) ;
2011-01-12 13:14:50 +00:00
bRefreshList = true ;
2008-12-08 05:30:24 +00:00
break ;
2014-06-07 02:30:39 +00:00
// GameCube - IPL Settings
2011-06-02 19:32:34 +00:00
case ID_GC_ALWAYS_HLE_BS2 :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bHLE_BS2 = GCAlwaysHLE_BS2 - > IsChecked ( ) ;
break ;
2014-06-07 02:30:39 +00:00
// GameCube - Devices
2009-10-19 15:14:48 +00:00
case ID_GC_EXIDEVICE_SP1 :
2009-02-28 21:30:43 +00:00
exidevice + + ;
case ID_GC_EXIDEVICE_SLOTB :
exidevice + + ;
2010-06-05 01:38:22 +00:00
case ID_GC_EXIDEVICE_SLOTA :
2012-03-22 21:52:20 +00:00
ChooseEXIDevice ( event . GetString ( ) , exidevice ) ;
2010-06-05 01:38:22 +00:00
break ;
2009-02-02 22:29:33 +00:00
case ID_GC_EXIDEVICE_SLOTA_PATH :
2015-01-20 12:41:46 +00:00
ChooseSlotPath ( true , SConfig : : GetInstance ( ) . m_EXIDevice [ 0 ] ) ;
2009-02-02 22:29:33 +00:00
break ;
case ID_GC_EXIDEVICE_SLOTB_PATH :
2015-01-24 01:09:35 +00:00
ChooseSlotPath ( false , SConfig : : GetInstance ( ) . m_EXIDevice [ 1 ] ) ;
2009-02-02 22:29:33 +00:00
break ;
2008-12-08 05:30:24 +00:00
}
}
2008-12-23 11:11:02 +00:00
2015-01-20 12:41:46 +00:00
void CConfigMain : : ChooseSlotPath ( bool isSlotA , TEXIDevices device_type )
2009-02-02 22:29:33 +00:00
{
2015-01-20 12:41:46 +00:00
bool memcard = ( device_type = = EXIDEVICE_MEMORYCARD ) ;
std : : string path ;
std : : string cardname ;
std : : string ext ;
std : : string pathA = SConfig : : GetInstance ( ) . m_strMemoryCardA ;
std : : string pathB = SConfig : : GetInstance ( ) . m_strMemoryCardB ;
if ( ! memcard )
{
pathA = SConfig : : GetInstance ( ) . m_strGbaCartA ;
pathB = SConfig : : GetInstance ( ) . m_strGbaCartB ;
}
SplitPath ( isSlotA ? pathA : pathB , & path , & cardname , & ext ) ;
2013-02-28 04:37:38 +00:00
std : : string filename = WxStrToStr ( wxFileSelector (
2011-01-05 04:35:46 +00:00
_ ( " Choose a file to open " ) ,
2015-01-20 12:41:46 +00:00
StrToWxStr ( path ) ,
StrToWxStr ( cardname ) ,
StrToWxStr ( ext ) ,
memcard ? _ ( " GameCube Memory Cards (*.raw,*.gcp) " ) + " |*.raw;*.gcp " : _ ( " Game Boy Advance Carts (*.gba) " ) + " |*.gba " ) ) ;
2009-02-28 21:30:43 +00:00
2009-02-02 22:29:33 +00:00
if ( ! filename . empty ( ) )
2009-02-28 21:46:04 +00:00
{
2011-08-07 07:17:49 +00:00
if ( File : : Exists ( filename ) )
{
2015-01-20 12:41:46 +00:00
if ( memcard )
{
GCMemcard memorycard ( filename ) ;
if ( ! memorycard . IsValid ( ) )
{
WxUtils : : ShowErrorDialog ( wxString : : Format ( _ ( " Cannot use that file as a memory card. \n %s \n " \
2015-02-15 19:43:31 +00:00
" is not a valid GameCube memory card file " ) , filename . c_str ( ) ) ) ;
2015-01-20 12:41:46 +00:00
return ;
}
}
2011-08-07 07:17:49 +00:00
}
2015-01-20 12:41:46 +00:00
# ifdef _WIN32
if ( ! strncmp ( File : : GetExeDirectory ( ) . c_str ( ) , filename . c_str ( ) , File : : GetExeDirectory ( ) . size ( ) ) )
{
// If the Exe Directory Matches the prefix of the filename, we still need to verify
// that the next character is a directory separator character, otherwise we may create an invalid path
char next_char = filename . at ( File : : GetExeDirectory ( ) . size ( ) ) + 1 ;
if ( next_char = = ' / ' | | next_char = = ' \\ ' )
2013-01-20 23:47:59 +00:00
{
2015-01-20 12:41:46 +00:00
filename . erase ( 0 , File : : GetExeDirectory ( ) . size ( ) + 1 ) ;
filename = " ./ " + filename ;
2013-01-20 23:47:59 +00:00
}
2015-01-20 12:41:46 +00:00
}
2015-01-29 11:34:10 +00:00
std : : replace ( filename . begin ( ) , filename . end ( ) , ' \\ ' , ' / ' ) ;
2015-01-20 12:41:46 +00:00
# endif
2011-08-07 07:17:49 +00:00
2009-02-28 22:01:58 +00:00
// also check that the path isn't used for the other memcard...
2015-01-20 12:41:46 +00:00
if ( filename . compare ( isSlotA ? pathB : pathA ) ! = 0 )
2009-02-28 22:01:58 +00:00
{
2015-01-20 12:41:46 +00:00
if ( memcard )
{
if ( isSlotA )
SConfig : : GetInstance ( ) . m_strMemoryCardA = filename ;
else
SConfig : : GetInstance ( ) . m_strMemoryCardB = filename ;
}
else
{
if ( isSlotA )
SConfig : : GetInstance ( ) . m_strGbaCartA = filename ;
else
SConfig : : GetInstance ( ) . m_strGbaCartB = filename ;
}
2009-02-28 22:01:58 +00:00
2014-07-07 22:47:57 +00:00
if ( Core : : IsRunning ( ) )
2009-02-28 22:01:58 +00:00
{
// Change memcard to the new file
ExpansionInterface : : ChangeDevice (
isSlotA ? 0 : 1 , // SlotA: channel 0, SlotB channel 1
2015-01-20 12:41:46 +00:00
device_type ,
2014-02-17 04:51:41 +00:00
0 ) ; // SP1 is device 2, slots are device 0
2009-02-28 22:01:58 +00:00
}
}
else
2009-02-28 21:46:04 +00:00
{
2015-01-20 12:41:46 +00:00
WxUtils : : ShowErrorDialog ( _ ( " Are you trying to use the same file in both slots? " ) ) ;
2009-02-28 21:46:04 +00:00
}
}
2009-02-02 22:29:33 +00:00
}
2008-12-08 05:30:24 +00:00
2012-03-22 21:52:20 +00:00
void CConfigMain : : ChooseEXIDevice ( wxString deviceName , int deviceNum )
2009-02-28 21:30:43 +00:00
{
TEXIDevices tempType ;
2014-05-17 17:17:28 +00:00
if ( ! deviceName . compare ( _ ( EXIDEV_MEMCARD_STR ) ) )
2011-10-09 10:18:15 +00:00
tempType = EXIDEVICE_MEMORYCARD ;
2014-03-29 06:19:04 +00:00
else if ( ! deviceName . compare ( _ ( EXIDEV_MEMDIR_STR ) ) )
tempType = EXIDEVICE_MEMORYCARDFOLDER ;
2014-05-17 17:17:28 +00:00
else if ( ! deviceName . compare ( _ ( EXIDEV_MIC_STR ) ) )
2009-02-28 21:30:43 +00:00
tempType = EXIDEVICE_MIC ;
2014-05-17 17:17:28 +00:00
else if ( ! deviceName . compare ( EXIDEV_BBA_STR ) )
2009-02-28 21:30:43 +00:00
tempType = EXIDEVICE_ETH ;
2015-01-20 12:41:46 +00:00
else if ( ! deviceName . compare ( EXIDEV_AGP_STR ) )
tempType = EXIDEVICE_AGP ;
2014-05-17 17:17:28 +00:00
else if ( ! deviceName . compare ( _ ( EXIDEV_AM_BB_STR ) ) )
2009-10-19 15:14:48 +00:00
tempType = EXIDEVICE_AM_BASEBOARD ;
2014-05-17 17:17:28 +00:00
else if ( ! deviceName . compare ( EXIDEV_GECKO_STR ) )
2011-01-16 20:04:06 +00:00
tempType = EXIDEVICE_GECKO ;
2014-05-17 17:17:28 +00:00
else if ( ! deviceName . compare ( _ ( DEV_NONE_STR ) ) )
2009-10-19 15:14:48 +00:00
tempType = EXIDEVICE_NONE ;
2009-02-28 21:30:43 +00:00
else
tempType = EXIDEVICE_DUMMY ;
2015-01-20 12:41:46 +00:00
// Gray out the memcard path button if we're not on a memcard or AGP
if ( tempType = = EXIDEVICE_MEMORYCARD | | tempType = = EXIDEVICE_AGP )
2009-02-28 21:30:43 +00:00
GCMemcardPath [ deviceNum ] - > Enable ( ) ;
else if ( deviceNum = = 0 | | deviceNum = = 1 )
GCMemcardPath [ deviceNum ] - > Disable ( ) ;
SConfig : : GetInstance ( ) . m_EXIDevice [ deviceNum ] = tempType ;
2014-07-07 22:47:57 +00:00
if ( Core : : IsRunning ( ) )
2009-02-28 21:30:43 +00:00
{
// Change plugged device! :D
ExpansionInterface : : ChangeDevice (
2014-02-17 04:51:41 +00:00
( deviceNum = = 1 ) ? 1 : 0 , // SlotB is on channel 1, slotA and SP1 are on 0
tempType , // The device enum to change to
( deviceNum = = 2 ) ? 2 : 0 ) ; // SP1 is device 2, slots are device 0
2009-02-28 21:30:43 +00:00
}
}
2009-02-02 22:29:33 +00:00
2009-02-23 09:34:28 +00:00
2009-09-02 21:00:45 +00:00
2008-12-23 11:11:02 +00:00
// Wii settings
2009-02-23 09:34:28 +00:00
// -------------------
2008-12-08 05:30:24 +00:00
void CConfigMain : : WiiSettingsChanged ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
2011-06-02 19:32:34 +00:00
// Wii - SYSCONF settings
2008-12-08 05:30:24 +00:00
case ID_WII_IPL_SSV :
2009-09-14 06:26:49 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.SSV " , WiiScreenSaver - > IsChecked ( ) ) ;
2008-12-08 05:30:24 +00:00
break ;
case ID_WII_IPL_E60 :
2014-10-13 22:24:35 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.E60 " , WiiPAL60 - > IsChecked ( ) ) ;
2008-12-08 05:30:24 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_WII_IPL_AR :
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.AR " , WiiAspectRatio - > GetSelection ( ) ) ;
break ;
case ID_WII_IPL_LNG :
2011-05-05 22:38:07 +00:00
{
int wii_system_lang = WiiSystemLang - > GetSelection ( ) ;
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.LNG " , wii_system_lang ) ;
u8 country_code = GetSADRCountryCode ( wii_system_lang ) ;
2014-03-10 11:30:55 +00:00
if ( ! SConfig : : GetInstance ( ) . m_SYSCONF - > SetArrayData ( " IPL.SADR " , & country_code , 1 ) )
2011-05-05 22:38:07 +00:00
{
2014-07-25 01:46:46 +00:00
WxUtils : : ShowErrorDialog ( _ ( " Failed to update country code in SYSCONF " ) ) ;
2011-05-05 22:38:07 +00:00
}
2010-06-05 01:38:22 +00:00
break ;
2011-05-05 22:38:07 +00:00
}
2010-06-05 01:38:22 +00:00
// Wii - Devices
2010-01-11 11:56:17 +00:00
case ID_WII_SD_CARD :
SConfig : : GetInstance ( ) . m_WiiSDCard = WiiSDCard - > IsChecked ( ) ;
2011-02-11 00:31:37 +00:00
WII_IPC_HLE_Interface : : SDIO_EventNotify ( ) ;
2010-01-11 11:56:17 +00:00
break ;
case ID_WII_KEYBOARD :
SConfig : : GetInstance ( ) . m_WiiKeyboard = WiiKeyboard - > IsChecked ( ) ;
break ;
2008-12-08 05:30:24 +00:00
}
}
2009-02-23 09:34:28 +00:00
2008-12-23 11:11:02 +00:00
// Paths settings
2009-02-23 09:34:28 +00:00
// -------------------
2015-02-15 19:43:31 +00:00
void CConfigMain : : ISOPathsSelectionChanged ( wxCommandEvent & WXUNUSED ( event ) )
2008-12-08 05:30:24 +00:00
{
2013-12-27 23:14:45 +00:00
RemoveISOPath - > Enable ( ISOPaths - > GetSelection ( ) ! = wxNOT_FOUND ) ;
2008-12-08 05:30:24 +00:00
}
void CConfigMain : : AddRemoveISOPaths ( wxCommandEvent & event )
{
if ( event . GetId ( ) = = ID_ADDISOPATH )
{
2011-01-05 04:35:46 +00:00
wxDirDialog dialog ( this , _ ( " Choose a directory to add " ) , wxGetHomeDir ( ) ,
2010-11-22 15:25:59 +00:00
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST ) ;
2008-12-08 05:30:24 +00:00
if ( dialog . ShowModal ( ) = = wxID_OK )
{
if ( ISOPaths - > FindString ( dialog . GetPath ( ) ) ! = - 1 )
2013-04-08 05:16:50 +00:00
{
2014-07-25 01:46:46 +00:00
WxUtils : : ShowErrorDialog ( _ ( " The chosen directory is already in the list. " ) ) ;
2013-04-08 05:16:50 +00:00
}
2008-12-08 05:30:24 +00:00
else
{
bRefreshList = true ;
ISOPaths - > Append ( dialog . GetPath ( ) ) ;
}
}
}
else
{
bRefreshList = true ;
ISOPaths - > Delete ( ISOPaths - > GetSelection ( ) ) ;
2013-12-27 23:14:45 +00:00
// This seems to not be activated on Windows when it should be. wxw bug?
# ifdef _WIN32
ISOPathsSelectionChanged ( wxCommandEvent ( ) ) ;
# endif
2008-12-08 05:30:24 +00:00
}
// Save changes right away
SConfig : : GetInstance ( ) . m_ISOFolder . clear ( ) ;
for ( unsigned int i = 0 ; i < ISOPaths - > GetCount ( ) ; i + + )
2013-02-28 04:37:38 +00:00
SConfig : : GetInstance ( ) . m_ISOFolder . push_back ( WxStrToStr ( ISOPaths - > GetStrings ( ) [ i ] ) ) ;
2008-12-08 05:30:24 +00:00
}
2015-02-15 19:43:31 +00:00
void CConfigMain : : RecursiveDirectoryChanged ( wxCommandEvent & WXUNUSED ( event ) )
2009-04-05 06:46:18 +00:00
{
2010-06-05 01:38:22 +00:00
SConfig : : GetInstance ( ) . m_RecursiveISOFolder = RecursiveISOPath - > IsChecked ( ) ;
2009-04-05 06:46:18 +00:00
bRefreshList = true ;
}
2015-02-15 19:43:31 +00:00
void CConfigMain : : DefaultISOChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
2008-12-08 05:30:24 +00:00
{
2014-10-20 21:49:33 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDefaultISO = WxStrToStr ( DefaultISO - > GetPath ( ) ) ;
2008-12-08 05:30:24 +00:00
}
2015-02-15 19:43:31 +00:00
void CConfigMain : : DVDRootChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
2008-12-08 05:30:24 +00:00
{
2013-02-28 04:37:38 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDVDRoot = WxStrToStr ( DVDRoot - > GetPath ( ) ) ;
2008-12-08 05:30:24 +00:00
}
2015-02-15 19:43:31 +00:00
void CConfigMain : : ApploaderPathChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
2009-12-10 09:16:10 +00:00
{
2013-02-28 04:37:38 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strApploader = WxStrToStr ( ApploaderPath - > GetPath ( ) ) ;
2009-12-10 09:16:10 +00:00
}
2015-02-15 19:43:31 +00:00
void CConfigMain : : NANDRootChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
2011-05-24 19:12:18 +00:00
{
std : : string NANDPath =
2013-02-28 08:39:06 +00:00
SConfig : : GetInstance ( ) . m_NANDPath =
File : : GetUserPath ( D_WIIROOT_IDX , WxStrToStr ( NANDRoot - > GetPath ( ) ) ) ;
NANDRoot - > SetPath ( StrToWxStr ( NANDPath ) ) ;
2011-05-24 19:12:18 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > UpdateLocation ( ) ;
2011-06-05 07:42:40 +00:00
DiscIO : : cUIDsys : : AccessInstance ( ) . UpdateLocation ( ) ;
DiscIO : : CSharedContent : : AccessInstance ( ) . UpdateLocation ( ) ;
2011-05-24 19:12:18 +00:00
main_frame - > UpdateWiiMenuChoice ( ) ;
}
2009-09-02 21:00:45 +00:00
2011-02-02 16:34:12 +00:00
// GFX backend selection
2011-01-31 01:28:32 +00:00
void CConfigMain : : OnSelectionChanged ( wxCommandEvent & ev )
2008-12-08 05:30:24 +00:00
{
2011-01-31 01:28:32 +00:00
g_video_backend = g_available_video_backends [ ev . GetInt ( ) ] ;
2011-02-02 16:34:12 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strVideoBackend = g_video_backend - > GetName ( ) ;
2008-12-08 05:30:24 +00:00
}
2011-01-31 01:28:32 +00:00
void CConfigMain : : OnConfig ( wxCommandEvent & )
2008-12-08 05:30:24 +00:00
{
2011-01-31 01:28:32 +00:00
if ( g_video_backend )
g_video_backend - > ShowConfig ( this ) ;
2008-12-08 05:30:24 +00:00
}
2010-04-22 04:28:34 +00:00
2011-05-05 22:38:07 +00:00
// Change from IPL.LNG value to IPL.SADR country code
inline u8 CConfigMain : : GetSADRCountryCode ( int language )
{
//http://wiibrew.org/wiki/Country_Codes
u8 countrycode = language ;
switch ( countrycode )
{
case 0 : //Japanese
countrycode = 1 ; //Japan
break ;
case 1 : //English
2015-02-18 00:17:34 +00:00
countrycode = 49 ; //USA
2011-05-05 22:38:07 +00:00
break ;
2014-02-17 04:51:41 +00:00
case 2 : //German
2011-05-05 22:38:07 +00:00
countrycode = 78 ; //Germany
break ;
case 3 : //French
countrycode = 77 ; //France
break ;
case 4 : //Spanish
countrycode = 105 ; //Spain
break ;
case 5 : //Italian
countrycode = 83 ; //Italy
break ;
2014-02-17 04:51:41 +00:00
case 6 : //Dutch
2011-05-05 22:38:07 +00:00
countrycode = 94 ; //Netherlands
break ;
case 7 : //Simplified Chinese
case 8 : //Traditional Chinese
countrycode = 157 ; //China
break ;
case 9 : //Korean
countrycode = 136 ; //Korea
break ;
}
return countrycode ;
}