diff --git a/SConstruct b/SConstruct
index 1438ff3521..960b06805a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -26,6 +26,10 @@ warnings = [
'packed',
'no-conversion',
]
+# XXX check for the availability of these (in GCC 4.3 or newer)
+if sys.platform != 'darwin':
+ warnings.append('no-array-bounds')
+ warnings.append('no-unused-result')
compileFlags = [
'-fno-exceptions',
@@ -53,10 +57,10 @@ include_paths = [
basedir + 'Externals/WiiUseSrc/Src',
basedir + 'Source/Core/VideoCommon/Src',
basedir + 'Source/Core/InputCommon/Src',
+ basedir + 'Source/Plugins/InputPluginCommon/Src',
basedir + 'Source/Core/AudioCommon/Src',
basedir + 'Source/Core/DebuggerUICommon/Src',
basedir + 'Source/Core/DSPCore/Src',
- basedir + 'Source/Plugins/InputUICommon/Src',
]
dirs = [
@@ -76,11 +80,13 @@ dirs = [
'Source/Plugins/Plugin_VideoSoftware/Src',
'Source/Plugins/Plugin_DSP_HLE/Src',
'Source/Plugins/Plugin_DSP_LLE/Src',
+ 'Source/Plugins/Plugin_GCPad/Src',
+ 'Source/Plugins/Plugin_GCPadNew/Src',
'Source/Plugins/Plugin_Wiimote/Src',
- 'Source/Plugins/InputUICommon/Src',
'Source/Core/DolphinWX/Src',
'Source/Core/DebuggerWX/Src',
'Source/UnitTests/',
+ 'Source/Plugins/InputPluginCommon/Src/',
'Source/Plugins/Plugin_WiimoteNew/Src/',
]
@@ -159,8 +165,7 @@ else:
variables = vars,
ENV = {
'PATH' : os.environ['PATH'],
- 'HOME' : os.environ['HOME'],
- 'PKG_CONFIG_PATH' : os.environ.get('PKG_CONFIG_PATH')
+ 'HOME' : os.environ['HOME']
},
BUILDERS = builders,
DESCRIPTION = description,
@@ -204,11 +209,11 @@ elif (flavour == 'prof'):
elif (flavour == 'release'):
compileFlags.append('-O3')
compileFlags.append('-fomit-frame-pointer');
+ warnings.append('error')
# more warnings
if env['lint']:
- warnings.append('error')
- #warnings.append('unreachable-code')
- #warnings.append('float-equal')
+ warnings.append('unreachable-code')
+ warnings.append('float-equal')
# add the warnings to the compile flags
compileFlags += [ ('-W' + warning) for warning in warnings ]
diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
index 75e4c56c63..f62e4b3863 100644
--- a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
+++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
@@ -20,30 +20,28 @@ AudioCommonConfig ac_Config;
// Load from given file
void AudioCommonConfig::Load(IniFile &file) {
- 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);
+ 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);
#ifdef _WIN32
- config.Get("Backend", &sBackend, BACKEND_DIRECTSOUND);
+ file.Get("Config", "Backend", &sBackend, BACKEND_DIRECTSOUND);
#elif defined(__APPLE__)
std::string temp;
- config.Get("Backend", &temp, BACKEND_COREAUDIO);
+ file.Get("Config", "Backend", &temp, BACKEND_COREAUDIO);
strncpy(sBackend, temp.c_str(), 128);
#else // linux
- config.Get("Backend", &sBackend, BACKEND_ALSA);
+ file.Get("Config", "Backend", &sBackend, BACKEND_ALSA);
#endif
}
// Set the values for the file
void AudioCommonConfig::Set(IniFile &file) {
- 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);
+ 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);
}
// Update according to the values (stream/mixer)
diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index 62a31a6219..d10537c069 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -471,6 +471,14 @@
RelativePath=".\Src\PluginDSP.h"
>
+
+
+
+
@@ -506,6 +514,10 @@
RelativePath="..\..\PluginSpecs\pluginspecs_dsp.h"
>
+
+
@@ -608,6 +620,10 @@
RelativePath=".\Src\CDUtils.h"
>
+
+
diff --git a/Source/Core/Common/Src/ChunkFile.cpp b/Source/Core/Common/Src/ChunkFile.cpp
new file mode 100644
index 0000000000..dc9b9b66a5
--- /dev/null
+++ b/Source/Core/Common/Src/ChunkFile.cpp
@@ -0,0 +1,22 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include "Common.h"
+#include "ChunkFile.h"
+
+#include
+
diff --git a/Source/Core/Common/Src/CommonPaths.h b/Source/Core/Common/Src/CommonPaths.h
index 5adff7038e..1a3b5168d1 100644
--- a/Source/Core/Common/Src/CommonPaths.h
+++ b/Source/Core/Common/Src/CommonPaths.h
@@ -132,6 +132,7 @@
// 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 e604f70ab7..04f08168a9 100644
--- a/Source/Core/Common/Src/IniFile.cpp
+++ b/Source/Core/Common/Src/IniFile.cpp
@@ -16,239 +16,510 @@
// http://code.google.com/p/dolphin-emu/
// see IniFile.h
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "StringUtil.h"
#include "IniFile.h"
-template
-void StripChars(std::string& str, const S space)
-{
- const size_t start = str.find_first_not_of(space);
+IniFile::IniFile()
+{}
- if (str.npos == start)
- str.clear();
- else
- str = str.substr(start, str.find_last_not_of(space) - start + 1);
+IniFile::~IniFile()
+{}
+
+Section::Section()
+ : lines(), name(""), comment("") {}
+
+
+Section::Section(const std::string& _name)
+ : lines(), name(_name), comment("") {}
+
+
+Section::Section(const Section& other)
+{
+ name = other.name;
+ comment = other.comment;
+ lines = other.lines;
}
-bool Section::Get(const std::string& key, std::string* const val, const std::string& def) const
+const Section* IniFile::GetSection(const char* sectionName) const
{
- const const_iterator f = find(key);
- if (f != end())
+ 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)
{
- *val = f->second;
- return true;
+ sections.push_back(Section(sectionName));
+ section = §ions[sections.size() - 1];
}
- if (false == def.empty())
- *val = def;
+
+ 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;
+ }
+ }
+
return false;
}
-void Section::Set(const std::string& key, const std::string& val, const std::string& def)
+void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const
{
- if (val != def)
- operator[](key) = val;
- else
- {
- iterator f = find(key);
- if (f != end())
- erase(f);
- }
-}
+ //
+ 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);}
-bool IniFile::Save(const std::string& filename) const
-{
- return Save(filename.c_str());
-}
-
-bool IniFile::Save(const char filename[]) const
-{
- std::ofstream file;
- file.open(filename);
- if (file.is_open())
+ // Allow preservation of spacing before comment
+ if (FirstCommentChar > 0)
{
- Save(file);
- file.close();
- return true;
- }
- else
- return false;
-}
-
-void IniFile::Save(std::ostream& file) const
-{
- const_iterator
- si = begin(),
- se = end();
- for ( ; si != se; ++si )
- {
- // skip a line at new sections
- file << "\n[" << si->first << "]\n";
- si->second.Save(file);
- }
-}
-
-void Section::Save(std::ostream& file) const
-{
- if (m_use_lines) // this is used when GetLines or SetLines has been called
- {
- std::vector::const_iterator
- i = m_lines.begin(),
- e = m_lines.end();
- for ( ; i!=e; ++i)
- file << *i << '\n';
- }
- else
- {
- Section::const_iterator
- vi = begin(),
- ve = end();
- for ( ; vi!=ve; ++vi)
+ while (line[FirstCommentChar - 1] == ' ' || line[FirstCommentChar - 1] == 9) // 9 == tab
{
- 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';
+ FirstCommentChar--;
}
}
-}
-bool IniFile::Load(const std::string& filename)
-{
- return Load(filename.c_str());
-}
-
-bool IniFile::Load(const char filename[])
-{
- std::ifstream file;
- file.open(filename);
- if (file.is_open())
+ if ((FirstEquals >= 0) && ((FirstCommentChar < 0) || (FirstEquals < FirstCommentChar)))
{
- Load(file);
- file.close();
- return true;
+ // 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)));
}
- else
- return false;
}
-void IniFile::Load(std::istream& file)
+std::string* IniFile::GetLine(Section* section, const char* key, std::string* valueOut, std::string* commentOut)
{
- std::vector lines;
-
- Section sectmp;
- Section* section = §mp;
-
- std::string line;
- while (std::getline(file, line)) // read a line
+ for (std::vector::iterator iter = section->lines.begin(); iter != section->lines.end(); ++iter)
{
- if (line.size())
+ std::string& line = *iter;
+ std::string lineKey;
+ ParseLine(line, &lineKey, valueOut, commentOut);
+
+ if (!strcasecmp(lineKey.c_str(), key))
{
- switch (line[0])
+ return &line;
+ }
+ }
+
+ return 0;
+}
+
+bool IniFile::Exists(const char* const sectionName, const char* key) const
+{
+
+ const Section* const section = GetSection(sectionName);
+ if (!section)
+ 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)
+{
+ Section* section = GetOrCreateSection(sectionName);
+ section->lines.clear();
+
+ for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
+ {
+ section->lines.push_back(*iter);
+ }
+}
+
+
+bool IniFile::DeleteKey(const char* sectionName, const char* key)
+{
+ Section* section = GetSection(sectionName);
+
+ if (!section)
+ {
+ 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] == '[')
{
- // section
- case '[' :
- section->m_lines = lines;
- // kinda odd trimming
- StripChars(line, "][\t\r ");
- section = &(*this)[line];
- lines.clear();
- break;
+ size_t endpos = line.find("]");
- // key/value
- default :
+ if (endpos != std::string::npos)
{
- std::istringstream ss(line);
+ // New section!
+ std::string sub = line.substr(1, endpos - 1);
+ sections.push_back(Section(sub));
- 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;
+ if (endpos + 1 < line.size())
+ {
+ sections[sections.size() - 1].comment = line.substr(endpos + 1);
+ }
}
- //break; // no break
-
- // comment
- case '#' :
- case ';' :
- lines.push_back(line);
- break;
+ }
+ else
+ {
+ sections[sections.size() - 1].lines.push_back(line);
}
}
}
- //Clean();
+
+ in.close();
+ return true;
}
-//
-// 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()
+bool IniFile::Save(const char* filename)
{
- iterator
- i = begin(),
- e = end();
- for ( ; i != e; )
+ std::ofstream out;
+ out.open(filename, std::ios::out);
+
+ if (out.fail())
{
- Section::iterator
- si = i->second.begin(),
- se = i->second.end();
- for ( ; si != se; )
- {
- if (si->second.empty())
- i->second.erase( si++ );
- else
- ++si;
+ 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;
}
- if (i->second.empty() && i->second.m_lines.empty())
- erase( i++ );
- else
- ++i;
+
+ 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;
+ }
+ else
+ {
+ // The key did not already exist in this section - let's add it.
+ section->lines.push_back(std::string(key) + " = " + newValue);
}
}
-bool IniFile::Exists(const std::string& section) const
+void IniFile::Set(const char* sectionName, const char* key, const std::vector& newValues)
{
- return find(section) != end();
+ 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::Delete(const std::string& section)
+void IniFile::Set(const char* sectionName, const char* key, u32 newValue)
{
- const iterator f = find(section);
- if (end() != f)
- erase(f);
+ Set(sectionName, key, StringFromFormat("0x%08x", newValue).c_str());
}
-bool Section::Exists(const std::string& key) const
+
+void IniFile::Set(const char* sectionName, const char* key, int newValue)
{
- return find(key) != end();
+ Set(sectionName, key, StringFromInt(newValue).c_str());
}
-void Section::Delete(const std::string& key)
+
+void IniFile::Set(const char* sectionName, const char* key, bool newValue)
{
- const iterator f = find(key);
- if (end() != f)
- erase(f);
+ Set(sectionName, key, StringFromBool(newValue).c_str());
}
-void Section::SetLines(const std::vector& lines)
+bool IniFile::Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue)
{
- m_lines = lines;
- m_use_lines = true;
+ Section* section = GetSection(sectionName);
+
+ if (!section)
+ {
+ if (defaultValue)
+ {
+ *value = defaultValue;
+ }
+ return false;
+ }
+
+ std::string* line = GetLine(section, key, value, 0);
+
+ if (!line)
+ {
+ if (defaultValue)
+ {
+ *value = defaultValue;
+ }
+ return false;
+ }
+
+ return true;
}
-void Section::GetLines(std::vector& lines)
+
+bool IniFile::Get(const char* sectionName, const char* key, std::vector& values)
{
- lines = m_lines;
- m_use_lines = true;
+
+ 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))
+ {
+ return true;
+ }
+
+ *value = defaultValue;
+ return false;
+}
+
+
+bool IniFile::Get(const char* sectionName, const char* key, u32* value, u32 defaultValue)
+{
+ std::string temp;
+ bool retval = Get(sectionName, key, &temp, 0);
+
+ if (retval && TryParseUInt(temp.c_str(), value))
+ {
+ return true;
+ }
+
+ *value = defaultValue;
+ return false;
+}
+
+
+bool IniFile::Get(const char* sectionName, const char* key, bool* value, bool defaultValue)
+{
+ std::string temp;
+ bool retval = Get(sectionName, key, &temp, 0);
+
+ if (retval && TryParseBool(temp.c_str(), value))
+ {
+ return true;
+ }
+
+ *value = defaultValue;
+ return false;
+}
+
+
+// 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;
+ }
+ */
diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h
index 19a5bb78a6..599939731b 100644
--- a/Source/Core/Common/Src/IniFile.h
+++ b/Source/Core/Common/Src/IniFile.h
@@ -18,105 +18,74 @@
#ifndef _INIFILE_H_
#define _INIFILE_H_
-#include "CommonTypes.h"
-
-#include
-#include
-
-
-
-
-
-
-
-
-
-
lines;
std::vector encryptedLines;
ARCode currentCode;
arCodes.clear();
- std::vector lines;
- ini["ActionReplay"].GetLines(lines);
+ if (!ini.GetLines("ActionReplay", lines))
+ return; // no codes found.
+
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 5c6bff0137..8f88b00545 100644
--- a/Source/Core/Core/Src/ConfigManager.cpp
+++ b/Source/Core/Core/Src/ConfigManager.cpp
@@ -73,108 +73,103 @@ void SConfig::SaveSettings()
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
// General
- Section& general = ini["General"];
- general.Set("LastFilename", m_LastFilename);
+ ini.Set("General", "LastFilename", m_LastFilename);
// ISO folders
- general.Set("GCMPathes", (int)m_ISOFolder.size());
+ ini.Set("General", "GCMPathes", (int)m_ISOFolder.size());
for (size_t i = 0; i < m_ISOFolder.size(); i++)
{
TCHAR tmp[16];
sprintf(tmp, "GCMPath%i", (int)i);
- general.Set(tmp, m_ISOFolder[i]);
+ ini.Set("General", tmp, m_ISOFolder[i]);
}
- general.Set("RecersiveGCMPaths", m_RecursiveISOFolder);
+ ini.Set("General", "RecersiveGCMPaths", m_RecursiveISOFolder);
- // 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);
+ // 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);
// Hotkeys
- Section& hotkeys = ini["Hotkeys"];
for (int i = HK_FULLSCREEN; i < NUM_HOTKEYS; i++)
{
- hotkeys.Set(g_HKData[i].IniText, m_LocalCoreStartupParameter.iHotkey[i]);
- hotkeys.Set((std::string(g_HKData[i].IniText) + "Modifier").c_str(),
+ ini.Set("Hotkeys", g_HKData[i].IniText, m_LocalCoreStartupParameter.iHotkey[i]);
+ ini.Set("Hotkeys", (std::string(g_HKData[i].IniText) + "Modifier").c_str(),
m_LocalCoreStartupParameter.iHotkeyModifier[i]);
}
// Display
- 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);
+ 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);
// Game List Control
- 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);
+ 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);
// Core
- 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]);
+ 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]);
char sidevicenum[16];
for (int i = 0; i < 4; ++i)
{
sprintf(sidevicenum, "SIDevice%i", i);
- core.Set(sidevicenum, m_SIDevice[i]);
+ ini.Set("Core", sidevicenum, m_SIDevice[i]);
}
- 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);
+ 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);
// Plugins
- core.Set("GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
- core.Set("DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
- core.Set("WiiMotePlugin",m_LocalCoreStartupParameter.m_strWiimotePlugin[0]);
+ 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]);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
m_SYSCONF->Save();
@@ -192,121 +187,119 @@ 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
{
- Section& general = ini["General"];
- general.Get("LastFilename", &m_LastFilename);
+ ini.Get("General", "LastFilename", &m_LastFilename);
m_ISOFolder.clear();
+ int numGCMPaths;
- unsigned int numGCMPaths;
- general.Get("GCMPathes", &numGCMPaths, 0);
- for (unsigned int i = 0; i < numGCMPaths; i++)
+ if (ini.Get("General", "GCMPathes", &numGCMPaths, 0))
{
- TCHAR tmp[16];
- sprintf(tmp, "GCMPath%i", i);
- std::string tmpPath;
- general.Get(tmp, &tmpPath, "");
- m_ISOFolder.push_back(tmpPath);
+ 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);
+ }
}
- general.Get("RecersiveGCMPaths", &m_RecursiveISOFolder, false);
+ ini.Get("General", "RecersiveGCMPaths", &m_RecursiveISOFolder, false);
}
{
// Interface
- 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);
+ 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);
// Hotkeys
- Section& hotkeys = ini["Hotkeys"];
for (int i = HK_FULLSCREEN; i < NUM_HOTKEYS; i++)
{
- hotkeys.Get(g_HKData[i].IniText,
+ ini.Get("Hotkeys", g_HKData[i].IniText,
&m_LocalCoreStartupParameter.iHotkey[i], g_HKData[i].DefaultKey);
- hotkeys.Get((std::string(g_HKData[i].IniText) + "Modifier").c_str(),
+ ini.Get("Hotkeys", (std::string(g_HKData[i].IniText) + "Modifier").c_str(),
&m_LocalCoreStartupParameter.iHotkeyModifier[i], g_HKData[i].DefaultModifier);
}
// Display
- 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);
+ 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);
// Game List Control
- 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", "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);
- 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);
+ 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);
// Core
- 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);
+ 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);
char sidevicenum[16];
for (int i = 0; i < 4; ++i)
{
sprintf(sidevicenum, "SIDevice%i", i);
- core.Get(sidevicenum, (u32*)&m_SIDevice[i], i==0 ? SI_GC_CONTROLLER:SI_NONE);
+ ini.Get("Core", sidevicenum, (u32*)&m_SIDevice[i], i==0 ? SI_GC_CONTROLLER:SI_NONE);
}
- 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
+ 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
// Plugins
- 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());
+ 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());
}
@@ -322,6 +315,6 @@ void SConfig::LoadSettingsWii()
{
char SectionName[32];
sprintf(SectionName, "Wiimote%i", i + 1);
- ini[SectionName].Get("AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
+ ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
}
}
diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h
index cb775b0520..2b975c204b 100644
--- a/Source/Core/Core/Src/ConfigManager.h
+++ b/Source/Core/Core/Src/ConfigManager.h
@@ -49,6 +49,7 @@ 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 2bd72e88b7..1fb2c4e1be 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -77,6 +77,7 @@ 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);
@@ -348,7 +349,7 @@ THREAD_RETURN EmuThread(void *pArg)
{
IniFile gameIni;
gameIni.Load(_CoreParameter.m_strGameIni.c_str());
- gameIni["Wii"].Get("Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR"));
+ gameIni.Get("Wii", "Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData("IPL.AR"));
}
VideoInitialize.bAutoAspectIs16_9 = aspectWide;
@@ -380,6 +381,18 @@ 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)
@@ -725,6 +738,16 @@ 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 cc92d84cb8..0a6c073877 100644
--- a/Source/Core/Core/Src/CoreParameter.h
+++ b/Source/Core/Core/Src/CoreParameter.h
@@ -21,6 +21,7 @@
#include "IniFile.h"
#include
+#define MAXPADS 1
#define MAXWIIMOTES 1
enum Hotkey {
@@ -120,6 +121,7 @@ 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 2a5d49452d..e382351df5 100644
--- a/Source/Core/Core/Src/CoreRerecording.cpp
+++ b/Source/Core/Core/Src/CoreRerecording.cpp
@@ -17,9 +17,9 @@
#include "Setup.h"
-#ifndef RERECORDING
-bool rerecording = false;
-#else
+#ifdef RERECORDING
+
+
// Include
// --------------
@@ -44,7 +44,7 @@ bool rerecording = false;
#include "HW/GPFifo.h"
#include "HW/CPU.h"
#include "HW/HW.h"
-#include "HW/DSPInterface.h"
+#include "HW/DSP.h"
#include "HW/GPFifo.h"
#include "HW/AudioInterface.h"
#include "HW/VideoInterface.h"
diff --git a/Source/Core/Core/Src/HW/GCPad.cpp b/Source/Core/Core/Src/HW/GCPad.cpp
deleted file mode 100644
index 8ec01eb8f4..0000000000
--- a/Source/Core/Core/Src/HW/GCPad.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#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
deleted file mode 100644
index a480579c0a..0000000000
--- a/Source/Core/Core/Src/HW/GCPad.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#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/Core/Core/Src/HW/HW.cpp b/Source/Core/Core/Src/HW/HW.cpp
index 72a7023590..70f6ae21fd 100644
--- a/Source/Core/Core/Src/HW/HW.cpp
+++ b/Source/Core/Core/Src/HW/HW.cpp
@@ -28,7 +28,6 @@
#include "Memmap.h"
#include "ProcessorInterface.h"
#include "SI.h"
-#include "GCPad.h"
#include "AudioInterface.h"
#include "VideoInterface.h"
#include "WII_IPC.h"
@@ -51,7 +50,6 @@ namespace HW
// Init the whole Hardware
AudioInterface::Init();
VideoInterface::Init();
- PAD_Init();
SerialInterface::Init();
ProcessorInterface::Init();
Memory::Init();
@@ -77,7 +75,6 @@ namespace HW
DSP::Shutdown();
Memory::Shutdown();
SerialInterface::Shutdown();
- PAD_Shutdown();
AudioInterface::Shutdown();
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
@@ -85,7 +82,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 2df3fb3dbe..3737a6f899 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 "GCPad.h" // for pad state
+#include "../PluginManager.h" // for pad state
// where to put baseboard debug
#define AMBASEBOARDDEBUG OSREPORT
@@ -142,11 +142,10 @@ 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));
- PAD_GetStatus(0, &PadStatus);
-
+ CPluginManager::GetInstance().GetPad(0)
+ ->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
res[resp++] = 0x10;
res[resp++] = 0x2;
int d10_0 = 0xdf;
@@ -311,8 +310,8 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
for (i=0; iPAD_GetStatus(i, &PadStatus);
unsigned char player_data[2] = {0,0};
if (PadStatus.button & PAD_BUTTON_START)
player_data[0] |= 0x80;
@@ -349,7 +348,8 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
int slots = *jvs_io++;
msg.addData(1);
SPADStatus PadStatus;
- PAD_GetStatus(0, &PadStatus);
+ CPluginManager::GetInstance().GetPad(0)
+ ->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 04f56f74db..b1036d9a8d 100644
--- a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp
+++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp
@@ -21,7 +21,6 @@
#include "SI.h"
#include "SI_Device.h"
#include "SI_DeviceGCController.h"
-#include "GCPad.h"
#include "EXI_Device.h"
#include "EXI_DeviceMic.h"
@@ -61,7 +60,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
while (iPosition < _iLength)
{
// Read the command
- GCPADCommands command = static_cast(_pBuffer[iPosition ^ 3]);
+ EBufferCommands command = static_cast(_pBuffer[iPosition ^ 3]);
iPosition++;
// Handle it
@@ -129,7 +128,8 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
{
SPADStatus PadStatus;
memset(&PadStatus, 0, sizeof(PadStatus));
- PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
+ Common::PluginPAD* pad = CPluginManager::GetInstance().GetPad(0);
+ pad->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
u32 netValues[2] = {0};
int NetPlay = 2;
@@ -258,6 +258,7 @@ 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)
@@ -268,8 +269,8 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
case CMD_WRITE:
{
- u8 uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
- u8 uStrength = command.Parameter2;
+ unsigned int uType = command.Parameter1; // 0 = stop, 1 = rumble, 2 = stop hard
+ unsigned int uStrength = command.Parameter2;
#if defined(HAVE_WX) && HAVE_WX
// get the correct pad number that should rumble locally when using netplay
@@ -279,7 +280,8 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
#endif
if (numPAD < 4)
- PAD_Rumble(numPAD, uType, uStrength);
+ if (pad->PAD_Rumble)
+ pad->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 cc2180970e..8a8dd0efb7 100644
--- a/Source/Core/Core/Src/HW/SI_DeviceGCController.h
+++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.h
@@ -18,36 +18,24 @@
#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:
- enum GCPADCommands
+
+ // Commands
+ enum EBufferCommands
{
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?
@@ -64,6 +52,25 @@ 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,
@@ -87,6 +94,8 @@ 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 918e062428..cc4f2e586a 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["USB Keyboard"].Get("Layout", &m_KeyboardLayout, (int)KBD_LAYOUT_QWERTY);
+ ini.Get("USB Keyboard", "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 89c6422363..d70436ffa0 100644
--- a/Source/Core/Core/Src/LuaInterface.cpp
+++ b/Source/Core/Core/Src/LuaInterface.cpp
@@ -2794,11 +2794,10 @@ DEFINE_LUA_FUNCTION(emulua_loadrom, "filename")
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
{
// General settings
- 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);
+ 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);
// Wii settings
if (StartUp.bWii)
{
diff --git a/Source/Core/Core/Src/OnFrame.h b/Source/Core/Core/Src/OnFrame.h
index 7d79c81dc9..416e4dc188 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 "HW/GCPad.h"
+#include "pluginspecs_pad.h"
#include
diff --git a/Source/Core/Core/Src/PatchEngine.cpp b/Source/Core/Core/Src/PatchEngine.cpp
index d1f00cb3f3..ca90c4491a 100644
--- a/Source/Core/Core/Src/PatchEngine.cpp
+++ b/Source/Core/Core/Src/PatchEngine.cpp
@@ -55,13 +55,12 @@ std::vector discList;
void LoadPatchSection(const char *section, std::vector &patches, IniFile &ini)
{
- //if (!ini.Exists(section))
- //return;
+ std::vector lines;
+ if (!ini.GetLines(section, lines))
+ 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;
@@ -100,14 +99,15 @@ 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;
- ini[section].GetLines(lines);
+ if (!ini.GetLines(section, lines))
+ return;
+
for (std::vector::const_iterator iter = lines.begin(); iter != lines.end(); ++iter)
{
std::string line = *iter;
@@ -117,18 +117,19 @@ static void LoadDiscList(const char *section, std::vector &_discLis
}
static void LoadSpeedhacks(const char *section, std::map &hacks, IniFile &ini) {
- Section& sect = ini[section];
- for (Section::const_iterator iter = sect.begin(); iter != sect.end(); ++iter)
+ std::vector keys;
+ ini.GetKeys(section, keys);
+ for (std::vector::const_iterator iter = keys.begin(); iter != keys.end(); ++iter)
{
- const std::string& key = iter->first;
+ std::string key = *iter;
std::string value;
- sect.Get(key, &value, "BOGUS");
+ ini.Get(section, key.c_str(), &value, "BOGUS");
if (value != "BOGUS")
{
u32 address;
u32 cycles;
bool success = true;
- success = success && TryParseUInt(std::string(key.c_str()), &address); // std::string(.c_str()); // what?
+ success = success && TryParseUInt(std::string(key.c_str()), &address);
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 f83efac035..43eb23831e 100644
--- a/Source/Core/Core/Src/PluginManager.cpp
+++ b/Source/Core/Core/Src/PluginManager.cpp
@@ -64,12 +64,15 @@ 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;
}
@@ -82,6 +85,15 @@ 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])
@@ -100,7 +112,7 @@ CPluginManager::~CPluginManager()
// Init and Shutdown Plugins
// ------------
-// Function: Point the m_wiimote[] and other variables to a certain plugin
+// Function: Point the m_pad[] and other variables to a certain plugin
bool CPluginManager::InitPlugins()
{
// Update pluginglobals.
@@ -122,9 +134,26 @@ bool CPluginManager::InitPlugins()
}
INFO_LOG(CONSOLE, "After GetVideo\n");
- // Check if we get at least one wiimote
+ // Check if we get at least one pad or wiimote
+ bool pad = false;
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)
{
@@ -151,6 +180,15 @@ 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])
@@ -266,6 +304,10 @@ 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;
@@ -340,12 +382,28 @@ void CPluginManager::ScanForPlugins()
/* Create or return the already created plugin pointers. This will be called
- often for the Wiimote from the SI_.cpp files.
+ often for the Pad and Wiimote from the SI_.cpp files. And often for the DSP
+ from the DSP 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)
@@ -412,6 +470,15 @@ 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)
@@ -429,6 +496,7 @@ 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);
}
@@ -453,6 +521,9 @@ 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;
@@ -461,7 +532,7 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TY
}
}
-// Open debugging window. Type = Video. Show = Show or hide window.
+// Open debugging window. Type = Video or DSP. 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 32c147e4de..38b0420908 100644
--- a/Source/Core/Core/Src/PluginManager.h
+++ b/Source/Core/Core/Src/PluginManager.h
@@ -20,8 +20,10 @@
#include "Plugin.h"
#include "PluginDSP.h"
+#include "PluginPAD.h"
#include "PluginVideo.h"
#include "PluginWiimote.h"
+#include "EventHandler.h"
#include "CoreParameter.h"
class CPluginInfo
@@ -50,10 +52,12 @@ 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);
@@ -71,6 +75,7 @@ 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/SConscript b/Source/Core/Core/Src/SConscript
index 2cee7e70a3..d90a40efc7 100644
--- a/Source/Core/Core/Src/SConscript
+++ b/Source/Core/Core/Src/SConscript
@@ -41,8 +41,6 @@ files = ["ActionReplay.cpp",
"HW/EXI_DeviceMemoryCard.cpp",
"HW/EXI_DeviceMic.cpp",
"HW/EXI_DeviceEthernet.cpp",
- "HW/GCPad.cpp",
- "HW/GCPadEmu.cpp",
"HW/GPFifo.cpp",
"HW/HW.cpp",
"HW/Memmap.cpp",
diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp
index a549124134..1da95de50f 100644
--- a/Source/Core/Core/Src/State.cpp
+++ b/Source/Core/Core/Src/State.cpp
@@ -92,6 +92,7 @@ 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/DSPCore/DSPCore.vcproj b/Source/Core/DSPCore/DSPCore.vcproj
index a532fb8094..b21a5760eb 100644
--- a/Source/Core/DSPCore/DSPCore.vcproj
+++ b/Source/Core/DSPCore/DSPCore.vcproj
@@ -502,6 +502,10 @@
RelativePath=".\Src\DSPAnalyzer.h"
>
+
+
diff --git a/Source/Core/DSPCore/Src/DSPBreakpoints.cpp b/Source/Core/DSPCore/Src/DSPBreakpoints.cpp
new file mode 100644
index 0000000000..0ab7de9abf
--- /dev/null
+++ b/Source/Core/DSPCore/Src/DSPBreakpoints.cpp
@@ -0,0 +1,19 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include "DSPBreakpoints.h"
+
diff --git a/Source/Core/DSPCore/Src/SConscript b/Source/Core/DSPCore/Src/SConscript
index c63f995e19..1c091cb5c7 100644
--- a/Source/Core/DSPCore/Src/SConscript
+++ b/Source/Core/DSPCore/Src/SConscript
@@ -6,6 +6,7 @@ files = [
"assemble.cpp",
"disassemble.cpp",
"DSPAccelerator.cpp",
+ "DSPBreakpoints.cpp",
"DSPIntCCUtil.cpp",
"DSPIntExtOps.cpp",
"DSPHWInterface.cpp",
diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
index c413813842..8198247038 100644
--- a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
@@ -142,14 +142,13 @@ void CBreakPointWindow::OnAddBreakPointMany()
if (ini.Load(filename.c_str())) // check if there is any file there
{
// get lines from a certain section
- if (!ini.Exists("BreakPoints"))
+ std::vector lines;
+ if (!ini.GetLines("BreakPoints", lines))
{
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);
@@ -189,14 +188,13 @@ void CBreakPointWindow::OnAddMemoryCheckMany()
if (ini.Load(filename.c_str()))
{
// get lines from a certain section
- if (!ini.Exists("MemoryChecks"))
+ std::vector lines;
+ if (!ini.GetLines("MemoryChecks", lines))
{
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 3b050b60c8..f8c1310aee 100644
--- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp
+++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp
@@ -88,93 +88,89 @@ void CCodeWindow::Load()
// The font to override DebuggerFont with
std::string fontDesc;
- Section& showonstart = ini["ShowOnStart"];
- showonstart.Get("DebuggerFont", &fontDesc);
+ ini.Get("ShowOnStart", "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.
- 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);
+ 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);
// Get notebook affiliation
- Section& section = ini[StringFromFormat("P - %s",
+ std::string _Section = StringFromFormat("P - %s",
(Parent->ActivePerspective < Parent->Perspectives.size())
- ? 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);
+ ? 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);
// Get floating setting
- 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);
+ 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);
// Boot to pause or not
- showonstart.Get("AutomaticStart", &bAutomaticStart, false);
- showonstart.Get("BootToPause", &bBootToPause, true);
+ ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false);
+ ini.Get("ShowOnStart", "BootToPause", &bBootToPause, true);
}
void CCodeWindow::Save()
{
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- Section& showonstart = ini["ShowOnStart"];
- showonstart.Set("DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
+ ini.Set("ShowOnStart", "DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
// Boot to pause or not
- showonstart.Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
- showonstart.Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
+ ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
+ ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
// Save windows settings
- //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",
+ //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",
(Parent->ActivePerspective < Parent->Perspectives.size())
- ? 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);
+ ? 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);
// Save floating setting
- 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.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));
ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
}
diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
index d24701975a..61e0468fe0 100644
--- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
@@ -129,23 +129,21 @@ 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)
{
- Section& memwin = _IniFile["MemoryWindow"];
- memwin.Set("x", GetPosition().x);
- memwin.Set("y", GetPosition().y);
- memwin.Set("w", GetSize().GetWidth());
- memwin.Set("h", GetSize().GetHeight());
+ _IniFile.Set("MemoryWindow", "x", GetPosition().x);
+ _IniFile.Set("MemoryWindow", "y", GetPosition().y);
+ _IniFile.Set("MemoryWindow", "w", GetSize().GetWidth());
+ _IniFile.Set("MemoryWindow", "h", GetSize().GetHeight());
}
}
void CMemoryWindow::Load(IniFile& _IniFile)
{
- 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());
+ 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());
SetSize(x, y, w, h);
}
@@ -324,12 +322,12 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
//memview->cu
wxString rawData=valbox->GetValue();
std::vector Dest;//May need a better name
- size_t size=0;
+ u32 size=0;
int pad=rawData.size()%2;//If it's uneven
unsigned long i=0;
long count=0;
char copy[3]={0};
- size_t newsize=0;
+ long 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 7bd8ec2118..06f4a7b789 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, (int)pFileSystem->GetFileSize(fname));
+ CheckFile(fname, pFileSystem->GetFileSize(fname));
}
void Close()
diff --git a/Source/Core/DolphinWX/DolphinWX.vcproj b/Source/Core/DolphinWX/DolphinWX.vcproj
index 25420388b9..d6a8f228a8 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;..\..\Plugins\InputUICommon\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;..\..\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;..\..\Plugins\InputUICommon\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;..\..\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();
}
}
@@ -279,6 +282,8 @@ 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]);
}
@@ -670,6 +675,10 @@ 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);
@@ -684,6 +693,10 @@ 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);
@@ -1066,6 +1079,9 @@ 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]);
}
@@ -1080,6 +1096,9 @@ 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 644736b5e8..a24824a7d9 100644
--- a/Source/Core/DolphinWX/Src/ConfigMain.h
+++ b/Source/Core/DolphinWX/Src/ConfigMain.h
@@ -99,6 +99,7 @@ private:
wxBoxSizer* sPlugins;
wxStaticBoxSizer* sbGraphicsPlugin;
wxStaticBoxSizer* sbDSPPlugin;
+ wxStaticBoxSizer* sbPadPlugin;
wxStaticBoxSizer* sbWiimotePlugin;
wxNotebook *Notebook;
@@ -137,6 +138,9 @@ private:
wxStaticText* ApploaderPathText;
wxFilePickerCtrl* ApploaderPath;
+ wxStaticText* PADText;
+ wxButton* PADConfig;
+ wxChoice* PADSelection;
wxButton* DSPConfig;
wxStaticText* DSPText;
wxChoice* DSPSelection;
@@ -235,6 +239,10 @@ 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 ee8c5ddf76..4795bcf0cc 100644
--- a/Source/Core/DolphinWX/Src/Frame.cpp
+++ b/Source/Core/DolphinWX/Src/Frame.cpp
@@ -45,7 +45,6 @@
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
#include "State.h"
#include "VolumeHandler.h"
-#include "HW/GCPad.h"
#include // wxWidgets
@@ -252,7 +251,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_GCPAD, CFrame::OnPluginGCPad)
+EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnPluginPAD)
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnPluginWiimote)
EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnToolBar)
@@ -442,7 +441,7 @@ CFrame::CFrame(wxFrame* parent,
{
IniFile ini; int winpos;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
- ini["LogWindow"].Get("pos", &winpos, 2);
+ ini.Get("LogWindow", "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)
@@ -713,6 +712,12 @@ 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);
@@ -878,7 +883,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
#endif
// Send the keyboard status to the Input plugin
- PAD_Input(event.GetKeyCode(), 1); // 1 = Down
+ CPluginManager::GetInstance().GetPad(0)->PAD_Input(event.GetKeyCode(), 1); // 1 = Down
}
else
event.Skip();
@@ -889,7 +894,7 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
event.Skip();
if(Core::GetState() != Core::CORE_UNINITIALIZED)
- PAD_Input(event.GetKeyCode(), 0); // 0 = Up*/
+ CPluginManager::GetInstance().GetPad(0)->PAD_Input(event.GetKeyCode(), 0); // 0 = Up
}
// --------
diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h
index 5e22b03051..d01c4b812b 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 OnPluginGCPad(wxCommandEvent& event);
+ void OnPluginPAD(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 397ee95d6f..45da0a4716 100644
--- a/Source/Core/DolphinWX/Src/FrameAui.cpp
+++ b/Source/Core/DolphinWX/Src/FrameAui.cpp
@@ -772,9 +772,8 @@ void CFrame::SetSimplePaneSize()
IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
- Section& logwin = ini["LogWindow"];
- logwin.Get("x", &x, Size);
- logwin.Get("y", &y, Size);
+ ini.Get("LogWindow", "x", &x, Size);
+ ini.Get("LogWindow", "y", &y, Size);
// Update size
m_Mgr->GetPane(wxT("Pane 0")).BestSize(x, y).MinSize(x, y).MaxSize(x, y);
@@ -895,9 +894,8 @@ void CFrame::SaveLocal()
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- Section& perspectives = ini["Perspectives"];
- perspectives.Get("Perspectives", &_Perspectives, "");
- perspectives.Get("Active", &ActivePerspective, 5);
+ ini.Get("Perspectives", "Perspectives", &_Perspectives, "");
+ ini.Get("Perspectives", "Active", &ActivePerspective, 5);
SplitString(_Perspectives, ",", VPerspectives);
for (u32 i = 0; i < VPerspectives.size(); i++)
@@ -910,10 +908,10 @@ void CFrame::SaveLocal()
if (Tmp.Name == "") continue;
//if (!ini.Exists(_Section.c_str(), "Width")) continue;
- Section& section = ini[StringFromFormat("P - %s", Tmp.Name.c_str())];
- section.Get("Perspective", &_Perspective, "");
- section.Get("Width", &_Width, "");
- section.Get("Height", &_Height, "");
+ _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, "");
Tmp.Perspective = wxString::FromAscii(_Perspective.c_str());
@@ -948,8 +946,8 @@ void CFrame::Save()
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- Section& section = ini[StringFromFormat("P - %s", Perspectives.at(ActivePerspective).Name.c_str())];
- section.Set("Perspective", m_Mgr->SavePerspective().mb_str());
+ std::string _Section = StringFromFormat("P - %s", Perspectives.at(ActivePerspective).Name.c_str());
+ ini.Set(_Section.c_str(), "Perspective", m_Mgr->SavePerspective().mb_str());
std::string SWidth = "", SHeight = "";
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
@@ -964,8 +962,8 @@ void CFrame::Save()
// Remove the ending ","
SWidth = SWidth.substr(0, SWidth.length()-1); SHeight = SHeight.substr(0, SHeight.length()-1);
- section.Set("Width", SWidth.c_str());
- section.Set("Height", SHeight.c_str());
+ ini.Set(_Section.c_str(), "Width", SWidth.c_str());
+ ini.Set(_Section.c_str(), "Height", SHeight.c_str());
// Save perspective names
std::string STmp = "";
@@ -974,9 +972,8 @@ void CFrame::Save()
STmp += Perspectives.at(i).Name + ",";
}
STmp = STmp.substr(0, STmp.length()-1);
- Section& perspectives = ini["Perspectives"];
- perspectives.Set("Perspectives", STmp.c_str());
- perspectives.Set("Active", ActivePerspective);
+ ini.Set("Perspectives", "Perspectives", STmp.c_str());
+ ini.Set("Perspectives", "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 7de9e51365..8bafc8aa15 100644
--- a/Source/Core/DolphinWX/Src/FrameTools.cpp
+++ b/Source/Core/DolphinWX/Src/FrameTools.cpp
@@ -27,44 +27,42 @@ window handle that is returned by CreateWindow() can be accessed from
Core::GetWindowHandle().
*/
-// Common
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-
-#include
+#include "Setup.h" // Common
#include "NetWindow.h"
-#include "Globals.h"
+#include "Common.h" // Common
+#include "FileUtil.h"
+#include "FileSearch.h"
+#include "Timer.h"
+
+#include "Globals.h" // Local
#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 "BootManager.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
// Resources
@@ -172,7 +170,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_GCPAD, _T("&GCPad Settings"));
+ pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&Gamecube Pad Settings"));
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings"));
if (g_pCodeWindow)
{
@@ -334,10 +332,8 @@ 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_GCPAD, _T("GCPad"), m_Bitmaps[Toolbar_PluginPAD], _T("GCPad settings"));
+ ToolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("GCPad"), m_Bitmaps[Toolbar_PluginPAD], _T("Gamecube Pad 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
@@ -944,25 +940,14 @@ void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
);
}
-extern Plugin g_GCPad; //TODOSHUFFLE
-void CFrame::OnPluginGCPad(wxCommandEvent& WXUNUSED (event))
+void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
{
- 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();
+ CPluginManager::GetInstance().OpenConfig(
+ GetHandle(),
+ SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[0].c_str(),
+ PLUGIN_TYPE_PAD
+ );
}
-
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 064c28c1bf..3b1e080dc1 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["EmuState"].Get("EmulationStateId", &nState);
+ ini.Get("EmuState", "EmulationStateId", &nState);
m_imageListSmall->Draw(m_EmuStateImageIndex[nState], dc, stateOffset, itemY);
}
}
@@ -439,7 +439,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
// Emulation status
int nState;
- ini["EmuState"].Get("EmulationStateId", &nState);
+ ini.Get("EmuState", "EmulationStateId", &nState);
// Emulation state
SetItemColumnImage(_Index, COLUMN_EMULATION_STATE, m_EmuStateImageIndex[nState]);
@@ -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["EmuState"].Get("EmulationStateId", &nState1);
+ ini.Get("EmuState", "EmulationStateId", &nState1);
ini.Load(GameIni2.c_str());
- ini["EmuState"].Get("EmulationStateId", &nState2);
+ ini.Get("EmuState", "EmulationStateId", &nState2);
if(nState1 > nState2) return 1 *t;
if(nState1 < nState2) return -1 *t;
@@ -809,9 +809,8 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
std::string emuState[5] = {"Broken", "Intro", "In-Game", "Playable", "Perfect"}, issues;
int nState;
- Section& emustate = ini["EmuState"];
- emustate.Get("EmulationStateId", &nState);
- emustate.Get("EmulationIssues", &issues, "");
+ ini.Get("EmuState", "EmulationStateId", &nState);
+ ini.Get("EmuState", "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 9581baba3f..c530df24bd 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_GCPAD,
+ IDM_CONFIG_PAD_PLUGIN,
IDM_CONFIG_WIIMOTE_PLUGIN,
// --------------------------------------------------------------
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp
index 09ef8870da..cb65e72a00 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp
@@ -782,57 +782,77 @@ void CISOProperties::SetRefresh(wxCommandEvent& event)
void CISOProperties::LoadGameConfig()
{
+ bool bTemp;
int iTemp;
std::string sTemp;
- Section& core = GameIni["Core"];
- Section& wii = GameIni["Wii"];
- Section& video = GameIni["Video"];
- Section& emustate = GameIni["EmuState"];
+ if (GameIni.Get("Core", "CPUThread", &bTemp))
+ CPUThread->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ CPUThread->Set3StateValue(wxCHK_UNDETERMINED);
- core.Get("CPUThread", &iTemp, (int)wxCHK_UNDETERMINED);
- CPUThread->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Core", "SkipIdle", &bTemp))
+ SkipIdle->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ SkipIdle->Set3StateValue(wxCHK_UNDETERMINED);
- core.Get("SkipIdle", &iTemp, (int)wxCHK_UNDETERMINED);
- SkipIdle->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Core", "TLBHack", &bTemp))
+ TLBHack->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ TLBHack->Set3StateValue(wxCHK_UNDETERMINED);
- core.Get("TLBHack", &iTemp, (int)wxCHK_UNDETERMINED);
- TLBHack->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Wii", "ProgressiveScan", &bTemp))
+ EnableProgressiveScan->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ EnableProgressiveScan->Set3StateValue(wxCHK_UNDETERMINED);
- wii.Get("ProgressiveScan", &iTemp, (int)wxCHK_UNDETERMINED);
- EnableProgressiveScan->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Wii", "Widescreen", &bTemp))
+ EnableWideScreen->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ EnableWideScreen->Set3StateValue(wxCHK_UNDETERMINED);
- wii.Get("Widescreen", &iTemp, (int)wxCHK_UNDETERMINED);
- EnableWideScreen->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "ForceFiltering", &bTemp))
+ ForceFiltering->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ ForceFiltering->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("ForceFiltering", &iTemp, (int)wxCHK_UNDETERMINED);
- ForceFiltering->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "EFBCopyDisable", &bTemp))
+ EFBCopyDisable->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ EFBCopyDisable->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("EFBCopyDisable", &iTemp, (int)wxCHK_UNDETERMINED);
- EFBCopyDisable->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "EFBToTextureEnable", &bTemp))
+ EFBToTextureEnable->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ EFBToTextureEnable->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("EFBToTextureEnable", &iTemp, (int)wxCHK_UNDETERMINED);
- EFBToTextureEnable->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "SafeTextureCache", &bTemp))
+ SafeTextureCache->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ SafeTextureCache->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("SafeTextureCache", &iTemp, (int)wxCHK_UNDETERMINED);
- SafeTextureCache->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "DstAlphaPass", &bTemp))
+ DstAlphaPass->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ DstAlphaPass->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("DstAlphaPass", &iTemp, (int)wxCHK_UNDETERMINED);
- DstAlphaPass->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "UseXFB", &bTemp))
+ UseXFB->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ UseXFB->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("UseXFB", &iTemp, (int)wxCHK_UNDETERMINED);
- UseXFB->Set3StateValue((wxCheckBoxState)iTemp);
+ if (GameIni.Get("Video", "FIFOBPHack", &bTemp))
+ BPHack->Set3StateValue((wxCheckBoxState)bTemp);
+ else
+ BPHack->Set3StateValue(wxCHK_UNDETERMINED);
- video.Get("FIFOBPHack", &iTemp, (int)wxCHK_UNDETERMINED);
- BPHack->Set3StateValue((wxCheckBoxState)iTemp);
-
- video.Get("ProjectionHack", &iTemp, -1);
+ GameIni.Get("Video", "ProjectionHack", &iTemp, -1);
Hack->SetSelection(iTemp);
- emustate.Get("EmulationStateId", &iTemp, -1);
+ GameIni.Get("EmuState", "EmulationStateId", &iTemp, -1);
EmuState->SetSelection(iTemp);
- emustate.Get("EmulationIssues", &sTemp);
+ GameIni.Get("EmuState", "EmulationIssues", &sTemp);
if (!sTemp.empty())
{
EmuIssues->SetValue(wxString(sTemp.c_str(), *wxConvCurrent));
@@ -846,29 +866,77 @@ void CISOProperties::LoadGameConfig()
bool CISOProperties::SaveGameConfig()
{
- Section& core = GameIni["Core"];
- Section& wii = GameIni["Wii"];
- Section& video = GameIni["Video"];
- Section& emustate = GameIni["EmuState"];
+ if (CPUThread->Get3StateValue() == wxCHK_UNDETERMINED)
+ GameIni.DeleteKey("Core", "CPUThread");
+ else
+ GameIni.Set("Core", "CPUThread", CPUThread->Get3StateValue());
- core.Set("CPUThread", CPUThread->Get3StateValue(), wxCHK_UNDETERMINED);
- core.Set("SkipIdle", SkipIdle->Get3StateValue(), wxCHK_UNDETERMINED);
- core.Set("TLBHack", TLBHack->Get3StateValue(), wxCHK_UNDETERMINED);
+ if (SkipIdle->Get3StateValue() == wxCHK_UNDETERMINED)
+ GameIni.DeleteKey("Core", "SkipIdle");
+ else
+ GameIni.Set("Core", "SkipIdle", SkipIdle->Get3StateValue());
- wii.Set("ProgressiveScan", EnableProgressiveScan->Get3StateValue(), wxCHK_UNDETERMINED);
- wii.Set("Widescreen", EnableWideScreen->Get3StateValue(), wxCHK_UNDETERMINED);
+ if (TLBHack->Get3StateValue() == wxCHK_UNDETERMINED)
+ GameIni.DeleteKey("Core", "TLBHack");
+ else
+ GameIni.Set("Core", "TLBHack", TLBHack->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 (EnableProgressiveScan->Get3StateValue() == wxCHK_UNDETERMINED)
+ GameIni.DeleteKey("Wii", "ProgressiveScan");
+ else
+ GameIni.Set("Wii", "ProgressiveScan", EnableProgressiveScan->Get3StateValue());
- emustate.Set("EmulationStateId", EmuState->GetSelection());
- emustate.Set("EmulationIssues", (const char*)EmuIssues->GetValue().mb_str(*wxConvCurrent));
+ 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));
PatchList_Save();
ActionReplayList_Save();
@@ -950,7 +1018,6 @@ 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)
{
@@ -965,7 +1032,8 @@ void CISOProperties::PatchList_Save()
}
++index;
}
- GameIni["OnFrame"].SetLines(lines);
+ GameIni.SetLines("OnFrame", lines);
+ lines.clear();
}
void CISOProperties::PatchButtonClicked(wxCommandEvent& event)
@@ -1036,7 +1104,7 @@ void CISOProperties::ActionReplayList_Save()
}
++index;
}
- GameIni["ActionReplay"].SetLines(lines);
+ GameIni.SetLines("ActionReplay", lines);
}
void CISOProperties::ActionReplayButtonClicked(wxCommandEvent& event)
diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp
index 450b902367..c96daf99e3 100644
--- a/Source/Core/DolphinWX/Src/LogWindow.cpp
+++ b/Source/Core/DolphinWX/Src/LogWindow.cpp
@@ -168,22 +168,16 @@ void CLogWindow::OnClose(wxCloseEvent& event)
void CLogWindow::SaveSettings()
{
IniFile ini;
-
- 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"];
+ 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);
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
- logs.Set(m_LogManager->getShortName((LogTypes::LOG_TYPE)i), m_checks->IsChecked(i));
+ ini.Set("Logs", m_LogManager->getShortName((LogTypes::LOG_TYPE)i), m_checks->IsChecked(i));
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
}
@@ -191,28 +185,25 @@ void CLogWindow::LoadSettings()
{
IniFile ini;
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
- Section& options = ini["Options"];
int verbosity,font;
- options.Get("Verbosity", &verbosity, 0);
+ ini.Get("Options", "Verbosity", &verbosity, 0);
if (verbosity < 1) verbosity = 1;
if (verbosity > MAX_LOGLEVEL) verbosity = MAX_LOGLEVEL;
m_verbosity->SetSelection(verbosity - 1);
- options.Get("Font", &font, 0);
+ ini.Get("Options", "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())));
- options.Get("WriteToFile", &m_writeFile, true);
+ ini.Get("Options", "WriteToFile", &m_writeFile, true);
m_writeFileCB->SetValue(m_writeFile);
- options.Get("WriteToConsole", &m_writeConsole, true);
+ ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
m_writeConsoleCB->SetValue(m_writeConsole);
- options.Get("WriteToWindow", &m_writeWindow, true);
+ ini.Get("Options", "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;
- logs.Get(m_LogManager->getShortName((LogTypes::LOG_TYPE)i), &enable, true);
+ ini.Get("Logs", 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 ffc9c85aaa..16093e4a09 100644
--- a/Source/Core/DolphinWX/Src/Main.cpp
+++ b/Source/Core/DolphinWX/Src/Main.cpp
@@ -95,6 +95,7 @@ bool DolphinApp::OnInit()
bool LoadElf = false;
bool selectVideoPlugin = false;
bool selectAudioPlugin = false;
+ bool selectPadPlugin = false;
bool selectWiimotePlugin = false;
wxString ElfFile;
@@ -129,6 +130,10 @@ 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
@@ -163,6 +168,10 @@ 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
@@ -192,10 +201,12 @@ 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
@@ -331,6 +342,7 @@ bool DolphinApp::OnInit()
#endif
LogManager::Init();
+ EventHandler::Init();
SConfig::Init();
CPluginManager::Init();
@@ -342,6 +354,14 @@ 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 "HW/GCPad.h"
+#include "pluginspecs_pad.h"
#include "svnrev.h"
//#include
diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript
index a4605c6886..c352f14f64 100644
--- a/Source/Core/DolphinWX/Src/SConscript
+++ b/Source/Core/DolphinWX/Src/SConscript
@@ -13,7 +13,7 @@ files = [
libs = [
'core', 'lzo2', 'discio', 'bdisasm', 'videocommon',
- 'inputuicommon', 'inputcommon', 'common', 'lua', 'z', 'sfml-network'
+ 'inputcommon', 'common', 'lua', 'z', 'sfml-network'
]
if wxenv['HAVE_WX']:
diff --git a/Source/Core/InputCommon/InputCommon.vcproj b/Source/Core/InputCommon/InputCommon.vcproj
index 692a50b37b..eaa33a78ca 100644
--- a/Source/Core/InputCommon/InputCommon.vcproj
+++ b/Source/Core/InputCommon/InputCommon.vcproj
@@ -45,7 +45,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Core/InputCommon/Src/Configuration.cpp b/Source/Core/InputCommon/Src/Configuration.cpp
index 7f4972ea11..c48e48d05f 100644
--- a/Source/Core/InputCommon/Src/Configuration.cpp
+++ b/Source/Core/InputCommon/Src/Configuration.cpp
@@ -18,10 +18,13 @@
#include // System
#include
-#define _USE_MATH_DEFINES
-#include
+#include
#include "Common.h" // Common
+#if defined HAVE_WX && HAVE_WX
+ #include
+#endif
+
#ifdef _WIN32
#define NOMINMAX
#include
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.cpp
index 98e199c24f..071a233887 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.cpp
@@ -2,7 +2,6 @@
#ifdef CIFACE_USE_DIRECTINPUT_KBM
-#include
#include "DirectInputKeyboardMouse.h"
// TODO: maybe add a ClearInputState function to this device
@@ -96,7 +95,7 @@ KeyboardMouse::KeyboardMouse( const LPDIRECTINPUTDEVICE8 kb_device, const LPDIRE
: m_kb_device(kb_device)
, m_mo_device(mo_device)
{
- m_last_update = Common::Timer::GetLocalTimeSinceJan1970();
+ m_last_update = wxGetLocalTimeMillis();
ZeroMemory( &m_state_in, sizeof(m_state_in) );
ZeroMemory( m_state_out, sizeof(m_state_out) );
@@ -134,7 +133,7 @@ bool KeyboardMouse::UpdateInput()
DIMOUSESTATE2 tmp_mouse;
// if mouse position hasn't been updated in a short while, skip a dev state
- u64 cur_time = Common::Timer::GetLocalTimeSinceJan1970();
+ wxLongLong cur_time = wxGetLocalTimeMillis();
if ( cur_time - m_last_update > DROP_INPUT_TIME )
{
// set axes to zero
@@ -179,7 +178,7 @@ bool KeyboardMouse::UpdateOutput()
{
bool want_on = false;
if ( m_state_out[i] )
- want_on = m_state_out[i] > Common::Timer::GetLocalTimeSinceJan1970() % 255 ; // light should flash when output is 0.5
+ want_on = m_state_out[i] > wxGetLocalTimeMillis() % 255 ; // light should flash when output is 0.5
// lights are set to their original state when output is zero
if ( want_on ^ m_current_state_out[i] )
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.h b/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.h
index e57e8d7e97..6af5fb10d0 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.h
+++ b/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInputKeyboardMouse.h
@@ -9,6 +9,8 @@
#include
#include
+#include
+#include
namespace ciface
{
@@ -111,7 +113,7 @@ private:
const LPDIRECTINPUTDEVICE8 m_kb_device;
const LPDIRECTINPUTDEVICE8 m_mo_device;
- u64 m_last_update;
+ wxLongLong m_last_update;
State m_state_in;
unsigned char m_state_out[3]; // NUM CAPS SCROLL
bool m_current_state_out[3]; // NUM CAPS SCROLL
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp
index 61a7b724f6..a2b6c638c9 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp
@@ -4,8 +4,6 @@
#include "XInput.h"
-#pragma comment(lib, "xinput.lib")
-
namespace ciface
{
namespace XInput
diff --git a/Source/Core/InputCommon/Src/DirectInputBase.cpp b/Source/Core/InputCommon/Src/DirectInputBase.cpp
new file mode 100644
index 0000000000..b9a7fee33d
--- /dev/null
+++ b/Source/Core/InputCommon/Src/DirectInputBase.cpp
@@ -0,0 +1,229 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+
+
+// Include
+// -------------------
+#include "DirectInputBase.h"
+
+
+
+DInput::DInput()
+ : g_pDI(NULL),
+ g_pKeyboard(NULL)
+{}
+
+
+DInput::~DInput()
+{
+ Free();
+}
+
+void DInput::DIKToString(unsigned int keycode, char *keyStr)
+{
+ switch(keycode) {
+ case DIK_RETURN:
+ sprintf(keyStr, "Enter");
+ break;
+ case DIK_LCONTROL:
+ sprintf(keyStr, "Left Ctrl");
+ break;
+ case DIK_RCONTROL:
+ strcpy(keyStr, "Right Ctrl");
+ break;
+ case DIK_LSHIFT:
+ sprintf(keyStr, "Left Shift");
+ break;
+ case DIK_RSHIFT:
+ sprintf(keyStr, "Right Shift");
+ break;
+ case DIK_LMENU:
+ sprintf(keyStr, "Left Alt");
+ break;
+ case DIK_RMENU:
+ strcpy(keyStr, "Right Alt");
+ break;
+ case DIK_UP:
+ sprintf(keyStr, "Up");
+ break;
+ case DIK_DOWN:
+ sprintf(keyStr, "Down");
+ break;
+ case DIK_LEFT:
+ sprintf(keyStr, "Left");
+ break;
+ case DIK_RIGHT:
+ sprintf(keyStr, "Right");
+ break;
+ case DIK_HOME:
+ strcpy(keyStr, "Home");
+ break;
+ case DIK_END:
+ strcpy(keyStr, "End");
+ break;
+ case DIK_INSERT:
+ strcpy(keyStr, "Ins");
+ break;
+ case DIK_DELETE:
+ strcpy(keyStr, "Del");
+ break;
+ case DIK_PGUP:
+ strcpy(keyStr, "PgUp");
+ break;
+ case DIK_PGDN:
+ strcpy(keyStr, "PgDn");
+ break;
+ case DIK_NUMLOCK:
+ strcpy(keyStr, "Num Lock");
+ break;
+ case DIK_NUMPAD0:
+ strcpy(keyStr, "Num 0");
+ break;
+ case DIK_NUMPAD1:
+ strcpy(keyStr, "Num 1");
+ break;
+ case DIK_NUMPAD2:
+ strcpy(keyStr, "Num 2");
+ break;
+ case DIK_NUMPAD3:
+ strcpy(keyStr, "Num 3");
+ break;
+ case DIK_NUMPAD4:
+ strcpy(keyStr, "Num 4");
+ break;
+ case DIK_NUMPAD5:
+ strcpy(keyStr, "Num 5");
+ break;
+ case DIK_NUMPAD6:
+ strcpy(keyStr, "Num 6");
+ break;
+ case DIK_NUMPAD7:
+ strcpy(keyStr, "Num 7");
+ break;
+ case DIK_NUMPAD8:
+ strcpy(keyStr, "Num 8");
+ break;
+ case DIK_NUMPAD9:
+ strcpy(keyStr, "Num 9");
+ break;
+ case DIK_DIVIDE:
+ strcpy(keyStr, "Num /");
+ break;
+ case DIK_NUMPADENTER:
+ strcpy(keyStr, "Num Enter");
+ break;
+ case DIK_DECIMAL:
+ strcpy(keyStr, "Num Decimal");
+ break;
+ case DIK_NUMPADCOMMA:
+ case DIK_ABNT_C2:
+ strcpy(keyStr, "Num Separator");
+ break;
+ case DIK_NUMPADEQUALS:
+ strcpy(keyStr, "Num =");
+ break;
+ default:
+ // TODO: Switch to unicode GetKeyNameText?
+ GetKeyNameTextA(keycode << 16, keyStr, 64);
+ break;
+ }
+}
+
+HRESULT DInput::Init(HWND hWnd)
+{
+ HRESULT hr;
+ DWORD dwCoopFlags;
+ dwCoopFlags = DISCL_FOREGROUND | DISCL_NOWINKEY;
+
+ // Create a DInput object
+ if (FAILED(hr = DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION,
+ IID_IDirectInput8, (VOID* *)&g_pDI, NULL)))
+ {
+ MessageBox(0, L"Direct Input Create Failed", 0, MB_ICONERROR);
+ return(hr);
+ }
+
+ if (FAILED(hr = g_pDI->CreateDevice(GUID_SysKeyboard, &g_pKeyboard, NULL)))
+ {
+ MessageBox(0, L"Couldn't access keyboard", 0, MB_ICONERROR);
+ Free();
+ return(hr);
+ }
+
+ g_pKeyboard->SetDataFormat(&c_dfDIKeyboard);
+ g_pKeyboard->SetCooperativeLevel(hWnd, dwCoopFlags);
+ g_pKeyboard->Acquire();
+
+ return(S_OK);
+}
+
+void DInput::Free()
+{
+ if (g_pKeyboard)
+ {
+ g_pKeyboard->Unacquire();
+ g_pKeyboard->Release();
+ g_pKeyboard = 0;
+ }
+
+ if (g_pDI)
+ {
+ g_pDI->Release();
+ g_pDI = 0;
+ }
+}
+
+// Desc: Read the input device's state when in immediate mode and display it.
+HRESULT DInput::Read()
+{
+ HRESULT hr;
+
+ if (NULL == g_pKeyboard)
+ {
+ return(S_OK);
+ }
+
+ // Get the input's device state, and put the state in dims
+ ZeroMemory(diks, sizeof(diks));
+ hr = g_pKeyboard->GetDeviceState(sizeof(diks), diks);
+
+ //for (int i=0; i<256; i++)
+ // if (diks[i]) MessageBox(0,"DSFJDKSF|",0,0);
+ if (FAILED(hr))
+ {
+ // DirectInput may be telling us that the input stream has been
+ // interrupted. We aren't tracking any state between polls, so
+ // we don't have any special reset that needs to be done.
+ // We just re-acquire and try again.
+
+ // If input is lost then acquire and keep trying
+ hr = g_pKeyboard->Acquire();
+
+ while (hr == DIERR_INPUTLOST)
+ {
+ hr = g_pKeyboard->Acquire();
+ }
+
+ // hr may be DIERR_OTHERAPPHASPRIO or other errors. This
+ // may occur when the app is minimized or in the process of
+ // switching, so just try again later
+ return(S_OK);
+ }
+
+ return(S_OK);
+}
diff --git a/Source/Core/InputCommon/Src/DirectInputBase.h b/Source/Core/InputCommon/Src/DirectInputBase.h
new file mode 100644
index 0000000000..22f7fb5d2e
--- /dev/null
+++ b/Source/Core/InputCommon/Src/DirectInputBase.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#ifndef _DIRECTINPUTBASE_H
+#define _DIRECTINPUTBASE_H
+
+
+#include // System
+#include
+
+#define DIRECTINPUT_VERSION 0x0800 // DirectInput
+#include
+
+
+
+class DInput
+{
+ public:
+
+ DInput();
+ ~DInput();
+
+ static void DInput::DIKToString(unsigned int keycode, char *keyStr);
+
+ HRESULT Init(HWND hWnd);
+ void Free();
+ HRESULT Read();
+
+
+ BYTE diks[256]; // DirectInput keyboard state buffer
+
+ private:
+
+ LPDIRECTINPUT8 g_pDI; // The DirectInput object
+ LPDIRECTINPUTDEVICE8 g_pKeyboard; // The keyboard device
+};
+
+#endif
+
diff --git a/Source/Core/InputCommon/Src/Event.hpp b/Source/Core/InputCommon/Src/Event.hpp
new file mode 100755
index 0000000000..7f84265c3d
--- /dev/null
+++ b/Source/Core/InputCommon/Src/Event.hpp
@@ -0,0 +1,264 @@
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+
+#ifndef SFML_EVENT_HPP
+#define SFML_EVENT_HPP
+
+
+namespace sf
+{
+ namespace Key
+ {
+ enum Code
+ {
+ A = 'a',
+ B = 'b',
+ C = 'c',
+ D = 'd',
+ E = 'e',
+ F = 'f',
+ G = 'g',
+ H = 'h',
+ I = 'i',
+ J = 'j',
+ K = 'k',
+ L = 'l',
+ M = 'm',
+ N = 'n',
+ O = 'o',
+ P = 'p',
+ Q = 'q',
+ R = 'r',
+ S = 's',
+ T = 't',
+ U = 'u',
+ V = 'v',
+ W = 'w',
+ X = 'x',
+ Y = 'y',
+ Z = 'z',
+ Num0 = '0',
+ Num1 = '1',
+ Num2 = '2',
+ Num3 = '3',
+ Num4 = '4',
+ Num5 = '5',
+ Num6 = '6',
+ Num7 = '7',
+ Num8 = '8',
+ Num9 = '9',
+ Escape = 256,
+ LControl,
+ LShift,
+ LAlt,
+ LSystem,
+ RControl,
+ RShift,
+ RAlt,
+ RSystem,
+ Menu,
+ LBracket,
+ RBracket,
+ SemiColon,
+ Comma,
+ Period,
+ Quote,
+ Slash,
+ BackSlash,
+ Tilde,
+ Equal,
+ Dash,
+ Space,
+ Return,
+ Back,
+ Tab,
+ PageUp,
+ PageDown,
+ End,
+ Home,
+ Insert,
+ Delete,
+ Add,
+ Subtract,
+ Multiply,
+ Divide,
+ Left,
+ Right,
+ Up,
+ Down,
+ Numpad0,
+ Numpad1,
+ Numpad2,
+ Numpad3,
+ Numpad4,
+ Numpad5,
+ Numpad6,
+ Numpad7,
+ Numpad8,
+ Numpad9,
+ F1,
+ F2,
+ F3,
+ F4,
+ F5,
+ F6,
+ F7,
+ F8,
+ F9,
+ F10,
+ F11,
+ F12,
+ F13,
+ F14,
+ F15,
+ Pause,
+
+ Count // For internal use
+ };
+ }
+
+
+ namespace Mouse
+ {
+ enum Button
+ {
+ Left,
+ Right,
+ Middle,
+ XButton1,
+ XButton2,
+
+ Count // For internal use
+ };
+ }
+
+
+ namespace Joy
+ {
+ enum Axis
+ {
+ AxisX,
+ AxisY,
+ AxisZ,
+ AxisR,
+ AxisU,
+ AxisV,
+ AxisPOV,
+
+ Count // For internal use
+ };
+ }
+
+
+ class Event
+ {
+ public :
+
+ struct KeyEvent
+ {
+ Key::Code Code;
+ bool Alt;
+ bool Control;
+ bool Shift;
+ };
+
+ struct TextEvent
+ {
+ // I'm not sure we need this...
+ unsigned short Unicode;
+ };
+
+ struct MouseMoveEvent
+ {
+ int X;
+ int Y;
+ };
+
+ struct MouseButtonEvent
+ {
+ Mouse::Button Button;
+ int X;
+ int Y;
+ };
+
+ struct MouseWheelEvent
+ {
+ int Delta;
+ };
+
+ struct JoyMoveEvent
+ {
+ unsigned int JoystickId;
+ Joy::Axis Axis;
+ float Position;
+ };
+
+ struct JoyButtonEvent
+ {
+ unsigned int JoystickId;
+ unsigned int Button;
+ };
+
+ struct SizeEvent
+ {
+ unsigned int Width;
+ unsigned int Height;
+ };
+
+ enum EventType
+ {
+ Closed,
+ Resized,
+ LostFocus,
+ GainedFocus,
+ TextEntered,
+ KeyPressed,
+ KeyReleased,
+ MouseWheelMoved,
+ MouseButtonPressed,
+ MouseButtonReleased,
+ MouseMoved,
+ MouseEntered,
+ MouseLeft,
+ JoyButtonPressed,
+ JoyButtonReleased,
+ JoyMoved
+ };
+
+ // Member data
+ EventType Type;
+
+ union
+ {
+ KeyEvent Key;
+ TextEvent Text;
+ MouseMoveEvent MouseMove;
+ MouseButtonEvent MouseButton;
+ MouseWheelEvent MouseWheel;
+ JoyMoveEvent JoyMove;
+ JoyButtonEvent JoyButton;
+ SizeEvent Size;
+ };
+ };
+
+} // namespace sf
+
+
+#endif // SFML_EVENT_HPP
diff --git a/Source/Core/InputCommon/Src/EventHandler.cpp b/Source/Core/InputCommon/Src/EventHandler.cpp
new file mode 100644
index 0000000000..19dc819baf
--- /dev/null
+++ b/Source/Core/InputCommon/Src/EventHandler.cpp
@@ -0,0 +1,318 @@
+#include "EventHandler.h"
+#include
+#include
+
+#if defined HAVE_WX && HAVE_WX
+#include
+#endif
+
+EventHandler *EventHandler::m_Instance = 0;
+
+EventHandler::EventHandler() {
+ memset(keys, 0, sizeof(keys));
+ memset(mouse, 0, sizeof(mouse));
+ memset(joys, 0, sizeof(joys));
+}
+
+EventHandler::~EventHandler() {
+}
+
+EventHandler *EventHandler::GetInstance() {
+ // fprintf(stderr, "handler instance %p\n", m_Instance);
+ return m_Instance;
+}
+
+void EventHandler::Init()
+{
+ m_Instance = new EventHandler();
+}
+
+void EventHandler::Shutdown() {
+ if (m_Instance)
+ delete m_Instance;
+ // fprintf(stderr, "deleting instance %p\n", m_Instance);
+ m_Instance = 0;
+}
+
+bool EventHandler::RegisterEventListener(listenFuncPtr func, Keys key) {
+ if (key.inputType == KeyboardInput) {
+ // fprintf(stderr, "Registering %d:%d %p %p \n", key.keyCode, key.mods, func, this);
+ if (key.keyCode == sf::Key::Count || key.mods >= NUMMODS ||
+ key.keyCode >= NUMKEYS)
+ return false;
+ if (keys[key.keyCode][key.mods] && keys[key.keyCode][key.mods] != func)
+ return false
+;
+ keys[key.keyCode][key.mods] = func;
+ } else if (key.inputType == MouseInput) {
+ if (mouse[key.mouseButton])
+ return false;
+ mouse[key.mouseButton] = func;
+ }
+
+ return true;
+}
+
+bool EventHandler::RemoveEventListener(Keys key) {
+ if (key.inputType == KeyboardInput) {
+ if ((key.keyCode == sf::Key::Count || key.keyCode >= NUMKEYS
+ || key.mods >= NUMMODS) && ! keys[key.keyCode][key.mods])
+ return false;
+ keys[key.keyCode][key.mods] = NULL;
+ } else if (key.inputType == MouseInput) {
+ if (! mouse[key.mouseButton])
+ return false;
+ mouse[key.mouseButton] = NULL;
+ }
+
+ return true;
+}
+
+void EventHandler::Update() {
+ for (unsigned int i = 0; i < eventQueue.size();i++) {
+ sf::Event ev = eventQueue.front();
+ eventQueue.pop();
+ fprintf(stderr, "Updating event type %d code %d mod %d func %p %p\n", ev.Type, ev.Key.Code, ev.Key.Alt+2*ev.Key.Shift+4*ev.Key.Control, keys[ev.Key.Code][ev.Key.Alt+2*ev.Key.Shift+4*ev.Key.Control], this);
+ if(keys[ev.Key.Code][ev.Key.Alt+2*ev.Key.Shift+4*ev.Key.Control])
+ keys[ev.Key.Code][ev.Key.Alt+2*ev.Key.Shift+4*ev.Key.Control](ev);
+ }
+}
+
+bool EventHandler::addEvent(sf::Event *ev) {
+ eventQueue.push(*ev);
+ fprintf(stderr, "Got event type %d code %d %p\n", ev->Type, ev->Key.Code, this);
+ return true;
+}
+
+
+bool EventHandler::TestEvent (Keys k, sf::Event e)
+{
+ //Mouse event
+ if (k.inputType==MouseInput && k.eventType==e.Type && k.mouseButton==e.MouseButton.Button)
+ {
+ return (true);
+ }
+ //Keyboard event
+ if (k.inputType==KeyboardInput && k.eventType==e.Type && k.keyCode==e.Key.Code)
+ {
+ return (true);
+ }
+ return (false);
+}
+
+#if defined HAVE_WX && HAVE_WX
+// Taken from wxw source code
+sf::Key::Code EventHandler::wxCharCodeToSF(int id)
+{
+ sf::Key::Code sfKey;
+
+ switch (id) {
+// case WXK_CANCEL: sfKey = sf::Key::Cancel; break;
+// case WXK_BACK: sfKey = sf::Key::BackSpace; break;
+ case WXK_TAB: sfKey = sf::Key::Tab; break;
+// case WXK_CLEAR: sfKey = sf::Key::Clear; break;
+ case WXK_RETURN: sfKey = sf::Key::Return; break;
+ case WXK_SHIFT: sfKey = sf::Key::LShift; break;
+ case WXK_CONTROL: sfKey = sf::Key::LControl; break;
+ case WXK_ALT: sfKey = sf::Key::LAlt; break;
+// case WXK_CAPITAL: sfKey = sf::Key::Caps_Lock; break;
+ case WXK_MENU : sfKey = sf::Key::Menu; break;
+ case WXK_PAUSE: sfKey = sf::Key::Pause; break;
+ case WXK_ESCAPE: sfKey = sf::Key::Escape; break;
+ case WXK_SPACE: sfKey = sf::Key::Space; break;
+ case WXK_PAGEUP: sfKey = sf::Key::PageUp; break;
+ case WXK_PAGEDOWN: sfKey = sf::Key::PageDown; break;
+ case WXK_END: sfKey = sf::Key::End; break;
+ case WXK_HOME : sfKey = sf::Key::Home; break;
+ case WXK_LEFT : sfKey = sf::Key::Left; break;
+ case WXK_UP: sfKey = sf::Key::Up; break;
+ case WXK_RIGHT: sfKey = sf::Key::Right; break;
+ case WXK_DOWN : sfKey = sf::Key::Down; break;
+// case WXK_SELECT: sfKey = sf::Key::Select; break;
+// case WXK_PRINT: sfKey = sf::Key::Print; break;
+// case WXK_EXECUTE: sfKey = sf::Key::Execute; break;
+ case WXK_INSERT: sfKey = sf::Key::Insert; break;
+ case WXK_DELETE: sfKey = sf::Key::Delete; break;
+// case WXK_HELP : sfKey = sf::Key::Help; break;
+ case WXK_NUMPAD0: sfKey = sf::Key::Numpad0; break;
+ case WXK_NUMPAD_INSERT: sfKey = sf::Key::Insert; break;
+ case WXK_NUMPAD1: sfKey = sf::Key::Numpad1; break;
+ case WXK_NUMPAD_END: sfKey = sf::Key::End; break;
+ case WXK_NUMPAD2: sfKey = sf::Key::Numpad2; break;
+ case WXK_NUMPAD_DOWN: sfKey = sf::Key::Down; break;
+ case WXK_NUMPAD3: sfKey = sf::Key::Numpad3; break;
+ case WXK_NUMPAD_PAGEDOWN: sfKey = sf::Key::PageDown; break;
+ case WXK_NUMPAD4: sfKey = sf::Key::Numpad4; break;
+ case WXK_NUMPAD_LEFT: sfKey = sf::Key::Left; break;
+ case WXK_NUMPAD5: sfKey = sf::Key::Numpad5; break;
+ case WXK_NUMPAD6: sfKey = sf::Key::Numpad6; break;
+ case WXK_NUMPAD_RIGHT: sfKey = sf::Key::Right; break;
+ case WXK_NUMPAD7: sfKey = sf::Key::Numpad7; break;
+ case WXK_NUMPAD_HOME: sfKey = sf::Key::Home; break;
+ case WXK_NUMPAD8: sfKey = sf::Key::Numpad8; break;
+ case WXK_NUMPAD_UP: sfKey = sf::Key::Up; break;
+ case WXK_NUMPAD9: sfKey = sf::Key::Numpad9; break;
+ case WXK_NUMPAD_PAGEUP: sfKey = sf::Key::PageUp; break;
+// case WXK_NUMPAD_DECIMAL: sfKey = sf::Key::Decimal; break;
+ case WXK_NUMPAD_DELETE: sfKey = sf::Key::Delete; break;
+ case WXK_NUMPAD_MULTIPLY: sfKey = sf::Key::Multiply; break;
+ case WXK_NUMPAD_ADD: sfKey = sf::Key::Add; break;
+ case WXK_NUMPAD_SUBTRACT: sfKey = sf::Key::Subtract; break;
+ case WXK_NUMPAD_DIVIDE: sfKey = sf::Key::Divide; break;
+ case WXK_NUMPAD_ENTER: sfKey = sf::Key::Return; break;
+// case WXK_NUMPAD_SEPARATOR:sfKey = sf::Key::Separator; break;
+ case WXK_F1: sfKey = sf::Key::F1; break;
+ case WXK_F2: sfKey = sf::Key::F2; break;
+ case WXK_F3: sfKey = sf::Key::F3; break;
+ case WXK_F4: sfKey = sf::Key::F4; break;
+ case WXK_F5: sfKey = sf::Key::F5; break;
+ case WXK_F6: sfKey = sf::Key::F6; break;
+ case WXK_F7: sfKey = sf::Key::F7; break;
+ case WXK_F8: sfKey = sf::Key::F8; break;
+ case WXK_F9: sfKey = sf::Key::F9; break;
+ case WXK_F10: sfKey = sf::Key::F10; break;
+ case WXK_F11: sfKey = sf::Key::F11; break;
+ case WXK_F12: sfKey = sf::Key::F12; break;
+ case WXK_F13: sfKey = sf::Key::F13; break;
+ case WXK_F14: sfKey = sf::Key::F14; break;
+ case WXK_F15: sfKey = sf::Key::F15; break;
+// case WXK_NUMLOCK: sfKey = sf::Key::Num_Lock; break;
+// case WXK_SCROLL: sfKey = sf::Key::Scroll_Lock; break;
+ default:
+
+ // To lower (will tolower work on windows?)
+ if (id >= 'A' && id <= 'Z')
+ id = id - 'A' + 'a';
+
+ if ((id >= 'a' && id <= 'z') ||
+ (id >= '0' && id <= '9'))
+ sfKey = (sf::Key::Code)id;
+ else
+ sfKey = sf::Key::Count; // Invalid key
+
+ }
+
+ return sfKey;
+}
+#endif
+
+void EventHandler::SFKeyToString(sf::Key::Code keycode, char *keyStr) {
+ switch (keycode) {
+/* case sf::Key::A = 'a': sprintf(keyStr, "UP"); break;
+ case sf::Key::B = 'b': sprintf(keyStr, "UP"); break;
+ case sf::Key::C = 'c': sprintf(keyStr, "UP"); break;
+ case sf::Key::D = 'd': sprintf(keyStr, "UP"); break;
+ case sf::Key::E = 'e': sprintf(keyStr, "UP"); break;
+ case sf::Key::F = 'f': sprintf(keyStr, "UP"); break;
+ case sf::Key::G = 'g': sprintf(keyStr, "UP"); break;
+ case sf::Key::H = 'h': sprintf(keyStr, "UP"); break;
+ case sf::Key::I = 'i': sprintf(keyStr, "UP"); break;
+ case sf::Key::J = 'j': sprintf(keyStr, "UP"); break;
+ case sf::Key::K = 'k': sprintf(keyStr, "UP"); break;
+ case sf::Key::L = 'l': sprintf(keyStr, "UP"); break;
+ case sf::Key::M = 'm': sprintf(keyStr, "UP"); break;
+ case sf::Key::N = 'n': sprintf(keyStr, "UP"); break;
+ case sf::Key::O = 'o': sprintf(keyStr, "UP"); break;
+ case sf::Key::P = 'p': sprintf(keyStr, "UP"); break;
+ case sf::Key::Q = 'q': sprintf(keyStr, "UP"); break;
+ case sf::Key::R = 'r': sprintf(keyStr, "UP"); break;
+ case sf::Key::S = 's': sprintf(keyStr, "UP"); break;
+ case sf::Key::T = 't': sprintf(keyStr, "UP"); break;
+ case sf::Key::U = 'u': sprintf(keyStr, "UP"); break;
+ case sf::Key::V = 'v': sprintf(keyStr, "UP"); break;
+ case sf::Key::W = 'w': sprintf(keyStr, "UP"); break;
+ case sf::Key::X = 'x': sprintf(keyStr, "UP"); break;
+ case sf::Key::Y = 'y': sprintf(keyStr, "UP"); break;
+ case sf::Key::Z = 'z': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num0 = '0': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num1 = '1': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num2 = '2': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num3 = '3': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num4 = '4': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num5 = '5': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num6 = '6': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num7 = '7': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num8 = '8': sprintf(keyStr, "UP"); break;
+ case sf::Key::Num9 = '9': sprintf(keyStr, "UP"); break;*/
+ case sf::Key::Escape: sprintf(keyStr, "Escape"); break;
+ case sf::Key::LControl: sprintf(keyStr, "LControl"); break;
+ case sf::Key::LShift: sprintf(keyStr, "LShift"); break;
+ case sf::Key::LAlt: sprintf(keyStr, "LAlt"); break;
+ case sf::Key::LSystem: sprintf(keyStr, "LSystem"); break;
+ case sf::Key::RControl: sprintf(keyStr, "RControl"); break;
+ case sf::Key::RShift: sprintf(keyStr, "RShift"); break;
+ case sf::Key::RAlt: sprintf(keyStr, "RAlt"); break;
+ case sf::Key::RSystem: sprintf(keyStr, "RSystem"); break;
+ case sf::Key::Menu: sprintf(keyStr, "Menu"); break;
+ case sf::Key::LBracket: sprintf(keyStr, "LBracket"); break;
+ case sf::Key::RBracket: sprintf(keyStr, "RBracket"); break;
+ case sf::Key::SemiColon: sprintf(keyStr, ";"); break;
+ case sf::Key::Comma: sprintf(keyStr, ","); break;
+ case sf::Key::Period: sprintf(keyStr, "."); break;
+ case sf::Key::Quote: sprintf(keyStr, "\'"); break;
+ case sf::Key::Slash: sprintf(keyStr, "/"); break;
+ case sf::Key::BackSlash: sprintf(keyStr, "\\"); break;
+ case sf::Key::Tilde: sprintf(keyStr, "~"); break;
+ case sf::Key::Equal: sprintf(keyStr, "="); break;
+ case sf::Key::Dash: sprintf(keyStr, "-"); break;
+ case sf::Key::Space: sprintf(keyStr, "Space"); break;
+ case sf::Key::Return: sprintf(keyStr, "Return"); break;
+ case sf::Key::Back: sprintf(keyStr, "Back"); break;
+ case sf::Key::Tab: sprintf(keyStr, "Tab"); break;
+ case sf::Key::PageUp: sprintf(keyStr, "Page Up"); break;
+ case sf::Key::PageDown: sprintf(keyStr, "Page Down"); break;
+ case sf::Key::End: sprintf(keyStr, "End"); break;
+ case sf::Key::Home: sprintf(keyStr, "Home"); break;
+ case sf::Key::Insert: sprintf(keyStr, "Insert"); break;
+ case sf::Key::Delete: sprintf(keyStr, "Delete"); break;
+ case sf::Key::Add: sprintf(keyStr, "+"); break;
+ case sf::Key::Subtract: sprintf(keyStr, "-"); break;
+ case sf::Key::Multiply: sprintf(keyStr, "*"); break;
+ case sf::Key::Divide: sprintf(keyStr, "/"); break;
+ case sf::Key::Left: sprintf(keyStr, "Left"); break;
+ case sf::Key::Right: sprintf(keyStr, "Right"); break;
+ case sf::Key::Up: sprintf(keyStr, "Up"); break;
+ case sf::Key::Down: sprintf(keyStr, "Down"); break;
+ case sf::Key::Numpad0: sprintf(keyStr, "NP 0"); break;
+ case sf::Key::Numpad1: sprintf(keyStr, "NP 1"); break;
+ case sf::Key::Numpad2: sprintf(keyStr, "NP 2"); break;
+ case sf::Key::Numpad3: sprintf(keyStr, "NP 3"); break;
+ case sf::Key::Numpad4: sprintf(keyStr, "NP 4"); break;
+ case sf::Key::Numpad5: sprintf(keyStr, "NP 5"); break;
+ case sf::Key::Numpad6: sprintf(keyStr, "NP 6"); break;
+ case sf::Key::Numpad7: sprintf(keyStr, "NP 7"); break;
+ case sf::Key::Numpad8: sprintf(keyStr, "NP 8"); break;
+ case sf::Key::Numpad9: sprintf(keyStr, "NP 9"); break;
+ case sf::Key::F1: sprintf(keyStr, "F1"); break;
+ case sf::Key::F2: sprintf(keyStr, "F2"); break;
+ case sf::Key::F3: sprintf(keyStr, "F3"); break;
+ case sf::Key::F4: sprintf(keyStr, "F4"); break;
+ case sf::Key::F5: sprintf(keyStr, "F5"); break;
+ case sf::Key::F6: sprintf(keyStr, "F6"); break;
+ case sf::Key::F7: sprintf(keyStr, "F7"); break;
+ case sf::Key::F8: sprintf(keyStr, "F8"); break;
+ case sf::Key::F9: sprintf(keyStr, "F9"); break;
+ case sf::Key::F10: sprintf(keyStr, "F10"); break;
+ case sf::Key::F11: sprintf(keyStr, "F11"); break;
+ case sf::Key::F12: sprintf(keyStr, "F12"); break;
+ case sf::Key::F13: sprintf(keyStr, "F13"); break;
+ case sf::Key::F14: sprintf(keyStr, "F14"); break;
+ case sf::Key::F15: sprintf(keyStr, "F15"); break;
+ case sf::Key::Pause: sprintf(keyStr, "Pause"); break;
+ default:
+ if (keycode > sf::Key::Escape)
+ sprintf(keyStr, "Invalid Key");
+ else
+ sprintf(keyStr, "%c", toupper(keycode));
+ break;
+ }
+}
+
+class EventHandlerCleaner
+{
+public:
+ ~EventHandlerCleaner()
+ {
+ //EventHandler::Destroy();
+ }
+} EventHandlerCleanerInst;
diff --git a/Source/Core/InputCommon/Src/EventHandler.h b/Source/Core/InputCommon/Src/EventHandler.h
new file mode 100644
index 0000000000..bde6bbf430
--- /dev/null
+++ b/Source/Core/InputCommon/Src/EventHandler.h
@@ -0,0 +1,64 @@
+#ifndef EVENTHANDER_H
+#define EVENTHANDER_H 1
+#include "Common.h"
+#include
+#include "Event.hpp"
+
+#define NUMKEYS 300
+#define NUMMODS 8
+
+typedef bool (*listenFuncPtr) (sf::Event);
+enum InputType
+{
+ KeyboardInput,
+ MouseInput,
+ JoystickInput
+};
+
+enum Modifiers {
+ UseAlt = 1,
+ UseShift = 2,
+ UseCtrl = 4
+};
+
+struct Keys {
+ InputType inputType;
+ sf::Event::EventType eventType;
+ sf::Key::Code keyCode;
+ int mods;
+ sf::Mouse::Button mouseButton;
+};
+
+class EventHandler {
+
+private:
+ listenFuncPtr keys[NUMKEYS][NUMMODS];
+ listenFuncPtr mouse[sf::Mouse::Count+1];
+ listenFuncPtr joys[sf::Joy::Count+1];
+ std::queue eventQueue;
+ static EventHandler *m_Instance;
+
+protected:
+ EventHandler(const EventHandler&);
+ EventHandler& operator= (const EventHandler&);
+
+ EventHandler();
+ ~EventHandler();
+
+public:
+
+ bool RegisterEventListener(listenFuncPtr func, Keys key);
+ bool RemoveEventListener(Keys key);
+ void Update();
+ static EventHandler *GetInstance();
+ static void Init();
+ static void Shutdown();
+ bool addEvent(sf::Event *e);
+ static bool TestEvent (Keys k, sf::Event e);
+#if defined HAVE_WX && HAVE_WX
+ static sf::Key::Code wxCharCodeToSF(int id);
+#endif
+ static void SFKeyToString(sf::Key::Code keycode, char *keyStr);
+};
+
+#endif
diff --git a/Source/Core/InputCommon/Src/InputCommon.cpp b/Source/Core/InputCommon/Src/InputCommon.cpp
new file mode 100644
index 0000000000..beed506f8e
--- /dev/null
+++ b/Source/Core/InputCommon/Src/InputCommon.cpp
@@ -0,0 +1,16 @@
+#include "EventHandler.h"
+
+//EventHandler *eventHandler = NULL;
+
+namespace InputCommon
+{
+ void Init() {
+ // init the event handler
+ //EventHandler::GetInstance();
+ }
+
+ void Shutdown() {
+ //if (eventHandler)
+ // delete eventHandler;
+ }
+}
diff --git a/Source/Core/InputCommon/Src/InputCommon.h b/Source/Core/InputCommon/Src/InputCommon.h
index 52b75e0f0f..5b930fb217 100644
--- a/Source/Core/InputCommon/Src/InputCommon.h
+++ b/Source/Core/InputCommon/Src/InputCommon.h
@@ -1,3 +1,7 @@
+#include "EventHandler.h"
+
+//extern EventHandler *eventHandler;
+
namespace InputCommon
{
enum EButtonType
@@ -20,4 +24,6 @@ enum EXInputTrigger
XI_TRIGGER_R,
};
+ void Init();
+ void Shutdown();
}
diff --git a/Source/Core/InputCommon/Src/SConscript b/Source/Core/InputCommon/Src/SConscript
index 59796940d7..d80a43f3c3 100644
--- a/Source/Core/InputCommon/Src/SConscript
+++ b/Source/Core/InputCommon/Src/SConscript
@@ -5,8 +5,8 @@ icenv = env.Clone()
files = [
'Configuration.cpp',
- 'InputConfig.cpp',
- 'ControllerEmu.cpp',
+ 'EventHandler.cpp',
+ 'InputCommon.cpp',
'SDL_Util.cpp',
'ControllerInterface/ControllerInterface.cpp',
]
@@ -16,6 +16,11 @@ if env['HAVE_X11']:
"X11InputBase.cpp",
]
+if env['HAVE_WX']:
+ files += [
+ "WXInputBase.cpp",
+ ]
+
if icenv['HAVE_SDL']:
files += [
'ControllerInterface/SDL/SDL.cpp'
diff --git a/Source/Plugins/InputUICommon/Src/WXInputBase.cpp b/Source/Core/InputCommon/Src/WXInputBase.cpp
similarity index 97%
rename from Source/Plugins/InputUICommon/Src/WXInputBase.cpp
rename to Source/Core/InputCommon/Src/WXInputBase.cpp
index 7067d3fd27..f89f813e97 100644
--- a/Source/Plugins/InputUICommon/Src/WXInputBase.cpp
+++ b/Source/Core/InputCommon/Src/WXInputBase.cpp
@@ -1,127 +1,127 @@
-// Copyright (C) 2003 Dolphin Project.
-
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, version 2.0.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License 2.0 for more details.
-
-// A copy of the GPL 2.0 should have been included with the program.
-// If not, see http://www.gnu.org/licenses/
-
-// Official SVN repository and contact information can be found at
-// http://code.google.com/p/dolphin-emu/
-
-#include
-#include "WXInputBase.h"
-//#include
-//#include
-//#include
-
-namespace InputCommon
-{
-
-const wxChar *WXKeyToString(int keycode)
-{
- switch (keycode)
- {
- case WXK_CANCEL: return wxT("Cancel"); break;
- case WXK_BACK: return wxT("Back"); break;
- case WXK_TAB: return wxT("Tab"); break;
- case WXK_CLEAR: return wxT("Clear"); break;
- case WXK_RETURN: return wxT("Return"); break;
- case WXK_SHIFT: return wxT("Shift"); break;
- case WXK_CONTROL: return wxT("Control"); break;
- case WXK_ALT: return wxT("Alt"); break;
- case WXK_CAPITAL: return wxT("CapsLock"); break;
- case WXK_MENU : return wxT("Menu"); break;
- case WXK_PAUSE: return wxT("Pause"); break;
- case WXK_ESCAPE: return wxT("Escape"); break;
- case WXK_SPACE: return wxT("Space"); break;
- case WXK_PAGEUP: return wxT("PgUp"); break;
- case WXK_PAGEDOWN: return wxT("PgDn"); break;
- case WXK_END: return wxT("End"); break;
- case WXK_HOME : return wxT("Home"); break;
- case WXK_LEFT : return wxT("Left"); break;
- case WXK_UP: return wxT("Up"); break;
- case WXK_RIGHT: return wxT("Right"); break;
- case WXK_DOWN : return wxT("Down"); break;
- case WXK_SELECT: return wxT("Select"); break;
- case WXK_PRINT: return wxT("Print"); break;
- case WXK_EXECUTE: return wxT("Execute"); break;
- case WXK_INSERT: return wxT("Insert"); break;
- case WXK_DELETE: return wxT("Delete"); break;
- case WXK_HELP : return wxT("Help"); break;
- case WXK_NUMPAD0: return wxT("NP 0"); break;
- case WXK_NUMPAD1: return wxT("NP 1"); break;
- case WXK_NUMPAD2: return wxT("NP 2"); break;
- case WXK_NUMPAD3: return wxT("NP 3"); break;
- case WXK_NUMPAD4: return wxT("NP 4"); break;
- case WXK_NUMPAD5: return wxT("NP 5"); break;
- case WXK_NUMPAD6: return wxT("NP 6"); break;
- case WXK_NUMPAD7: return wxT("NP 7"); break;
- case WXK_NUMPAD8: return wxT("NP 8"); break;
- case WXK_NUMPAD9: return wxT("NP 9"); break;
- case WXK_NUMPAD_DECIMAL: return wxT("NP ."); break;
- case WXK_NUMPAD_DELETE: return wxT("NP Delete"); break;
- case WXK_NUMPAD_INSERT: return wxT("NP Insert"); break;
- case WXK_NUMPAD_END: return wxT("NP End"); break;
- case WXK_NUMPAD_DOWN: return wxT("NP Down"); break;
- case WXK_NUMPAD_PAGEDOWN: return wxT("NP Pagedown"); break;
- case WXK_NUMPAD_LEFT: return wxT("NP Left"); break;
- case WXK_NUMPAD_RIGHT: return wxT("NP Right"); break;
- case WXK_NUMPAD_HOME: return wxT("NP Home"); break;
- case WXK_NUMPAD_UP: return wxT("NP Up"); break;
- case WXK_NUMPAD_PAGEUP: return wxT("NP Pageup"); break;
- case WXK_NUMPAD_MULTIPLY: return wxT("NP *"); break;
- case WXK_NUMPAD_ADD: return wxT("NP +"); break;
- case WXK_NUMPAD_SUBTRACT: return wxT("NP -"); break;
- case WXK_NUMPAD_DIVIDE: return wxT("NP /"); break;
- case WXK_NUMPAD_ENTER: return wxT("NP Enter"); break;
- case WXK_NUMPAD_SEPARATOR: return wxT("NP Separator"); break;
- case WXK_F1: return wxT("F1"); break;
- case WXK_F2: return wxT("F2"); break;
- case WXK_F3: return wxT("F3"); break;
- case WXK_F4: return wxT("F4"); break;
- case WXK_F5: return wxT("F5"); break;
- case WXK_F6: return wxT("F6"); break;
- case WXK_F7: return wxT("F7"); break;
- case WXK_F8: return wxT("F8"); break;
- case WXK_F9: return wxT("F9"); break;
- case WXK_F10: return wxT("F10"); break;
- case WXK_F11: return wxT("F11"); break;
- case WXK_F12: return wxT("F12"); break;
- case WXK_F13: return wxT("F13"); break;
- case WXK_F14: return wxT("F14"); break;
- case WXK_F15: return wxT("F15"); break;
- case WXK_F16: return wxT("F16"); break;
- case WXK_F17: return wxT("F17"); break;
- case WXK_F18: return wxT("F19"); break;
- case WXK_F19: return wxT("F20"); break;
- case WXK_F20: return wxT("F21"); break;
- case WXK_F21: return wxT("F22"); break;
- case WXK_F22: return wxT("F23"); break;
- case WXK_F23: return wxT("F24"); break;
- case WXK_F24: return wxT("F25"); break;
- case WXK_NUMLOCK: return wxT("Numlock"); break;
- case WXK_SCROLL: return wxT("Scrolllock"); break;
- default: return wxString::FromAscii(keycode);
- }
-}
-
-const wxChar *WXKeymodToString(int modifier)
-{
- switch (modifier)
- {
- case wxMOD_ALT: return wxT("Alt"); break;
- case wxMOD_CMD: return wxT("Ctrl"); break;
- case wxMOD_ALTGR: return wxT("Ctrl+Alt"); break;
- case wxMOD_SHIFT: return wxT("Shift"); break;
- default: return wxT(""); break;
- }
-}
-
-}
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include
+#include "WXInputBase.h"
+//#include
+//#include
+//#include
+
+namespace InputCommon
+{
+
+const wxChar *WXKeyToString(int keycode)
+{
+ switch (keycode)
+ {
+ case WXK_CANCEL: return wxT("Cancel"); break;
+ case WXK_BACK: return wxT("Back"); break;
+ case WXK_TAB: return wxT("Tab"); break;
+ case WXK_CLEAR: return wxT("Clear"); break;
+ case WXK_RETURN: return wxT("Return"); break;
+ case WXK_SHIFT: return wxT("Shift"); break;
+ case WXK_CONTROL: return wxT("Control"); break;
+ case WXK_ALT: return wxT("Alt"); break;
+ case WXK_CAPITAL: return wxT("CapsLock"); break;
+ case WXK_MENU : return wxT("Menu"); break;
+ case WXK_PAUSE: return wxT("Pause"); break;
+ case WXK_ESCAPE: return wxT("Escape"); break;
+ case WXK_SPACE: return wxT("Space"); break;
+ case WXK_PAGEUP: return wxT("PgUp"); break;
+ case WXK_PAGEDOWN: return wxT("PgDn"); break;
+ case WXK_END: return wxT("End"); break;
+ case WXK_HOME : return wxT("Home"); break;
+ case WXK_LEFT : return wxT("Left"); break;
+ case WXK_UP: return wxT("Up"); break;
+ case WXK_RIGHT: return wxT("Right"); break;
+ case WXK_DOWN : return wxT("Down"); break;
+ case WXK_SELECT: return wxT("Select"); break;
+ case WXK_PRINT: return wxT("Print"); break;
+ case WXK_EXECUTE: return wxT("Execute"); break;
+ case WXK_INSERT: return wxT("Insert"); break;
+ case WXK_DELETE: return wxT("Delete"); break;
+ case WXK_HELP : return wxT("Help"); break;
+ case WXK_NUMPAD0: return wxT("NP 0"); break;
+ case WXK_NUMPAD1: return wxT("NP 1"); break;
+ case WXK_NUMPAD2: return wxT("NP 2"); break;
+ case WXK_NUMPAD3: return wxT("NP 3"); break;
+ case WXK_NUMPAD4: return wxT("NP 4"); break;
+ case WXK_NUMPAD5: return wxT("NP 5"); break;
+ case WXK_NUMPAD6: return wxT("NP 6"); break;
+ case WXK_NUMPAD7: return wxT("NP 7"); break;
+ case WXK_NUMPAD8: return wxT("NP 8"); break;
+ case WXK_NUMPAD9: return wxT("NP 9"); break;
+ case WXK_NUMPAD_DECIMAL: return wxT("NP ."); break;
+ case WXK_NUMPAD_DELETE: return wxT("NP Delete"); break;
+ case WXK_NUMPAD_INSERT: return wxT("NP Insert"); break;
+ case WXK_NUMPAD_END: return wxT("NP End"); break;
+ case WXK_NUMPAD_DOWN: return wxT("NP Down"); break;
+ case WXK_NUMPAD_PAGEDOWN: return wxT("NP Pagedown"); break;
+ case WXK_NUMPAD_LEFT: return wxT("NP Left"); break;
+ case WXK_NUMPAD_RIGHT: return wxT("NP Right"); break;
+ case WXK_NUMPAD_HOME: return wxT("NP Home"); break;
+ case WXK_NUMPAD_UP: return wxT("NP Up"); break;
+ case WXK_NUMPAD_PAGEUP: return wxT("NP Pageup"); break;
+ case WXK_NUMPAD_MULTIPLY: return wxT("NP *"); break;
+ case WXK_NUMPAD_ADD: return wxT("NP +"); break;
+ case WXK_NUMPAD_SUBTRACT: return wxT("NP -"); break;
+ case WXK_NUMPAD_DIVIDE: return wxT("NP /"); break;
+ case WXK_NUMPAD_ENTER: return wxT("NP Enter"); break;
+ case WXK_NUMPAD_SEPARATOR: return wxT("NP Separator"); break;
+ case WXK_F1: return wxT("F1"); break;
+ case WXK_F2: return wxT("F2"); break;
+ case WXK_F3: return wxT("F3"); break;
+ case WXK_F4: return wxT("F4"); break;
+ case WXK_F5: return wxT("F5"); break;
+ case WXK_F6: return wxT("F6"); break;
+ case WXK_F7: return wxT("F7"); break;
+ case WXK_F8: return wxT("F8"); break;
+ case WXK_F9: return wxT("F9"); break;
+ case WXK_F10: return wxT("F10"); break;
+ case WXK_F11: return wxT("F11"); break;
+ case WXK_F12: return wxT("F12"); break;
+ case WXK_F13: return wxT("F13"); break;
+ case WXK_F14: return wxT("F14"); break;
+ case WXK_F15: return wxT("F15"); break;
+ case WXK_F16: return wxT("F16"); break;
+ case WXK_F17: return wxT("F17"); break;
+ case WXK_F18: return wxT("F19"); break;
+ case WXK_F19: return wxT("F20"); break;
+ case WXK_F20: return wxT("F21"); break;
+ case WXK_F21: return wxT("F22"); break;
+ case WXK_F22: return wxT("F23"); break;
+ case WXK_F23: return wxT("F24"); break;
+ case WXK_F24: return wxT("F25"); break;
+ case WXK_NUMLOCK: return wxT("Numlock"); break;
+ case WXK_SCROLL: return wxT("Scrolllock"); break;
+ default: return wxString::FromAscii(keycode);
+ }
+}
+
+const wxChar *WXKeymodToString(int modifier)
+{
+ switch (modifier)
+ {
+ case wxMOD_ALT: return wxT("Alt"); break;
+ case wxMOD_CMD: return wxT("Ctrl"); break;
+ case wxMOD_ALTGR: return wxT("Ctrl+Alt"); break;
+ case wxMOD_SHIFT: return wxT("Shift"); break;
+ default: return wxT(""); break;
+ }
+}
+
+}
diff --git a/Source/Plugins/InputUICommon/Src/WXInputBase.h b/Source/Core/InputCommon/Src/WXInputBase.h
similarity index 96%
rename from Source/Plugins/InputUICommon/Src/WXInputBase.h
rename to Source/Core/InputCommon/Src/WXInputBase.h
index c249309699..8c1e74aafc 100644
--- a/Source/Plugins/InputUICommon/Src/WXInputBase.h
+++ b/Source/Core/InputCommon/Src/WXInputBase.h
@@ -1,28 +1,28 @@
-// Copyright (C) 2003 Dolphin Project.
-
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, version 2.0.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License 2.0 for more details.
-
-// A copy of the GPL 2.0 should have been included with the program.
-// If not, see http://www.gnu.org/licenses/
-
-// Official SVN repository and contact information can be found at
-// http://code.google.com/p/dolphin-emu/
-
-#ifndef WXINPUTBASE_H
-#define WXINPUTBASE_H
-
-#include
-
-namespace InputCommon
-{
-const wxChar *WXKeyToString(int keycode);
-const wxChar *WXKeymodToString(int modifier);
-}
-#endif
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#ifndef WXINPUTBASE_H
+#define WXINPUTBASE_H
+
+#include
+
+namespace InputCommon
+{
+const wxChar *WXKeyToString(int keycode);
+const wxChar *WXKeymodToString(int modifier);
+}
+#endif
diff --git a/Source/Core/InputCommon/Src/X11InputBase.h b/Source/Core/InputCommon/Src/X11InputBase.h
index eaf8475e50..13c6717f86 100644
--- a/Source/Core/InputCommon/Src/X11InputBase.h
+++ b/Source/Core/InputCommon/Src/X11InputBase.h
@@ -20,7 +20,7 @@
#include
#include
-#include "InputConfig.h"
+#include "Config.h"
#if defined(HAVE_WX) && HAVE_WX
#include
#endif
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp
index 8a91283860..a956a53cf2 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp
@@ -47,68 +47,63 @@ void VideoConfig::Load(const char *ini_file)
IniFile iniFile;
iniFile.Load(ini_file);
- Section& hardware = iniFile["Hardware"];
- hardware.Get("VSync", &bVSync, false); // Hardware
-
- Section& settings = iniFile["Settings"];
- settings.Get("StretchToFit", &bNativeResolution, true);
- settings.Get("2xResolution", &b2xResolution, false);
- settings.Get("wideScreenHack", &bWidescreenHack, false);
- settings.Get("AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
- settings.Get("Crop", &bCrop, false);
- settings.Get("UseXFB", &bUseXFB, true);
- settings.Get("UseRealXFB", &bUseRealXFB, false);
- settings.Get("AutoScale", &bAutoScale, true);
- settings.Get("UseNativeMips", &bUseNativeMips, true);
+ iniFile.Get("Hardware", "VSync", &bVSync, 0); // Hardware
+ iniFile.Get("Settings", "StretchToFit", &bNativeResolution, true);
+ iniFile.Get("Settings", "2xResolution", &b2xResolution, false);
+ iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false);
+ iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
+ iniFile.Get("Settings", "Crop", &bCrop, false);
+ iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
+ iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, 0);
+ iniFile.Get("Settings", "AutoScale", &bAutoScale, true);
+ iniFile.Get("Settings", "UseNativeMips", &bUseNativeMips, true);
- settings.Get("SafeTextureCache", &bSafeTextureCache, false); // Settings
+ iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false); // Settings
//Safe texture cache params
- settings.Get("SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples,512);
+ iniFile.Get("Settings", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples,512);
- settings.Get("ShowFPS", &bShowFPS, false); // Settings
- settings.Get("OverlayStats", &bOverlayStats, false);
- settings.Get("OverlayProjStats", &bOverlayProjStats, false);
- settings.Get("ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
- settings.Get("DLOptimize", &iCompileDLsLevel, 0);
- settings.Get("DumpTextures", &bDumpTextures, false);
- settings.Get("HiresTextures", &bHiresTextures, false);
- settings.Get("DumpEFBTarget", &bDumpEFBTarget, false);
- settings.Get("DumpFrames", &bDumpFrames, false);
- settings.Get("FreeLook", &bFreeLook, false);
- settings.Get("ShowShaderErrors", &bShowShaderErrors, false);
- settings.Get("MSAA", &iMultisampleMode, 0);
- settings.Get("DstAlphaPass", &bDstAlphaPass, false);
+ iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
+ iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
+ iniFile.Get("Settings", "OverlayProjStats", &bOverlayProjStats, false);
+ iniFile.Get("Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
+ iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
+ iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
+ iniFile.Get("Settings", "HiresTextures", &bHiresTextures, 0);
+ iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
+ iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
+ iniFile.Get("Settings", "FreeLook", &bFreeLook, 0);
+ iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
+ iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
+ iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false);
- settings.Get("TexFmtOverlayEnable", &bTexFmtOverlayEnable, false);
- settings.Get("TexFmtOverlayCenter", &bTexFmtOverlayCenter, false);
- settings.Get("WireFrame", &bWireFrame, false);
- settings.Get("DisableLighting", &bDisableLighting, false);
- settings.Get("DisableTexturing", &bDisableTexturing, false);
- settings.Get("DisableFog", &bDisableFog, false);
+ iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
+ iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
+ iniFile.Get("Settings", "WireFrame", &bWireFrame, 0);
+ iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0);
+ iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0);
+ iniFile.Get("Settings", "DisableFog", &bDisableFog, 0);
+
+ iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
+ iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 1); // NOTE - this is x in (1 << x)
+ iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
+
+ iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true);
+ iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, false);
+ iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bOSDHotKey, 0);
+ iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToTexture, false);
+ iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
+ iniFile.Get("Hacks", "FIFOBPHack", &bFIFOBPhack, false);
+ iniFile.Get("Hacks", "ProjectionHack", &iPhackvalue, 0);
- Section& enhancements = iniFile["Enhancements"];
- enhancements.Get("ForceFiltering", &bForceFiltering, false);
- enhancements.Get("MaxAnisotropy", &iMaxAnisotropy, 1); // NOTE - this is x in (1 << x)
- enhancements.Get("PostProcessingShader", &sPostProcessingShader, "");
-
- Section& hacks = iniFile["Hacks"];
- hacks.Get("EFBAccessEnable", &bEFBAccessEnable, true);
- hacks.Get("EFBCopyDisable", &bEFBCopyDisable, false);
- hacks.Get("EFBCopyDisableHotKey", &bOSDHotKey, false);
- hacks.Get("EFBToTextureEnable", &bCopyEFBToTexture, false);
- hacks.Get("EFBScaledCopy", &bCopyEFBScaled, true);
- hacks.Get("FIFOBPHack", &bFIFOBPhack, false);
- hacks.Get("ProjectionHack", &iPhackvalue, 0);
-
- hardware.Get("Adapter", &iAdapter, 0);
+ iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
if (iAdapter == -1)
iAdapter = 0;
- hardware.Get("SimpleFB", &bSimpleFB, false);
+ iniFile.Get("Hardware", "SimpleFB", &bSimpleFB, false);
// Load common settings
iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
bool bTmp;
- iniFile["Interface"].Get("UsePanicHandlers", &bTmp, true);
+ iniFile.Get("Interface", "UsePanicHandlers", &bTmp, true);
SetEnableAlert(bTmp);
}
@@ -117,87 +112,94 @@ void VideoConfig::GameIniLoad(const char *ini_file)
IniFile iniFile;
iniFile.Load(ini_file);
- Section& video = iniFile["Video"];
-
- video.Get("ForceFiltering", &bForceFiltering, bForceFiltering);
- video.Get("MaxAnisotropy", &iMaxAnisotropy, iMaxAnisotropy); // NOTE - this is x in (1 << x)
- video.Get("EFBCopyDisable", &bEFBCopyDisable, bEFBCopyDisable);
- video.Get("EFBCopyDisableHotKey", &bOSDHotKey, bOSDHotKey);
- video.Get("EFBToTextureEnable", &bCopyEFBToTexture, bCopyEFBToTexture);
- video.Get("EFBScaledCopy", &bCopyEFBScaled, bCopyEFBScaled);
- video.Get("SafeTextureCache", &bSafeTextureCache, bSafeTextureCache);
+ if (iniFile.Exists("Video", "ForceFiltering"))
+ iniFile.Get("Video", "ForceFiltering", &bForceFiltering, 0);
+ if (iniFile.Exists("Video", "MaxAnisotropy"))
+ iniFile.Get("Video", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x)
+ if (iniFile.Exists("Video", "EFBCopyDisable"))
+ iniFile.Get("Video", "EFBCopyDisable", &bEFBCopyDisable, 0);
+ if (iniFile.Exists("Video", "EFBCopyDisableHotKey"))
+ iniFile.Get("Video", "EFBCopyDisableHotKey", &bOSDHotKey, 0);
+ if (iniFile.Exists("Video", "EFBToTextureEnable"))
+ iniFile.Get("Video", "EFBToTextureEnable", &bCopyEFBToTexture, 0);
+ if (iniFile.Exists("Video", "EFBScaledCopy"))
+ iniFile.Get("Video", "EFBScaledCopy", &bCopyEFBScaled, 0);
+ if (iniFile.Exists("Video", "SafeTextureCache"))
+ iniFile.Get("Video", "SafeTextureCache", &bSafeTextureCache, false);
//Safe texture cache params
- video.Get("SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples, iSafeTextureCache_ColorSamples);
+ if (iniFile.Exists("Video", "SafeTextureCacheColorSamples"))
+ iniFile.Get("Video", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples,512);
- video.Get("MSAA", &iMultisampleMode, iMultisampleMode);
- video.Get("DstAlphaPass", &bDstAlphaPass, bDstAlphaPass);
- video.Get("UseXFB", &bUseXFB, bUseXFB);
- video.Get("UseRealXFB", &bUseRealXFB, bUseRealXFB);
- video.Get("FIFOBPHack", &bFIFOBPhack, bFIFOBPhack);
- video.Get("ProjectionHack", &iPhackvalue, iPhackvalue);
- video.Get("UseNativeMips", &bUseNativeMips, bUseNativeMips);
+ if (iniFile.Exists("Video", "MSAA"))
+ iniFile.Get("Video", "MSAA", &iMultisampleMode, 0);
+ if (iniFile.Exists("Video", "DstAlphaPass"))
+ iniFile.Get("Video", "DstAlphaPass", &bDstAlphaPass, false);
+ if (iniFile.Exists("Video", "UseXFB"))
+ iniFile.Get("Video", "UseXFB", &bUseXFB, 0);
+ if (iniFile.Exists("Video", "UseRealXFB"))
+ iniFile.Get("Video", "UseRealXFB", &bUseRealXFB, 0);
+ if (iniFile.Exists("Video", "FIFOBPHack"))
+ iniFile.Get("Video", "FIFOBPHack", &bFIFOBPhack, false);
+ if (iniFile.Exists("Video", "ProjectionHack"))
+ iniFile.Get("Video", "ProjectionHack", &iPhackvalue, 0);
+ if (iniFile.Exists("Video", "UseNativeMips"))
+ iniFile.Get("Video", "UseNativeMips", &bUseNativeMips, true);
}
void VideoConfig::Save(const char *ini_file)
{
IniFile iniFile;
iniFile.Load(ini_file);
+ iniFile.Set("Hardware", "VSync", bVSync);
+ iniFile.Set("Settings", "StretchToFit", bNativeResolution);
+ iniFile.Set("Settings", "2xResolution", b2xResolution);
+ iniFile.Set("Settings", "AspectRatio", iAspectRatio);
+ iniFile.Set("Settings", "Crop", bCrop);
+ iniFile.Set("Settings", "wideScreenHack", bWidescreenHack);
+ iniFile.Set("Settings", "UseXFB", bUseXFB);
+ iniFile.Set("Settings", "UseRealXFB", bUseRealXFB);
+ iniFile.Set("Settings", "AutoScale", bAutoScale);
+ iniFile.Set("Settings", "UseNativeMips", bUseNativeMips);
- Section& hardware = iniFile["Hardware"];
- hardware.Set("VSync", bVSync);
-
- Section& settings = iniFile["Settings"];
- settings.Set("StretchToFit", bNativeResolution);
- settings.Set("2xResolution", b2xResolution);
- settings.Set("AspectRatio", iAspectRatio);
- settings.Set("Crop", bCrop);
- settings.Set("wideScreenHack", bWidescreenHack);
- settings.Set("UseXFB", bUseXFB);
- settings.Set("UseRealXFB", bUseRealXFB);
- settings.Set("AutoScale", bAutoScale);
- settings.Set("UseNativeMips", bUseNativeMips);
-
- settings.Set("SafeTextureCache", bSafeTextureCache);
+ iniFile.Set("Settings", "SafeTextureCache", bSafeTextureCache);
//safe texture cache params
- settings.Set("SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
+ iniFile.Set("Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
- settings.Set("ShowFPS", bShowFPS);
- settings.Set("OverlayStats", bOverlayStats);
- settings.Set("OverlayProjStats", bOverlayProjStats);
- settings.Set("DLOptimize", iCompileDLsLevel);
- settings.Set("Show", iCompileDLsLevel);
- settings.Set("DumpTextures", bDumpTextures);
- settings.Set("HiresTextures", bHiresTextures);
- settings.Set("DumpEFBTarget", bDumpEFBTarget);
- settings.Set("DumpFrames", bDumpFrames);
- settings.Set("FreeLook", bFreeLook);
- settings.Set("ShowEFBCopyRegions", bShowEFBCopyRegions);
- settings.Set("ShowShaderErrors", bShowShaderErrors);
- settings.Set("MSAA", iMultisampleMode);
- settings.Set("TexFmtOverlayEnable", bTexFmtOverlayEnable);
- settings.Set("TexFmtOverlayCenter", bTexFmtOverlayCenter);
- settings.Set("Wireframe", bWireFrame);
- settings.Set("DisableLighting", bDisableLighting);
- settings.Set("DisableTexturing", bDisableTexturing);
- settings.Set("DstAlphaPass", bDstAlphaPass);
- settings.Set("DisableFog", bDisableFog);
+ iniFile.Set("Settings", "ShowFPS", bShowFPS);
+ iniFile.Set("Settings", "OverlayStats", bOverlayStats);
+ iniFile.Set("Settings", "OverlayProjStats", bOverlayProjStats);
+ iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
+ iniFile.Set("Settings", "Show", iCompileDLsLevel);
+ iniFile.Set("Settings", "DumpTextures", bDumpTextures);
+ iniFile.Set("Settings", "HiresTextures", bHiresTextures);
+ iniFile.Set("Settings", "DumpEFBTarget", bDumpEFBTarget);
+ iniFile.Set("Settings", "DumpFrames", bDumpFrames);
+ iniFile.Set("Settings", "FreeLook", bFreeLook);
+ iniFile.Set("Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
+ iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
+ iniFile.Set("Settings", "MSAA", iMultisampleMode);
+ iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
+ iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
+ iniFile.Set("Settings", "Wireframe", bWireFrame);
+ iniFile.Set("Settings", "DisableLighting", bDisableLighting);
+ iniFile.Set("Settings", "DisableTexturing", bDisableTexturing);
+ iniFile.Set("Settings", "DstAlphaPass", bDstAlphaPass);
+ iniFile.Set("Settings", "DisableFog", bDisableFog);
- Section& enhancements = iniFile["Enhancements"];
- enhancements.Set("ForceFiltering", bForceFiltering);
- enhancements.Set("MaxAnisotropy", iMaxAnisotropy);
- enhancements.Set("PostProcessingShader", sPostProcessingShader);
+ iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
+ iniFile.Set("Enhancements", "MaxAnisotropy", iMaxAnisotropy);
+ iniFile.Set("Enhancements", "PostProcessingShader", sPostProcessingShader);
- Section& hacks = iniFile["Hacks"];
- hacks.Set("EFBAccessEnable", bEFBAccessEnable);
- hacks.Set("EFBCopyDisable", bEFBCopyDisable);
- hacks.Set("EFBCopyDisableHotKey", bOSDHotKey);
- hacks.Set("EFBToTextureEnable", bCopyEFBToTexture);
- hacks.Set("EFBScaledCopy", bCopyEFBScaled);
- hacks.Set("FIFOBPHack", bFIFOBPhack);
- hacks.Set("ProjectionHack", iPhackvalue);
+ iniFile.Set("Hacks", "EFBAccessEnable", bEFBAccessEnable);
+ iniFile.Set("Hacks", "EFBCopyDisable", bEFBCopyDisable);
+ iniFile.Set("Hacks", "EFBCopyDisableHotKey", bOSDHotKey);
+ iniFile.Set("Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
+ iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled);
+ iniFile.Set("Hacks", "FIFOBPHack", bFIFOBPhack);
+ iniFile.Set("Hacks", "ProjectionHack", iPhackvalue);
- hardware.Set("Adapter", iAdapter);
- hardware.Set("SimpleFB", bSimpleFB);
+ iniFile.Set("Hardware", "Adapter", iAdapter);
+ iniFile.Set("Hardware", "SimpleFB", bSimpleFB);
iniFile.Save(ini_file);
}
diff --git a/Source/Dolphin.sln b/Source/Dolphin.sln
index 939329ca5d..66bd93866b 100644
--- a/Source/Dolphin.sln
+++ b/Source/Dolphin.sln
@@ -7,7 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcpr
{33546D62-7F34-4EA6-A88E-D538B36E16BF} = {33546D62-7F34-4EA6-A88E-D538B36E16BF}
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
- {838A89A3-3AA0-4A45-ACBE-3D1E0980C2ED} = {838A89A3-3AA0-4A45-ACBE-3D1E0980C2ED}
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
@@ -64,8 +63,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dolphin", "Core\DolphinWX\D
{29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510}
{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77} = {4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}
{F0B874CB-4476-4199-9315-8343D05AE684} = {F0B874CB-4476-4199-9315-8343D05AE684}
- {660BB3F7-ED8F-4027-A460-8E4EDA8189BE} = {660BB3F7-ED8F-4027-A460-8E4EDA8189BE}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16} = {9FF603F8-B3BB-4144-9688-B2B802FA0F16}
{B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C}
EndProjectSection
EndProject
@@ -105,9 +104,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_Wiimote", "Plugins\P
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InputCommon", "Core\InputCommon\InputCommon.vcproj", "{C7E5D50A-2916-464B-86A7-E10B3CC88ADA}"
- ProjectSection(ProjectDependencies) = postProject
- {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
- EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AudioCommon", "Core\AudioCommon\AudioCommon.vcproj", "{FBAFB369-07EB-4460-9CAD-08BE5789DAB6}"
EndProject
@@ -188,6 +184,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoSoftware", "Plu
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_GCPad", "Plugins\Plugin_GCPad\Plugin_GCPad.vcproj", "{9FF603F8-B3BB-4144-9688-B2B802FA0F16}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
+ {05C75041-D67D-4903-A362-8395A7B35C75} = {05C75041-D67D-4903-A362-8395A7B35C75}
+ {11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
+ {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E}
+ {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE} = {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_GCPadNew", "Plugins\Plugin_GCPadNew\Plugin_GCPadNew.vcproj", "{1C3A7A91-A97F-4C7C-B45D-26F2242904D7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
+ {05C75041-D67D-4903-A362-8395A7B35C75} = {05C75041-D67D-4903-A362-8395A7B35C75}
+ {11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
+ {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E}
+ {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE} = {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE}
+ {660BB3F7-ED8F-4027-A460-8E4EDA8189BE} = {660BB3F7-ED8F-4027-A460-8E4EDA8189BE}
+ {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_WiimoteNew", "Plugins\Plugin_WiimoteNew\Plugin_WiimoteNew.vcproj", "{BB6CE47B-C676-44BB-AE93-2CF59B8C8BD4}"
ProjectSection(ProjectDependencies) = postProject
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
@@ -199,7 +216,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_WiimoteNew", "Plugin
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InputUICommon", "Plugins\InputUICommon\InputUICommon.vcproj", "{660BB3F7-ED8F-4027-A460-8E4EDA8189BE}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InputPluginCommon", "Plugins\InputPluginCommon\InputPluginCommon.vcproj", "{660BB3F7-ED8F-4027-A460-8E4EDA8189BE}"
ProjectSection(ProjectDependencies) = postProject
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
{05C75041-D67D-4903-A362-8395A7B35C75} = {05C75041-D67D-4903-A362-8395A7B35C75}
@@ -557,6 +574,30 @@ Global
{66A4E7BD-E2E8-4373-9B75-8750EB5AE683}.Release|Win32.Build.0 = Release|Win32
{66A4E7BD-E2E8-4373-9B75-8750EB5AE683}.Release|x64.ActiveCfg = Release|x64
{66A4E7BD-E2E8-4373-9B75-8750EB5AE683}.Release|x64.Build.0 = Release|x64
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Debug|Win32.Build.0 = Debug|Win32
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Debug|x64.ActiveCfg = Debug|x64
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Debug|x64.Build.0 = Debug|x64
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.DebugFast|Win32.Build.0 = DebugFast|Win32
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.DebugFast|x64.ActiveCfg = DebugFast|x64
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.DebugFast|x64.Build.0 = DebugFast|x64
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Release|Win32.ActiveCfg = Release|Win32
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Release|Win32.Build.0 = Release|Win32
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Release|x64.ActiveCfg = Release|x64
+ {9FF603F8-B3BB-4144-9688-B2B802FA0F16}.Release|x64.Build.0 = Release|x64
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Debug|Win32.Build.0 = Debug|Win32
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Debug|x64.ActiveCfg = Debug|x64
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Debug|x64.Build.0 = Debug|x64
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.DebugFast|Win32.Build.0 = DebugFast|Win32
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.DebugFast|x64.ActiveCfg = DebugFast|x64
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.DebugFast|x64.Build.0 = DebugFast|x64
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Release|Win32.ActiveCfg = Release|Win32
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Release|Win32.Build.0 = Release|Win32
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Release|x64.ActiveCfg = Release|x64
+ {1C3A7A91-A97F-4C7C-B45D-26F2242904D7}.Release|x64.Build.0 = Release|x64
{BB6CE47B-C676-44BB-AE93-2CF59B8C8BD4}.Debug|Win32.ActiveCfg = Debug|Win32
{BB6CE47B-C676-44BB-AE93-2CF59B8C8BD4}.Debug|Win32.Build.0 = Debug|Win32
{BB6CE47B-C676-44BB-AE93-2CF59B8C8BD4}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/Source/Dolphin.xcodeproj/project.pbxproj b/Source/Dolphin.xcodeproj/project.pbxproj
index e04c133408..7f75c81114 100644
--- a/Source/Dolphin.xcodeproj/project.pbxproj
+++ b/Source/Dolphin.xcodeproj/project.pbxproj
@@ -39,6 +39,7 @@
292AC1FC11838FD700B8790B /* BreakPoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABD9B11838FD400B8790B /* BreakPoints.h */; };
292AC1FD11838FD700B8790B /* CDUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABD9C11838FD400B8790B /* CDUtils.cpp */; };
292AC1FE11838FD700B8790B /* CDUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABD9D11838FD400B8790B /* CDUtils.h */; };
+ 292AC1FF11838FD700B8790B /* ChunkFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABD9E11838FD400B8790B /* ChunkFile.cpp */; };
292AC20011838FD700B8790B /* ChunkFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABD9F11838FD400B8790B /* ChunkFile.h */; };
292AC20111838FD700B8790B /* ColorUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABDA011838FD400B8790B /* ColorUtil.cpp */; };
292AC20211838FD700B8790B /* ColorUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABDA111838FD400B8790B /* ColorUtil.h */; };
@@ -61,6 +62,7 @@
292AC21311838FD700B8790B /* DebugInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABDB311838FD400B8790B /* DebugInterface.h */; };
292AC21411838FD700B8790B /* DynamicLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABDB411838FD400B8790B /* DynamicLibrary.cpp */; };
292AC21511838FD700B8790B /* DynamicLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABDB511838FD400B8790B /* DynamicLibrary.h */; };
+ 292AC21611838FD700B8790B /* ExtendedTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABDB611838FD400B8790B /* ExtendedTrace.cpp */; };
292AC21711838FD700B8790B /* ExtendedTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABDB711838FD400B8790B /* ExtendedTrace.h */; };
292AC21811838FD700B8790B /* FileSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABDB811838FD400B8790B /* FileSearch.cpp */; };
292AC21911838FD700B8790B /* FileSearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABDB911838FD400B8790B /* FileSearch.h */; };
@@ -499,6 +501,7 @@
292AC3D211838FD700B8790B /* DSPAccelerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABFCA11838FD600B8790B /* DSPAccelerator.h */; };
292AC3D311838FD700B8790B /* DSPAnalyzer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABFCB11838FD600B8790B /* DSPAnalyzer.cpp */; };
292AC3D411838FD700B8790B /* DSPAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABFCC11838FD600B8790B /* DSPAnalyzer.h */; };
+ 292AC3D511838FD700B8790B /* DSPBreakpoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABFCD11838FD600B8790B /* DSPBreakpoints.cpp */; };
292AC3D611838FD700B8790B /* DSPBreakpoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABFCE11838FD600B8790B /* DSPBreakpoints.h */; };
292AC3D711838FD700B8790B /* DSPCodeUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292ABFCF11838FD600B8790B /* DSPCodeUtil.cpp */; };
292AC3D811838FD700B8790B /* DSPCodeUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 292ABFD011838FD600B8790B /* DSPCodeUtil.h */; };
@@ -1297,6 +1300,7 @@
292ABD9B11838FD400B8790B /* BreakPoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakPoints.h; sourceTree = ""; };
292ABD9C11838FD400B8790B /* CDUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDUtils.cpp; sourceTree = ""; };
292ABD9D11838FD400B8790B /* CDUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDUtils.h; sourceTree = ""; };
+ 292ABD9E11838FD400B8790B /* ChunkFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChunkFile.cpp; sourceTree = ""; };
292ABD9F11838FD400B8790B /* ChunkFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChunkFile.h; sourceTree = ""; };
292ABDA011838FD400B8790B /* ColorUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorUtil.cpp; sourceTree = ""; };
292ABDA111838FD400B8790B /* ColorUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorUtil.h; sourceTree = ""; };
@@ -1319,6 +1323,7 @@
292ABDB311838FD400B8790B /* DebugInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugInterface.h; sourceTree = ""; };
292ABDB411838FD400B8790B /* DynamicLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLibrary.cpp; sourceTree = ""; };
292ABDB511838FD400B8790B /* DynamicLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLibrary.h; sourceTree = ""; };
+ 292ABDB611838FD400B8790B /* ExtendedTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtendedTrace.cpp; sourceTree = ""; };
292ABDB711838FD400B8790B /* ExtendedTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtendedTrace.h; sourceTree = ""; };
292ABDB811838FD400B8790B /* FileSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSearch.cpp; sourceTree = ""; };
292ABDB911838FD400B8790B /* FileSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSearch.h; sourceTree = ""; };
@@ -1817,6 +1822,7 @@
292ABFCA11838FD600B8790B /* DSPAccelerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSPAccelerator.h; sourceTree = ""; };
292ABFCB11838FD600B8790B /* DSPAnalyzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DSPAnalyzer.cpp; sourceTree = ""; };
292ABFCC11838FD600B8790B /* DSPAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSPAnalyzer.h; sourceTree = ""; };
+ 292ABFCD11838FD600B8790B /* DSPBreakpoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DSPBreakpoints.cpp; sourceTree = ""; };
292ABFCE11838FD600B8790B /* DSPBreakpoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSPBreakpoints.h; sourceTree = ""; };
292ABFCF11838FD600B8790B /* DSPCodeUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DSPCodeUtil.cpp; sourceTree = ""; };
292ABFD011838FD600B8790B /* DSPCodeUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DSPCodeUtil.h; sourceTree = ""; };
@@ -2694,6 +2700,7 @@
292ABD9B11838FD400B8790B /* BreakPoints.h */,
292ABD9C11838FD400B8790B /* CDUtils.cpp */,
292ABD9D11838FD400B8790B /* CDUtils.h */,
+ 292ABD9E11838FD400B8790B /* ChunkFile.cpp */,
292ABD9F11838FD400B8790B /* ChunkFile.h */,
292ABDA011838FD400B8790B /* ColorUtil.cpp */,
292ABDA111838FD400B8790B /* ColorUtil.h */,
@@ -2710,6 +2717,7 @@
292ABDB311838FD400B8790B /* DebugInterface.h */,
292ABDB411838FD400B8790B /* DynamicLibrary.cpp */,
292ABDB511838FD400B8790B /* DynamicLibrary.h */,
+ 292ABDB611838FD400B8790B /* ExtendedTrace.cpp */,
292ABDB711838FD400B8790B /* ExtendedTrace.h */,
292ABDB811838FD400B8790B /* FileSearch.cpp */,
292ABDB911838FD400B8790B /* FileSearch.h */,
@@ -3442,6 +3450,7 @@
292ABFCA11838FD600B8790B /* DSPAccelerator.h */,
292ABFCB11838FD600B8790B /* DSPAnalyzer.cpp */,
292ABFCC11838FD600B8790B /* DSPAnalyzer.h */,
+ 292ABFCD11838FD600B8790B /* DSPBreakpoints.cpp */,
292ABFCE11838FD600B8790B /* DSPBreakpoints.h */,
292ABFCF11838FD600B8790B /* DSPCodeUtil.cpp */,
292ABFD011838FD600B8790B /* DSPCodeUtil.h */,
@@ -5398,6 +5407,7 @@
292AC1F611838FD700B8790B /* ABI.cpp in Sources */,
292AC1FB11838FD700B8790B /* BreakPoints.cpp in Sources */,
292AC1FD11838FD700B8790B /* CDUtils.cpp in Sources */,
+ 292AC1FF11838FD700B8790B /* ChunkFile.cpp in Sources */,
292AC20111838FD700B8790B /* ColorUtil.cpp in Sources */,
292AC20811838FD700B8790B /* ConsoleListener.cpp in Sources */,
292AC20A11838FD700B8790B /* CPUDetect.cpp in Sources */,
@@ -5406,6 +5416,7 @@
292AC20E11838FD700B8790B /* md5.cpp in Sources */,
292AC21011838FD700B8790B /* sha1.cpp in Sources */,
292AC21411838FD700B8790B /* DynamicLibrary.cpp in Sources */,
+ 292AC21611838FD700B8790B /* ExtendedTrace.cpp in Sources */,
292AC21811838FD700B8790B /* FileSearch.cpp in Sources */,
292AC21A11838FD700B8790B /* FileUtil.cpp in Sources */,
292AC21D11838FD700B8790B /* Hash.cpp in Sources */,
@@ -5640,6 +5651,7 @@
292AC3CF11838FD700B8790B /* disassemble.cpp in Sources */,
292AC3D111838FD700B8790B /* DSPAccelerator.cpp in Sources */,
292AC3D311838FD700B8790B /* DSPAnalyzer.cpp in Sources */,
+ 292AC3D511838FD700B8790B /* DSPBreakpoints.cpp in Sources */,
292AC3D711838FD700B8790B /* DSPCodeUtil.cpp in Sources */,
292AC3DA11838FD700B8790B /* DSPCore.cpp in Sources */,
292AC3DC11838FD700B8790B /* DSPEmitter.cpp in Sources */,
diff --git a/Source/PluginSpecs/pluginspecs_pad.h b/Source/PluginSpecs/pluginspecs_pad.h
new file mode 100644
index 0000000000..45237b7dc7
--- /dev/null
+++ b/Source/PluginSpecs/pluginspecs_pad.h
@@ -0,0 +1,88 @@
+//__________________________________________________________________________________________________
+// Common pad plugin spec, version #1.0 maintained by F|RES
+//
+
+#ifndef _PAD_H_INCLUDED__
+#define _PAD_H_INCLUDED__
+
+#include "PluginSpecs.h"
+
+#include "ExportProlog.h"
+
+#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
+
+typedef void (*TLog)(const char* _pMessage);
+typedef bool (*TRendererHasFocus)(void);
+
+typedef struct
+{
+ HWND hWnd;
+#if defined HAVE_X11 && HAVE_X11
+ void *pXWindow;
+#endif
+ TLog pLog;
+ TRendererHasFocus pRendererHasFocus;
+} SPADInitialize;
+
+typedef struct
+{
+ unsigned short button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
+ unsigned char stickX; // 0 <= stickX <= 255
+ unsigned char stickY; // 0 <= stickY <= 255
+ unsigned char substickX; // 0 <= substickX <= 255
+ unsigned char substickY; // 0 <= substickY <= 255
+ unsigned char triggerLeft; // 0 <= triggerLeft <= 255
+ unsigned char triggerRight; // 0 <= triggerRight <= 255
+ unsigned char analogA; // 0 <= analogA <= 255
+ unsigned char analogB; // 0 <= analogB <= 255
+ bool MicButton; // HAX
+ signed char err; // one of PAD_ERR_* number
+} SPADStatus;
+
+
+// I N T E R F A C E
+
+// __________________________________________________________________________________________________
+// Function:
+// Purpose:
+// input:
+// output:
+//
+EXPORT void CALL 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
+//
+EXPORT void CALL 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
+//
+EXPORT void CALL PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength);
+
+#include "ExportEpilog.h"
+#endif
diff --git a/Source/Plugins/InputUICommon/InputUICommon.vcproj b/Source/Plugins/InputPluginCommon/InputPluginCommon.vcproj
similarity index 96%
rename from Source/Plugins/InputUICommon/InputUICommon.vcproj
rename to Source/Plugins/InputPluginCommon/InputPluginCommon.vcproj
index b64cb4c9b1..d7df1fea37 100644
--- a/Source/Plugins/InputUICommon/InputUICommon.vcproj
+++ b/Source/Plugins/InputPluginCommon/InputPluginCommon.vcproj
@@ -2,7 +2,7 @@
-
-
-
-
-
-
+
+
+
@@ -433,7 +429,19 @@
>
+
+
+
+
+
+
diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Plugins/InputPluginCommon/Src/Config.cpp
similarity index 94%
rename from Source/Core/InputCommon/Src/InputConfig.cpp
rename to Source/Plugins/InputPluginCommon/Src/Config.cpp
index f01a723360..417867c175 100644
--- a/Source/Core/InputCommon/Src/InputConfig.cpp
+++ b/Source/Plugins/InputPluginCommon/Src/Config.cpp
@@ -1,57 +1,57 @@
-
-#include "InputConfig.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/Core/InputCommon/Src/InputConfig.h b/Source/Plugins/InputPluginCommon/Src/Config.h
similarity index 86%
rename from Source/Core/InputCommon/Src/InputConfig.h
rename to Source/Plugins/InputPluginCommon/Src/Config.h
index 51379a33fc..8ab222efc2 100644
--- a/Source/Core/InputCommon/Src/InputConfig.h
+++ b/Source/Plugins/InputPluginCommon/Src/Config.h
@@ -1,33 +1,36 @@
-#pragma once
-
-#include "ControllerInterface/ControllerInterface.h"
-#include "Thread.h"
-#include "FileUtil.h"
-#include "IniFile.h"
-
-#include "ControllerEmu.h"
-
-#include
-#include
-#include