mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Warp back to 5578. Sorry for the lost changes, please re-apply. Reason: 5579 is a complete disaster.
Not only does it change tons of files to switch to a new and non-working (it doesn't parse my ini files, at least) ini parser, it also reshuffles a lot of code and removes a plugin. The latter part is fine, but doing these two major switches in one revision, one of which is broken, is completely unacceptable. I said to merge tiny changes, not massive reworkings. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5589 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
+12
-7
@@ -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 ]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -471,6 +471,14 @@
|
||||
RelativePath=".\Src\PluginDSP.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginPAD.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginPAD.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginVideo.cpp"
|
||||
>
|
||||
@@ -506,6 +514,10 @@
|
||||
RelativePath="..\..\PluginSpecs\pluginspecs_dsp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\PluginSpecs\pluginspecs_pad.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\PluginSpecs\pluginspecs_video.h"
|
||||
>
|
||||
@@ -608,6 +620,10 @@
|
||||
RelativePath=".\Src\CDUtils.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ChunkFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\ChunkFile.h"
|
||||
>
|
||||
|
||||
@@ -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 <stdio.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
|
||||
|
||||
+449
-178
File diff suppressed because it is too large
Load Diff
@@ -18,105 +18,74 @@
|
||||
#ifndef _INIFILE_H_
|
||||
#define _INIFILE_H_
|
||||
|
||||
#include "CommonTypes.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
// some things that include IniFile.h rely on this being here
|
||||
#include "StringUtil.h"
|
||||
|
||||
class IniFile;
|
||||
|
||||
class Section : public std::map<std::string, std::string>
|
||||
class Section
|
||||
{
|
||||
friend class IniFile;
|
||||
|
||||
public:
|
||||
Section() : m_use_lines(false) {}
|
||||
Section();
|
||||
Section(const std::string& _name);
|
||||
Section(const Section& other);
|
||||
std::vector<std::string>lines;
|
||||
std::string name;
|
||||
std::string comment;
|
||||
|
||||
bool Exists(const std::string& key) const;
|
||||
void Delete(const std::string& key);
|
||||
|
||||
void SetLines(const std::vector<std::string>& lines);
|
||||
void GetLines(std::vector<std::string>& lines);
|
||||
|
||||
bool Get(const std::string& key, std::string* const val, const std::string& def = "") const;
|
||||
void Set(const std::string& key, const std::string& val, const std::string& def = "");
|
||||
|
||||
template <typename V>
|
||||
void Set(const std::string& key, const V val)
|
||||
bool operator<(const Section& other) const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << val;
|
||||
operator[](key) = ss.str();
|
||||
return(name < other.name);
|
||||
}
|
||||
|
||||
// if val doesn't match def, set the key's value to val
|
||||
// otherwise delete that key
|
||||
//
|
||||
// this removed a lot of redundant code in the game-properties stuff
|
||||
template <typename V, typename D>
|
||||
void Set(const std::string& key, const V val, const D def)
|
||||
{
|
||||
if (val != def)
|
||||
Set(key, val);
|
||||
else
|
||||
{
|
||||
iterator f = find(key);
|
||||
if (f != end())
|
||||
erase(f);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename V>
|
||||
bool Get(const std::string& key, V* const val) const
|
||||
{
|
||||
const const_iterator f = find(key);
|
||||
if (f != end())
|
||||
{
|
||||
std::istringstream ss(f->second);
|
||||
ss >> *val;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename V, typename D>
|
||||
bool Get(const std::string& key, V* const val, const D def) const
|
||||
{
|
||||
if (Get(key, val))
|
||||
return true;
|
||||
*val = def;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Save(std::ostream& file) const;
|
||||
|
||||
std::vector<std::string> m_lines;
|
||||
|
||||
private:
|
||||
bool m_use_lines;
|
||||
};
|
||||
|
||||
class IniFile : public std::map<std::string, Section>
|
||||
class IniFile
|
||||
{
|
||||
public:
|
||||
void Clean();
|
||||
bool Exists(const std::string& section) const;
|
||||
void Delete(const std::string& section);
|
||||
IniFile();
|
||||
~IniFile();
|
||||
|
||||
bool Save(const char filename[]) const;
|
||||
bool Load(const char filename[]);
|
||||
bool Load(const char* filename);
|
||||
bool Save(const char* filename);
|
||||
|
||||
bool Save(const std::string& filename) const;
|
||||
bool Load(const std::string& filename);
|
||||
void Set(const char* sectionName, const char* key, const char* newValue);
|
||||
void Set(const char* sectionName, const char* key, int newValue);
|
||||
void Set(const char* sectionName, const char* key, u32 newValue);
|
||||
void Set(const char* sectionName, const char* key, bool newValue);
|
||||
void Set(const char* sectionName, const char* key, const std::string& newValue) {Set(sectionName, key, newValue.c_str());}
|
||||
void Set(const char* sectionName, const char* key, const std::vector<std::string>& newValues);
|
||||
|
||||
void Save(std::ostream& file) const;
|
||||
void Load(std::istream& file);
|
||||
void SetLines(const char* sectionName, const std::vector<std::string> &lines);
|
||||
|
||||
// Returns true if exists key in section
|
||||
bool Exists(const char* sectionName, const char* key) const;
|
||||
|
||||
// getter should be const
|
||||
bool Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue = "");
|
||||
bool Get(const char* sectionName, const char* key, int* value, int defaultValue = 0);
|
||||
bool Get(const char* sectionName, const char* key, u32* value, u32 defaultValue = 0);
|
||||
bool Get(const char* sectionName, const char* key, bool* value, bool defaultValue = false);
|
||||
bool Get(const char* sectionName, const char* key, std::vector<std::string>& values);
|
||||
|
||||
bool GetKeys(const char* sectionName, std::vector<std::string>& keys) const;
|
||||
bool GetLines(const char* sectionName, std::vector<std::string>& lines) const;
|
||||
|
||||
bool DeleteKey(const char* sectionName, const char* key);
|
||||
bool DeleteSection(const char* sectionName);
|
||||
|
||||
void SortSections();
|
||||
|
||||
void ParseLine(const std::string& line, std::string* keyOut, std::string* valueOut, std::string* commentOut) const;
|
||||
std::string* GetLine(Section* section, const char* key, std::string* valueOut, std::string* commentOut);
|
||||
|
||||
private:
|
||||
std::vector<Section>sections;
|
||||
|
||||
const Section* GetSection(const char* section) const;
|
||||
Section* GetSection(const char* section);
|
||||
Section* GetOrCreateSection(const char* section);
|
||||
std::string* GetLine(const char* section, const char* key);
|
||||
void CreateSection(const char* section);
|
||||
};
|
||||
|
||||
#endif // _INIFILE_H_
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// 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 "PluginPAD.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
PluginPAD::PluginPAD(const char *_Filename) : CPlugin(_Filename), validPAD(false)
|
||||
{
|
||||
PAD_GetStatus = reinterpret_cast<TPAD_GetStatus>
|
||||
(LoadSymbol("PAD_GetStatus"));
|
||||
PAD_Input = reinterpret_cast<TPAD_Input>
|
||||
(LoadSymbol("PAD_Input"));
|
||||
PAD_Rumble = reinterpret_cast<TPAD_Rumble>
|
||||
(LoadSymbol("PAD_Rumble"));
|
||||
|
||||
if ((PAD_GetStatus != 0) &&
|
||||
(PAD_Input != 0) &&
|
||||
(PAD_Rumble != 0))
|
||||
validPAD = true;
|
||||
}
|
||||
|
||||
PluginPAD::~PluginPAD() {}
|
||||
|
||||
} // Namespace
|
||||
@@ -0,0 +1,47 @@
|
||||
// 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 _PLUGINPAD_H_
|
||||
#define _PLUGINPAD_H_
|
||||
|
||||
#include "pluginspecs_pad.h"
|
||||
#include "Plugin.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
typedef void (__cdecl* TPAD_GetStatus)(u8, SPADStatus*);
|
||||
typedef void (__cdecl* TPAD_Input)(u16, u8);
|
||||
typedef void (__cdecl* TPAD_Rumble)(u8, unsigned int, unsigned int);
|
||||
|
||||
class PluginPAD : public CPlugin {
|
||||
public:
|
||||
PluginPAD(const char *_Filename);
|
||||
virtual ~PluginPAD();
|
||||
virtual bool IsValid() {return validPAD;};
|
||||
|
||||
TPAD_GetStatus PAD_GetStatus;
|
||||
TPAD_Input PAD_Input;
|
||||
TPAD_Rumble PAD_Rumble;
|
||||
|
||||
private:
|
||||
bool validPAD;
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // _PLUGINPAD_H_
|
||||
@@ -7,10 +7,12 @@ files = [
|
||||
"ABI.cpp",
|
||||
"BreakPoints.cpp",
|
||||
"CDUtils.cpp",
|
||||
"ChunkFile.cpp",
|
||||
"ColorUtil.cpp",
|
||||
"ConsoleListener.cpp",
|
||||
"CPUDetect.cpp",
|
||||
"DynamicLibrary.cpp",
|
||||
"ExtendedTrace.cpp",
|
||||
"FileSearch.cpp",
|
||||
"FileUtil.cpp",
|
||||
"Hash.cpp",
|
||||
@@ -26,6 +28,7 @@ files = [
|
||||
"PluginDSP.cpp",
|
||||
"PluginWiimote.cpp",
|
||||
"PluginVideo.cpp",
|
||||
"PluginPAD.cpp",
|
||||
"SDCardUtil.cpp",
|
||||
"StringUtil.cpp",
|
||||
"SymbolDB.cpp",
|
||||
@@ -43,7 +46,6 @@ files = [
|
||||
]
|
||||
|
||||
if sys.platform == 'win32':
|
||||
files += [ "ExtendedTrace.cpp" ]
|
||||
files += [ "stdafx.cpp" ]
|
||||
|
||||
env_common = env.Clone()
|
||||
|
||||
@@ -773,26 +773,6 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="GCPad"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\HW\GCPad.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\GCPad.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\GCPadEmu.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\GCPadEmu.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="PowerPC"
|
||||
|
||||
@@ -105,12 +105,14 @@ void LoadCodes(IniFile &ini, bool forceLoad)
|
||||
&& !forceLoad)
|
||||
return;
|
||||
|
||||
std::vector<std::string> lines;
|
||||
std::vector<std::string> encryptedLines;
|
||||
ARCode currentCode;
|
||||
arCodes.clear();
|
||||
|
||||
std::vector<std::string> lines;
|
||||
ini["ActionReplay"].GetLines(lines);
|
||||
if (!ini.GetLines("ActionReplay", lines))
|
||||
return; // no codes found.
|
||||
|
||||
for (std::vector<std::string>::const_iterator it = lines.begin(); it != lines.end(); ++it)
|
||||
{
|
||||
std::string line = *it;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<u8>("IPL.AR"));
|
||||
gameIni.Get("Wii", "Widescreen", &aspectWide, !!SConfig::GetInstance().m_SYSCONF->GetData<u8>("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()
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "IniFile.h"
|
||||
#include <string>
|
||||
|
||||
#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];
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
#include <ControllerInterface/ControllerInterface.h>
|
||||
#include "GCPadEmu.h"
|
||||
#include <InputConfig.h>
|
||||
#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<ControllerEmu*>::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<ControllerEmu*>::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();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user