diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
index f62e4b3863..75e4c56c63 100644
--- a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
+++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
@@ -20,28 +20,30 @@ AudioCommonConfig ac_Config;
// Load from given file
void AudioCommonConfig::Load(IniFile &file) {
- file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
- file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
- file.Get("Config", "EnableJIT", &m_EnableJIT, true);
- file.Get("Config", "Volume", &m_Volume, 75);
+ Section& config = file["Config"];
+ config.Get("EnableDTKMusic", &m_EnableDTKMusic, true);
+ config.Get("EnableThrottle", &m_EnableThrottle, true);
+ config.Get("EnableJIT", &m_EnableJIT, true);
+ config.Get("Volume", &m_Volume, 75);
#ifdef _WIN32
- file.Get("Config", "Backend", &sBackend, BACKEND_DIRECTSOUND);
+ config.Get("Backend", &sBackend, BACKEND_DIRECTSOUND);
#elif defined(__APPLE__)
std::string temp;
- file.Get("Config", "Backend", &temp, BACKEND_COREAUDIO);
+ config.Get("Backend", &temp, BACKEND_COREAUDIO);
strncpy(sBackend, temp.c_str(), 128);
#else // linux
- file.Get("Config", "Backend", &sBackend, BACKEND_ALSA);
+ config.Get("Backend", &sBackend, BACKEND_ALSA);
#endif
}
// Set the values for the file
void AudioCommonConfig::Set(IniFile &file) {
- file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
- file.Set("Config", "EnableThrottle", m_EnableThrottle);
- file.Set("Config", "EnableJIT", m_EnableJIT);
- file.Set("Config", "Backend", sBackend);
- file.Set("Config", "Volume", m_Volume);
+ Section& config = file["Config"];
+ config.Set("EnableDTKMusic", m_EnableDTKMusic);
+ config.Set("EnableThrottle", m_EnableThrottle);
+ config.Set("EnableJIT", m_EnableJIT);
+ config.Set("Backend", sBackend);
+ config.Set("Volume", m_Volume);
}
// Update according to the values (stream/mixer)
diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index d10537c069..d037b90e1d 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -471,14 +471,6 @@
RelativePath=".\Src\PluginDSP.h"
>
-
-
-
-
@@ -514,10 +506,6 @@
RelativePath="..\..\PluginSpecs\pluginspecs_dsp.h"
>
-
-
diff --git a/Source/Core/Common/Src/CommonPaths.h b/Source/Core/Common/Src/CommonPaths.h
index 1a3b5168d1..5adff7038e 100644
--- a/Source/Core/Common/Src/CommonPaths.h
+++ b/Source/Core/Common/Src/CommonPaths.h
@@ -132,7 +132,6 @@
// Plugin files
#define DEFAULT_GFX_PLUGIN PLUGIN_PREFIX "Plugin_VideoOGL" PLUGIN_SUFFIX
#define DEFAULT_DSP_PLUGIN PLUGIN_PREFIX "Plugin_DSP_HLE" PLUGIN_SUFFIX
-#define DEFAULT_PAD_PLUGIN PLUGIN_PREFIX "Plugin_GCPadNew" PLUGIN_SUFFIX
#define DEFAULT_WIIMOTE_PLUGIN PLUGIN_PREFIX "Plugin_Wiimote" PLUGIN_SUFFIX
// Sys files
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp
index 04f08168a9..e604f70ab7 100644
--- a/Source/Core/Common/Src/IniFile.cpp
+++ b/Source/Core/Common/Src/IniFile.cpp
@@ -16,510 +16,239 @@
// http://code.google.com/p/dolphin-emu/
// see IniFile.h
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include "StringUtil.h"
#include "IniFile.h"
-IniFile::IniFile()
-{}
-
-IniFile::~IniFile()
-{}
-
-Section::Section()
- : lines(), name(""), comment("") {}
-
-
-Section::Section(const std::string& _name)
- : lines(), name(_name), comment("") {}
-
-
-Section::Section(const Section& other)
+template
+void StripChars(std::string& str, const S space)
{
- name = other.name;
- comment = other.comment;
- lines = other.lines;
+ const size_t start = str.find_first_not_of(space);
+
+ if (str.npos == start)
+ str.clear();
+ else
+ str = str.substr(start, str.find_last_not_of(space) - start + 1);
}
-const Section* IniFile::GetSection(const char* sectionName) const
+bool Section::Get(const std::string& key, std::string* const val, const std::string& def) const
{
- for (std::vector::const_iterator iter = sections.begin(); iter != sections.end(); ++iter)
- if (!strcasecmp(iter->name.c_str(), sectionName))
- return (&(*iter));
- return 0;
-}
-
-Section* IniFile::GetSection(const char* sectionName)
-{
- for (std::vector::iterator iter = sections.begin(); iter != sections.end(); ++iter)
- if (!strcasecmp(iter->name.c_str(), sectionName))
- return (&(*iter));
- return 0;
-}
-
-Section* IniFile::GetOrCreateSection(const char* sectionName)
-{
- Section* section = GetSection(sectionName);
-
- if (!section)
+ const const_iterator f = find(key);
+ if (f != end())
{
- sections.push_back(Section(sectionName));
- section = §ions[sections.size() - 1];
+ *val = f->second;
+ return true;
}
-
- return(section);
-}
-
-
-bool IniFile::DeleteSection(const char* sectionName)
-{
- Section* s = GetSection(sectionName);
-
- if (!s)
- {
- return false;
- }
-
- for (std::vector::iterator iter = sections.begin(); iter != sections.end(); ++iter)
- {
- if (&(*iter) == s)
- {
- sections.erase(iter);
- return true;
- }
- }
-
+ if (false == def.empty())
+ *val = def;
return false;
}
-void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const
+void Section::Set(const std::string& key, const std::string& val, const std::string& def)
{
- //
- int FirstEquals = (int)line.find("=", 0);
- int FirstCommentChar = -1;
- // Comments
- //if (FirstCommentChar < 0) {FirstCommentChar = (int)line.find(";", FirstEquals > 0 ? FirstEquals : 0);}
- if (FirstCommentChar < 0) {FirstCommentChar = (int)line.find("#", FirstEquals > 0 ? FirstEquals : 0);}
- if (FirstCommentChar < 0) {FirstCommentChar = (int)line.find("//", FirstEquals > 0 ? FirstEquals : 0);}
-
- // Allow preservation of spacing before comment
- if (FirstCommentChar > 0)
+ if (val != def)
+ operator[](key) = val;
+ else
{
- while (line[FirstCommentChar - 1] == ' ' || line[FirstCommentChar - 1] == 9) // 9 == tab
- {
- FirstCommentChar--;
- }
- }
-
- if ((FirstEquals >= 0) && ((FirstCommentChar < 0) || (FirstEquals < FirstCommentChar)))
- {
- // Yes, a valid line!
- *keyOut = StripSpaces(line.substr(0, FirstEquals));
- if (commentOut) *commentOut = FirstCommentChar > 0 ? line.substr(FirstCommentChar) : std::string("");
- if (valueOut) *valueOut = StripQuotes(StripSpaces(line.substr(FirstEquals + 1, FirstCommentChar - FirstEquals - 1)));
+ iterator f = find(key);
+ if (f != end())
+ erase(f);
}
}
-std::string* IniFile::GetLine(Section* section, const char* key, std::string* valueOut, std::string* commentOut)
+bool IniFile::Save(const std::string& filename) const
{
- for (std::vector::iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
- {
- std::string& line = *iter;
- std::string lineKey;
- ParseLine(line, &lineKey, valueOut, commentOut);
-
- if (!strcasecmp(lineKey.c_str(), key))
- {
- return &line;
- }
- }
-
- return 0;
+ return Save(filename.c_str());
}
-bool IniFile::Exists(const char* const sectionName, const char* key) const
+bool IniFile::Save(const char filename[]) const
{
-
- const Section* const section = GetSection(sectionName);
- if (!section)
+ std::ofstream file;
+ file.open(filename);
+ if (file.is_open())
+ {
+ Save(file);
+ file.close();
+ return true;
+ }
+ else
return false;
-
- for (std::vector::const_iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
- {
- std::string lineKey;
- ParseLine(*iter, &lineKey, NULL, NULL);
-
- if (!strcasecmp(lineKey.c_str(), key))
- {
- return true;
- }
- }
-
- return false;
}
-void IniFile::SetLines(const char* sectionName, const std::vector &lines)
+void IniFile::Save(std::ostream& file) const
{
- Section* section = GetOrCreateSection(sectionName);
- section->lines.clear();
-
- for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
+ const_iterator
+ si = begin(),
+ se = end();
+ for ( ; si != se; ++si )
{
- section->lines.push_back(*iter);
+ // skip a line at new sections
+ file << "\n[" << si->first << "]\n";
+ si->second.Save(file);
}
}
-
-bool IniFile::DeleteKey(const char* sectionName, const char* key)
+void Section::Save(std::ostream& file) const
{
- Section* section = GetSection(sectionName);
-
- if (!section)
+ if (m_use_lines) // this is used when GetLines or SetLines has been called
{
- return false;
- }
-
- std::string* line = GetLine(section, key, 0, 0);
-
- for (std::vector::iterator liter = section->lines.begin(); liter != section->lines.end(); ++liter)
- {
- if (line == &(*liter))
- {
- section->lines.erase(liter);
- return true;
- }
- }
-
- return false; //shouldn't happen
-}
-
-// Return a list of all keys in a section
-bool IniFile::GetKeys(const char* sectionName, std::vector& keys) const
-{
- const Section* section = GetSection(sectionName);
-
- if (!section)
- {
- return false;
- }
-
- keys.clear();
-
- for (std::vector::const_iterator liter = section->lines.begin(); liter != section->lines.end(); ++liter)
- {
- std::string key;
- ParseLine(*liter, &key, 0, 0);
- keys.push_back(key);
- }
-
- return true;
-}
-
-// Return a list of all lines in a section
-bool IniFile::GetLines(const char* sectionName, std::vector& lines) const
-{
- const Section* section = GetSection(sectionName);
- if (!section)
- return false;
-
- lines.clear();
- for (std::vector::const_iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
- {
- std::string line = StripSpaces(*iter);
- int commentPos = (int)line.find('#');
- if (commentPos == 0)
- {
- continue;
- }
-
- if (commentPos != (int)std::string::npos)
- {
- line = StripSpaces(line.substr(0, commentPos));
- }
-
- lines.push_back(line);
- }
-
- return true;
-}
-
-
-void IniFile::SortSections()
-{
- std::sort(sections.begin(), sections.end());
-}
-
-bool IniFile::Load(const char* filename)
-{
- // Maximum number of letters in a line
- static const int MAX_BYTES = 1024*32;
-
- sections.clear();
- sections.push_back(Section(""));
- // first section consists of the comments before the first real section
-
- // Open file
- std::ifstream in;
- in.open(filename, std::ios::in);
-
- if (in.fail()) return false;
-
- while (!in.eof())
- {
- char templine[MAX_BYTES];
- in.getline(templine, MAX_BYTES);
- std::string line = templine;
-
-#ifndef _WIN32
- // Check for CRLF eol and convert it to LF
- if (!line.empty() && line.at(line.size()-1) == '\r')
- {
- line.erase(line.size()-1);
- }
-#endif
-
- if (in.eof()) break;
-
- if (line.size() > 0)
- {
- if (line[0] == '[')
- {
- size_t endpos = line.find("]");
-
- if (endpos != std::string::npos)
- {
- // New section!
- std::string sub = line.substr(1, endpos - 1);
- sections.push_back(Section(sub));
-
- if (endpos + 1 < line.size())
- {
- sections[sections.size() - 1].comment = line.substr(endpos + 1);
- }
- }
- }
- else
- {
- sections[sections.size() - 1].lines.push_back(line);
- }
- }
- }
-
- in.close();
- return true;
-}
-
-bool IniFile::Save(const char* filename)
-{
- std::ofstream out;
- out.open(filename, std::ios::out);
-
- if (out.fail())
- {
- return false;
- }
-
- for (std::vector::const_iterator iter = sections.begin(); iter != sections.end(); ++iter)
- {
- const Section& section = *iter;
-
- if (section.name != "")
- {
- out << "[" << section.name << "]" << section.comment << std::endl;
- }
-
- for (std::vector::const_iterator liter = section.lines.begin(); liter != section.lines.end(); ++liter)
- {
- std::string s = *liter;
- out << s << std::endl;
- }
- }
-
- out.close();
- return true;
-}
-
-void IniFile::Set(const char* sectionName, const char* key, const char* newValue)
-{
- Section* section = GetOrCreateSection(sectionName);
- std::string value, comment;
- std::string* line = GetLine(section, key, &value, &comment);
-
- if (line)
- {
- // Change the value - keep the key and comment
- *line = StripSpaces(key) + " = " + newValue + comment;
+ std::vector::const_iterator
+ i = m_lines.begin(),
+ e = m_lines.end();
+ for ( ; i!=e; ++i)
+ file << *i << '\n';
}
else
{
- // The key did not already exist in this section - let's add it.
- section->lines.push_back(std::string(key) + " = " + newValue);
- }
-}
-
-void IniFile::Set(const char* sectionName, const char* key, const std::vector& newValues)
-{
- std::string temp;
-
- // Join the strings with ,
- std::vector::const_iterator it;
- for (it = newValues.begin(); it != newValues.end(); ++it) {
-
- temp = (*it) + ",";
- }
-
- // remove last ,
- temp.resize(temp.length() - 1);
-
- Set(sectionName, key, temp.c_str());
-}
-
-void IniFile::Set(const char* sectionName, const char* key, u32 newValue)
-{
- Set(sectionName, key, StringFromFormat("0x%08x", newValue).c_str());
-}
-
-
-void IniFile::Set(const char* sectionName, const char* key, int newValue)
-{
- Set(sectionName, key, StringFromInt(newValue).c_str());
-}
-
-
-void IniFile::Set(const char* sectionName, const char* key, bool newValue)
-{
- Set(sectionName, key, StringFromBool(newValue).c_str());
-}
-
-bool IniFile::Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue)
-{
- Section* section = GetSection(sectionName);
-
- if (!section)
- {
- if (defaultValue)
+ Section::const_iterator
+ vi = begin(),
+ ve = end();
+ for ( ; vi!=ve; ++vi)
{
- *value = defaultValue;
+ file << vi->first << " = ";
+ // if value has quotes or whitespace, surround it with quotes
+ if (vi->second.find_first_of("\"\t ") != std::string::npos)
+ file << '"' << vi->second << '"';
+ else
+ file << vi->second;
+ file << '\n';
}
- return false;
}
+}
- std::string* line = GetLine(section, key, value, 0);
+bool IniFile::Load(const std::string& filename)
+{
+ return Load(filename.c_str());
+}
- if (!line)
+bool IniFile::Load(const char filename[])
+{
+ std::ifstream file;
+ file.open(filename);
+ if (file.is_open())
{
- if (defaultValue)
+ Load(file);
+ file.close();
+ return true;
+ }
+ else
+ return false;
+}
+
+void IniFile::Load(std::istream& file)
+{
+ std::vector lines;
+
+ Section sectmp;
+ Section* section = §mp;
+
+ std::string line;
+ while (std::getline(file, line)) // read a line
+ {
+ if (line.size())
{
- *value = defaultValue;
+ switch (line[0])
+ {
+ // section
+ case '[' :
+ section->m_lines = lines;
+ // kinda odd trimming
+ StripChars(line, "][\t\r ");
+ section = &(*this)[line];
+ lines.clear();
+ break;
+
+ // key/value
+ default :
+ {
+ std::istringstream ss(line);
+
+ std::string key; std::getline(ss, key, '=');
+ std::string val; std::getline(ss, val);
+
+ StripChars(val, "\t\r ");
+ // handle quote surrounded values
+ if (val.length() > 1)
+ if ('"' == val[0])
+ val.assign(val.begin()+1, val.end()-1);
+
+ StripChars(key, "\t\r ");
+ (*section)[key] = val;
+ }
+ //break; // no break
+
+ // comment
+ case '#' :
+ case ';' :
+ lines.push_back(line);
+ break;
+ }
}
- return false;
}
-
- return true;
+ //Clean();
}
-
-bool IniFile::Get(const char* sectionName, const char* key, std::vector& values)
+//
+// IniFile :: Clean
+//
+// remove empty key/values and sections
+// after trying to access ini sections/values with the [] operator, they are automatically allocated
+// this deletes the empty stuff
+//
+void IniFile::Clean()
{
-
- std::string temp;
- bool retval = Get(sectionName, key, &temp, 0);
-
- if (! retval || temp.empty()) {
- return false;
- }
-
-
- // ignore starting , if any
- size_t subStart = temp.find_first_not_of(",");
- size_t subEnd;
-
- // split by ,
- while (subStart != std::string::npos) {
-
- // Find next ,
- subEnd = temp.find_first_of(",", subStart);
- if (subStart != subEnd)
- // take from first char until next ,
- values.push_back(StripSpaces(temp.substr(subStart, subEnd - subStart)));
-
- // Find the next non , char
- subStart = temp.find_first_not_of(",", subEnd);
- }
-
- return true;
-}
-
-bool IniFile::Get(const char* sectionName, const char* key, int* value, int defaultValue)
-{
- std::string temp;
- bool retval = Get(sectionName, key, &temp, 0);
-
- if (retval && TryParseInt(temp.c_str(), value))
+ iterator
+ i = begin(),
+ e = end();
+ for ( ; i != e; )
{
- return true;
+ Section::iterator
+ si = i->second.begin(),
+ se = i->second.end();
+ for ( ; si != se; )
+ {
+ if (si->second.empty())
+ i->second.erase( si++ );
+ else
+ ++si;
+ }
+ if (i->second.empty() && i->second.m_lines.empty())
+ erase( i++ );
+ else
+ ++i;
}
-
- *value = defaultValue;
- return false;
}
-
-bool IniFile::Get(const char* sectionName, const char* key, u32* value, u32 defaultValue)
+bool IniFile::Exists(const std::string& section) const
{
- std::string temp;
- bool retval = Get(sectionName, key, &temp, 0);
-
- if (retval && TryParseUInt(temp.c_str(), value))
- {
- return true;
- }
-
- *value = defaultValue;
- return false;
+ return find(section) != end();
}
-
-bool IniFile::Get(const char* sectionName, const char* key, bool* value, bool defaultValue)
+void IniFile::Delete(const std::string& section)
{
- std::string temp;
- bool retval = Get(sectionName, key, &temp, 0);
-
- if (retval && TryParseBool(temp.c_str(), value))
- {
- return true;
- }
-
- *value = defaultValue;
- return false;
+ const iterator f = find(section);
+ if (end() != f)
+ erase(f);
}
+bool Section::Exists(const std::string& key) const
+{
+ return find(key) != end();
+}
-// TODO: Keep this code below?
-/*
- int main()
- {
- IniFile ini;
- ini.Load("my.ini");
- ini.Set("Hej", "A", "amaskdfl");
- ini.Set("Mossa", "A", "amaskdfl");
- ini.Set("Aissa", "A", "amaskdfl");
- //ini.Read("my.ini");
- std::string x;
- ini.Get("Hej", "B", &x, "boo");
- ini.DeleteKey("Mossa", "A");
- ini.DeleteSection("Mossa");
- ini.SortSections();
- ini.Save("my.ini");
- //UpdateVars(ini);
- return 0;
- }
- */
+void Section::Delete(const std::string& key)
+{
+ const iterator f = find(key);
+ if (end() != f)
+ erase(f);
+}
+
+void Section::SetLines(const std::vector& lines)
+{
+ m_lines = lines;
+ m_use_lines = true;
+}
+
+void Section::GetLines(std::vector& lines)
+{
+ lines = m_lines;
+ m_use_lines = true;
+}
diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h
index 599939731b..19a5bb78a6 100644
--- a/Source/Core/Common/Src/IniFile.h
+++ b/Source/Core/Common/Src/IniFile.h
@@ -18,74 +18,105 @@
#ifndef _INIFILE_H_
#define _INIFILE_H_
-#include
-#include
+#include "CommonTypes.h"
+#include
+#include
+
+
+
+
+
+
+
+
+
+
lines;
std::vector encryptedLines;
ARCode currentCode;
arCodes.clear();
- if (!ini.GetLines("ActionReplay", lines))
- return; // no codes found.
-
+ std::vector lines;
+ ini["ActionReplay"].GetLines(lines);
for (std::vector::const_iterator it = lines.begin(); it != lines.end(); ++it)
{
std::string line = *it;
diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp
index 8f88b00545..5c6bff0137 100644
--- a/Source/Core/Core/Src/ConfigManager.cpp
+++ b/Source/Core/Core/Src/ConfigManager.cpp
@@ -73,103 +73,108 @@ void SConfig::SaveSettings()
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
// General
- ini.Set("General", "LastFilename", m_LastFilename);
+ Section& general = ini["General"];
+ general.Set("LastFilename", m_LastFilename);
// ISO folders
- ini.Set("General", "GCMPathes", (int)m_ISOFolder.size());
+ general.Set("GCMPathes", (int)m_ISOFolder.size());
for (size_t i = 0; i < m_ISOFolder.size(); i++)
{
TCHAR tmp[16];
sprintf(tmp, "GCMPath%i", (int)i);
- ini.Set("General", tmp, m_ISOFolder[i]);
+ general.Set(tmp, m_ISOFolder[i]);
}
- ini.Set("General", "RecersiveGCMPaths", m_RecursiveISOFolder);
+ general.Set("RecersiveGCMPaths", m_RecursiveISOFolder);
- // Interface
- ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
- ini.Set("Interface", "UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers);
- ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor);
- ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor);
- ini.Set("Interface", "Theme", m_LocalCoreStartupParameter.iTheme);
- ini.Set("Interface", "MainWindowPosX", m_LocalCoreStartupParameter.iPosX);
- ini.Set("Interface", "MainWindowPosY", m_LocalCoreStartupParameter.iPosY);
- ini.Set("Interface", "MainWindowWidth", m_LocalCoreStartupParameter.iWidth);
- ini.Set("Interface", "MainWindowHeight", m_LocalCoreStartupParameter.iHeight);
- ini.Set("Interface", "Language", m_InterfaceLanguage);
- ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar);
- ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar);
- ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow);
- ini.Set("Interface", "ShowConsole", m_InterfaceConsole);
+ // Interface
+ Section& iface = ini["Interface"];
+ iface.Set("ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
+ iface.Set("UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers);
+ iface.Set("HideCursor", m_LocalCoreStartupParameter.bHideCursor);
+ iface.Set("AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor);
+ iface.Set("Theme", m_LocalCoreStartupParameter.iTheme);
+ iface.Set("MainWindowPosX", m_LocalCoreStartupParameter.iPosX);
+ iface.Set("MainWindowPosY", m_LocalCoreStartupParameter.iPosY);
+ iface.Set("MainWindowWidth", m_LocalCoreStartupParameter.iWidth);
+ iface.Set("MainWindowHeight", m_LocalCoreStartupParameter.iHeight);
+ iface.Set("Language", m_InterfaceLanguage);
+ iface.Set("ShowToolbar", m_InterfaceToolbar);
+ iface.Set("ShowStatusbar", m_InterfaceStatusbar);
+ iface.Set("ShowLogWindow", m_InterfaceLogWindow);
+ iface.Set("ShowConsole", m_InterfaceConsole);
// Hotkeys
+ Section& hotkeys = ini["Hotkeys"];
for (int i = HK_FULLSCREEN; i < NUM_HOTKEYS; i++)
{
- ini.Set("Hotkeys", g_HKData[i].IniText, m_LocalCoreStartupParameter.iHotkey[i]);
- ini.Set("Hotkeys", (std::string(g_HKData[i].IniText) + "Modifier").c_str(),
+ hotkeys.Set(g_HKData[i].IniText, m_LocalCoreStartupParameter.iHotkey[i]);
+ hotkeys.Set((std::string(g_HKData[i].IniText) + "Modifier").c_str(),
m_LocalCoreStartupParameter.iHotkeyModifier[i]);
}
// Display
- ini.Set("Display", "FullscreenResolution", m_LocalCoreStartupParameter.strFullscreenResolution);
- ini.Set("Display", "Fullscreen", m_LocalCoreStartupParameter.bFullscreen);
- ini.Set("Display", "RenderToMain", m_LocalCoreStartupParameter.bRenderToMain);
- ini.Set("Display", "RenderWindowXPos", m_LocalCoreStartupParameter.iRenderWindowXPos);
- ini.Set("Display", "RenderWindowYPos", m_LocalCoreStartupParameter.iRenderWindowYPos);
- ini.Set("Display", "RenderWindowWidth", m_LocalCoreStartupParameter.iRenderWindowWidth);
- ini.Set("Display", "RenderWindowHeight", m_LocalCoreStartupParameter.iRenderWindowHeight);
+ Section& display = ini["Display"];
+ display.Set("FullscreenResolution", m_LocalCoreStartupParameter.strFullscreenResolution);
+ display.Set("Fullscreen", m_LocalCoreStartupParameter.bFullscreen);
+ display.Set("RenderToMain", m_LocalCoreStartupParameter.bRenderToMain);
+ display.Set("RenderWindowXPos", m_LocalCoreStartupParameter.iRenderWindowXPos);
+ display.Set("RenderWindowYPos", m_LocalCoreStartupParameter.iRenderWindowYPos);
+ display.Set("RenderWindowWidth", m_LocalCoreStartupParameter.iRenderWindowWidth);
+ display.Set("RenderWindowHeight", m_LocalCoreStartupParameter.iRenderWindowHeight);
// Game List Control
- ini.Set("GameList", "ListDrives", m_ListDrives);
- ini.Set("GameList", "ListWad", m_ListWad);
- ini.Set("GameList", "ListWii", m_ListWii);
- ini.Set("GameList", "ListGC", m_ListGC);
- ini.Set("GameList", "ListJap", m_ListJap);
- ini.Set("GameList", "ListPal", m_ListPal);
- ini.Set("GameList", "ListUsa", m_ListUsa);
- ini.Set("GameList", "ListFrance", m_ListFrance);
- ini.Set("GameList", "ListItaly", m_ListItaly);
- ini.Set("GameList", "ListKorea", m_ListKorea);
- ini.Set("GameList", "ListTaiwan", m_ListTaiwan);
- ini.Set("GameList", "ListUnknown", m_ListUnknown);
+ Section& gamelist = ini["GameList"];
+ gamelist.Set("ListDrives", m_ListDrives);
+ gamelist.Set("ListWad", m_ListWad);
+ gamelist.Set("ListWii", m_ListWii);
+ gamelist.Set("ListGC", m_ListGC);
+ gamelist.Set("ListJap", m_ListJap);
+ gamelist.Set("ListPal", m_ListPal);
+ gamelist.Set("ListUsa", m_ListUsa);
+ gamelist.Set("ListFrance", m_ListFrance);
+ gamelist.Set("ListItaly", m_ListItaly);
+ gamelist.Set("ListKorea", m_ListKorea);
+ gamelist.Set("ListTaiwan", m_ListTaiwan);
+ gamelist.Set("ListUnknown", m_ListUnknown);
// Core
- ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
- ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore);
- ini.Set("Core", "CPUThread", m_LocalCoreStartupParameter.bCPUThread);
- ini.Set("Core", "DSPThread", m_LocalCoreStartupParameter.bDSPThread);
- ini.Set("Core", "SkipIdle", m_LocalCoreStartupParameter.bSkipIdle);
- ini.Set("Core", "LockThreads", m_LocalCoreStartupParameter.bLockThreads);
- ini.Set("Core", "DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM);
- ini.Set("Core", "DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot);
- ini.Set("Core", "Apploader", m_LocalCoreStartupParameter.m_strApploader);
- ini.Set("Core", "EnableCheats", m_LocalCoreStartupParameter.bEnableCheats);
- ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage);
- ini.Set("Core", "MemcardA", m_strMemoryCardA);
- ini.Set("Core", "MemcardB", m_strMemoryCardB);
- ini.Set("Core", "SlotA", m_EXIDevice[0]);
- ini.Set("Core", "SlotB", m_EXIDevice[1]);
- ini.Set("Core", "SerialPort1", m_EXIDevice[2]);
+ Section& core = ini["Core"];
+ core.Set("HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
+ core.Set("CPUCore", m_LocalCoreStartupParameter.iCPUCore);
+ core.Set("CPUThread", m_LocalCoreStartupParameter.bCPUThread);
+ core.Set("DSPThread", m_LocalCoreStartupParameter.bDSPThread);
+ core.Set("SkipIdle", m_LocalCoreStartupParameter.bSkipIdle);
+ core.Set("LockThreads", m_LocalCoreStartupParameter.bLockThreads);
+ core.Set("DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM);
+ core.Set("DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot);
+ core.Set("Apploader", m_LocalCoreStartupParameter.m_strApploader);
+ core.Set("EnableCheats", m_LocalCoreStartupParameter.bEnableCheats);
+ core.Set("SelectedLanguage",m_LocalCoreStartupParameter.SelectedLanguage);
+ core.Set("MemcardA", m_strMemoryCardA);
+ core.Set("MemcardB", m_strMemoryCardB);
+ core.Set("SlotA", m_EXIDevice[0]);
+ core.Set("SlotB", m_EXIDevice[1]);
+ core.Set("SerialPort1", m_EXIDevice[2]);
char sidevicenum[16];
for (int i = 0; i < 4; ++i)
{
sprintf(sidevicenum, "SIDevice%i", i);
- ini.Set("Core", sidevicenum, m_SIDevice[i]);
+ core.Set(sidevicenum, m_SIDevice[i]);
}
- ini.Set("Core", "WiiSDCard", m_WiiSDCard);
- ini.Set("Core", "WiiKeyboard", m_WiiKeyboard);
- ini.Set("Core", "RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer);
- ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient);
- ini.Set("Core", "FrameLimit", m_Framelimit);
- ini.Set("Core", "UseFPS", b_UseFPS);
+ core.Set("WiiSDCard", m_WiiSDCard);
+ core.Set("WiiKeyboard", m_WiiKeyboard);
+ core.Set("RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer);
+ core.Set("RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient);
+ core.Set("FrameLimit", m_Framelimit);
+ core.Set("UseFPS", b_UseFPS);
// Plugins
- ini.Set("Core", "GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
- ini.Set("Core", "DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
- ini.Set("Core", "PadPlugin", m_LocalCoreStartupParameter.m_strPadPlugin[0]);
- ini.Set("Core", "WiiMotePlugin",m_LocalCoreStartupParameter.m_strWiimotePlugin[0]);
+ core.Set("GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
+ core.Set("DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
+ core.Set("WiiMotePlugin",m_LocalCoreStartupParameter.m_strWiimotePlugin[0]);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
m_SYSCONF->Save();
@@ -187,119 +192,121 @@ void SConfig::LoadSettings()
// Hard coded default
m_DefaultGFXPlugin = PluginsDir + DEFAULT_GFX_PLUGIN;
m_DefaultDSPPlugin = PluginsDir + DEFAULT_DSP_PLUGIN;
- m_DefaultPADPlugin = PluginsDir + DEFAULT_PAD_PLUGIN;
m_DefaultWiiMotePlugin = PluginsDir + DEFAULT_WIIMOTE_PLUGIN;
// General
{
- ini.Get("General", "LastFilename", &m_LastFilename);
+ Section& general = ini["General"];
+ general.Get("LastFilename", &m_LastFilename);
m_ISOFolder.clear();
- int numGCMPaths;
- if (ini.Get("General", "GCMPathes", &numGCMPaths, 0))
+ unsigned int numGCMPaths;
+ general.Get("GCMPathes", &numGCMPaths, 0);
+ for (unsigned int i = 0; i < numGCMPaths; i++)
{
- for (int i = 0; i < numGCMPaths; i++)
- {
- TCHAR tmp[16];
- sprintf(tmp, "GCMPath%i", i);
- std::string tmpPath;
- ini.Get("General", tmp, &tmpPath, "");
- m_ISOFolder.push_back(tmpPath);
- }
+ TCHAR tmp[16];
+ sprintf(tmp, "GCMPath%i", i);
+ std::string tmpPath;
+ general.Get(tmp, &tmpPath, "");
+ m_ISOFolder.push_back(tmpPath);
}
- ini.Get("General", "RecersiveGCMPaths", &m_RecursiveISOFolder, false);
+ general.Get("RecersiveGCMPaths", &m_RecursiveISOFolder, false);
}
{
// Interface
- ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false);
- ini.Get("Interface", "UsePanicHandlers", &m_LocalCoreStartupParameter.bUsePanicHandlers, true);
- ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false);
- ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false);
- ini.Get("Interface", "Theme", &m_LocalCoreStartupParameter.iTheme, 0);
- ini.Get("Interface", "MainWindowPosX", &m_LocalCoreStartupParameter.iPosX, 100);
- ini.Get("Interface", "MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100);
- ini.Get("Interface", "MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800);
- ini.Get("Interface", "MainWindowHeight", &m_LocalCoreStartupParameter.iHeight, 600);
- ini.Get("Interface", "Language", (int*)&m_InterfaceLanguage, 0);
- ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true);
- ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true);
- ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false);
- ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false);
+ Section& iface = ini["Interface"];
+ iface.Get("ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, false);
+ iface.Get("UsePanicHandlers", &m_LocalCoreStartupParameter.bUsePanicHandlers, true);
+ iface.Get("HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false);
+ iface.Get("AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false);
+ iface.Get("Theme", &m_LocalCoreStartupParameter.iTheme, 0);
+ iface.Get("MainWindowPosX", &m_LocalCoreStartupParameter.iPosX, 100);
+ iface.Get("MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100);
+ iface.Get("MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800);
+ iface.Get("MainWindowHeight", &m_LocalCoreStartupParameter.iHeight, 600);
+ iface.Get("Language", (int*)&m_InterfaceLanguage, 0);
+ iface.Get("ShowToolbar", &m_InterfaceToolbar, true);
+ iface.Get("ShowStatusbar", &m_InterfaceStatusbar, true);
+ iface.Get("ShowLogWindow", &m_InterfaceLogWindow, false);
+ iface.Get("ShowConsole", &m_InterfaceConsole, false);
// Hotkeys
+ Section& hotkeys = ini["Hotkeys"];
for (int i = HK_FULLSCREEN; i < NUM_HOTKEYS; i++)
{
- ini.Get("Hotkeys", g_HKData[i].IniText,
+ hotkeys.Get(g_HKData[i].IniText,
&m_LocalCoreStartupParameter.iHotkey[i], g_HKData[i].DefaultKey);
- ini.Get("Hotkeys", (std::string(g_HKData[i].IniText) + "Modifier").c_str(),
+ hotkeys.Get((std::string(g_HKData[i].IniText) + "Modifier").c_str(),
&m_LocalCoreStartupParameter.iHotkeyModifier[i], g_HKData[i].DefaultModifier);
}
// Display
- ini.Get("Display", "Fullscreen", &m_LocalCoreStartupParameter.bFullscreen, false);
- ini.Get("Display", "FullscreenResolution", &m_LocalCoreStartupParameter.strFullscreenResolution, "640x480");
- ini.Get("Display", "RenderToMain", &m_LocalCoreStartupParameter.bRenderToMain, false);
- ini.Get("Display", "RenderWindowXPos", &m_LocalCoreStartupParameter.iRenderWindowXPos, 0);
- ini.Get("Display", "RenderWindowYPos", &m_LocalCoreStartupParameter.iRenderWindowYPos, 0);
- ini.Get("Display", "RenderWindowWidth", &m_LocalCoreStartupParameter.iRenderWindowWidth, 640);
- ini.Get("Display", "RenderWindowHeight", &m_LocalCoreStartupParameter.iRenderWindowHeight, 480);
+ Section& display = ini["Display"];
+ display.Get("Fullscreen", &m_LocalCoreStartupParameter.bFullscreen, false);
+ display.Get("FullscreenResolution", &m_LocalCoreStartupParameter.strFullscreenResolution, "640x480");
+ display.Get("RenderToMain", &m_LocalCoreStartupParameter.bRenderToMain, false);
+ display.Get("RenderWindowXPos", &m_LocalCoreStartupParameter.iRenderWindowXPos, 0);
+ display.Get("RenderWindowYPos", &m_LocalCoreStartupParameter.iRenderWindowYPos, 0);
+ display.Get("RenderWindowWidth", &m_LocalCoreStartupParameter.iRenderWindowWidth, 640);
+ display.Get("RenderWindowHeight", &m_LocalCoreStartupParameter.iRenderWindowHeight, 480);
// Game List Control
- ini.Get("GameList", "ListDrives", &m_ListDrives, false);
- ini.Get("GameList", "ListWad", &m_ListWad, true);
- ini.Get("GameList", "ListWii", &m_ListWii, true);
- ini.Get("GameList", "ListGC", &m_ListGC, true);
- ini.Get("GameList", "ListJap", &m_ListJap, true);
- ini.Get("GameList", "ListPal", &m_ListPal, true);
- ini.Get("GameList", "ListUsa", &m_ListUsa, true);
+ Section& gamelist = ini["GameList"];
+ gamelist.Get("ListDrives", &m_ListDrives, false);
+ gamelist.Get("ListWad", &m_ListWad, true);
+ gamelist.Get("ListWii", &m_ListWii, true);
+ gamelist.Get("ListGC", &m_ListGC, true);
+ gamelist.Get("ListJap", &m_ListJap, true);
+ gamelist.Get("ListPal", &m_ListPal, true);
+ gamelist.Get("ListUsa", &m_ListUsa, true);
- ini.Get("GameList", "ListFrance", &m_ListFrance, true);
- ini.Get("GameList", "ListItaly", &m_ListItaly, true);
- ini.Get("GameList", "ListKorea", &m_ListKorea, true);
- ini.Get("GameList", "ListTaiwan", &m_ListTaiwan, true);
- ini.Get("GameList", "ListUnknown", &m_ListUnknown, true);
+ gamelist.Get("ListFrance", &m_ListFrance, true);
+ gamelist.Get("ListItaly", &m_ListItaly, true);
+ gamelist.Get("ListKorea", &m_ListKorea, true);
+ gamelist.Get("ListTaiwan", &m_ListTaiwan, true);
+ gamelist.Get("ListUnknown", &m_ListUnknown, true);
// Core
- ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, true);
- ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1);
- ini.Get("Core", "DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false);
- ini.Get("Core", "CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
- ini.Get("Core", "SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true);
- ini.Get("Core", "LockThreads", &m_LocalCoreStartupParameter.bLockThreads, false);
- ini.Get("Core", "DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM);
- ini.Get("Core", "DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot);
- ini.Get("Core", "Apploader", &m_LocalCoreStartupParameter.m_strApploader);
- ini.Get("Core", "EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false);
- ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0);
- ini.Get("Core", "MemcardA", &m_strMemoryCardA);
- ini.Get("Core", "MemcardB", &m_strMemoryCardB);
- ini.Get("Core", "SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD_A);
- ini.Get("Core", "SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_MEMORYCARD_B);
- ini.Get("Core", "SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE);
- ini.Get("Core", "ProfiledReJIT",&m_LocalCoreStartupParameter.bJITProfiledReJIT, false);
+ Section& core = ini["Core"];
+ core.Get("HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, true);
+ core.Get("CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1);
+ core.Get("DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false);
+ core.Get("CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true);
+ core.Get("SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true);
+ core.Get("LockThreads", &m_LocalCoreStartupParameter.bLockThreads, false);
+ core.Get("DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM);
+ core.Get("DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot);
+ core.Get("Apploader", &m_LocalCoreStartupParameter.m_strApploader);
+ core.Get("EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false);
+ core.Get("SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0);
+ core.Get("MemcardA", &m_strMemoryCardA);
+ core.Get("MemcardB", &m_strMemoryCardB);
+ core.Get("SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD_A);
+ core.Get("SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_MEMORYCARD_B);
+ core.Get("SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE);
+ core.Get("ProfiledReJIT", &m_LocalCoreStartupParameter.bJITProfiledReJIT, false);
char sidevicenum[16];
for (int i = 0; i < 4; ++i)
{
sprintf(sidevicenum, "SIDevice%i", i);
- ini.Get("Core", sidevicenum, (u32*)&m_SIDevice[i], i==0 ? SI_GC_CONTROLLER:SI_NONE);
+ core.Get(sidevicenum, (u32*)&m_SIDevice[i], i==0 ? SI_GC_CONTROLLER:SI_NONE);
}
- ini.Get("Core", "WiiSDCard", &m_WiiSDCard, false);
- ini.Get("Core", "WiiKeyboard", &m_WiiKeyboard, false);
- ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false);
- ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);
- ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
- ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default
- ini.Get("Core", "UseFPS", &b_UseFPS, false); // use vps as default
+ core.Get("WiiSDCard", &m_WiiSDCard, false);
+ core.Get("WiiKeyboard", &m_WiiKeyboard, false);
+ core.Get("RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false);
+ core.Get("RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false);
+ core.Get("TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
+ core.Get("FrameLimit", &m_Framelimit, 1); // auto frame limit by default
+ core.Get("UseFPS", &b_UseFPS, false); // use vps as default
// Plugins
- ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
- ini.Get("Core", "DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str());
- ini.Get("Core", "PadPlugin", &m_LocalCoreStartupParameter.m_strPadPlugin[0], m_DefaultPADPlugin.c_str());
- ini.Get("Core", "WiiMotePlugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[0], m_DefaultWiiMotePlugin.c_str());
+ core.Get("GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
+ core.Get("DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str());
+ core.Get("WiiMotePlugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[0], m_DefaultWiiMotePlugin.c_str());
}
@@ -315,6 +322,6 @@ void SConfig::LoadSettingsWii()
{
char SectionName[32];
sprintf(SectionName, "Wiimote%i", i + 1);
- ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
+ ini[SectionName].Get("AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
}
}
diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h
index 2b975c204b..cb775b0520 100644
--- a/Source/Core/Core/Src/ConfigManager.h
+++ b/Source/Core/Core/Src/ConfigManager.h
@@ -49,7 +49,6 @@ struct SConfig
// hard coded default plugins ...
std::string m_DefaultGFXPlugin;
std::string m_DefaultDSPPlugin;
- std::string m_DefaultPADPlugin;
std::string m_DefaultWiiMotePlugin;
// name of the last used filename
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index 1fb2c4e1be..2bd72e88b7 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -77,7 +77,6 @@ void Callback_VideoCopiedToXFB(bool video_update);
void Callback_DSPLog(const TCHAR* _szMessage, int _v);
const char *Callback_ISOName(void);
void Callback_DSPInterrupt();
-void Callback_PADLog(const TCHAR* _szMessage);
void Callback_WiimoteLog(const TCHAR* _szMessage, int _v);
void Callback_WiimoteInput(int _number, u16 _channelID, const void* _pData, u32 _Size);
bool Callback_RendererHasFocus(void);
@@ -349,7 +348,7 @@ THREAD_RETURN EmuThread(void *pArg)
{
IniFile gameIni;
gameIni.Load(_CoreParameter.m_strGameIni.c_str());
- gameIni.Get("Wii", "Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR"));
+ gameIni["Wii"].Get("Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR"));
}
VideoInitialize.bAutoAspectIs16_9 = aspectWide;
@@ -381,18 +380,6 @@ THREAD_RETURN EmuThread(void *pArg)
dspInit.bOnThread = _CoreParameter.bDSPThread;
Plugins.GetDSP()->Initialize((void *)&dspInit);
-
- // Load and init GCPadPlugin
- SPADInitialize PADInitialize;
- PADInitialize.hWnd = g_pWindowHandle;
-#if defined(HAVE_X11) && HAVE_X11
- PADInitialize.pXWindow = g_pXWindow;
-#endif
- PADInitialize.pLog = Callback_PADLog;
- PADInitialize.pRendererHasFocus = Callback_RendererHasFocus;
- // This is may be needed to avoid a SDL problem
- //Plugins.FreeWiimote();
- Plugins.GetPad(0)->Initialize(&PADInitialize);
// Load and Init WiimotePlugin - only if we are booting in wii mode
if (_CoreParameter.bWii)
@@ -738,16 +725,6 @@ void Callback_DSPInterrupt()
DSP::GenerateDSPInterruptFromPlugin(DSP::INT_DSP);
}
-
-// Callback_PADLog
-//
-void Callback_PADLog(const TCHAR* _szMessage)
-{
- // FIXME add levels
- INFO_LOG(SERIALINTERFACE, _szMessage);
-}
-
-
// Callback_ISOName: Let the DSP plugin get the game name
//
const char *Callback_ISOName()
diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h
index 0a6c073877..cc92d84cb8 100644
--- a/Source/Core/Core/Src/CoreParameter.h
+++ b/Source/Core/Core/Src/CoreParameter.h
@@ -21,7 +21,6 @@
#include "IniFile.h"
#include
-#define MAXPADS 1
#define MAXWIIMOTES 1
enum Hotkey {
@@ -121,7 +120,6 @@ struct SCoreStartupParameter
// files
std::string m_strVideoPlugin;
- std::string m_strPadPlugin[MAXPADS];
std::string m_strDSPPlugin;
std::string m_strWiimotePlugin[MAXWIIMOTES];
diff --git a/Source/Core/Core/Src/CoreRerecording.cpp b/Source/Core/Core/Src/CoreRerecording.cpp
index e382351df5..46dd74d3d9 100644
--- a/Source/Core/Core/Src/CoreRerecording.cpp
+++ b/Source/Core/Core/Src/CoreRerecording.cpp
@@ -44,7 +44,7 @@
#include "HW/GPFifo.h"
#include "HW/CPU.h"
#include "HW/HW.h"
-#include "HW/DSP.h"
+#include "HW/DSPInterface.h"
#include "HW/GPFifo.h"
#include "HW/AudioInterface.h"
#include "HW/VideoInterface.h"
diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp
index 986e39afca..e7011ad57d 100644
--- a/Source/Core/Core/Src/HW/DVDInterface.cpp
+++ b/Source/Core/Core/Src/HW/DVDInterface.cpp
@@ -574,29 +574,29 @@ void ExecuteCommand(UDICR& _DICR)
{
case 0x80000000:
ERROR_LOG(DVDINTERFACE, "GC-AM: READ MEDIA BOARD STATUS (80000000)");
- for (int i = 0; i < m_DILENGTH.Length / 4; i++)
+ for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++)
Memory::Write_U32(0, m_DIMAR.Address + i * 4);
break;
case 0x80000040:
ERROR_LOG(DVDINTERFACE, "GC-AM: READ MEDIA BOARD STATUS (2) (80000040)");
- for (int i = 0; i < m_DILENGTH.Length / 4; i++)
+ for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++)
Memory::Write_U32(~0, m_DIMAR.Address + i * 4);
Memory::Write_U32(0x00000020, m_DIMAR.Address); // DIMM SIZE, LE
Memory::Write_U32(0x4743414D, m_DIMAR.Address + 4); // GCAM signature
break;
case 0x80000120:
ERROR_LOG(DVDINTERFACE, "GC-AM: READ FIRMWARE STATUS (80000120)");
- for (int i = 0; i < m_DILENGTH.Length / 4; i++)
+ for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++)
Memory::Write_U32(0x01010101, m_DIMAR.Address + i * 4);
break;
case 0x80000140:
ERROR_LOG(DVDINTERFACE, "GC-AM: READ FIRMWARE STATUS (80000140)");
- for (int i = 0; i < m_DILENGTH.Length / 4; i++)
+ for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++)
Memory::Write_U32(0x01010101, m_DIMAR.Address + i * 4);
break;
case 0x84000020:
ERROR_LOG(DVDINTERFACE, "GC-AM: READ MEDIA BOARD STATUS (1) (84000020)");
- for (int i = 0; i < m_DILENGTH.Length / 4; i++)
+ for (unsigned int i = 0; i < m_DILENGTH.Length / 4; i++)
Memory::Write_U32(0x00000000, m_DIMAR.Address + i * 4);
break;
default:
diff --git a/Source/Core/Core/Src/HW/GCPad.cpp b/Source/Core/Core/Src/HW/GCPad.cpp
new file mode 100644
index 0000000000..ecb1d49d54
--- /dev/null
+++ b/Source/Core/Core/Src/HW/GCPad.cpp
@@ -0,0 +1,100 @@
+#include
+#include "GCPadEmu.h"
+#include
+#include "../ConfigManager.h"
+
+/*staticTODOSHUFFLE*/ Plugin g_GCPad( "GCPad", "Pad", "GCPad" );
+
+void PAD_Init()
+{
+ // i realize i am checking IsInit() twice, just too lazy to change it
+ if ( false == g_GCPad.controller_interface.IsInit() )
+ {
+ // add 4 gcpads
+ for ( unsigned int i = 0; i<4; ++i )
+ g_GCPad.controllers.push_back( new GCPad( i ) );
+
+ // load the saved controller config
+ g_GCPad.LoadConfig();
+
+ // needed for Xlib and exclusive dinput
+ g_GCPad.controller_interface.SetHwnd( SConfig::GetInstance().m_LocalCoreStartupParameter.hMainWindow );
+ g_GCPad.controller_interface.Init();
+
+ // update control refs
+ std::vector::const_iterator i = g_GCPad.controllers.begin(),
+ e = g_GCPad.controllers.end();
+ for ( ; i!=e; ++i )
+ (*i)->UpdateReferences( g_GCPad.controller_interface );
+
+ }
+}
+
+void PAD_Shutdown()
+{
+ if ( g_GCPad.controller_interface.IsInit() )
+ {
+ std::vector::const_iterator
+ i = g_GCPad.controllers.begin(),
+ e = g_GCPad.controllers.end();
+ for ( ; i!=e; ++i )
+ delete *i;
+ g_GCPad.controllers.clear();
+
+ g_GCPad.controller_interface.DeInit();
+ }
+}
+
+void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
+{
+ memset( _pPADStatus, 0, sizeof(*_pPADStatus) );
+ _pPADStatus->err = PAD_ERR_NONE;
+ // wtf is this?
+ _pPADStatus->button |= PAD_USE_ORIGIN;
+
+ // try lock
+ if ( false == g_GCPad.controls_crit.TryEnter() )
+ {
+ // if gui has lock (messing with controls), skip this input cycle
+ // center axes and return
+ memset( &_pPADStatus->stickX, 0x80, 4 );
+ return;
+ }
+
+ // if we are on the next input cycle, update output and input
+ // if we can get a lock
+ static int _last_numPAD = 4;
+ if ( _numPAD <= _last_numPAD && g_GCPad.interface_crit.TryEnter() )
+ {
+ g_GCPad.controller_interface.UpdateOutput();
+ g_GCPad.controller_interface.UpdateInput();
+ g_GCPad.interface_crit.Leave();
+ }
+ _last_numPAD = _numPAD;
+
+ // get input
+ ((GCPad*)g_GCPad.controllers[ _numPAD ])->GetInput( _pPADStatus );
+
+ // leave
+ g_GCPad.controls_crit.Leave();
+
+}
+
+void PAD_Input(u16 _Key, u8 _UpDown)
+{
+ // nofin
+}
+
+void PAD_Rumble(u8 _numPAD, u8 _uType, u8 _uStrength)
+{
+ // enter
+ if ( g_GCPad.controls_crit.TryEnter() )
+ {
+ // TODO: this has potential to not stop rumble if user is messing with GUI at the perfect time
+ // set rumble
+ ((GCPad*)g_GCPad.controllers[ _numPAD ])->SetOutput( 1 == _uType && _uStrength > 2 );
+
+ // leave
+ g_GCPad.controls_crit.Leave();
+ }
+}
diff --git a/Source/Core/Core/Src/HW/GCPad.h b/Source/Core/Core/Src/HW/GCPad.h
new file mode 100644
index 0000000000..a480579c0a
--- /dev/null
+++ b/Source/Core/Core/Src/HW/GCPad.h
@@ -0,0 +1,55 @@
+#pragma once
+
+#define PAD_ERR_NONE 0
+#define PAD_ERR_NO_CONTROLLER -1
+#define PAD_ERR_NOT_READY -2
+#define PAD_ERR_TRANSFER -3
+
+#define PAD_USE_ORIGIN 0x0080
+
+#define PAD_BUTTON_LEFT 0x0001
+#define PAD_BUTTON_RIGHT 0x0002
+#define PAD_BUTTON_DOWN 0x0004
+#define PAD_BUTTON_UP 0x0008
+#define PAD_TRIGGER_Z 0x0010
+#define PAD_TRIGGER_R 0x0020
+#define PAD_TRIGGER_L 0x0040
+#define PAD_BUTTON_A 0x0100
+#define PAD_BUTTON_B 0x0200
+#define PAD_BUTTON_X 0x0400
+#define PAD_BUTTON_Y 0x0800
+#define PAD_BUTTON_START 0x1000
+
+struct SPADStatus
+{
+ u16 button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
+ u8 stickX; // 0 <= stickX <= 255
+ u8 stickY; // 0 <= stickY <= 255
+ u8 substickX; // 0 <= substickX <= 255
+ u8 substickY; // 0 <= substickY <= 255
+ u8 triggerLeft; // 0 <= triggerLeft <= 255
+ u8 triggerRight; // 0 <= triggerRight <= 255
+ u8 analogA; // 0 <= analogA <= 255
+ u8 analogB; // 0 <= analogB <= 255
+ u8 err; // one of PAD_ERR_* number
+ bool MicButton; // This is hax for the mic device input...
+};
+
+// if plugin isn't initialized, init and load config
+void PAD_Init();
+
+void PAD_Shutdown();
+
+void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus);
+
+// Function: Send keyboard input to the plugin
+// Purpose:
+// input: The key and if it's pressed or released
+// output: None
+void PAD_Input(u16 _Key, u8 _UpDown);
+
+// Function: PAD_Rumble
+// Purpose: Pad rumble!
+// input: PAD number, Command type (Stop=0, Rumble=1, Stop Hard=2) and strength of Rumble
+// output: none
+void PAD_Rumble(u8 _numPAD, u8 _uType, u8 _uStrength);
diff --git a/Source/Plugins/Plugin_GCPadNew/Src/GCPadEmu.cpp b/Source/Core/Core/Src/HW/GCPadEmu.cpp
similarity index 88%
rename from Source/Plugins/Plugin_GCPadNew/Src/GCPadEmu.cpp
rename to Source/Core/Core/Src/HW/GCPadEmu.cpp
index 500ec666b3..b7db04daf5 100644
--- a/Source/Plugins/Plugin_GCPadNew/Src/GCPadEmu.cpp
+++ b/Source/Core/Core/Src/HW/GCPadEmu.cpp
@@ -1,108 +1,108 @@
-
-#include "GCPadEmu.h"
-
-const u16 button_bitmasks[] =
-{
- PAD_BUTTON_A,
- PAD_BUTTON_B,
- PAD_BUTTON_X,
- PAD_BUTTON_Y,
- PAD_TRIGGER_Z,
- PAD_BUTTON_START
-};
-
-const u16 trigger_bitmasks[] =
-{
- PAD_TRIGGER_L,
- PAD_TRIGGER_R,
-};
-
-const u16 dpad_bitmasks[] =
-{
- PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT
-};
-
-const char* const named_buttons[] =
-{
- "A",
- "B",
- "X",
- "Y",
- "Z",
- "Start",
-};
-
-const char* const named_triggers[] =
-{
- "L", "R", "L-Analog", "R-Analog"
-};
-
-GCPad::GCPad( const unsigned int index ) : m_index(index)
-{
-
- // buttons
- groups.push_back( m_buttons = new Buttons( "Buttons" ) );
- for ( unsigned int i=0; i < sizeof(named_buttons)/sizeof(*named_buttons); ++i )
- m_buttons->controls.push_back( new ControlGroup::Input( named_buttons[i] ) );
-
- // sticks
- groups.push_back( m_main_stick = new AnalogStick( "Main Stick" ) );
- groups.push_back( m_c_stick = new AnalogStick( "C-Stick" ) );
-
- // triggers
- groups.push_back( m_triggers = new MixedTriggers( "Triggers" ) );
- for ( unsigned int i=0; i < sizeof(named_triggers)/sizeof(*named_triggers); ++i )
- m_triggers->controls.push_back( new ControlGroup::Input( named_triggers[i] ) );
-
- // rumble
- groups.push_back( m_rumble = new ControlGroup( "Rumble" ) );
- m_rumble->controls.push_back( new ControlGroup::Output( "Motor" ) );
-
- // dpad
- groups.push_back( m_dpad = new Buttons( "D-Pad" ) );
- for ( unsigned int i=0; i < 4; ++i )
- m_dpad->controls.push_back( new ControlGroup::Input( named_directions[i] ) );
-
- // options
- groups.push_back( m_options = new ControlGroup( "Options" ) );
- m_options->settings.push_back( new ControlGroup::Setting( "Background Input", false ) );
-
-}
-
-std::string GCPad::GetName() const
-{
- return std::string("GCPad") + char('1'+m_index);
-}
-
-void GCPad::GetInput( SPADStatus* const pad )
-{
- // if window has focus or background input enabled
- if (g_PADInitialize->pRendererHasFocus() || m_options[0].settings[0]->value )
- {
- // buttons
- m_buttons->GetState( &pad->button, button_bitmasks );
-
- // TODO: set analog A/B analog to full or w/e, prolly not needed
-
- // dpad
- m_dpad->GetState( &pad->button, dpad_bitmasks );
-
- // sticks
- m_main_stick->GetState( &pad->stickX, &pad->stickY, 0x80, 127 );
- m_c_stick->GetState( &pad->substickX, &pad->substickY, 0x80, 127 );
-
- // triggers
- m_triggers->GetState( &pad->button, trigger_bitmasks, &pad->triggerLeft, 0xFF );
- }
- else
- {
- // center sticks
- memset( &pad->stickX, 0x80, 4 );
- }
-}
-
-void GCPad::SetOutput( const bool on )
-{
- // only rumble if window has focus or background input is enabled
- m_rumble->controls[0]->control_ref->State( on && (g_PADInitialize->pRendererHasFocus() || m_options[0].settings[0]->value) );
-}
+#include "..\Host.h"
+#include "GCPadEmu.h"
+
+const u16 button_bitmasks[] =
+{
+ PAD_BUTTON_A,
+ PAD_BUTTON_B,
+ PAD_BUTTON_X,
+ PAD_BUTTON_Y,
+ PAD_TRIGGER_Z,
+ PAD_BUTTON_START
+};
+
+const u16 trigger_bitmasks[] =
+{
+ PAD_TRIGGER_L,
+ PAD_TRIGGER_R,
+};
+
+const u16 dpad_bitmasks[] =
+{
+ PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT
+};
+
+const char* const named_buttons[] =
+{
+ "A",
+ "B",
+ "X",
+ "Y",
+ "Z",
+ "Start",
+};
+
+const char* const named_triggers[] =
+{
+ "L", "R", "L-Analog", "R-Analog"
+};
+
+GCPad::GCPad( const unsigned int index ) : m_index(index)
+{
+
+ // buttons
+ groups.push_back( m_buttons = new Buttons( "Buttons" ) );
+ for ( unsigned int i=0; i < sizeof(named_buttons)/sizeof(*named_buttons); ++i )
+ m_buttons->controls.push_back( new ControlGroup::Input( named_buttons[i] ) );
+
+ // sticks
+ groups.push_back( m_main_stick = new AnalogStick( "Main Stick" ) );
+ groups.push_back( m_c_stick = new AnalogStick( "C-Stick" ) );
+
+ // triggers
+ groups.push_back( m_triggers = new MixedTriggers( "Triggers" ) );
+ for ( unsigned int i=0; i < sizeof(named_triggers)/sizeof(*named_triggers); ++i )
+ m_triggers->controls.push_back( new ControlGroup::Input( named_triggers[i] ) );
+
+ // rumble
+ groups.push_back( m_rumble = new ControlGroup( "Rumble" ) );
+ m_rumble->controls.push_back( new ControlGroup::Output( "Motor" ) );
+
+ // dpad
+ groups.push_back( m_dpad = new Buttons( "D-Pad" ) );
+ for ( unsigned int i=0; i < 4; ++i )
+ m_dpad->controls.push_back( new ControlGroup::Input( named_directions[i] ) );
+
+ // options
+ groups.push_back( m_options = new ControlGroup( "Options" ) );
+ m_options->settings.push_back( new ControlGroup::Setting( "Background Input", false ) );
+
+}
+
+std::string GCPad::GetName() const
+{
+ return std::string("GCPad") + char('1'+m_index);
+}
+
+void GCPad::GetInput( SPADStatus* const pad )
+{
+ // if window has focus or background input enabled
+ if (Host_RendererHasFocus() || m_options[0].settings[0]->value )
+ {
+ // buttons
+ m_buttons->GetState( &pad->button, button_bitmasks );
+
+ // TODO: set analog A/B analog to full or w/e, prolly not needed
+
+ // dpad
+ m_dpad->GetState( &pad->button, dpad_bitmasks );
+
+ // sticks
+ m_main_stick->GetState( &pad->stickX, &pad->stickY, 0x80, 127 );
+ m_c_stick->GetState( &pad->substickX, &pad->substickY, 0x80, 127 );
+
+ // triggers
+ m_triggers->GetState( &pad->button, trigger_bitmasks, &pad->triggerLeft, 0xFF );
+ }
+ else
+ {
+ // center sticks
+ memset( &pad->stickX, 0x80, 4 );
+ }
+}
+
+void GCPad::SetOutput( const bool on )
+{
+ // only rumble if window has focus or background input is enabled
+ m_rumble->controls[0]->control_ref->State( on && (Host_RendererHasFocus() || m_options[0].settings[0]->value) );
+}
diff --git a/Source/Plugins/Plugin_GCPadNew/Src/GCPadEmu.h b/Source/Core/Core/Src/HW/GCPadEmu.h
similarity index 81%
rename from Source/Plugins/Plugin_GCPadNew/Src/GCPadEmu.h
rename to Source/Core/Core/Src/HW/GCPadEmu.h
index 6a1c916364..09d2b4d2dd 100644
--- a/Source/Plugins/Plugin_GCPadNew/Src/GCPadEmu.h
+++ b/Source/Core/Core/Src/HW/GCPadEmu.h
@@ -1,34 +1,29 @@
-#ifndef _CONEMU_GCPAD_H_
-#define _CONEMU_GCPAD_H_
-
-#include
-
-extern SPADInitialize *g_PADInitialize;
-
-class GCPad : public ControllerEmu
-{
-public:
-
- GCPad( const unsigned int index );
- void GetInput( SPADStatus* const pad );
- void SetOutput( const bool on );
-
- std::string GetName() const;
-
-
-private:
-
- Buttons* m_buttons;
- AnalogStick* m_main_stick;
- AnalogStick* m_c_stick;
- Buttons* m_dpad;
- MixedTriggers* m_triggers;
- ControlGroup* m_rumble;
- ControlGroup* m_options;
-
- const unsigned int m_index;
-
-};
-
-
-#endif
+#pragma once
+
+#include
+#include "GCPad.h"
+
+class GCPad : public ControllerEmu
+{
+public:
+
+ GCPad( const unsigned int index );
+ void GetInput( SPADStatus* const pad );
+ void SetOutput( const bool on );
+
+ std::string GetName() const;
+
+
+private:
+
+ Buttons* m_buttons;
+ AnalogStick* m_main_stick;
+ AnalogStick* m_c_stick;
+ Buttons* m_dpad;
+ MixedTriggers* m_triggers;
+ ControlGroup* m_rumble;
+ ControlGroup* m_options;
+
+ const unsigned int m_index;
+
+};
diff --git a/Source/Core/Core/Src/HW/HW.cpp b/Source/Core/Core/Src/HW/HW.cpp
index 70f6ae21fd..72a7023590 100644
--- a/Source/Core/Core/Src/HW/HW.cpp
+++ b/Source/Core/Core/Src/HW/HW.cpp
@@ -28,6 +28,7 @@
#include "Memmap.h"
#include "ProcessorInterface.h"
#include "SI.h"
+#include "GCPad.h"
#include "AudioInterface.h"
#include "VideoInterface.h"
#include "WII_IPC.h"
@@ -50,6 +51,7 @@ namespace HW
// Init the whole Hardware
AudioInterface::Init();
VideoInterface::Init();
+ PAD_Init();
SerialInterface::Init();
ProcessorInterface::Init();
Memory::Init();
@@ -75,6 +77,7 @@ namespace HW
DSP::Shutdown();
Memory::Shutdown();
SerialInterface::Shutdown();
+ PAD_Shutdown();
AudioInterface::Shutdown();
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
@@ -82,7 +85,7 @@ namespace HW
WII_IPCInterface::Shutdown();
WII_IPC_HLE_Interface::Shutdown();
}
-
+
State_Shutdown();
CoreTiming::Shutdown();
}
diff --git a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp
index 3737a6f899..2df3fb3dbe 100644
--- a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp
+++ b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp
@@ -19,7 +19,7 @@
#include "SI_Device.h"
#include "SI_DeviceAMBaseboard.h"
-#include "../PluginManager.h" // for pad state
+#include "GCPad.h" // for pad state
// where to put baseboard debug
#define AMBASEBOARDDEBUG OSREPORT
@@ -142,10 +142,11 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
case 0x10:
{
DEBUG_LOG(AMBASEBOARDDEBUG, "GC-AM: CMD 10, %02x (READ STATUS&SWITCHES)", ptr(1));
+
SPADStatus PadStatus;
memset(&PadStatus, 0 ,sizeof(PadStatus));
- CPluginManager::GetInstance().GetPad(0)
- ->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
+ PAD_GetStatus(0, &PadStatus);
+
res[resp++] = 0x10;
res[resp++] = 0x2;
int d10_0 = 0xdf;
@@ -310,8 +311,8 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
for (i=0; iPAD_GetStatus(i, &PadStatus);
+ PAD_GetStatus(i, &PadStatus);
+
unsigned char player_data[2] = {0,0};
if (PadStatus.button & PAD_BUTTON_START)
player_data[0] |= 0x80;
@@ -348,8 +349,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
int slots = *jvs_io++;
msg.addData(1);
SPADStatus PadStatus;
- CPluginManager::GetInstance().GetPad(0)
- ->PAD_GetStatus(0, &PadStatus);
+ PAD_GetStatus(0, &PadStatus);
while (slots--)
{
msg.addData(0);
diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp
index b1036d9a8d..04f56f74db 100644
--- a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp
+++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp
@@ -21,6 +21,7 @@
#include "SI.h"
#include "SI_Device.h"
#include "SI_DeviceGCController.h"
+#include "GCPad.h"
#include "EXI_Device.h"
#include "EXI_DeviceMic.h"
@@ -60,7 +61,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
while (iPosition < _iLength)
{
// Read the command
- EBufferCommands command = static_cast(_pBuffer[iPosition ^ 3]);
+ GCPADCommands command = static_cast(_pBuffer[iPosition ^ 3]);
iPosition++;
// Handle it
@@ -128,8 +129,7 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
{
SPADStatus PadStatus;
memset(&PadStatus, 0, sizeof(PadStatus));
- Common::PluginPAD* pad = CPluginManager::GetInstance().GetPad(0);
- pad->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
+ PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
u32 netValues[2] = {0};
int NetPlay = 2;
@@ -258,7 +258,6 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
// SendCommand
void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
{
- Common::PluginPAD* pad = CPluginManager::GetInstance().GetPad(0);
UCommand command(_Cmd);
switch (command.Command)
@@ -269,8 +268,8 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
case CMD_WRITE:
{
- unsigned int uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
- unsigned int uStrength = command.Parameter2;
+ u8 uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
+ u8 uStrength = command.Parameter2;
#if defined(HAVE_WX) && HAVE_WX
// get the correct pad number that should rumble locally when using netplay
@@ -280,8 +279,7 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
#endif
if (numPAD < 4)
- if (pad->PAD_Rumble)
- pad->PAD_Rumble(numPAD, uType, uStrength);
+ PAD_Rumble(numPAD, uType, uStrength);
if (!_Poll)
{
diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.h b/Source/Core/Core/Src/HW/SI_DeviceGCController.h
index 8a8dd0efb7..cc2180970e 100644
--- a/Source/Core/Core/Src/HW/SI_DeviceGCController.h
+++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.h
@@ -18,24 +18,36 @@
#ifndef _SI_DEVICEGCCONTROLLER_H
#define _SI_DEVICEGCCONTROLLER_H
-#include "../PluginManager.h"
#include "SI_Device.h"
-
+#include "GCPad.h"
// standard gamecube controller
class CSIDevice_GCController : public ISIDevice
{
private:
-
- // Commands
- enum EBufferCommands
+ enum GCPADCommands
{
CMD_INVALID = 0xFFFFFFFF,
CMD_RESET = 0x00,
+ CMD_WRITE = 0x40,
CMD_ORIGIN = 0x41,
CMD_RECALIBRATE = 0x42,
};
+ union UCommand
+ {
+ u32 Hex;
+ struct
+ {
+ unsigned Parameter1 : 8;
+ unsigned Parameter2 : 8;
+ unsigned Command : 8;
+ unsigned : 8;
+ };
+ UCommand() {Hex = 0;}
+ UCommand(u32 _iValue) {Hex = _iValue;}
+ };
+
struct SOrigin
{
u8 uCommand;// Maybe should be button bits?
@@ -52,25 +64,6 @@ private:
u8 unk_7;
};
- enum EDirectCommands
- {
- CMD_WRITE = 0x40
- };
-
- union UCommand
- {
- u32 Hex;
- struct
- {
- unsigned Parameter1 : 8;
- unsigned Parameter2 : 8;
- unsigned Command : 8;
- unsigned : 8;
- };
- UCommand() {Hex = 0;}
- UCommand(u32 _iValue) {Hex = _iValue;}
- };
-
enum EButtonCombo
{
COMBO_NONE = 0,
@@ -94,8 +87,6 @@ private:
EButtonCombo m_LastButtonCombo;
public:
-
- // Constructor
CSIDevice_GCController(int _iDeviceNumber);
// Run the SI Buffer
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp
index cc4f2e586a..16e471eafd 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp
@@ -37,7 +37,7 @@ bool CWII_IPC_HLE_Device_usb_kbd::Open(u32 _CommandAddress, u32 _Mode)
INFO_LOG(WII_IPC_STM, "CWII_IPC_HLE_Device_usb_kbd: Open");
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
- ini.Get("USB Keyboard", "Layout", &m_KeyboardLayout, KBD_LAYOUT_QWERTY);
+ ini["USB Keyboard"].Get("Layout", &m_KeyboardLayout, KBD_LAYOUT_QWERTY);
for(int i = 0; i < 256; i++)
m_OldKeyBuffer[i] = false;
diff --git a/Source/Core/Core/Src/LuaInterface.cpp b/Source/Core/Core/Src/LuaInterface.cpp
index d70436ffa0..89c6422363 100644
--- a/Source/Core/Core/Src/LuaInterface.cpp
+++ b/Source/Core/Core/Src/LuaInterface.cpp
@@ -2794,10 +2794,11 @@ DEFINE_LUA_FUNCTION(emulua_loadrom, "filename")
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
{
// General settings
- game_ini.Get("Core", "CPUOnThread", &StartUp.bCPUThread, StartUp.bCPUThread);
- game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
- game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
- game_ini.Get("Core", "TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
+ Section& core = game_ini["Core"];
+ core.Get("CPUOnThread", &StartUp.bCPUThread, StartUp.bCPUThread);
+ core.Get("SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle);
+ core.Get("EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF);
+ core.Get("TLBHack", &StartUp.iTLBHack, StartUp.iTLBHack);
// Wii settings
if (StartUp.bWii)
{
diff --git a/Source/Core/Core/Src/OnFrame.h b/Source/Core/Core/Src/OnFrame.h
index 416e4dc188..7d79c81dc9 100644
--- a/Source/Core/Core/Src/OnFrame.h
+++ b/Source/Core/Core/Src/OnFrame.h
@@ -19,7 +19,7 @@
#define __FRAME_H
#include "Common.h"
-#include "pluginspecs_pad.h"
+#include "HW/GCPad.h"
#include
diff --git a/Source/Core/Core/Src/PatchEngine.cpp b/Source/Core/Core/Src/PatchEngine.cpp
index ca90c4491a..d1f00cb3f3 100644
--- a/Source/Core/Core/Src/PatchEngine.cpp
+++ b/Source/Core/Core/Src/PatchEngine.cpp
@@ -55,12 +55,13 @@ std::vector discList;
void LoadPatchSection(const char *section, std::vector &patches, IniFile &ini)
{
- std::vector lines;
- if (!ini.GetLines(section, lines))
- return;
+ //if (!ini.Exists(section))
+ //return;
Patch currentPatch;
+ std::vector lines;
+ ini[section].GetLines(lines);
for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string line = *iter;
@@ -99,15 +100,14 @@ void LoadPatchSection(const char *section, std::vector &patches, IniFile
}
}
}
- if (currentPatch.name.size()) patches.push_back(currentPatch);
+ if (currentPatch.name.size())
+ patches.push_back(currentPatch);
}
static void LoadDiscList(const char *section, std::vector &_discList, IniFile &ini) {
std::vector lines;
- if (!ini.GetLines(section, lines))
- return;
-
+ ini[section].GetLines(lines);
for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string line = *iter;
@@ -117,19 +117,18 @@ static void LoadDiscList(const char *section, std::vector &_discLis
}
static void LoadSpeedhacks(const char *section, std::map &hacks, IniFile &ini) {
- std::vector keys;
- ini.GetKeys(section, keys);
- for (std::vector::const_iterator iter = keys.begin(); iter != keys.end(); ++iter)
+ Section& sect = ini[section];
+ for (Section::const_iterator iter = sect.begin(); iter != sect.end(); ++iter)
{
- std::string key = *iter;
+ const std::string& key = iter->first;
std::string value;
- ini.Get(section, key.c_str(), &value, "BOGUS");
+ sect.Get(key, &value, "BOGUS");
if (value != "BOGUS")
{
u32 address;
u32 cycles;
bool success = true;
- success = success && TryParseUInt(std::string(key.c_str()), &address);
+ success = success && TryParseUInt(std::string(key.c_str()), &address); // std::string(.c_str()); // what?
success = success && TryParseUInt(value, &cycles);
if (success) {
speedHacks[address] = (int)cycles;
diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp
index 43eb23831e..f83efac035 100644
--- a/Source/Core/Core/Src/PluginManager.cpp
+++ b/Source/Core/Core/Src/PluginManager.cpp
@@ -64,15 +64,12 @@ CPluginManager::CPluginManager()
// Start LogManager
m_PluginGlobals->logManager = LogManager::GetInstance();
- m_PluginGlobals->eventHandler = EventHandler::GetInstance();
m_params = &(SConfig::GetInstance().m_LocalCoreStartupParameter);
// Set initial values to NULL.
m_video = NULL;
m_dsp = NULL;
- for (int i = 0; i < MAXPADS; i++)
- m_pad[i] = NULL;
for (int i = 0; i < MAXWIIMOTES; i++)
m_wiimote[i] = NULL;
}
@@ -85,15 +82,6 @@ CPluginManager::~CPluginManager()
delete m_PluginGlobals;
delete m_dsp;
- for (int i = 0; i < MAXPADS; i++)
- {
- if (m_pad[i])
- {
- delete m_pad[i];
- m_pad[i] = NULL;
- }
- }
-
for (int i = 0; i < MAXWIIMOTES; i++)
{
if (m_wiimote[i])
@@ -112,7 +100,7 @@ CPluginManager::~CPluginManager()
// Init and Shutdown Plugins
// ------------
-// Function: Point the m_pad[] and other variables to a certain plugin
+// Function: Point the m_wiimote[] and other variables to a certain plugin
bool CPluginManager::InitPlugins()
{
// Update pluginglobals.
@@ -134,26 +122,9 @@ bool CPluginManager::InitPlugins()
}
INFO_LOG(CONSOLE, "After GetVideo\n");
- // Check if we get at least one pad or wiimote
- bool pad = false;
+ // Check if we get at least one wiimote
bool wiimote = false;
- // Init pad
- for (int i = 0; i < MAXPADS; i++)
- {
- // Check that the plugin has a name
- if (!m_params->m_strPadPlugin[i].empty())
- GetPad(i);
- // Check that GetPad succeeded
- if (m_pad[i] != NULL)
- pad = true;
- }
- if (!pad)
- {
- PanicAlert("Can't init any PAD Plugins");
- return false;
- }
-
// Init wiimote
if (m_params->bWii)
{
@@ -180,15 +151,6 @@ bool CPluginManager::InitPlugins()
// for an explanation about the current LoadLibrary() and FreeLibrary() behavior.
void CPluginManager::ShutdownPlugins()
{
- for (int i = 0; i < MAXPADS; i++)
- {
- if (m_pad[i])
- {
- m_pad[i]->Shutdown();
- FreePad(i);
- }
- }
-
for (int i = 0; i < MAXWIIMOTES; i++)
{
if (m_wiimote[i])
@@ -304,10 +266,6 @@ void *CPluginManager::LoadPlugin(const char *_rFilename)
plugin = new Common::PluginDSP(_rFilename);
break;
- case PLUGIN_TYPE_PAD:
- plugin = new Common::PluginPAD(_rFilename);
- break;
-
case PLUGIN_TYPE_WIIMOTE:
plugin = new Common::PluginWiimote(_rFilename);
break;
@@ -382,28 +340,12 @@ void CPluginManager::ScanForPlugins()
/* Create or return the already created plugin pointers. This will be called
- often for the Pad and Wiimote from the SI_.cpp files. And often for the DSP
- from the DSP files.
+ often for the Wiimote from the SI_.cpp files.
We don't need to check if [Plugin]->IsValid() here because it will not be set by LoadPlugin()
if it's not valid.
*/
// ------------
-Common::PluginPAD *CPluginManager::GetPad(int controller)
-{
- if (m_pad[controller] != NULL)
- {
- if (m_pad[controller]->GetFilename() == m_params->m_strPadPlugin[controller])
- return m_pad[controller];
- else
- FreePad(controller);
- }
-
- // Else load a new plugin
- m_pad[controller] = (Common::PluginPAD*)LoadPlugin(m_params->m_strPadPlugin[controller].c_str());
- return m_pad[controller];
-}
-
Common::PluginWiimote *CPluginManager::GetWiimote(int controller)
{
if (m_wiimote[controller] != NULL)
@@ -470,15 +412,6 @@ void CPluginManager::FreeDSP()
m_dsp = NULL;
}
-void CPluginManager::FreePad(u32 Pad)
-{
- if (Pad < MAXPADS)
- {
- delete m_pad[Pad];
- m_pad[Pad] = NULL;
- }
-}
-
void CPluginManager::FreeWiimote(u32 Wiimote)
{
if (Wiimote < MAXWIIMOTES)
@@ -496,7 +429,6 @@ void CPluginManager::EmuStateChange(PLUGIN_EMUSTATE newState)
// Would we need to call all plugins?
// If yes, how would one check if the plugin was not
// just created by GetXxx(idx) because there was none?
- GetPad(0)->EmuStateChange(newState);
GetWiimote(0)->EmuStateChange(newState);
}
@@ -521,9 +453,6 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TY
case PLUGIN_TYPE_DSP:
GetDSP()->Config((HWND)_Parent);
break;
- case PLUGIN_TYPE_PAD:
- GetPad(0)->Config((HWND)_Parent);
- break;
case PLUGIN_TYPE_WIIMOTE:
GetWiimote(0)->Config((HWND)_Parent);
break;
@@ -532,7 +461,7 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TY
}
}
-// Open debugging window. Type = Video or DSP. Show = Show or hide window.
+// Open debugging window. Type = Video. Show = Show or hide window.
void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename, PLUGIN_TYPE Type, bool Show)
{
if (!File::Exists(_rFilename))
diff --git a/Source/Core/Core/Src/PluginManager.h b/Source/Core/Core/Src/PluginManager.h
index 38b0420908..32c147e4de 100644
--- a/Source/Core/Core/Src/PluginManager.h
+++ b/Source/Core/Core/Src/PluginManager.h
@@ -20,10 +20,8 @@
#include "Plugin.h"
#include "PluginDSP.h"
-#include "PluginPAD.h"
#include "PluginVideo.h"
#include "PluginWiimote.h"
-#include "EventHandler.h"
#include "CoreParameter.h"
class CPluginInfo
@@ -52,12 +50,10 @@ public:
Common::PluginVideo *GetVideo();
Common::PluginDSP *GetDSP();
- Common::PluginPAD *GetPad(int controller);
Common::PluginWiimote *GetWiimote(int controller);
void FreeVideo();
void FreeDSP();
- void FreePad(u32 Pad);
void FreeWiimote(u32 Wiimote);
void EmuStateChange(PLUGIN_EMUSTATE newState);
@@ -75,7 +71,6 @@ private:
CPluginInfos m_PluginInfos;
PLUGIN_GLOBALS *m_PluginGlobals;
- Common::PluginPAD *m_pad[4];
Common::PluginVideo *m_video;
Common::PluginWiimote *m_wiimote[4];
Common::PluginDSP *m_dsp;
diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp
index 1da95de50f..a549124134 100644
--- a/Source/Core/Core/Src/State.cpp
+++ b/Source/Core/Core/Src/State.cpp
@@ -92,7 +92,6 @@ void DoState(PointerWrap &p)
CPluginManager &pm = CPluginManager::GetInstance();
pm.GetVideo()->DoState(p.GetPPtr(), p.GetMode());
pm.GetDSP()->DoState(p.GetPPtr(), p.GetMode());
- pm.GetPad(0)->DoState(p.GetPPtr(), p.GetMode());
if (Core::g_CoreStartupParameter.bWii)
pm.GetWiimote(0)->DoState(p.GetPPtr(), p.GetMode());
PowerPC::DoState(p);
diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
index 8198247038..c413813842 100644
--- a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
@@ -142,13 +142,14 @@ void CBreakPointWindow::OnAddBreakPointMany()
if (ini.Load(filename.c_str())) // check if there is any file there
{
// get lines from a certain section
- std::vector lines;
- if (!ini.GetLines("BreakPoints", lines))
+ if (!ini.Exists("BreakPoints"))
{
wxMessageBox(_T("You have no [BreakPoints] line in your file"));
return;
}
+ std::vector lines;
+ ini["BreakPoints"].GetLines(lines);
for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string line = StripSpaces(*iter);
@@ -188,13 +189,14 @@ void CBreakPointWindow::OnAddMemoryCheckMany()
if (ini.Load(filename.c_str()))
{
// get lines from a certain section
- std::vector lines;
- if (!ini.GetLines("MemoryChecks", lines))
+ if (!ini.Exists("MemoryChecks"))
{
wxMessageBox(_T("You have no [MemoryChecks] line in your file"));
return;
}
+ std::vector lines;
+ ini["MemoryChecks"].GetLines(lines);
for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string line = StripSpaces(*iter);
diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp
index f8c1310aee..3b050b60c8 100644
--- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp
+++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp
@@ -88,89 +88,93 @@ void CCodeWindow::Load()
// The font to override DebuggerFont with
std::string fontDesc;
- ini.Get("ShowOnStart", "DebuggerFont", &fontDesc);
+ Section& showonstart = ini["ShowOnStart"];
+ showonstart.Get("DebuggerFont", &fontDesc);
if (!fontDesc.empty())
DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str()));
// Decide what windows to use
// This stuff really doesn't belong in CodeWindow anymore, does it? It should be
// in Frame.cpp somewhere, even though it's debugger stuff.
- ini.Get("ShowOnStart", "Code", &bCodeWindow, true);
- ini.Get("ShowOnStart", "Registers", &bRegisterWindow, false);
- ini.Get("ShowOnStart", "Breakpoints", &bBreakpointWindow, false);
- ini.Get("ShowOnStart", "Memory", &bMemoryWindow, false);
- ini.Get("ShowOnStart", "JIT", &bJitWindow, false);
- ini.Get("ShowOnStart", "Sound", &bSoundWindow, false);
- ini.Get("ShowOnStart", "Video", &bVideoWindow, false);
+ showonstart.Get("Code", &bCodeWindow, true);
+ showonstart.Get("Registers", &bRegisterWindow, false);
+ showonstart.Get("Breakpoints", &bBreakpointWindow, false);
+ showonstart.Get("Memory", &bMemoryWindow, false);
+ showonstart.Get("JIT", &bJitWindow, false);
+ showonstart.Get("Sound", &bSoundWindow, false);
+ showonstart.Get("Video", &bVideoWindow, false);
// Get notebook affiliation
- std::string _Section = StringFromFormat("P - %s",
+ Section& section = ini[StringFromFormat("P - %s",
(Parent->ActivePerspective < Parent->Perspectives.size())
- ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "");
- ini.Get(_Section.c_str(), "Log", &iLogWindow, 1);
- ini.Get(_Section.c_str(), "Console", &iConsoleWindow, 1);
- ini.Get(_Section.c_str(), "Code", &iCodeWindow, 1);
- ini.Get(_Section.c_str(), "Registers", &iRegisterWindow, 1);
- ini.Get(_Section.c_str(), "Breakpoints", &iBreakpointWindow, 0);
- ini.Get(_Section.c_str(), "Memory", &iMemoryWindow, 1);
- ini.Get(_Section.c_str(), "JIT", &iJitWindow, 1);
- ini.Get(_Section.c_str(), "Sound", &iSoundWindow, 0);
- ini.Get(_Section.c_str(), "Video", &iVideoWindow, 0);
+ ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "")];
+ section.Get("Log", &iLogWindow, 1);
+ section.Get("Console", &iConsoleWindow, 1);
+ section.Get("Code", &iCodeWindow, 1);
+ section.Get("Registers", &iRegisterWindow, 1);
+ section.Get("Breakpoints", &iBreakpointWindow, 0);
+ section.Get("Memory", &iMemoryWindow, 1);
+ section.Get("JIT", &iJitWindow, 1);
+ section.Get("Sound", &iSoundWindow, 0);
+ section.Get("Video", &iVideoWindow, 0);
// Get floating setting
- ini.Get("Float", "Log", &Parent->bFloatLogWindow, false);
- ini.Get("Float", "Console", &Parent->bFloatConsoleWindow, false);
- ini.Get("Float", "Code", &bFloatCodeWindow, false);
- ini.Get("Float", "Registers", &bFloatRegisterWindow, false);
- ini.Get("Float", "Breakpoints", &bFloatBreakpointWindow, false);
- ini.Get("Float", "Memory", &bFloatMemoryWindow, false);
- ini.Get("Float", "JIT", &bFloatJitWindow, false);
- ini.Get("Float", "Sound", &bFloatSoundWindow, false);
- ini.Get("Float", "Video", &bFloatVideoWindow, false);
+ Section& flt = ini["Float"];
+ flt.Get("Log", &Parent->bFloatLogWindow, false);
+ flt.Get("Console", &Parent->bFloatConsoleWindow, false);
+ flt.Get("Code", &bFloatCodeWindow, false);
+ flt.Get("Registers", &bFloatRegisterWindow, false);
+ flt.Get("Breakpoints", &bFloatBreakpointWindow, false);
+ flt.Get("Memory", &bFloatMemoryWindow, false);
+ flt.Get("JIT", &bFloatJitWindow, false);
+ flt.Get("Sound", &bFloatSoundWindow, false);
+ flt.Get("Video", &bFloatVideoWindow, false);
// Boot to pause or not
- ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false);
- ini.Get("ShowOnStart", "BootToPause", &bBootToPause, true);
+ showonstart.Get("AutomaticStart", &bAutomaticStart, false);
+ showonstart.Get("BootToPause", &bBootToPause, true);
}
void CCodeWindow::Save()
{
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- ini.Set("ShowOnStart", "DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
+ Section& showonstart = ini["ShowOnStart"];
+ showonstart.Set("DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
// Boot to pause or not
- ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
- ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
+ showonstart.Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
+ showonstart.Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
// Save windows settings
- //ini.Set("ShowOnStart", "Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW));
- ini.Set("ShowOnStart", "Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW));
- ini.Set("ShowOnStart", "Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW));
- ini.Set("ShowOnStart", "Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW));
- ini.Set("ShowOnStart", "JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW));
- ini.Set("ShowOnStart", "Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW));
- ini.Set("ShowOnStart", "Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW));
- std::string _Section = StringFromFormat("P - %s",
+ //showonstart.Set("Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW));
+ showonstart.Set("Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW));
+ showonstart.Set("Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW));
+ showonstart.Set("Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW));
+ showonstart.Set("JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW));
+ showonstart.Set("Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW));
+ showonstart.Set("Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW));
+ Section& section = ini[StringFromFormat("P - %s",
(Parent->ActivePerspective < Parent->Perspectives.size())
- ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "");
- ini.Set(_Section.c_str(), "Log", iLogWindow);
- ini.Set(_Section.c_str(), "Console", iConsoleWindow);
- ini.Set(_Section.c_str(), "Code", iCodeWindow);
- ini.Set(_Section.c_str(), "Registers", iRegisterWindow);
- ini.Set(_Section.c_str(), "Breakpoints", iBreakpointWindow);
- ini.Set(_Section.c_str(), "Memory", iMemoryWindow);
- ini.Set(_Section.c_str(), "JIT", iJitWindow);
- ini.Set(_Section.c_str(), "Sound", iSoundWindow);
- ini.Set(_Section.c_str(), "Video", iVideoWindow);
+ ? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "")];
+ section.Set("Log", iLogWindow);
+ section.Set("Console", iConsoleWindow);
+ section.Set("Code", iCodeWindow);
+ section.Set("Registers", iRegisterWindow);
+ section.Set("Breakpoints", iBreakpointWindow);
+ section.Set("Memory", iMemoryWindow);
+ section.Set("JIT", iJitWindow);
+ section.Set("Sound", iSoundWindow);
+ section.Set("Video", iVideoWindow);
// Save floating setting
- ini.Set("Float", "Log", !!FindWindowById(IDM_LOGWINDOW_PARENT));
- ini.Set("Float", "Console", !!FindWindowById(IDM_CONSOLEWINDOW_PARENT));
- ini.Set("Float", "Code", !!FindWindowById(IDM_CODEWINDOW_PARENT));
- ini.Set("Float", "Registers", !!FindWindowById(IDM_REGISTERWINDOW_PARENT));
- ini.Set("Float", "Breakpoints", !!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT));
- ini.Set("Float", "Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT));
- ini.Set("Float", "JIT", !!FindWindowById(IDM_JITWINDOW_PARENT));
- ini.Set("Float", "Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT));
- ini.Set("Float", "Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT));
+ Section& flt = ini["Float"];
+ flt.Set("Log", !!FindWindowById(IDM_LOGWINDOW_PARENT));
+ flt.Set("Console", !!FindWindowById(IDM_CONSOLEWINDOW_PARENT));
+ flt.Set("Code", !!FindWindowById(IDM_CODEWINDOW_PARENT));
+ flt.Set("Registers", !!FindWindowById(IDM_REGISTERWINDOW_PARENT));
+ flt.Set("Breakpoints", !!FindWindowById(IDM_BREAKPOINTWINDOW_PARENT));
+ flt.Set("Memory", !!FindWindowById(IDM_MEMORYWINDOW_PARENT));
+ flt.Set("JIT", !!FindWindowById(IDM_JITWINDOW_PARENT));
+ flt.Set("Sound", !!FindWindowById(IDM_SOUNDWINDOW_PARENT));
+ flt.Set("Video", !!FindWindowById(IDM_VIDEOWINDOW_PARENT));
ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
}
diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
index 61e0468fe0..d24701975a 100644
--- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
@@ -129,21 +129,23 @@ void CMemoryWindow::Save(IniFile& _IniFile) const
// Prevent these bad values that can happen after a crash or hanging
if(GetPosition().x != -32000 && GetPosition().y != -32000)
{
- _IniFile.Set("MemoryWindow", "x", GetPosition().x);
- _IniFile.Set("MemoryWindow", "y", GetPosition().y);
- _IniFile.Set("MemoryWindow", "w", GetSize().GetWidth());
- _IniFile.Set("MemoryWindow", "h", GetSize().GetHeight());
+ Section& memwin = _IniFile["MemoryWindow"];
+ memwin.Set("x", GetPosition().x);
+ memwin.Set("y", GetPosition().y);
+ memwin.Set("w", GetSize().GetWidth());
+ memwin.Set("h", GetSize().GetHeight());
}
}
void CMemoryWindow::Load(IniFile& _IniFile)
{
- int x,y,w,h;
- _IniFile.Get("MemoryWindow", "x", &x, GetPosition().x);
- _IniFile.Get("MemoryWindow", "y", &y, GetPosition().y);
- _IniFile.Get("MemoryWindow", "w", &w, GetSize().GetWidth());
- _IniFile.Get("MemoryWindow", "h", &h, GetSize().GetHeight());
+ int x, y, w, h;
+ Section& memwin = _IniFile["MemoryWindow"];
+ memwin.Get("x", &x, GetPosition().x);
+ memwin.Get("y", &y, GetPosition().y);
+ memwin.Get("w", &w, GetSize().GetWidth());
+ memwin.Get("h", &h, GetSize().GetHeight());
SetSize(x, y, w, h);
}
@@ -322,12 +324,12 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
//memview->cu
wxString rawData=valbox->GetValue();
std::vector Dest;//May need a better name
- u32 size=0;
+ size_t size=0;
int pad=rawData.size()%2;//If it's uneven
unsigned long i=0;
long count=0;
char copy[3]={0};
- long newsize=0;
+ size_t newsize=0;
unsigned char *tmp2=0;
char* tmpstr=0;
switch (chkHex->GetValue()){
diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp
index 06f4a7b789..7bd8ec2118 100644
--- a/Source/Core/DiscIO/Src/FileMonitor.cpp
+++ b/Source/Core/DiscIO/Src/FileMonitor.cpp
@@ -142,7 +142,7 @@ void FindFilename(u64 offset)
if (!fname || (strlen(fname) == 512))
return;
- CheckFile(fname, pFileSystem->GetFileSize(fname));
+ CheckFile(fname, (int)pFileSystem->GetFileSize(fname));
}
void Close()
diff --git a/Source/Core/DolphinWX/DolphinWX.vcproj b/Source/Core/DolphinWX/DolphinWX.vcproj
index d6a8f228a8..25420388b9 100644
--- a/Source/Core/DolphinWX/DolphinWX.vcproj
+++ b/Source/Core/DolphinWX/DolphinWX.vcproj
@@ -56,7 +56,7 @@
Optimization="3"
InlineFunctionExpansion="0"
FavorSizeOrSpeed="1"
- AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DebuggerUICommon\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\SFML\include"
+ AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DebuggerUICommon\src;..\DiscIO\Src;..\InputCommon\Src;..\..\Plugins\InputUICommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="false"
RuntimeLibrary="0"
@@ -174,7 +174,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="false"
- AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DebuggerUICommon\src;..\DiscIO\Src;..\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\SFML\include"
+ AdditionalIncludeDirectories="..\Common\Src;..\Core\Src;..\DebuggerWX\src;..\DebuggerUICommon\src;..\DiscIO\Src;..\InputCommon\Src;..\..\Plugins\InputUICommon\Src;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\..\..\Externals\SFML\include"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
@@ -286,7 +286,7 @@
Disable();
DSPSelection->Disable();
- PADSelection->Disable();
WiimoteSelection->Disable();
}
}
@@ -282,8 +279,6 @@ void CConfigMain::InitializeGUIValues()
// Plugins
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
- for (int i = 0; i < MAXPADS; i++)
- FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[i]);
for (int i=0; i < MAXWIIMOTES; i++)
FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[i]);
}
@@ -675,10 +670,6 @@ void CConfigMain::CreateGUIControls()
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("Gamecube 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);
@@ -693,10 +684,6 @@ void CConfigMain::CreateGUIControls()
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);
@@ -1079,9 +1066,6 @@ void CConfigMain::OnSelectionChanged(wxCommandEvent& WXUNUSED (event))
{
// Update plugin filenames
GetFilename(GraphicSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
- GetFilename(DSPSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
- for (int i = 0; i < MAXPADS; i++)
- GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[i]);
for (int i = 0; i < MAXWIIMOTES; i++)
GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[i]);
}
@@ -1096,9 +1080,6 @@ void CConfigMain::OnConfig(wxCommandEvent& event)
case ID_DSP_CONFIG:
CallConfig(DSPSelection);
break;
- case ID_PAD_CONFIG:
- CallConfig(PADSelection);
- break;
case ID_WIIMOTE_CONFIG:
CallConfig(WiimoteSelection);
break;
diff --git a/Source/Core/DolphinWX/Src/ConfigMain.h b/Source/Core/DolphinWX/Src/ConfigMain.h
index a24824a7d9..644736b5e8 100644
--- a/Source/Core/DolphinWX/Src/ConfigMain.h
+++ b/Source/Core/DolphinWX/Src/ConfigMain.h
@@ -99,7 +99,6 @@ private:
wxBoxSizer* sPlugins;
wxStaticBoxSizer* sbGraphicsPlugin;
wxStaticBoxSizer* sbDSPPlugin;
- wxStaticBoxSizer* sbPadPlugin;
wxStaticBoxSizer* sbWiimotePlugin;
wxNotebook *Notebook;
@@ -138,9 +137,6 @@ private:
wxStaticText* ApploaderPathText;
wxFilePickerCtrl* ApploaderPath;
- wxStaticText* PADText;
- wxButton* PADConfig;
- wxChoice* PADSelection;
wxButton* DSPConfig;
wxStaticText* DSPText;
wxChoice* DSPSelection;
@@ -239,10 +235,6 @@ private:
ID_WIIMOTE_CONFIG,
ID_WIIMOTE_TEXT,
ID_WIIMOTE_CB,
- ID_PAD_TEXT,
- ID_PAD_ABOUT ,
- ID_PAD_CONFIG,
- ID_PAD_CB,
ID_DSP_ABOUT,
ID_DSP_CONFIG,
ID_DSP_TEXT,
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp
index 4795bcf0cc..ee8c5ddf76 100644
--- a/Source/Core/DolphinWX/Src/Frame.cpp
+++ b/Source/Core/DolphinWX/Src/Frame.cpp
@@ -45,6 +45,7 @@
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
#include "State.h"
#include "VolumeHandler.h"
+#include "HW/GCPad.h"
#include // wxWidgets
@@ -251,7 +252,7 @@ EVT_MENU(IDM_SCREENSHOT, CFrame::OnScreenshot)
EVT_MENU(wxID_PREFERENCES, CFrame::OnConfigMain)
EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX)
EVT_MENU(IDM_CONFIG_DSP_PLUGIN, CFrame::OnPluginDSP)
-EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnPluginPAD)
+EVT_MENU(IDM_CONFIG_GCPAD, CFrame::OnPluginGCPad)
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnPluginWiimote)
EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnToolBar)
@@ -441,7 +442,7 @@ CFrame::CFrame(wxFrame* parent,
{
IniFile ini; int winpos;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
- ini.Get("LogWindow", "pos", &winpos, 2);
+ ini["LogWindow"].Get("pos", &winpos, 2);
m_Mgr->GetPane(wxT("Pane 0")).Show().PaneBorder(false).CaptionVisible(false).Layer(0).Center();
m_Mgr->GetPane(wxT("Pane 1")).Hide().PaneBorder(false).CaptionVisible(true).Layer(0)
@@ -712,12 +713,6 @@ void CFrame::OnCustomHostMessage(int Id)
{
DoRemovePage(Win, false);
- CPluginManager::GetInstance().OpenDebug(
- GetHandle(),
- SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
- PLUGIN_TYPE_DSP, false
- );
-
//Win->Reparent(NULL);
//g_pCodeWindow->OnToggleDLLWindow(false, 0);
GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(false);
@@ -883,7 +878,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
#endif
// Send the keyboard status to the Input plugin
- CPluginManager::GetInstance().GetPad(0)->PAD_Input(event.GetKeyCode(), 1); // 1 = Down
+ PAD_Input(event.GetKeyCode(), 1); // 1 = Down
}
else
event.Skip();
@@ -894,7 +889,7 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
event.Skip();
if(Core::GetState() != Core::CORE_UNINITIALIZED)
- CPluginManager::GetInstance().GetPad(0)->PAD_Input(event.GetKeyCode(), 0); // 0 = Up
+ PAD_Input(event.GetKeyCode(), 0); // 0 = Up*/
}
// --------
diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h
index d01c4b812b..5e22b03051 100644
--- a/Source/Core/DolphinWX/Src/Frame.h
+++ b/Source/Core/DolphinWX/Src/Frame.h
@@ -320,7 +320,7 @@ class CFrame : public CRenderFrame
void OnConfigMain(wxCommandEvent& event); // Options
void OnPluginGFX(wxCommandEvent& event);
void OnPluginDSP(wxCommandEvent& event);
- void OnPluginPAD(wxCommandEvent& event);
+ void OnPluginGCPad(wxCommandEvent& event);
void OnPluginWiimote(wxCommandEvent& event);
void OnToggleFullscreen(wxCommandEvent& event);
diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp
index 45da0a4716..397ee95d6f 100644
--- a/Source/Core/DolphinWX/Src/FrameAui.cpp
+++ b/Source/Core/DolphinWX/Src/FrameAui.cpp
@@ -772,8 +772,9 @@ void CFrame::SetSimplePaneSize()
IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
- ini.Get("LogWindow", "x", &x, Size);
- ini.Get("LogWindow", "y", &y, Size);
+ Section& logwin = ini["LogWindow"];
+ logwin.Get("x", &x, Size);
+ logwin.Get("y", &y, Size);
// Update size
m_Mgr->GetPane(wxT("Pane 0")).BestSize(x, y).MinSize(x, y).MaxSize(x, y);
@@ -894,8 +895,9 @@ void CFrame::SaveLocal()
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- ini.Get("Perspectives", "Perspectives", &_Perspectives, "");
- ini.Get("Perspectives", "Active", &ActivePerspective, 5);
+ Section& perspectives = ini["Perspectives"];
+ perspectives.Get("Perspectives", &_Perspectives, "");
+ perspectives.Get("Active", &ActivePerspective, 5);
SplitString(_Perspectives, ",", VPerspectives);
for (u32 i = 0; i < VPerspectives.size(); i++)
@@ -908,10 +910,10 @@ void CFrame::SaveLocal()
if (Tmp.Name == "") continue;
//if (!ini.Exists(_Section.c_str(), "Width")) continue;
- _Section = StringFromFormat("P - %s", Tmp.Name.c_str());
- ini.Get(_Section.c_str(), "Perspective", &_Perspective, "");
- ini.Get(_Section.c_str(), "Width", &_Width, "");
- ini.Get(_Section.c_str(), "Height", &_Height, "");
+ Section& section = ini[StringFromFormat("P - %s", Tmp.Name.c_str())];
+ section.Get("Perspective", &_Perspective, "");
+ section.Get("Width", &_Width, "");
+ section.Get("Height", &_Height, "");
Tmp.Perspective = wxString::FromAscii(_Perspective.c_str());
@@ -946,8 +948,8 @@ void CFrame::Save()
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- std::string _Section = StringFromFormat("P - %s", Perspectives.at(ActivePerspective).Name.c_str());
- ini.Set(_Section.c_str(), "Perspective", m_Mgr->SavePerspective().mb_str());
+ Section& section = ini[StringFromFormat("P - %s", Perspectives.at(ActivePerspective).Name.c_str())];
+ section.Set("Perspective", m_Mgr->SavePerspective().mb_str());
std::string SWidth = "", SHeight = "";
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
@@ -962,8 +964,8 @@ void CFrame::Save()
// Remove the ending ","
SWidth = SWidth.substr(0, SWidth.length()-1); SHeight = SHeight.substr(0, SHeight.length()-1);
- ini.Set(_Section.c_str(), "Width", SWidth.c_str());
- ini.Set(_Section.c_str(), "Height", SHeight.c_str());
+ section.Set("Width", SWidth.c_str());
+ section.Set("Height", SHeight.c_str());
// Save perspective names
std::string STmp = "";
@@ -972,8 +974,9 @@ void CFrame::Save()
STmp += Perspectives.at(i).Name + ",";
}
STmp = STmp.substr(0, STmp.length()-1);
- ini.Set("Perspectives", "Perspectives", STmp.c_str());
- ini.Set("Perspectives", "Active", ActivePerspective);
+ Section& perspectives = ini["Perspectives"];
+ perspectives.Set("Perspectives", STmp.c_str());
+ perspectives.Set("Active", ActivePerspective);
ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
// Save notebook affiliations
diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp
index 8bafc8aa15..7de9e51365 100644
--- a/Source/Core/DolphinWX/Src/FrameTools.cpp
+++ b/Source/Core/DolphinWX/Src/FrameTools.cpp
@@ -27,42 +27,44 @@ window handle that is returned by CreateWindow() can be accessed from
Core::GetWindowHandle().
*/
+// Common
+#include
+#include
+#include
+#include
+#include
-#include "Setup.h" // Common
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+#include
+
+#include
#include "NetWindow.h"
-#include "Common.h" // Common
-#include "FileUtil.h"
-#include "FileSearch.h"
-#include "Timer.h"
-
-#include "Globals.h" // Local
+#include "Globals.h"
#include "Frame.h"
#include "ConfigMain.h"
-#include "PluginManager.h"
#include "MemcardManager.h"
#include "CheatsWindow.h"
#include "LuaWindow.h"
#include "AboutDolphin.h"
#include "GameListCtrl.h"
-#include "BootManager.h"
#include "LogWindow.h"
#include "WxUtils.h"
-
-#include "ConfigManager.h" // Core
-#include "Core.h"
-#include "OnFrame.h"
-#include "HW/CPU.h"
-#include "PowerPC/PowerPC.h"
-#include "HW/DVDInterface.h"
-#include "HW/ProcessorInterface.h"
-#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
-#include "State.h"
-#include "VolumeHandler.h"
-#include "NANDContentLoader.h"
-#include "WXInputBase.h"
-
-#include // wxWidgets
+#include "BootManager.h"
// Resources
@@ -170,7 +172,7 @@ void CFrame::CreateMenu()
pOptionsMenu->AppendSeparator();
pOptionsMenu->Append(IDM_CONFIG_GFX_PLUGIN, _T("&Graphics Settings"));
pOptionsMenu->Append(IDM_CONFIG_DSP_PLUGIN, _T("&DSP Settings"));
- pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&Gamecube Pad Settings"));
+ pOptionsMenu->Append(IDM_CONFIG_GCPAD, _T("&GCPad Settings"));
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings"));
if (g_pCodeWindow)
{
@@ -332,8 +334,10 @@ void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
ToolBar->AddTool(wxID_PREFERENCES, _T("Config"), m_Bitmaps[Toolbar_PluginOptions], _T("Configure..."));
ToolBar->AddTool(IDM_CONFIG_GFX_PLUGIN, _T("Graphics"), m_Bitmaps[Toolbar_PluginGFX], _T("Graphics settings"));
ToolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
- ToolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("GCPad"), m_Bitmaps[Toolbar_PluginPAD], _T("Gamecube Pad settings"));
+ ToolBar->AddTool(IDM_CONFIG_GCPAD, _T("GCPad"), m_Bitmaps[Toolbar_PluginPAD], _T("GCPad settings"));
ToolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings"));
+ ToolBar->AddSeparator();
+ ToolBar->AddTool(wxID_ABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
// after adding the buttons to the toolbar, must call Realize() to reflect
// the changes
@@ -940,14 +944,25 @@ void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
);
}
-void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
+extern Plugin g_GCPad; //TODOSHUFFLE
+void CFrame::OnPluginGCPad(wxCommandEvent& WXUNUSED (event))
{
- CPluginManager::GetInstance().OpenConfig(
- GetHandle(),
- SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[0].c_str(),
- PLUGIN_TYPE_PAD
- );
+ bool was_init = false;
+
+ if ( g_GCPad.controller_interface.IsInit() ) // check if game is running
+ was_init = true;
+ else
+ PAD_Init();
+
+ ConfigDialog* configDiag = new ConfigDialog( this, g_GCPad, g_GCPad.gui_name, was_init );
+
+ configDiag->ShowModal();
+ configDiag->Destroy();
+
+ if ( !was_init ) // if game isn't running
+ PAD_Shutdown();
}
+
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
{
CPluginManager::GetInstance().OpenConfig(
diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp
index 3b1e080dc1..576655c014 100644
--- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp
+++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp
@@ -357,7 +357,7 @@ void CGameListCtrl::OnPaintDrawImages(wxPaintEvent& event)
m_imageListSmall->Draw(m_FlagImageIndex[rISOFile.GetCountry()], dc, flagOffset, itemY);
ini.Load((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + (rISOFile.GetUniqueID()) + ".ini").c_str());
- ini.Get("EmuState", "EmulationStateId", &nState);
+ ini["EmuState"].Get("EmulationStateId", &nState);
m_imageListSmall->Draw(m_EmuStateImageIndex[nState], dc, stateOffset, itemY);
}
}
@@ -701,9 +701,9 @@ int wxCALLBACK wxListCompare(long item1, long item2, long sortData)
std::string GameIni2 = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + iso2->GetUniqueID() + ".ini";
ini.Load(GameIni1.c_str());
- ini.Get("EmuState", "EmulationStateId", &nState1);
+ ini["EmuState"].Get("EmulationStateId", &nState1);
ini.Load(GameIni2.c_str());
- ini.Get("EmuState", "EmulationStateId", &nState2);
+ ini["EmuState"].Get("EmulationStateId", &nState2);
if(nState1 > nState2) return 1 *t;
if(nState1 < nState2) return -1 *t;
@@ -809,8 +809,9 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
std::string emuState[5] = {"Broken", "Intro", "In-Game", "Playable", "Perfect"}, issues;
int nState;
- ini.Get("EmuState", "EmulationStateId", &nState);
- ini.Get("EmuState", "EmulationIssues", &issues, "");
+ Section& emustate = ini["EmuState"];
+ emustate.Get("EmulationStateId", &nState);
+ emustate.Get("EmulationIssues", &issues, "");
// Get item Coords then convert from wxWindow coord to Screen coord
wxRect Rect;
diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h
index c530df24bd..9581baba3f 100644
--- a/Source/Core/DolphinWX/Src/Globals.h
+++ b/Source/Core/DolphinWX/Src/Globals.h
@@ -121,7 +121,7 @@ enum
IDM_CONFIG_GFX_PLUGIN,
IDM_CONFIG_DSP_PLUGIN,
- IDM_CONFIG_PAD_PLUGIN,
+ IDM_CONFIG_GCPAD,
IDM_CONFIG_WIIMOTE_PLUGIN,
// --------------------------------------------------------------
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp
index cb65e72a00..09ef8870da 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp
@@ -782,77 +782,57 @@ void CISOProperties::SetRefresh(wxCommandEvent& event)
void CISOProperties::LoadGameConfig()
{
- bool bTemp;
int iTemp;
std::string sTemp;
- if (GameIni.Get("Core", "CPUThread", &bTemp))
- CPUThread->Set3StateValue((wxCheckBoxState)bTemp);
- else
- CPUThread->Set3StateValue(wxCHK_UNDETERMINED);
+ Section& core = GameIni["Core"];
+ Section& wii = GameIni["Wii"];
+ Section& video = GameIni["Video"];
+ Section& emustate = GameIni["EmuState"];
- if (GameIni.Get("Core", "SkipIdle", &bTemp))
- SkipIdle->Set3StateValue((wxCheckBoxState)bTemp);
- else
- SkipIdle->Set3StateValue(wxCHK_UNDETERMINED);
+ core.Get("CPUThread", &iTemp, (int)wxCHK_UNDETERMINED);
+ CPUThread->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Core", "TLBHack", &bTemp))
- TLBHack->Set3StateValue((wxCheckBoxState)bTemp);
- else
- TLBHack->Set3StateValue(wxCHK_UNDETERMINED);
+ core.Get("SkipIdle", &iTemp, (int)wxCHK_UNDETERMINED);
+ SkipIdle->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Wii", "ProgressiveScan", &bTemp))
- EnableProgressiveScan->Set3StateValue((wxCheckBoxState)bTemp);
- else
- EnableProgressiveScan->Set3StateValue(wxCHK_UNDETERMINED);
+ core.Get("TLBHack", &iTemp, (int)wxCHK_UNDETERMINED);
+ TLBHack->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Wii", "Widescreen", &bTemp))
- EnableWideScreen->Set3StateValue((wxCheckBoxState)bTemp);
- else
- EnableWideScreen->Set3StateValue(wxCHK_UNDETERMINED);
+ wii.Get("ProgressiveScan", &iTemp, (int)wxCHK_UNDETERMINED);
+ EnableProgressiveScan->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "ForceFiltering", &bTemp))
- ForceFiltering->Set3StateValue((wxCheckBoxState)bTemp);
- else
- ForceFiltering->Set3StateValue(wxCHK_UNDETERMINED);
+ wii.Get("Widescreen", &iTemp, (int)wxCHK_UNDETERMINED);
+ EnableWideScreen->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "EFBCopyDisable", &bTemp))
- EFBCopyDisable->Set3StateValue((wxCheckBoxState)bTemp);
- else
- EFBCopyDisable->Set3StateValue(wxCHK_UNDETERMINED);
+ video.Get("ForceFiltering", &iTemp, (int)wxCHK_UNDETERMINED);
+ ForceFiltering->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "EFBToTextureEnable", &bTemp))
- EFBToTextureEnable->Set3StateValue((wxCheckBoxState)bTemp);
- else
- EFBToTextureEnable->Set3StateValue(wxCHK_UNDETERMINED);
+ video.Get("EFBCopyDisable", &iTemp, (int)wxCHK_UNDETERMINED);
+ EFBCopyDisable->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "SafeTextureCache", &bTemp))
- SafeTextureCache->Set3StateValue((wxCheckBoxState)bTemp);
- else
- SafeTextureCache->Set3StateValue(wxCHK_UNDETERMINED);
+ video.Get("EFBToTextureEnable", &iTemp, (int)wxCHK_UNDETERMINED);
+ EFBToTextureEnable->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "DstAlphaPass", &bTemp))
- DstAlphaPass->Set3StateValue((wxCheckBoxState)bTemp);
- else
- DstAlphaPass->Set3StateValue(wxCHK_UNDETERMINED);
+ video.Get("SafeTextureCache", &iTemp, (int)wxCHK_UNDETERMINED);
+ SafeTextureCache->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "UseXFB", &bTemp))
- UseXFB->Set3StateValue((wxCheckBoxState)bTemp);
- else
- UseXFB->Set3StateValue(wxCHK_UNDETERMINED);
+ video.Get("DstAlphaPass", &iTemp, (int)wxCHK_UNDETERMINED);
+ DstAlphaPass->Set3StateValue((wxCheckBoxState)iTemp);
- if (GameIni.Get("Video", "FIFOBPHack", &bTemp))
- BPHack->Set3StateValue((wxCheckBoxState)bTemp);
- else
- BPHack->Set3StateValue(wxCHK_UNDETERMINED);
+ video.Get("UseXFB", &iTemp, (int)wxCHK_UNDETERMINED);
+ UseXFB->Set3StateValue((wxCheckBoxState)iTemp);
- GameIni.Get("Video", "ProjectionHack", &iTemp, -1);
+ video.Get("FIFOBPHack", &iTemp, (int)wxCHK_UNDETERMINED);
+ BPHack->Set3StateValue((wxCheckBoxState)iTemp);
+
+ video.Get("ProjectionHack", &iTemp, -1);
Hack->SetSelection(iTemp);
- GameIni.Get("EmuState", "EmulationStateId", &iTemp, -1);
+ emustate.Get("EmulationStateId", &iTemp, -1);
EmuState->SetSelection(iTemp);
- GameIni.Get("EmuState", "EmulationIssues", &sTemp);
+ emustate.Get("EmulationIssues", &sTemp);
if (!sTemp.empty())
{
EmuIssues->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
@@ -866,77 +846,29 @@ void CISOProperties::LoadGameConfig()
bool CISOProperties::SaveGameConfig()
{
- if (CPUThread->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Core", "CPUThread");
- else
- GameIni.Set("Core", "CPUThread", CPUThread->Get3StateValue());
+ Section& core = GameIni["Core"];
+ Section& wii = GameIni["Wii"];
+ Section& video = GameIni["Video"];
+ Section& emustate = GameIni["EmuState"];
- if (SkipIdle->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Core", "SkipIdle");
- else
- GameIni.Set("Core", "SkipIdle", SkipIdle->Get3StateValue());
+ core.Set("CPUThread", CPUThread->Get3StateValue(), wxCHK_UNDETERMINED);
+ core.Set("SkipIdle", SkipIdle->Get3StateValue(), wxCHK_UNDETERMINED);
+ core.Set("TLBHack", TLBHack->Get3StateValue(), wxCHK_UNDETERMINED);
- if (TLBHack->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Core", "TLBHack");
- else
- GameIni.Set("Core", "TLBHack", TLBHack->Get3StateValue());
+ wii.Set("ProgressiveScan", EnableProgressiveScan->Get3StateValue(), wxCHK_UNDETERMINED);
+ wii.Set("Widescreen", EnableWideScreen->Get3StateValue(), wxCHK_UNDETERMINED);
- if (EnableProgressiveScan->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Wii", "ProgressiveScan");
- else
- GameIni.Set("Wii", "ProgressiveScan", EnableProgressiveScan->Get3StateValue());
+ video.Set("ForceFiltering", ForceFiltering->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("EFBCopyDisable", EFBCopyDisable->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("EFBToTextureEnable", EFBToTextureEnable->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("SafeTextureCache", SafeTextureCache->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("DstAlphaPass", DstAlphaPass->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("UseXFB", UseXFB->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("FIFOBPHack", BPHack->Get3StateValue(), wxCHK_UNDETERMINED);
+ video.Set("ProjectionHack", Hack->GetSelection(), wxCHK_UNDETERMINED);
- if (EnableWideScreen->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Wii", "Widescreen");
- else
- GameIni.Set("Wii", "Widescreen", EnableWideScreen->Get3StateValue());
-
- if (ForceFiltering->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "ForceFiltering");
- else
- GameIni.Set("Video", "ForceFiltering", ForceFiltering->Get3StateValue());
-
- if (EFBCopyDisable->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "EFBCopyDisable");
- else
- GameIni.Set("Video", "EFBCopyDisable", EFBCopyDisable->Get3StateValue());
-
- if (EFBToTextureEnable->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "EFBToTextureEnable");
- else
- GameIni.Set("Video", "EFBToTextureEnable", EFBToTextureEnable->Get3StateValue());
-
- if (SafeTextureCache->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "SafeTextureCache");
- else
- GameIni.Set("Video", "SafeTextureCache", SafeTextureCache->Get3StateValue());
-
- if (DstAlphaPass->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "DstAlphaPass");
- else
- GameIni.Set("Video", "DstAlphaPass", DstAlphaPass->Get3StateValue());
-
- if (UseXFB->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "UseXFB");
- else
- GameIni.Set("Video", "UseXFB", UseXFB->Get3StateValue());
-
- if (BPHack->Get3StateValue() == wxCHK_UNDETERMINED)
- GameIni.DeleteKey("Video", "FIFOBPHack");
- else
- GameIni.Set("Video", "FIFOBPHack", BPHack->Get3StateValue());
-
- if (Hack->GetSelection() == -1)
- GameIni.DeleteKey("Video", "ProjectionHack");
- else
- GameIni.Set("Video", "ProjectionHack", Hack->GetSelection());
-
- if (EmuState->GetSelection() == -1)
- GameIni.DeleteKey("EmuState", "EmulationStateId");
- else
- GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection());
-
- GameIni.Set("EmuState", "EmulationIssues", (const char*)EmuIssues->GetValue().mb_str(*wxConvCurrent));
+ emustate.Set("EmulationStateId", EmuState->GetSelection());
+ emustate.Set("EmulationIssues", (const char*)EmuIssues->GetValue().mb_str(*wxConvCurrent));
PatchList_Save();
ActionReplayList_Save();
@@ -1018,6 +950,7 @@ void CISOProperties::PatchList_Load()
void CISOProperties::PatchList_Save()
{
std::vector lines;
+ lines.clear();
u32 index = 0;
for (std::vector::const_iterator onFrame_it = onFrame.begin(); onFrame_it != onFrame.end(); ++onFrame_it)
{
@@ -1032,8 +965,7 @@ void CISOProperties::PatchList_Save()
}
++index;
}
- GameIni.SetLines("OnFrame", lines);
- lines.clear();
+ GameIni["OnFrame"].SetLines(lines);
}
void CISOProperties::PatchButtonClicked(wxCommandEvent& event)
@@ -1104,7 +1036,7 @@ void CISOProperties::ActionReplayList_Save()
}
++index;
}
- GameIni.SetLines("ActionReplay", lines);
+ GameIni["ActionReplay"].SetLines(lines);
}
void CISOProperties::ActionReplayButtonClicked(wxCommandEvent& event)
diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp
index c96daf99e3..450b902367 100644
--- a/Source/Core/DolphinWX/Src/LogWindow.cpp
+++ b/Source/Core/DolphinWX/Src/LogWindow.cpp
@@ -168,16 +168,22 @@ void CLogWindow::OnClose(wxCloseEvent& event)
void CLogWindow::SaveSettings()
{
IniFile ini;
- ini.Set("LogWindow", "x", Parent->m_Mgr->GetPane(wxT("Pane 1")).rect.GetWidth());
- ini.Set("LogWindow", "y", Parent->m_Mgr->GetPane(wxT("Pane 1")).rect.GetHeight());
- ini.Set("LogWindow", "pos", Parent->m_Mgr->GetPane(wxT("Pane 1")).dock_direction);
- ini.Set("Options", "Verbosity", m_verbosity->GetSelection() + 1);
- ini.Set("Options", "Font", m_FontChoice->GetSelection());
- ini.Set("Options", "WriteToFile", m_writeFile);
- ini.Set("Options", "WriteToConsole", m_writeConsole);
- ini.Set("Options", "WriteToWindow", m_writeWindow);
+
+ Section& logwin = ini["LogWindow"];
+ logwin.Set("x", Parent->m_Mgr->GetPane(wxT("Pane 1")).rect.GetWidth());
+ logwin.Set("y", Parent->m_Mgr->GetPane(wxT("Pane 1")).rect.GetHeight());
+ logwin.Set("pos", Parent->m_Mgr->GetPane(wxT("Pane 1")).dock_direction);
+
+ Section& options = ini["Options"];
+ options.Set("Verbosity", m_verbosity->GetSelection() + 1);
+ options.Set("Font", m_FontChoice->GetSelection());
+ options.Set("WriteToFile", m_writeFile);
+ options.Set("WriteToConsole", m_writeConsole);
+ options.Set("WriteToWindow", m_writeWindow);
+
+ Section& logs = ini["Logs"];
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
- ini.Set("Logs", m_LogManager->getShortName((LogTypes::LOG_TYPE)i), m_checks->IsChecked(i));
+ logs.Set(m_LogManager->getShortName((LogTypes::LOG_TYPE)i), m_checks->IsChecked(i));
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
}
@@ -185,25 +191,28 @@ void CLogWindow::LoadSettings()
{
IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
+ Section& options = ini["Options"];
int verbosity,font;
- ini.Get("Options", "Verbosity", &verbosity, 0);
+ options.Get("Verbosity", &verbosity, 0);
if (verbosity < 1) verbosity = 1;
if (verbosity > MAX_LOGLEVEL) verbosity = MAX_LOGLEVEL;
m_verbosity->SetSelection(verbosity - 1);
- ini.Get("Options", "Font", &font, 0);
+ options.Get("Font", &font, 0);
m_FontChoice->SetSelection(font);
if (m_FontChoice->GetSelection() < (int)Font.size())
m_Log->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour, Font.at(m_FontChoice->GetSelection())));
- ini.Get("Options", "WriteToFile", &m_writeFile, true);
+ options.Get("WriteToFile", &m_writeFile, true);
m_writeFileCB->SetValue(m_writeFile);
- ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
+ options.Get("WriteToConsole", &m_writeConsole, true);
m_writeConsoleCB->SetValue(m_writeConsole);
- ini.Get("Options", "WriteToWindow", &m_writeWindow, true);
+ options.Get("WriteToWindow", &m_writeWindow, true);
m_writeWindowCB->SetValue(m_writeWindow);
+
+ Section& logs = ini["Logs"];
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
{
bool enable;
- ini.Get("Logs", m_LogManager->getShortName((LogTypes::LOG_TYPE)i), &enable, true);
+ logs.Get(m_LogManager->getShortName((LogTypes::LOG_TYPE)i), &enable, true);
if (m_writeWindow && enable)
m_LogManager->addListener((LogTypes::LOG_TYPE)i, this);
diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp
index 16093e4a09..ffc9c85aaa 100644
--- a/Source/Core/DolphinWX/Src/Main.cpp
+++ b/Source/Core/DolphinWX/Src/Main.cpp
@@ -95,7 +95,6 @@ bool DolphinApp::OnInit()
bool LoadElf = false;
bool selectVideoPlugin = false;
bool selectAudioPlugin = false;
- bool selectPadPlugin = false;
bool selectWiimotePlugin = false;
wxString ElfFile;
@@ -130,10 +129,6 @@ bool DolphinApp::OnInit()
wxCMD_LINE_OPTION, "A", "audio_plugin","Specify an audio plugin",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
- {
- wxCMD_LINE_OPTION, "P", "pad_plugin","Specify a pad plugin",
- wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
- },
{
wxCMD_LINE_OPTION, "W", "wiimote_plugin","Specify a wiimote plugin",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
@@ -168,10 +163,6 @@ bool DolphinApp::OnInit()
wxCMD_LINE_OPTION, _("A"), _("audio_plugin"), wxT("Specify an audio plugin"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
},
- {
- wxCMD_LINE_OPTION, _("P"), _("pad_plugin"), wxT("Specify a pad plugin"),
- wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
- },
{
wxCMD_LINE_OPTION, _("W"), _("wiimote_plugin"), wxT("Specify a wiimote plugin"),
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
@@ -201,12 +192,10 @@ bool DolphinApp::OnInit()
#if wxCHECK_VERSION(2, 9, 0)
selectVideoPlugin = parser.Found("video_plugin", &videoPluginFilename);
selectAudioPlugin = parser.Found("audio_plugin", &audioPluginFilename);
- selectPadPlugin = parser.Found("pad_plugin", &padPluginFilename);
selectWiimotePlugin = parser.Found("wiimote_plugin", &wiimotePluginFilename);
#else
selectVideoPlugin = parser.Found(_T("video_plugin"), &videoPluginFilename);
selectAudioPlugin = parser.Found(_T("audio_plugin"), &audioPluginFilename);
- selectPadPlugin = parser.Found(_T("pad_plugin"), &padPluginFilename);
selectWiimotePlugin = parser.Found(_T("wiimote_plugin"), &wiimotePluginFilename);
#endif
#endif // wxUSE_CMDLINE_PARSER
@@ -342,7 +331,6 @@ bool DolphinApp::OnInit()
#endif
LogManager::Init();
- EventHandler::Init();
SConfig::Init();
CPluginManager::Init();
@@ -354,14 +342,6 @@ bool DolphinApp::OnInit()
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin =
std::string(audioPluginFilename.mb_str());
- if (selectPadPlugin && padPluginFilename != wxEmptyString)
- {
- int k;
- for(k=0;k
-#include "pluginspecs_pad.h"
+#include "HW/GCPad.h"
#include "svnrev.h"
//#include
diff --git a/Source/Core/InputCommon/InputCommon.vcproj b/Source/Core/InputCommon/InputCommon.vcproj
index eaa33a78ca..cf176d76e7 100644
--- a/Source/Core/InputCommon/InputCommon.vcproj
+++ b/Source/Core/InputCommon/InputCommon.vcproj
@@ -45,7 +45,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Source/Plugins/InputPluginCommon/Src/Config.cpp b/Source/Core/InputCommon/Src/Config.cpp
similarity index 96%
rename from Source/Plugins/InputPluginCommon/Src/Config.cpp
rename to Source/Core/InputCommon/Src/Config.cpp
index 417867c175..134d2687e0 100644
--- a/Source/Plugins/InputPluginCommon/Src/Config.cpp
+++ b/Source/Core/InputCommon/Src/Config.cpp
@@ -1,57 +1,57 @@
-
-#include "Config.h"
-
-Plugin::Plugin( const char* const _ini_name, const char* const _gui_name, const char* const _profile_name )
- : ini_name(_ini_name)
- , gui_name(_gui_name)
- , profile_name(_profile_name)
-{
- // GCPads
- //for ( unsigned int i = 0; i<4; ++i )
- //controllers.push_back( new GCPad( i ) );
- // Wiimotes / disabled, cause it only the GUI half is done
- //for ( unsigned int i = 0; i<4; ++i )
- // controllers.push_back( new Wiimote( i ) );
-};
-
-Plugin::~Plugin()
-{
- // delete pads
- std::vector::const_iterator i = controllers.begin(),
- e = controllers.end();
- for ( ; i != e; ++i )
- delete *i;
-}
-
-void Plugin::LoadConfig()
-{
- IniFile inifile;
-
- std::ifstream file;
- file.open( (std::string(File::GetUserPath(D_CONFIG_IDX)) + ini_name + ".ini" ).c_str() );
- inifile.Load( file );
- file.close();
-
- std::vector< ControllerEmu* >::const_iterator i = controllers.begin(),
- e = controllers.end();
- for ( ; i!=e; ++i )
- (*i)->LoadConfig( inifile[ (*i)->GetName() ] );
-}
-
-void Plugin::SaveConfig()
-{
- IniFile inifile;
-
- std::vector< ControllerEmu* >::const_iterator i = controllers.begin(),
- e = controllers.end();
- for ( ; i!=e; ++i )
- (*i)->SaveConfig( inifile[ (*i)->GetName() ] );
-
- // dont need to save empty values
- //inifile.Clean();
-
- std::ofstream file;
- file.open( (std::string(File::GetUserPath(D_CONFIG_IDX)) + ini_name + ".ini" ).c_str() );
- inifile.Save( file );
- file.close();
-}
+
+#include "Config.h"
+
+Plugin::Plugin( const char* const _ini_name, const char* const _gui_name, const char* const _profile_name )
+ : ini_name(_ini_name)
+ , gui_name(_gui_name)
+ , profile_name(_profile_name)
+{
+ // GCPads
+ //for ( unsigned int i = 0; i<4; ++i )
+ //controllers.push_back( new GCPad( i ) );
+ // Wiimotes / disabled, cause it only the GUI half is done
+ //for ( unsigned int i = 0; i<4; ++i )
+ // controllers.push_back( new Wiimote( i ) );
+};
+
+Plugin::~Plugin()
+{
+ // delete pads
+ std::vector::const_iterator i = controllers.begin(),
+ e = controllers.end();
+ for ( ; i != e; ++i )
+ delete *i;
+}
+
+void Plugin::LoadConfig()
+{
+ IniFile inifile;
+
+ std::ifstream file;
+ file.open( (std::string(File::GetUserPath(D_CONFIG_IDX)) + ini_name + ".ini" ).c_str() );
+ inifile.Load( file );
+ file.close();
+
+ std::vector< ControllerEmu* >::const_iterator i = controllers.begin(),
+ e = controllers.end();
+ for ( ; i!=e; ++i )
+ (*i)->LoadConfig( inifile[ (*i)->GetName() ] );
+}
+
+void Plugin::SaveConfig()
+{
+ IniFile inifile;
+
+ std::vector< ControllerEmu* >::const_iterator i = controllers.begin(),
+ e = controllers.end();
+ for ( ; i!=e; ++i )
+ (*i)->SaveConfig( inifile[ (*i)->GetName() ] );
+
+ // dont need to save empty values
+ //inifile.Clean();
+
+ std::ofstream file;
+ file.open( (std::string(File::GetUserPath(D_CONFIG_IDX)) + ini_name + ".ini" ).c_str() );
+ inifile.Save( file );
+ file.close();
+}
diff --git a/Source/Plugins/InputPluginCommon/Src/Config.h b/Source/Core/InputCommon/Src/Config.h
similarity index 86%
rename from Source/Plugins/InputPluginCommon/Src/Config.h
rename to Source/Core/InputCommon/Src/Config.h
index 8ab222efc2..51379a33fc 100644
--- a/Source/Plugins/InputPluginCommon/Src/Config.h
+++ b/Source/Core/InputCommon/Src/Config.h
@@ -1,36 +1,33 @@
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-#include
-#include "Thread.h"
-#include "FileUtil.h"
-#include "IniFile.h"
-
-#include "ControllerEmu.h"
-
-#include
-#include
-#include