Interface and general: Fixed the hangings and crashes that would occur from repeated Start and Stop, added optional toolbar themes, made the fullscreen mode in the OpenGL plugin more user friendly for Windows users

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1770 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-01-04 21:53:41 +00:00
parent 1ed27a4fc1
commit eb2ce16a6c
31 changed files with 11580 additions and 1104 deletions

View File

@ -66,6 +66,12 @@ void SConfig::SaveSettings()
{
// General
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor);
ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor);
ini.Set("Interface", "Theme", m_LocalCoreStartupParameter.iTheme);
// Core
ini.Set("Core", "HLEBios", m_LocalCoreStartupParameter.bHLEBios);
ini.Set("Core", "UseDynarec", m_LocalCoreStartupParameter.bUseJIT);
@ -77,7 +83,6 @@ void SConfig::SaveSettings()
ini.Set("Core", "OptimizeQuantizers", m_LocalCoreStartupParameter.bOptimizeQuantizers);
ini.Set("Core", "EnableCheats", m_LocalCoreStartupParameter.bEnableCheats);
ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage);
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
ini.Set("Core", "RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer);
ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient);
@ -157,6 +162,12 @@ void SConfig::LoadSettings()
}
{
// General interfance
ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false);
ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false);
ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false);
ini.Get("Interface", "Theme", &m_LocalCoreStartupParameter.iTheme, 0);
// Core
ini.Get("Core", "HLEBios", &m_LocalCoreStartupParameter.bHLEBios, true);
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
@ -168,7 +179,6 @@ void SConfig::LoadSettings()
ini.Get("Core", "OptimizeQuantizers", &m_LocalCoreStartupParameter.bOptimizeQuantizers, true);
ini.Get("Core", "EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false);
ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0);
ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false);
ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false);
ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);

View File

@ -15,22 +15,41 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <string>
//////////////////////////////////////////////////////////////////////////////////////////
// Include
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#include <string> // System
#include <vector>
#include "Globals.h"
#include "Core.h" // Core
#include "Globals.h" // Local
#include "ConfigMain.h"
#include "PluginManager.h"
#include "Frame.h"
//////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Declarations and definitions
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern CFrame* main_frame;
///////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Event table
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BEGIN_EVENT_TABLE(CConfigMain, wxDialog)
EVT_CLOSE(CConfigMain::OnClose)
EVT_BUTTON(ID_CLOSE, CConfigMain::CloseClick)
EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_HIDECURSOR, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_AUTOHIDECURSOR, CConfigMain::CoreSettingsChanged)
EVT_RADIOBOX(ID_INTERFACE_THEME, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_ALLWAYS_HLEBIOS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_USEDYNAREC, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_USEDUALCORE, CConfigMain::CoreSettingsChanged)
@ -38,8 +57,6 @@ EVT_CHECKBOX(ID_LOCKTHREADS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_OPTIMIZEQUANTIZERS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_IDLESKIP, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_ENABLECHEATS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::CoreSettingsChanged)
EVT_CHOICE(ID_GC_SRAM_LNG, CConfigMain::GCSettingsChanged)
EVT_CHOICE(ID_WII_BT_BAR, CConfigMain::WiiSettingsChanged)
@ -66,10 +83,16 @@ EVT_CHOICE(ID_WIIMOTE_CB, CConfigMain::OnSelectionChanged)
EVT_BUTTON(ID_WIIMOTE_CONFIG, CConfigMain::OnConfig)
END_EVENT_TABLE()
////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Window class
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Control refreshing of the ISOs list
bRefreshList = false;
// Load Wii SYSCONF
@ -89,6 +112,8 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
}
CreateGUIControls();
// 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(), wxConvUTF8));
@ -98,227 +123,304 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
CConfigMain::~CConfigMain()
{
}
////////////////////////////////////////////
// ====================================================================
// Enable or disable objects
// -------------
void CConfigMain::UpdateGUI()
{
if(Core::GetState() != Core::CORE_UNINITIALIZED)
{
CorePage->Disable();
GamecubePage->Disable();
WiiPage->Disable();
PathsPage->Disable();
PluginPage->Disable();
}
}
// ==========================
void CConfigMain::CreateGUIControls()
{
Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
MainPage = new wxPanel(Notebook, ID_COREPAGE, wxDefaultPosition, wxDefaultSize);
GeneralPage = new wxPanel(Notebook, ID_GENERALPAGE, wxDefaultPosition, wxDefaultSize);
CorePage = new wxPanel(Notebook, ID_COREPAGE, wxDefaultPosition, wxDefaultSize);
GamecubePage = new wxPanel(Notebook, ID_GAMECUBEPAGE, wxDefaultPosition, wxDefaultSize);
WiiPage = new wxPanel(Notebook, ID_WIIPAGE, wxDefaultPosition, wxDefaultSize);
PathsPage = new wxPanel(Notebook, ID_PATHSPAGE, wxDefaultPosition, wxDefaultSize);
PluginPage = new wxPanel(Notebook, ID_PLUGINPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(MainPage, wxT("Main"));
Notebook->AddPage(GeneralPage, wxT("General"));
Notebook->AddPage(CorePage, wxT("Core"));
Notebook->AddPage(GamecubePage, wxT("Gamecube"));
Notebook->AddPage(WiiPage, wxT("Wii"));
Notebook->AddPage(PathsPage, wxT("Paths"));
Notebook->AddPage(PluginPage, wxT("Plugins"));
//////////////////////////////////
// Main page
// --------
sCore = new wxBoxSizer(wxVERTICAL);
//////////////////////////////////
// General page
// --------
// Basic Settings
sbBasic = new wxStaticBoxSizer(wxVERTICAL, MainPage, wxT("Basic Settings"));
UseDualCore = new wxCheckBox(MainPage, ID_USEDUALCORE, wxT("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDualCore->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
SkipIdle = new wxCheckBox(MainPage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle);
EnableCheats = new wxCheckBox(MainPage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
ConfirmStop = new wxCheckBox(MainPage, ID_INTERFACE_CONFIRMSTOP, wxT("Confirm On Stop"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ConfirmStop->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop);
// Confirm on stop
ConfirmStop = new wxCheckBox(GeneralPage, ID_INTERFACE_CONFIRMSTOP, wxT("Confirm On Stop"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
ConfirmStop->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop);
AutoHideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_AUTOHIDECURSOR, wxT("Auto Hide Cursor"));
AutoHideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor);
HideCursor = new wxCheckBox(GeneralPage, ID_INTERFACE_HIDECURSOR, wxT("Always Hide Cursor"));
HideCursor->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor);
sbBasic->Add(UseDualCore, 0, wxALL, 5);
sbBasic->Add(SkipIdle, 0, wxALL, 5);
sbBasic->Add(EnableCheats, 0, wxALL, 5);
sbBasic->Add(ConfirmStop, 0, wxALL, 5);
// Advanced Settings
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, MainPage, wxT("Advanced Settings"));
AllwaysHLEBIOS = new wxCheckBox(MainPage, ID_ALLWAYS_HLEBIOS, wxT("HLE the BIOS all the time"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
AllwaysHLEBIOS->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios);
UseDynaRec = new wxCheckBox(MainPage, ID_USEDYNAREC, wxT("Enable Dynamic Recompilation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDynaRec->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseJIT);
LockThreads = new wxCheckBox(MainPage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
OptimizeQuantizers = new wxCheckBox(MainPage, ID_OPTIMIZEQUANTIZERS, wxT("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
OptimizeQuantizers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bOptimizeQuantizers);
sbAdvanced->Add(AllwaysHLEBIOS, 0, wxALL, 5);
sbAdvanced->Add(UseDynaRec, 0, wxALL, 5);
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
sbAdvanced->Add(OptimizeQuantizers, 0, wxALL, 5);
// Populate sCore
sCore->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
//sCore->AddStretchSpacer();
sCore->Add(sbAdvanced, 0, wxEXPAND|wxALL, 5);
MainPage->SetSizer(sCore);
sCore->Layout();
// Populate the settings
sbInterface = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Interface Settings"));
sbInterface->Add(ConfirmStop, 0, wxALL, 5);
sbInterface->Add(AutoHideCursor, 0, wxALL, 5);
sbInterface->Add(HideCursor, 0, wxALL, 5);
// ToolTips
ConfirmStop->SetToolTip(wxT("Show a confirmation box before stopping a game."));
AutoHideCursor->SetToolTip(wxT("This will auto hide the cursor in fullscreen mode."));
HideCursor->SetToolTip(wxT("This will always hide the cursor when it's over the rendering window."
" It can be convenient in a Wii game that already has a cursor."
));
//////////////////////////////////
// Gamecube page
// --------
sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, wxT("IPL Settings"));
arrayStringFor_GCSystemLang.Add(wxT("English"));
arrayStringFor_GCSystemLang.Add(wxT("German"));
arrayStringFor_GCSystemLang.Add(wxT("French"));
arrayStringFor_GCSystemLang.Add(wxT("Spanish"));
arrayStringFor_GCSystemLang.Add(wxT("Italian"));
arrayStringFor_GCSystemLang.Add(wxT("Dutch"));
GCSystemLangText = new wxStaticText(GamecubePage, ID_GC_SRAM_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
GCSystemLang->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
// -----------------------------------
// Themes
// -----------
wxArrayString ThemeChoices;
ThemeChoices.Add(wxT("Boomy"));
ThemeChoices.Add(wxT("Vista"));
ThemeChoices.Add(wxT("X-Plastik"));
ThemeChoices.Add(wxT("KDE"));
Theme = new wxRadioBox(GeneralPage, ID_INTERFACE_THEME, wxT("Theme"),
wxDefaultPosition, wxDefaultSize, ThemeChoices, 1, wxRA_SPECIFY_COLS);
sGamecube = new wxBoxSizer(wxVERTICAL);
sGamecubeIPLSettings = new wxGridBagSizer(0, 0);
sGamecubeIPLSettings->Add(GCSystemLangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sGamecubeIPLSettings->Add(GCSystemLang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
sbGamecubeIPLSettings->Add(sGamecubeIPLSettings);
sGamecube->Add(sbGamecubeIPLSettings, 0, wxEXPAND|wxALL, 5);
GamecubePage->SetSizer(sGamecube);
sGamecube->Layout();
// Set selected
Theme->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme);
// Copyright notice
Theme->SetItemToolTip(0, wxT("Created by Milosz Wlazlo [miloszwl@miloszwl.com, miloszwl.deviantart.com]"));
Theme->SetItemToolTip(1, wxT("Created by VistaIcons.com"));
Theme->SetItemToolTip(2, wxT("Created by black_rider and published on ForumW.org > Web Developments"));
Theme->SetItemToolTip(3, wxT("Created by KDE-Look.org"));
// Populate the entire page
sGeneralPage = new wxBoxSizer(wxVERTICAL);
sGeneralPage->Add(sbInterface, 0, wxEXPAND | wxALL, 5);
sGeneralPage->Add(Theme, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxBOTTOM), 5);
GeneralPage->SetSizer(sGeneralPage);
sGeneralPage->Layout();
//////////////////////////////////
// Wii page
// --------
sbWiimoteSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("Wiimote Settings"));
arrayStringFor_WiiSensBarPos.Add(wxT("Bottom")); arrayStringFor_WiiSensBarPos.Add(wxT("Top"));
WiiSensBarPosText = new wxStaticText(WiiPage, ID_WII_BT_BAR_TEXT, wxT("Sensor Bar Position:"), wxDefaultPosition, wxDefaultSize);
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
WiiSensBarPos->SetSelection(m_SYSCONF[BT_BAR]);
WiiLeds = new wxCheckBox(WiiPage, ID_WII_BT_LEDS, wxT("Show Wiimote Leds in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiLeds->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiLeds);
WiiSpeakers = new wxCheckBox(WiiPage, ID_WII_BT_SPEAKERS, wxT("Show Wiimote Speaker status in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiSpeakers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers);
//////////////////////////////////
// Core page
// --------
sCore = new wxBoxSizer(wxVERTICAL);
sbWiiIPLSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("IPL Settings"));
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, wxT("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiScreenSaver->SetValue(m_SYSCONF[IPL_SSV]!=0);
WiiProgressiveScan = new wxCheckBox(WiiPage, ID_WII_IPL_PGS, wxT("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiProgressiveScan->SetValue(m_SYSCONF[IPL_PGS]!=0);
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, wxT("Use EuRGB60 Mode (PAL6)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiEuRGB60->SetValue(m_SYSCONF[IPL_E60]!=0);
arrayStringFor_WiiAspectRatio.Add(wxT("4:3")); arrayStringFor_WiiAspectRatio.Add(wxT("16:9"));
WiiAspectRatioText = new wxStaticText(WiiPage, ID_WII_IPL_AR_TEXT, wxT("Aspect Ratio:"), wxDefaultPosition, wxDefaultSize);
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
WiiAspectRatio->SetSelection(m_SYSCONF[IPL_AR]);
arrayStringFor_WiiSystemLang = arrayStringFor_GCSystemLang;
arrayStringFor_WiiSystemLang.Insert(wxT("Japanese"), 0);
WiiSystemLangText = new wxStaticText(WiiPage, ID_WII_IPL_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
WiiSystemLang->SetSelection(m_SYSCONF[IPL_LNG]);
// Basic Settings
sbBasic = new wxStaticBoxSizer(wxVERTICAL, CorePage, wxT("Basic Settings"));
UseDualCore = new wxCheckBox(CorePage, ID_USEDUALCORE, wxT("Enable Dual Core"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDualCore->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
SkipIdle = new wxCheckBox(CorePage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle);
EnableCheats = new wxCheckBox(CorePage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
// Populate sbWiimoteSettings
sWii = new wxBoxSizer(wxVERTICAL);
sWiimoteSettings = new wxGridBagSizer(0, 0);
sWiimoteSettings->Add(WiiSensBarPosText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiimoteSettings->Add(WiiSensBarPos, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
sWiimoteSettings->Add(WiiLeds, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sWiimoteSettings->Add(WiiSpeakers, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sbWiimoteSettings->Add(sWiimoteSettings);
sWii->Add(sbWiimoteSettings, 0, wxEXPAND|wxALL, 5);
sbBasic->Add(UseDualCore, 0, wxALL, 5);
sbBasic->Add(SkipIdle, 0, wxALL, 5);
sbBasic->Add(EnableCheats, 0, wxALL, 5);
sWiiIPLSettings = new wxGridBagSizer(0, 0);
sWiiIPLSettings->Add(WiiScreenSaver, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(WiiProgressiveScan, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(WiiEuRGB60, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(WiiAspectRatioText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiiIPLSettings->Add(WiiAspectRatio, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
sWiiIPLSettings->Add(WiiSystemLangText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiiIPLSettings->Add(WiiSystemLang, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
sbWiiIPLSettings->Add(sWiiIPLSettings);
sWii->Add(sbWiiIPLSettings, 0, wxEXPAND|wxALL, 5);
WiiPage->SetSizer(sWii);
sWii->Layout();
// Advanced Settings
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, CorePage, wxT("Advanced Settings"));
AllwaysHLEBIOS = new wxCheckBox(CorePage, ID_ALLWAYS_HLEBIOS, wxT("HLE the BIOS all the time"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
AllwaysHLEBIOS->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios);
UseDynaRec = new wxCheckBox(CorePage, ID_USEDYNAREC, wxT("Enable Dynamic Recompilation"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
UseDynaRec->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseJIT);
LockThreads = new wxCheckBox(CorePage, ID_LOCKTHREADS, wxT("Lock threads to cores"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
LockThreads->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bLockThreads);
OptimizeQuantizers = new wxCheckBox(CorePage, ID_OPTIMIZEQUANTIZERS, wxT("Optimize Quantizers"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
OptimizeQuantizers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bOptimizeQuantizers);
sbAdvanced->Add(AllwaysHLEBIOS, 0, wxALL, 5);
sbAdvanced->Add(UseDynaRec, 0, wxALL, 5);
sbAdvanced->Add(LockThreads, 0, wxALL, 5);
sbAdvanced->Add(OptimizeQuantizers, 0, wxALL, 5);
// Populate sCore
sCore->Add(sbBasic, 0, wxEXPAND|wxALL, 5);
//sCore->AddStretchSpacer();
sCore->Add(sbAdvanced, 0, wxEXPAND|wxALL, 5);
CorePage->SetSizer(sCore);
sCore->Layout();
//////////////////////////////////
// Paths page
// --------
sbISOPaths = new wxStaticBoxSizer(wxVERTICAL, PathsPage, wxT("ISO Directories"));
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath->Enable(false);
//////////////////////////////////
// Gamecube page
// --------
sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, GamecubePage, wxT("IPL Settings"));
arrayStringFor_GCSystemLang.Add(wxT("English"));
arrayStringFor_GCSystemLang.Add(wxT("German"));
arrayStringFor_GCSystemLang.Add(wxT("French"));
arrayStringFor_GCSystemLang.Add(wxT("Spanish"));
arrayStringFor_GCSystemLang.Add(wxT("Italian"));
arrayStringFor_GCSystemLang.Add(wxT("Dutch"));
GCSystemLangText = new wxStaticText(GamecubePage, ID_GC_SRAM_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
GCSystemLang = new wxChoice(GamecubePage, ID_GC_SRAM_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_GCSystemLang, 0, wxDefaultValidator);
GCSystemLang->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
DefaultISOText = new wxStaticText(PathsPage, ID_DEFAULTISO_TEXT, wxT("Default ISO:"), wxDefaultPosition, wxDefaultSize);
DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString, wxT("Choose a default ISO:"),
wxString::Format(wxT("All GC/Wii images (gcm, iso, gcz)|*.gcm;*.iso;*.gcz|All files (%s)|%s"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN);
DefaultISO->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.c_str()));
sGamecube = new wxBoxSizer(wxVERTICAL);
sGamecubeIPLSettings = new wxGridBagSizer(0, 0);
sGamecubeIPLSettings->Add(GCSystemLangText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sGamecubeIPLSettings->Add(GCSystemLang, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
sbGamecubeIPLSettings->Add(sGamecubeIPLSettings);
sGamecube->Add(sbGamecubeIPLSettings, 0, wxEXPAND|wxALL, 5);
GamecubePage->SetSizer(sGamecube);
sGamecube->Layout();
DVDRootText = new wxStaticText(PathsPage, ID_DVDROOT_TEXT, wxT("DVD Root:"), wxDefaultPosition, wxDefaultSize);
DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString, wxT("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
DVDRoot->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot.c_str()));
sPaths = new wxBoxSizer(wxVERTICAL);
//////////////////////////////////
// Wii page
// --------
sbWiimoteSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("Wiimote Settings"));
arrayStringFor_WiiSensBarPos.Add(wxT("Bottom")); arrayStringFor_WiiSensBarPos.Add(wxT("Top"));
WiiSensBarPosText = new wxStaticText(WiiPage, ID_WII_BT_BAR_TEXT, wxT("Sensor Bar Position:"), wxDefaultPosition, wxDefaultSize);
WiiSensBarPos = new wxChoice(WiiPage, ID_WII_BT_BAR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSensBarPos, 0, wxDefaultValidator);
WiiSensBarPos->SetSelection(m_SYSCONF[BT_BAR]);
WiiLeds = new wxCheckBox(WiiPage, ID_WII_BT_LEDS, wxT("Show Wiimote Leds in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiLeds->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiLeds);
WiiSpeakers = new wxCheckBox(WiiPage, ID_WII_BT_SPEAKERS, wxT("Show Wiimote Speaker status in status bar"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiSpeakers->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bWiiSpeakers);
sbISOPaths->Add(ISOPaths, 1, wxEXPAND|wxALL, 0);
sbWiiIPLSettings = new wxStaticBoxSizer(wxVERTICAL, WiiPage, wxT("IPL Settings"));
WiiScreenSaver = new wxCheckBox(WiiPage, ID_WII_IPL_SSV, wxT("Enable Screen Saver (burn-in reduction)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiScreenSaver->SetValue(m_SYSCONF[IPL_SSV]!=0);
WiiProgressiveScan = new wxCheckBox(WiiPage, ID_WII_IPL_PGS, wxT("Enable Progressive Scan"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiProgressiveScan->SetValue(m_SYSCONF[IPL_PGS]!=0);
WiiEuRGB60 = new wxCheckBox(WiiPage, ID_WII_IPL_E60, wxT("Use EuRGB60 Mode (PAL6)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
WiiEuRGB60->SetValue(m_SYSCONF[IPL_E60]!=0);
arrayStringFor_WiiAspectRatio.Add(wxT("4:3")); arrayStringFor_WiiAspectRatio.Add(wxT("16:9"));
WiiAspectRatioText = new wxStaticText(WiiPage, ID_WII_IPL_AR_TEXT, wxT("Aspect Ratio:"), wxDefaultPosition, wxDefaultSize);
WiiAspectRatio = new wxChoice(WiiPage, ID_WII_IPL_AR, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiAspectRatio, 0, wxDefaultValidator);
WiiAspectRatio->SetSelection(m_SYSCONF[IPL_AR]);
arrayStringFor_WiiSystemLang = arrayStringFor_GCSystemLang;
arrayStringFor_WiiSystemLang.Insert(wxT("Japanese"), 0);
WiiSystemLangText = new wxStaticText(WiiPage, ID_WII_IPL_LNG_TEXT, wxT("System Language:"), wxDefaultPosition, wxDefaultSize);
WiiSystemLang = new wxChoice(WiiPage, ID_WII_IPL_LNG, wxDefaultPosition, wxDefaultSize, arrayStringFor_WiiSystemLang, 0, wxDefaultValidator);
WiiSystemLang->SetSelection(m_SYSCONF[IPL_LNG]);
sISOButtons = new wxBoxSizer(wxHORIZONTAL);
sISOButtons->AddStretchSpacer(1);
sISOButtons->Add(AddISOPath, 0, wxALL, 0);
sISOButtons->Add(RemoveISOPath, 0, wxALL, 0);
sbISOPaths->Add(sISOButtons, 0, wxEXPAND|wxALL, 5);
sPaths->Add(sbISOPaths, 1, wxEXPAND|wxALL, 5);
// Populate sbWiimoteSettings
sWii = new wxBoxSizer(wxVERTICAL);
sWiimoteSettings = new wxGridBagSizer(0, 0);
sWiimoteSettings->Add(WiiSensBarPosText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiimoteSettings->Add(WiiSensBarPos, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);
sWiimoteSettings->Add(WiiLeds, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sWiimoteSettings->Add(WiiSpeakers, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sbWiimoteSettings->Add(sWiimoteSettings);
sWii->Add(sbWiimoteSettings, 0, wxEXPAND|wxALL, 5);
sOtherPaths = new wxGridBagSizer(0, 0);
sOtherPaths->AddGrowableCol(1);
sOtherPaths->Add(DefaultISOText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sOtherPaths->Add(DefaultISO, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sOtherPaths->Add(DVDRootText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sOtherPaths->Add(DVDRoot, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sPaths->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5);
PathsPage->SetSizer(sPaths);
sPaths->Layout();
sWiiIPLSettings = new wxGridBagSizer(0, 0);
sWiiIPLSettings->Add(WiiScreenSaver, wxGBPosition(0, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(WiiProgressiveScan, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(WiiEuRGB60, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5);
sWiiIPLSettings->Add(WiiAspectRatioText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiiIPLSettings->Add(WiiAspectRatio, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
sWiiIPLSettings->Add(WiiSystemLangText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sWiiIPLSettings->Add(WiiSystemLang, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
sbWiiIPLSettings->Add(sWiiIPLSettings);
sWii->Add(sbWiiIPLSettings, 0, wxEXPAND|wxALL, 5);
WiiPage->SetSizer(sWii);
sWii->Layout();
//////////////////////////////////
// Plugins page
// --------
sbGraphicsPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Graphics"));
GraphicSelection = new wxChoice(PluginPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
GraphicConfig = new wxButton(PluginPage, ID_GRAPHIC_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
sbDSPPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("DSP"));
DSPSelection = new wxChoice(PluginPage, ID_DSP_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
DSPConfig = new wxButton(PluginPage, ID_DSP_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
//////////////////////////////////
// Paths page
// --------
sbISOPaths = new wxStaticBoxSizer(wxVERTICAL, PathsPage, wxT("ISO Directories"));
ISOPaths = new wxListBox(PathsPage, ID_ISOPATHS, wxDefaultPosition, wxDefaultSize, arrayStringFor_ISOPaths, wxLB_SINGLE, wxDefaultValidator);
AddISOPath = new wxButton(PathsPage, ID_ADDISOPATH, wxT("Add..."), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath = new wxButton(PathsPage, ID_REMOVEISOPATH, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0);
RemoveISOPath->Enable(false);
sbPadPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Pad"));
PADSelection = new wxChoice(PluginPage, ID_PAD_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
PADConfig = new wxButton(PluginPage, ID_PAD_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
DefaultISOText = new wxStaticText(PathsPage, ID_DEFAULTISO_TEXT, wxT("Default ISO:"), wxDefaultPosition, wxDefaultSize);
DefaultISO = new wxFilePickerCtrl(PathsPage, ID_DEFAULTISO, wxEmptyString, wxT("Choose a default ISO:"),
wxString::Format(wxT("All GC/Wii images (gcm, iso, gcz)|*.gcm;*.iso;*.gcz|All files (%s)|%s"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr),
wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN);
DefaultISO->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.c_str()));
sbWiimotePlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Wiimote"));
WiimoteSelection = new wxChoice(PluginPage, ID_WIIMOTE_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
WiimoteConfig = new wxButton(PluginPage, ID_WIIMOTE_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
DVDRootText = new wxStaticText(PathsPage, ID_DVDROOT_TEXT, wxT("DVD Root:"), wxDefaultPosition, wxDefaultSize);
DVDRoot = new wxDirPickerCtrl(PathsPage, ID_DVDROOT, wxEmptyString, wxT("Choose a DVD root directory:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
DVDRoot->SetPath(wxString::FromAscii(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot.c_str()));
sPlugins = new wxBoxSizer(wxVERTICAL);
sbGraphicsPlugin->Add(GraphicSelection, 1, wxEXPAND|wxALL, 5);
sbGraphicsPlugin->Add(GraphicConfig, 0, wxALL, 5);
sPlugins->Add(sbGraphicsPlugin, 0, wxEXPAND|wxALL, 5);
sPaths = new wxBoxSizer(wxVERTICAL);
sbDSPPlugin->Add(DSPSelection, 1, wxEXPAND|wxALL, 5);
sbDSPPlugin->Add(DSPConfig, 0, wxALL, 5);
sPlugins->Add(sbDSPPlugin, 0, wxEXPAND|wxALL, 5);
sbISOPaths->Add(ISOPaths, 1, wxEXPAND|wxALL, 0);
sISOButtons = new wxBoxSizer(wxHORIZONTAL);
sISOButtons->AddStretchSpacer(1);
sISOButtons->Add(AddISOPath, 0, wxALL, 0);
sISOButtons->Add(RemoveISOPath, 0, wxALL, 0);
sbISOPaths->Add(sISOButtons, 0, wxEXPAND|wxALL, 5);
sPaths->Add(sbISOPaths, 1, wxEXPAND|wxALL, 5);
sOtherPaths = new wxGridBagSizer(0, 0);
sOtherPaths->AddGrowableCol(1);
sOtherPaths->Add(DefaultISOText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sOtherPaths->Add(DefaultISO, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sOtherPaths->Add(DVDRootText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sOtherPaths->Add(DVDRoot, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sPaths->Add(sOtherPaths, 0, wxEXPAND|wxALL, 5);
PathsPage->SetSizer(sPaths);
sPaths->Layout();
//////////////////////////////////
// Plugins page
// --------
sbGraphicsPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Graphics"));
GraphicSelection = new wxChoice(PluginPage, ID_GRAPHIC_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
GraphicConfig = new wxButton(PluginPage, ID_GRAPHIC_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
sbDSPPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Toolbar_PluginDSP"));
DSPSelection = new wxChoice(PluginPage, ID_DSP_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
DSPConfig = new wxButton(PluginPage, ID_DSP_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
sbPadPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Pad"));
PADSelection = new wxChoice(PluginPage, ID_PAD_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
PADConfig = new wxButton(PluginPage, ID_PAD_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
sbWiimotePlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginPage, wxT("Wiimote"));
WiimoteSelection = new wxChoice(PluginPage, ID_WIIMOTE_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
WiimoteConfig = new wxButton(PluginPage, ID_WIIMOTE_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
sPlugins = new wxBoxSizer(wxVERTICAL);
sbGraphicsPlugin->Add(GraphicSelection, 1, wxEXPAND|wxALL, 5);
sbGraphicsPlugin->Add(GraphicConfig, 0, wxALL, 5);
sPlugins->Add(sbGraphicsPlugin, 0, wxEXPAND|wxALL, 5);
sbDSPPlugin->Add(DSPSelection, 1, wxEXPAND|wxALL, 5);
sbDSPPlugin->Add(DSPConfig, 0, wxALL, 5);
sPlugins->Add(sbDSPPlugin, 0, wxEXPAND|wxALL, 5);
sbPadPlugin->Add(PADSelection, 1, wxEXPAND|wxALL, 5);
sbPadPlugin->Add(PADConfig, 0, wxALL, 5);
sPlugins->Add(sbPadPlugin, 0, wxEXPAND|wxALL, 5);
sbWiimotePlugin->Add(WiimoteSelection, 1, wxEXPAND|wxALL, 5);
sbWiimotePlugin->Add(WiimoteConfig, 0, wxALL, 5);
sPlugins->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
PluginPage->SetSizer(sPlugins);
sPlugins->Layout();
sbPadPlugin->Add(PADSelection, 1, wxEXPAND|wxALL, 5);
sbPadPlugin->Add(PADConfig, 0, wxALL, 5);
sPlugins->Add(sbPadPlugin, 0, wxEXPAND|wxALL, 5);
sbWiimotePlugin->Add(WiimoteSelection, 1, wxEXPAND|wxALL, 5);
sbWiimotePlugin->Add(WiimoteConfig, 0, wxALL, 5);
sPlugins->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
PluginPage->SetSizer(sPlugins);
sPlugins->Layout();
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
@ -330,6 +432,8 @@ void CConfigMain::CreateGUIControls()
sMain->Add(Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
UpdateGUI();
this->SetSizer(sMain);
this->Layout();
@ -376,7 +480,25 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
{
case ID_ALLWAYS_HLEBIOS:
case ID_INTERFACE_CONFIRMSTOP: // Interface
SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop = ConfirmStop->IsChecked();
break;
case ID_INTERFACE_AUTOHIDECURSOR:
if (AutoHideCursor->IsChecked()) HideCursor->SetValue(!AutoHideCursor->IsChecked()); // Update the other one
SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked();
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked();
break;
case ID_INTERFACE_HIDECURSOR:
if (HideCursor->IsChecked()) AutoHideCursor->SetValue(!HideCursor->IsChecked()); // Update the other one
SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor = AutoHideCursor->IsChecked();
SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor = HideCursor->IsChecked();
break;
case ID_INTERFACE_THEME:
SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme = Theme->GetSelection();
main_frame->InitBitmaps();
break;
case ID_ALLWAYS_HLEBIOS: // Core
SConfig::GetInstance().m_LocalCoreStartupParameter.bHLEBios = AllwaysHLEBIOS->IsChecked();
break;
case ID_USEDYNAREC:
@ -397,9 +519,6 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
case ID_ENABLECHEATS:
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats = EnableCheats->IsChecked();
break;
case ID_INTERFACE_CONFIRMSTOP:
SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop = ConfirmStop->IsChecked();
break;
}
}

View File

@ -36,6 +36,7 @@ class CConfigMain
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
virtual ~CConfigMain();
void OnClick(wxMouseEvent& event);
void CloseClick(wxCommandEvent& event);
void OnSelectionChanged(wxCommandEvent& event);
void OnConfig(wxCommandEvent& event);
@ -44,18 +45,21 @@ class CConfigMain
private:
DECLARE_EVENT_TABLE();
DECLARE_EVENT_TABLE();
wxBoxSizer* sGeneralPage; // General Settings
wxCheckBox* ConfirmStop, * AutoHideCursor, *HideCursor;
wxRadioBox* Theme;
wxBoxSizer* sCore; // Core settings
wxStaticBoxSizer* sbBasic, *sbAdvanced, *sbInterface;
wxCheckBox* UseDualCore;
wxCheckBox* SkipIdle;
wxCheckBox* EnableCheats;
wxCheckBox* ConfirmStop;
wxCheckBox* AllwaysHLEBIOS;
wxCheckBox* UseDynaRec;
wxCheckBox* UseDualCore;
wxCheckBox* LockThreads;
wxCheckBox* OptimizeQuantizers;
wxCheckBox* SkipIdle;
wxCheckBox* EnableCheats;
wxBoxSizer* sGamecube; // GC settings
wxStaticBoxSizer* sbGamecubeIPLSettings;
@ -81,7 +85,7 @@ class CConfigMain
wxNotebook *Notebook;
wxPanel *GeneralPage;
wxPanel *MainPage;
wxPanel *CorePage;
wxPanel *GamecubePage;
wxPanel *WiiPage;
wxPanel *PathsPage;
@ -210,7 +214,8 @@ class CConfigMain
ID_GC_SRAM_LNG_TEXT,
ID_GC_SRAM_LNG,
ID_INTERFACE_CONFIRMSTOP, // Interface settings
ID_INTERFACE_CONFIRMSTOP, ID_INTERFACE_HIDECURSOR, ID_INTERFACE_AUTOHIDECURSOR,
ID_INTERFACE_THEME, // Interface settings
ID_WII_BT_BAR_TEXT,
ID_WII_BT_BAR,
@ -248,7 +253,7 @@ class CConfigMain
ID_GRAPHIC_CB
};
void CreateGUIControls();
void CreateGUIControls(); void UpdateGUI();
void OnClose(wxCloseEvent& event);
void CoreSettingsChanged(wxCommandEvent& event);
void GCSettingsChanged(wxCommandEvent& event);

File diff suppressed because it is too large Load Diff

View File

@ -16,11 +16,33 @@
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////
// Includes
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifndef __FRAME_H_
#define __FRAME_H_
#include <wx/wx.h>
#include <wx/wx.h> // wxWidgets
#include <wx/busyinfo.h>
#include <wx/mstream.h>
////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// A shortcut to access the bitmaps
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name))
inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
{
wxMemoryInputStream is(data, length);
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
}
////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// Class declarations
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CGameListCtrl;
class CFrame : public wxFrame
{
@ -33,21 +55,26 @@ class CFrame : public wxFrame
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
void* GetRenderHandle() {
#ifdef _WIN32
return(m_Panel->GetHandle());
#else
return this;
#endif
}
void* GetRenderHandle()
{
#ifdef _WIN32
return(m_Panel->GetHandle());
#else
return this;
#endif
}
virtual ~CFrame();
// These have to be public
wxStatusBar* m_pStatusBar;
void InitBitmaps();
void DoStop();
bool bRenderToMain;
// --------------------------------
// ---------------------------------------
// Wiimote leds
// ---------
// ---------------
void ModifyStatusBar();
void CreateDestroy(int Case);
void CreateLeds(); void CreateSpeakers();
@ -60,25 +87,24 @@ class CFrame : public wxFrame
wxStaticBitmap *m_StatBmp[7];
u8 g_Leds[4]; u8 g_Leds_[4];
u8 g_Speakers[3]; u8 g_Speakers_[3];
// ---------
// ---------------
private:
wxBoxSizer* sizerPanel;
CGameListCtrl* m_GameListCtrl;
wxPanel* m_Panel;
wxToolBar* theToolBar;
wxToolBar* TheToolBar;
wxToolBarToolBase* m_ToolPlay;
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
// Music mod
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef MUSICMOD
wxToolBarToolBase* mm_ToolMute, * mm_ToolPlay, * mm_ToolLog;
void MM_UpdateGUI(); void MM_PopulateGUI(); void MM_InitBitmaps();
void MM_UpdateGUI(); void MM_PopulateGUI(); void MM_InitBitmaps(int Theme);
void MM_OnPlay();
void MM_OnMute(wxCommandEvent& event);
void MM_OnPause(wxCommandEvent& event);
@ -88,7 +114,7 @@ class CFrame : public wxFrame
///////////////////////////////////
enum EBitmaps
enum EToolbar
{
Toolbar_FileOpen,
Toolbar_Refresh,
@ -96,31 +122,41 @@ class CFrame : public wxFrame
Toolbar_Play,
Toolbar_Stop,
Toolbar_Pause,
Toolbar_FullScreen,
Toolbar_PluginOptions,
Toolbar_PluginGFX,
Toolbar_PluginDSP,
Toolbar_PluginPAD,
Toolbar_FullScreen,
Toolbar_Wiimote,
Toolbar_Help,
#ifdef MUSICMOD
#ifdef MUSICMOD // Music modification
Toolbar_Log, Toolbar_PluginDSP_Dis, Toolbar_Log_Dis,
#endif
Bitmaps_Max,
END
EToolbar_Max
};
enum EBitmapsThemes
{
BOOMY,
VISTA,
XPLASTIK,
KDE,
THEMES_MAX
};
enum WiimoteBitmaps // Wiimote speaker bitmaps
{
CREATELEDS = END,
CREATELEDS,
DESTROYLEDS,
CREATESPEAKERS,
DESTROYSPEAKERS
};
wxBitmap m_Bitmaps[Bitmaps_Max];
wxBitmap m_BitmapsMenu[Bitmaps_Max];
wxBitmap m_Bitmaps[EToolbar_Max];
wxBitmap m_BitmapsMenu[EToolbar_Max];
void InitBitmaps();
void PopulateToolbar(wxToolBar* toolBar);
void RecreateToolbar();
void CreateMenu();
@ -158,6 +194,8 @@ class CFrame : public wxFrame
void OnToggleToolbar(wxCommandEvent& event);
void OnToggleStatusbar(wxCommandEvent& event);
void OnKeyDown(wxKeyEvent& event); void OnKeyUp(wxKeyEvent& event);
void OnDoubleClick(wxMouseEvent& event); void OnMotion(wxMouseEvent& event);
void OnHostMessage(wxCommandEvent& event);
void OnMemcard(wxCommandEvent& event); // Misc
@ -178,9 +216,18 @@ class CFrame : public wxFrame
void UpdateGUI();
// Old function that could be cool
// Double click and mouse move options
double m_fLastClickTime, m_iLastMotionTime; int LastMouseX, LastMouseY;
#if wxUSE_TIMER
void Update();
void OnTimer(wxTimerEvent& WXUNUSED(event)) { Update(); }
wxTimer m_timer;
#endif
// Event table
DECLARE_EVENT_TABLE();
};
////////////////////////////////
#endif // __FRAME_H_

View File

@ -0,0 +1,775 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Windowses
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CFrame is the main parent window. Inside CFrame there is an m_Panel that is the parent for
the rendering window (when we render to the main window). In Windows the rendering window is
created by giving CreateWindow() m_Panel->GetHandle() as parent window and creating a new
child window to m_Panel. The new child window handle that is returned by CreateWindow() can
be accessed from Core::GetWindowHandle().
///////////////////////////////////////////////*/
// ----------------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------------
#include "Globals.h" // Local
#include "Frame.h"
#include "ConfigMain.h"
#include "PluginManager.h"
#include "MemcardManager.h"
#include "CheatsWindow.h"
#include "AboutDolphin.h"
#include "GameListCtrl.h"
#include "BootManager.h"
#include "Common.h" // Common
#include "FileUtil.h"
#include "Timer.h"
#include "Config.h" // Core
#include "Core.h"
#include "HW/DVDInterface.h"
#include "Plugins/Plugin_PAD.h"
#include "State.h"
#include "VolumeHandler.h"
#include <wx/datetime.h> // wxWidgets
// ----------------------------------------------------------------------------
// Resources
// ----------------------------------------------------------------------------
extern "C" {
#include "../resources/Dolphin.c" // Dolphin icon
#include "../resources/toolbar_browse.c"
#include "../resources/toolbar_file_open.c"
#include "../resources/toolbar_fullscreen.c"
#include "../resources/toolbar_help.c"
#include "../resources/toolbar_pause.c"
#include "../resources/toolbar_play.c"
#include "../resources/toolbar_plugin_dsp.c"
#include "../resources/toolbar_plugin_gfx.c"
#include "../resources/toolbar_plugin_options.c"
#include "../resources/toolbar_plugin_pad.c"
#include "../resources/toolbar_refresh.c"
#include "../resources/toolbar_stop.c"
#include "../resources/Boomy.h" // Theme packages
#include "../resources/Vista.h"
#include "../resources/X-Plastik.h"
#include "../resources/KDE.h"
};
// ----------------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------------
static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
// ----------------------------------------------------------------------------
// Other Windows
// ----------------------------------------------------------------------------
wxCheatsWindow* CheatsWindow;
// =======================================================
// Create menu items
// -------------
void CFrame::CreateMenu()
{
delete m_pMenuBar;
m_pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
// file menu
wxMenu* fileMenu = new wxMenu;
m_pMenuItemOpen = fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
fileMenu->Append(wxID_REFRESH, _T("&Refresh"));
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Alt+F4"));
m_pMenuBar->Append(fileMenu, _T("&File"));
// Emulation menu
wxMenu* emulationMenu = new wxMenu;
m_pMenuItemPlay = emulationMenu->Append(IDM_PLAY, _T("&Play"));
m_pMenuChangeDisc = emulationMenu->Append(IDM_CHANGEDISC, _T("Change disc"));
m_pMenuItemStop = emulationMenu->Append(IDM_STOP, _T("&Stop"));
emulationMenu->AppendSeparator();
wxMenu *saveMenu = new wxMenu;
wxMenu *loadMenu = new wxMenu;
m_pMenuItemLoad = emulationMenu->AppendSubMenu(saveMenu, _T("&Load State"));
m_pMenuItemSave = emulationMenu->AppendSubMenu(loadMenu, _T("Sa&ve State"));
for (int i = 1; i < 10; i++) {
saveMenu->Append(IDM_LOADSLOT1 + i - 1, wxString::Format(_T("Slot %i\tF%i"), i, i));
loadMenu->Append(IDM_SAVESLOT1 + i - 1, wxString::Format(_T("Slot %i\tShift+F%i"), i, i));
}
m_pMenuBar->Append(emulationMenu, _T("&Emulation"));
// Options menu
wxMenu* pOptionsMenu = new wxMenu;
m_pPluginOptions = pOptionsMenu->Append(IDM_CONFIG_MAIN, _T("Co&nfigure..."));
pOptionsMenu->AppendSeparator();
pOptionsMenu->Append(IDM_CONFIG_GFX_PLUGIN, _T("&Toolbar_PluginGFX settings"));
pOptionsMenu->Append(IDM_CONFIG_DSP_PLUGIN, _T("&Toolbar_PluginDSP settings"));
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&Toolbar_PluginPAD settings"));
#ifdef _WIN32
pOptionsMenu->AppendSeparator();
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter"));
#endif
m_pMenuBar->Append(pOptionsMenu, _T("&Options"));
// Misc menu
wxMenu* miscMenu = new wxMenu;
miscMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("View &toolbar"));
miscMenu->Check(IDM_TOGGLE_TOOLBAR, true);
miscMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _T("View &statusbar"));
miscMenu->Check(IDM_TOGGLE_STATUSBAR, true);
miscMenu->AppendSeparator();
miscMenu->Append(IDM_MEMCARD, _T("&Memcard manager"));
miscMenu->Append(IDM_CHEATS, _T("Action &Replay Manager"));
m_pMenuBar->Append(miscMenu, _T("&Misc"));
// Help menu
wxMenu* helpMenu = new wxMenu;
/*helpMenu->Append(wxID_HELP, _T("&Help"));
re-enable when there's something useful to display*/
helpMenu->Append(IDM_HELPWEBSITE, _T("Dolphin &web site"));
helpMenu->Append(IDM_HELPGOOGLECODE, _T("Dolphin at &Google Code"));
helpMenu->AppendSeparator();
helpMenu->Append(IDM_HELPABOUT, _T("&About..."));
m_pMenuBar->Append(helpMenu, _T("&Help"));
// Associate the menu bar with the frame
SetMenuBar(m_pMenuBar);
}
// =======================================================
// Create toolbar items
// -------------
void CFrame::PopulateToolbar(wxToolBar* toolBar)
{
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
toolBar->SetToolBitmapSize(wxSize(w, h));
toolBar->AddTool(wxID_OPEN, _T("Open"), m_Bitmaps[Toolbar_FileOpen], _T("Open file..."));
toolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh"));
toolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory..."));
toolBar->AddSeparator();
m_pToolPlay = toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
toolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop"));
#ifdef _WIN32
toolBar->AddTool(IDM_TOGGLE_FULLSCREEN, _T("Fullscr."), m_Bitmaps[Toolbar_FullScreen], _T("Toggle Fullscreen"));
#endif
toolBar->AddSeparator();
toolBar->AddTool(IDM_CONFIG_MAIN, _T("Config"), m_Bitmaps[Toolbar_PluginOptions], _T("Configure..."));
toolBar->AddTool(IDM_CONFIG_GFX_PLUGIN, _T("Gfx"), m_Bitmaps[Toolbar_PluginGFX], _T("Gfx settings"));
toolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
toolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("Pad"), m_Bitmaps[Toolbar_PluginPAD], _T("Pad settings"));
toolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings"));
toolBar->AddSeparator();
toolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
//////////////////////////////////////////////////
// Music mod
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef MUSICMOD
MM_PopulateGUI();
#endif
///////////////////////
// after adding the buttons to the toolbar, must call Realize() to reflect
// the changes
toolBar->Realize();
}
//////////////////////////////////////////////////
// Delete and recreate the toolbar
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CFrame::RecreateToolbar()
{
wxToolBarBase* toolBar = GetToolBar();
long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE;
delete toolBar;
SetToolBar(NULL);
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
TheToolBar = CreateToolBar(style, ID_TOOLBAR);
PopulateToolbar(TheToolBar);
SetToolBar(TheToolBar);
UpdateGUI();
}
///////////////////////////////
void CFrame::InitBitmaps()
{
// Get selected theme
int Theme = SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme;
/* Save memory by only having one set of bitmaps loaded at any time. I mean, they are still
in the exe, which is in memory, but at least we wont make another copy of all of them. */
switch (Theme)
{
case BOOMY:
{
// These are stored as 48x48
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(toolbar_file_open_png);
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(toolbar_refresh_png);
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(toolbar_browse_png);
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(toolbar_play_png);
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(toolbar_stop_png);
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(toolbar_pause_png);
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(toolbar_plugin_options_png);
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(toolbar_plugin_gfx_png);
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(toolbar_plugin_dsp_png);
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(toolbar_fullscreen_png);
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(toolbar_help_png);
// Scale the 48x48 bitmaps to 24x24
for (size_t n = Toolbar_FileOpen; n <= Toolbar_Help; n++)
{
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(24, 24));
}
}
break;
case VISTA:
{
// These are stored as 24x24 and need no scaling
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open1_png);
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh1_png);
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse1_png);
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play1_png);
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop1_png);
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause1_png);
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options1_png);
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx1_png);
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP1_png);
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad1_png);
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote1_png);
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen1_png);
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help1_png);
}
break;
case XPLASTIK:
{
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open2_png);
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh2_png);
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse2_png);
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play2_png);
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop2_png);
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause2_png);
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options2_png);
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx2_png);
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP2_png);
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad2_png);
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote2_png);
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen2_png);
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help2_png);
}
break;
case KDE:
{
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open3_png);
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh3_png);
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse3_png);
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play3_png);
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop3_png);
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause3_png);
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options3_png);
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx3_png);
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP3_png);
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad3_png);
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote3_png);
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen3_png);
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help3_png);
}
break;
default: PanicAlert("Theme selection went wrong");
}
//////////////////////////////////////////////////
// Music modification
// -------------
#ifdef MUSICMOD
MM_InitBitmaps(Theme);
#endif
//////////////////////////
// Update in case the bitmap has been updated
if (GetToolBar() != NULL) RecreateToolbar();
}
// =======================================================
// Open file to boot or for changing disc
// -------------
void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
{
// Don't allow this for an initialized core
//if (Core::GetState() != Core::CORE_UNINITIALIZED)
// return;
DoOpen(true);
}
void CFrame::DoOpen(bool Boot)
{
wxString path = wxFileSelector(
_T("Select the file to load"),
wxEmptyString, wxEmptyString, wxEmptyString,
wxString::Format
(
_T("All GC/Wii files (elf, dol, gcm, iso)|*.elf;*.dol;*.gcm;*.iso;*.gcz|All files (%s)|%s"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
if (!path)
{
return;
}
// Should we boot a new game or just change the disc?
if(Boot)
{
BootManager::BootCore(std::string(path.ToAscii()));
}
else
{
// Get the current ISO name
std::string OldName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strFilename;
// Change the iso and make sure it's a valid file
if(!VolumeHandler::SetVolumeName(std::string(path.ToAscii())))
{
PanicAlert("The file you selected is not a valid ISO file. Please try again.");
// Put back the old one
VolumeHandler::SetVolumeName(OldName);
}
// Yes it is a valid ISO file
else
{
std::string OldID = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID;
std::string NewID = VolumeHandler::GetVolume()->GetUniqueID();
// Warn the user if he's selecting a completely different game
if(OldID != NewID)
PanicAlert(
"The new game ID '%s' is not the same as the old game ID '%s'."
" It is not recommended that you change the disc to another game this way."
" It may crash your game. If you want to play another game you"
" have to Stop this game and Start a new game."
, NewID.c_str(), OldID.c_str()
);
// Save the new ISO file name
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strFilename = std::string(path.ToAscii());
}
}
}
void CFrame::OnChangeDisc(wxCommandEvent& WXUNUSED (event))
{
DVDInterface::SetLidOpen(true);
DoOpen(false);
DVDInterface::SetLidOpen(false);
}
// =============
void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
{
Close(true);
}
void CFrame::OnClose(wxCloseEvent& event)
{
// Don't forget the skip of the window won't be destroyed
event.Skip();
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
Core::Stop();
UpdateGUI();
}
}
void CFrame::OnHelp(wxCommandEvent& event)
{
switch (event.GetId())
{
case IDM_HELPABOUT:
{
AboutDolphin frame(this);
frame.ShowModal();
break;
}
case IDM_HELPWEBSITE:
File::Launch("http://www.dolphin-emu.com/");
break;
case IDM_HELPGOOGLECODE:
File::Launch("http://code.google.com/p/dolphin-emu/");
break;
}
}
// =======================================================
// Play button
// -------------
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
{
#ifdef MUSICMOD // Music modification
MM_OnPlay();
#endif
// shuffle2: wxBusyInfo is meant to be created on the stack
// and only stay around for the life of the scope it's in.
// If that is not what we want, find another solution. I don't
// think such a dialog is needed anyways, so maybe kill it?
wxBusyInfo bootingDialog(wxString::FromAscii("Booting..."), this);
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
if (Core::GetState() == Core::CORE_RUN)
{
Core::SetState(Core::CORE_PAUSE);
}
else
{
Core::SetState(Core::CORE_RUN);
}
UpdateGUI();
}
// Start the selected ISO
else if (m_GameListCtrl->GetSelectedISO() != 0)
{
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
}
/* Start the default ISO, or if we don't have a default ISO, start the last
started ISO */
else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() &&
wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter.
m_strDefaultGCM.c_str(), wxConvUTF8)))
{
BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM);
}
else if (!SConfig::GetInstance().m_LastFilename.empty() &&
wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8)))
{
BootManager::BootCore(SConfig::GetInstance().m_LastFilename);
}
}
// =============
void CFrame::DoStop()
{
if (Core::GetState() != Core::CORE_UNINITIALIZED)
{
Core::Stop();
/* This is needed to let GetState() == CORE_UNINITIALIZED together with the
"delete g_pThread" in Core.cpp. Todo: Please feel free to fix it some other way. */
//PanicAlert("%i", (int)bRenderToMain);
#ifdef _WIN32
if (bRenderToMain)
while(Core::GetState() != Core::CORE_UNINITIALIZED) Sleep(10);
#endif
UpdateGUI();
}
}
void CFrame::OnStop(wxCommandEvent& WXUNUSED (event))
{
// Ask for confirmation in case the user accidently clicked Stop
bool answer;
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
{
answer = AskYesNo("Are you sure you want to stop the current emulation?",
"Confirm", wxYES_NO);
}
else
{
answer = true;
}
if (answer) DoStop();
}
void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event))
{
if (m_GameListCtrl)
{
m_GameListCtrl->Update();
}
}
void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
{
CConfigMain ConfigMain(this);
ConfigMain.ShowModal();
if (ConfigMain.bRefreshList)
m_GameListCtrl->Update();
}
void CFrame::OnPluginGFX(wxCommandEvent& WXUNUSED (event))
{
CPluginManager::GetInstance().OpenConfig(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str()
);
}
void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
{
CPluginManager::GetInstance().OpenConfig(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
);
}
void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
{
CPluginManager::GetInstance().OpenConfig(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str()
);
}
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
{
CPluginManager::GetInstance().OpenConfig(
GetHandle(),
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin.c_str()
);
}
void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event))
{
m_GameListCtrl->BrowseForDirectory();
}
void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event))
{
CMemcardManager MemcardManager(this);
MemcardManager.ShowModal();
}
void CFrame::OnShow_CheatsWindow(wxCommandEvent& WXUNUSED (event))
{
CheatsWindow = new wxCheatsWindow(this, wxDefaultPosition, wxSize(600, 390));
}
// =======================================================
/* Toogle fullscreen. In Windows the fullscreen mode is accomplished by expanding the m_Panel to cover
the entire screen (when we render to the main window). */
// -------------
void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
{
ShowFullScreen(true);
UpdateGUI();
}
void CFrame::OnToggleDualCore(wxCommandEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore = !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore;
SConfig::GetInstance().SaveSettings();
}
void CFrame::OnToggleSkipIdle(wxCommandEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle = !SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle;
SConfig::GetInstance().SaveSettings();
}
void CFrame::OnLoadState(wxCommandEvent& event)
{
int id = event.GetId();
int slot = id - IDM_LOADSLOT1 + 1;
State_Load(slot);
}
void CFrame::OnResize(wxSizeEvent& event)
{
DoMoveIcons(); // In FrameWiimote.cpp
event.Skip();
}
void CFrame::OnSaveState(wxCommandEvent& event)
{
int id = event.GetId();
int slot = id - IDM_SAVESLOT1 + 1;
State_Save(slot);
}
// =======================================================
// Let us enable and disable the toolbar
// -------------
void CFrame::OnToggleToolbar(wxCommandEvent& event)
{
wxToolBarBase* toolBar = GetToolBar();
if (event.IsChecked())
{
CFrame::RecreateToolbar();
}
else
{
delete toolBar;
SetToolBar(NULL);
}
this->SendSizeEvent();
}
// ===================
// =======================================================
// Let us enable and disable the status bar
// -------------
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
{
if (event.IsChecked())
m_pStatusBar->Show();
else
m_pStatusBar->Hide();
this->SendSizeEvent();
}
// ===================
// =======================================================
// Update the enabled/disabled status
// -------------
void CFrame::UpdateGUI()
{
#ifdef MUSICMOD
MM_UpdateGUI();
#endif
// Save status
bool initialized = Core::GetState() != Core::CORE_UNINITIALIZED;
bool running = Core::GetState() == Core::CORE_RUN;
bool paused = Core::GetState() == Core::CORE_PAUSE;
// Make sure that we have a toolbar
if (GetToolBar() != NULL)
{
// Enable/disable the Config and Stop buttons
//GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized);
GetToolBar()->EnableTool(wxID_OPEN, !initialized);
GetToolBar()->EnableTool(wxID_REFRESH, !initialized); // Don't allow refresh when we don't show the list
GetToolBar()->EnableTool(IDM_STOP, running || paused);
}
// File
m_pMenuItemOpen->Enable(!initialized);
// Emulation
m_pMenuItemStop->Enable(running || paused);
m_pMenuItemLoad->Enable(initialized);
m_pMenuItemSave->Enable(initialized);
m_pPluginOptions->Enable(!running && !paused);
// Misc
m_pMenuChangeDisc->Enable(initialized);
if (running)
{
if (GetToolBar() != NULL)
{
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
m_pToolPlay->SetShortHelp(_("Pause"));
m_pToolPlay->SetLabel(_("Pause"));
}
m_pMenuItemPlay->SetText(_("&Pause"));
}
else
{
if (GetToolBar() != NULL)
{
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
m_pToolPlay->SetShortHelp(_("Play"));
m_pToolPlay->SetLabel(_("Play"));
}
m_pMenuItemPlay->SetText(_("&Play"));
}
if (GetToolBar() != NULL) GetToolBar()->Realize();
if (!initialized)
{
if (m_GameListCtrl && !m_GameListCtrl->IsShown())
{
m_GameListCtrl->Enable();
m_GameListCtrl->Show();
sizerPanel->FitInside(m_Panel);
}
}
else
{
if (m_GameListCtrl && m_GameListCtrl->IsShown())
{
m_GameListCtrl->Disable();
m_GameListCtrl->Hide();
}
}
TheToolBar->Realize();
}

View File

@ -109,6 +109,8 @@ enum
IDM_UPDATEBREAKPOINTS,
IDM_HOST_MESSAGE,
IDM_MPANEL, ID_STATUSBAR,
ID_TOOLBAR = 500,
LIST_CTRL = 1000
};

View File

@ -15,6 +15,10 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Includes
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#include <vector>
#include <string>
#include "svnrev.h"
@ -42,7 +46,12 @@
#include "LogWindow.h"
#include "ExtendedTrace.h"
#include "BootManager.h"
////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Declarations and definitions
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IMPLEMENT_APP(DolphinApp)
#if defined(HAVE_WX) && HAVE_WX
@ -79,134 +88,150 @@ LONG WINAPI MyUnhandledExceptionFilter(LPEXCEPTION_POINTERS e) {
return EXCEPTION_CONTINUE_SEARCH;
}
#endif
///////////////////////////////////
// The `main program' equivalent, creating the windows and returning the
// main frame
/////////////////////////////////////////////////////////////
/* The `main program' equivalent that creates the mai nwindow and return the main frame */
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool DolphinApp::OnInit()
{
DetectCPU();
#if defined _DEBUG && defined _WIN32
int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF;
_CrtSetDbgFlag(tmpflag);
#endif
#if defined(HAVE_WX) && HAVE_WX
RegisterMsgAlertHandler(&wxMsgAlert);
#endif
#ifdef _WIN32
EXTENDEDTRACEINITIALIZE(".");
SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
// TODO: if First Boot
if (!cpu_info.bSSE2)
{
MessageBox(0, _T("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n"), "Dolphin", MB_ICONINFORMATION);
return false;
}
#else
if (!cpu_info.bSSE2)
{
printf("%s", "Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n");
exit(0);
}
#endif
// ============
// Check for debugger
// Declarations and definitions
bool UseDebugger = false;
bool UseLogger = false;
bool LoadElf = false; wxString ElfFile;
#if wxUSE_CMDLINE_PARSER
wxCmdLineEntryDesc cmdLineDesc[] =
{
// Detect CPU info and write it to the cpu_info struct
DetectCPU();
//
#if defined _DEBUG && defined _WIN32
int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF;
_CrtSetDbgFlag(tmpflag);
#endif
// Register message box handler
#if defined(HAVE_WX) && HAVE_WX
RegisterMsgAlertHandler(&wxMsgAlert);
#endif
// ------------------------------------------
// Show CPU message
// ---------------
#ifdef _WIN32
EXTENDEDTRACEINITIALIZE(".");
SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter);
// TODO: if First Boot
if (!cpu_info.bSSE2)
{
wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP
},
{
wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")
},
{
wxCMD_LINE_SWITCH, _T("l"), _T("logger"), _T("Opens The Logger")
},
{
wxCMD_LINE_OPTION, _T("e"), _T("elf"), _T("Loads an elf file"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_NONE
MessageBox(0, _T("Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n"), "Dolphin", MB_ICONINFORMATION);
return false;
}
};
#else
if (!cpu_info.bSSE2)
{
printf("%s", "Hi,\n\nDolphin requires that your CPU has support for SSE2 extensions.\n"
"Unfortunately your CPU does not support them, so Dolphin will not run.\n\n"
"Sayonara!\n");
exit(0);
}
#endif
// ---------------
#if defined(__APPLE__)
// check to see if ~/Library/Application Support/Dolphin exists; if not, create it
char AppSupportDir[MAXPATHLEN];
snprintf(AppSupportDir, sizeof(AppSupportDir), "%s/Library/Application Support", getenv("HOME"));
if (!File::Exists(AppSupportDir) || !File::IsDirectory(AppSupportDir))
PanicAlert("Could not open ~/Library/Application Support");
strlcat(AppSupportDir, "/Dolphin", sizeof(AppSupportDir));
if (!File::Exists(AppSupportDir))
File::CreateDir(AppSupportDir);
if (!File::IsDirectory(AppSupportDir))
PanicAlert("~/Library/Application Support/Dolphin exists, but is not a directory");
chdir(AppSupportDir);
// ------------------------------------------
// Parse command lines
// ---------------
#if wxUSE_CMDLINE_PARSER
wxCmdLineEntryDesc cmdLineDesc[] =
{
{
wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP
},
{
wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")
},
{
wxCMD_LINE_SWITCH, _T("l"), _T("logger"), _T("Opens The Logger")
},
{
wxCMD_LINE_OPTION, _T("e"), _T("elf"), _T("Loads an elf file"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
{
wxCMD_LINE_NONE
}
};
if (!File::Exists("User")) File::CreateDir("User");
if (!File::Exists("User/GC")) File::CreateDir("User/GC");
// HACK: Get rid of bogus osx param
if (argc > 1 && wxString(argv[argc - 1]).StartsWith(_("-psn_"))) {
delete argv[argc-1];
argv[argc-1] = NULL;
argc--;
}
#endif
#if defined(__APPLE__)
// check to see if ~/Library/Application Support/Dolphin exists; if not, create it
char AppSupportDir[MAXPATHLEN];
snprintf(AppSupportDir, sizeof(AppSupportDir), "%s/Library/Application Support", getenv("HOME"));
if (!File::Exists(AppSupportDir) || !File::IsDirectory(AppSupportDir))
PanicAlert("Could not open ~/Library/Application Support");
// Gets the passed media files from command line
wxCmdLineParser parser(cmdLineDesc, argc, argv);
strlcat(AppSupportDir, "/Dolphin", sizeof(AppSupportDir));
if (!File::Exists(AppSupportDir))
File::CreateDir(AppSupportDir);
if (!File::IsDirectory(AppSupportDir))
PanicAlert("~/Library/Application Support/Dolphin exists, but is not a directory");
chdir(AppSupportDir);
// Get filenames from the command line
if (parser.Parse() != 0)
{
return false;
}
if (!File::Exists("User")) File::CreateDir("User");
if (!File::Exists("User/GC")) File::CreateDir("User/GC");
// HACK: Get rid of bogus osx param
if (argc > 1 && wxString(argv[argc - 1]).StartsWith(_("-psn_"))) {
delete argv[argc-1];
argv[argc-1] = NULL;
argc--;
}
#endif
UseDebugger = parser.Found(_T("debugger"));
UseLogger = parser.Found(_T("logger"));
LoadElf = parser.Found(_T("elf"), &ElfFile);
// Gets the passed media files from command line
wxCmdLineParser parser(cmdLineDesc, argc, argv);
if( LoadElf && ElfFile == wxEmptyString )
PanicAlert("You did not specify a file name");
// Get filenames from the command line
if (parser.Parse() != 0)
{
return false;
}
// ============
#endif
UseDebugger = parser.Found(_T("debugger"));
UseLogger = parser.Found(_T("logger"));
LoadElf = parser.Found(_T("elf"), &ElfFile);
if( LoadElf && ElfFile == wxEmptyString )
PanicAlert("You did not specify a file name");
// ============
#endif
// Load CONFIG_FILE settings
SConfig::GetInstance().LoadSettings();
wxInitAllImageHandlers();
// Create the main frame window
#ifdef _DEBUG
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
#else
const char *title = "Dolphin SVN R " SVN_REV_STR;
#endif
// Enable the PNG image handler
wxInitAllImageHandlers();
// Create the window title
#ifdef _DEBUG
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
#else
const char *title = "Dolphin SVN R " SVN_REV_STR;
#endif
// ---------------------------------------------------------------------------------------
// If we are debugging let use save the main window position and size
// TODO: Save position and size on exit
// ---------
// ------------
IniFile ini;
ini.Load(DEBUGGER_CONFIG_FILE);
@ -216,7 +241,7 @@ bool DolphinApp::OnInit()
ini.Get("MainWindow", "y", &y, 100);
ini.Get("MainWindow", "w", &w, 600);
ini.Get("MainWindow", "h", &h, 800);
// ---------
// -------------------
if(UseDebugger)
{
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
@ -227,9 +252,10 @@ bool DolphinApp::OnInit()
main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
wxPoint(100, 100), wxSize(800, 600));
}
// ---------
// ------------------
// Create debugger
// Create debugging window
if (UseDebugger)
{
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, main_frame);
@ -237,15 +263,19 @@ bool DolphinApp::OnInit()
}
if(!UseDebugger && UseLogger)
{
#ifdef LOGGING
// We aren't using debugger, just logger
// Should be fine for a local copy
CLogWindow* m_LogWindow = new CLogWindow(main_frame);
m_LogWindow->Show(true);
#endif
}
#ifdef LOGGING
// We aren't using debugger, just logger
// Should be fine for a local copy
CLogWindow* m_LogWindow = new CLogWindow(main_frame);
m_LogWindow->Show(true);
#endif
}
// First check if we have a elf command line
// ---------------------------------------------------
// Check the autoboot options.
// ---------------------
// First check if we have a elf command line. Todo: Should we place this under #if wxUSE_CMDLINE_PARSER?
if (LoadElf && ElfFile != wxEmptyString)
{
BootManager::BootCore(std::string(ElfFile.ToAscii()));
@ -267,7 +297,9 @@ bool DolphinApp::OnInit()
BootManager::BootCore(SConfig::GetInstance().m_LastFilename);
}
}
// ---------------------
// Set main parent window
SetTopWindow(main_frame);
return true;
}
@ -277,6 +309,8 @@ void DolphinApp::OnEndSession()
{
SConfig::GetInstance().SaveSettings();
}
/////////////////////////////////////// Main window created
/////////////////////////////////////////////////////////////
/* We declare this here instead of in Common/MsgHandler.cpp because we want to keep Common
@ -361,6 +395,9 @@ void Host_UpdateBreakPointView()
}
/////////////////////////////////////////////////////////////
/* Update Wiimote status bar */
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Host_UpdateLeds(int led_bits) {
// Convert it to a simpler byte format
main_frame->g_Leds[0] = led_bits >> 0;
@ -376,7 +413,8 @@ void Host_UpdateSpeakerStatus(int index, int speaker_bits) {
main_frame->UpdateSpeakers();
}
void Host_UpdateStatus() {
void Host_UpdateStatus()
{
// Debugging
//std::string Tmp = ArrayToString(main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
//std::string Tmp2 = ArrayToString(main_frame->g_Speakers_, sizeof(main_frame->g_Speakers_));
@ -391,6 +429,8 @@ void Host_UpdateStatus() {
memcpy(main_frame->g_Speakers_, main_frame->g_Speakers, sizeof(main_frame->g_Speakers));
}
}
///////////////////////////
void Host_UpdateMemoryView()
{}

View File

@ -22,6 +22,7 @@ if wxenv['HAVE_WX']:
'ARCodeAddEdit.cpp',
'ConfigMain.cpp',
'Frame.cpp',
'FrameTools.cpp',
'GameListCtrl.cpp',
'Globals.cpp',
'ISOFile.cpp',

View File

@ -9,8 +9,8 @@
Const: yes
*/
#ifndef _WXINCLUDE_MYHEADER_H_
#define _WXINCLUDE_MYHEADER_H_
#ifndef _WXINCLUDE_MYHEADER_0_H_
#define _WXINCLUDE_MYHEADER_0_H_
static const unsigned char Toolbar_Log_png[] = {
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff