mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Moved WiimoteNew into Dolphin and eliminated the old wiimote plugin. Removed wiimote plugin support. Moved input dialog related InputUICommon stuff into DolphinWX. Removed now unused InputCommon files. UDPWiimote stuff is temporarily disabled until it is reorganized so Core won't depend on wx. Real wiimotes are now initialized on first need(wiimote diag open or game start) and left initialized until Dolphin exit.(maybe this will work better for Linux/OS X) (scons probably needs some fixes)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6270 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@@ -373,8 +373,6 @@ dirs = [
|
||||
#'Source/Plugins/Plugin_VideoDX9/Src',
|
||||
'Source/Plugins/Plugin_VideoOGL/Src',
|
||||
'Source/Plugins/Plugin_VideoSoftware/Src',
|
||||
'Source/Plugins/Plugin_Wiimote/Src',
|
||||
'Source/Plugins/Plugin_WiimoteNew/Src',
|
||||
'Source/UnitTests',
|
||||
]
|
||||
|
||||
|
||||
@@ -480,14 +480,6 @@
|
||||
RelativePath=".\Src\PluginVideo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginWiimote.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginWiimote.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Specs"
|
||||
>
|
||||
@@ -511,10 +503,6 @@
|
||||
RelativePath="..\..\PluginSpecs\pluginspecs_video.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\PluginSpecs\pluginspecs_wiimote.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// 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 "PluginWiimote.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
PluginWiimote::PluginWiimote(const char *_Filename)
|
||||
: CPlugin(_Filename), validWiimote(false)
|
||||
{
|
||||
Wiimote_ControlChannel = reinterpret_cast<TWiimote_ControlChannel>
|
||||
(LoadSymbol("Wiimote_ControlChannel"));
|
||||
Wiimote_Input = reinterpret_cast<TWiimote_Input>
|
||||
(LoadSymbol("Wiimote_Input"));
|
||||
Wiimote_InterruptChannel = reinterpret_cast<TWiimote_InterruptChannel>
|
||||
(LoadSymbol("Wiimote_InterruptChannel"));
|
||||
Wiimote_Update = reinterpret_cast<TWiimote_Update>
|
||||
(LoadSymbol("Wiimote_Update"));
|
||||
Wiimote_GetAttachedControllers = reinterpret_cast<TWiimote_GetAttachedControllers>
|
||||
(LoadSymbol("Wiimote_GetAttachedControllers"));
|
||||
Wiimote_UnPairWiimotes = reinterpret_cast<TWiimote_UnPairWiimotes>
|
||||
(LoadSymbol("Wiimote_UnPairWiimotes"));
|
||||
|
||||
if ((Wiimote_ControlChannel != 0) &&
|
||||
(Wiimote_Input != 0) &&
|
||||
(Wiimote_InterruptChannel != 0) &&
|
||||
(Wiimote_Update != 0) &&
|
||||
(Wiimote_GetAttachedControllers != 0))
|
||||
validWiimote = true;
|
||||
}
|
||||
|
||||
PluginWiimote::~PluginWiimote() { }
|
||||
|
||||
} // Namespace
|
||||
@@ -1,53 +0,0 @@
|
||||
// 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 _PLUGINWIIMOTE_H_
|
||||
#define _PLUGINWIIMOTE_H_
|
||||
|
||||
#include "pluginspecs_wiimote.h"
|
||||
#include "Plugin.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
|
||||
typedef void (__cdecl* TWiimote_Update)(int _number);
|
||||
typedef void (__cdecl* TWiimote_Input)(u16 _Key, u8 _UpDown);
|
||||
typedef void (__cdecl* TWiimote_ControlChannel)(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
||||
typedef void (__cdecl* TWiimote_InterruptChannel)(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
||||
typedef unsigned int (__cdecl* TWiimote_UnPairWiimotes)();
|
||||
typedef unsigned int (__cdecl* TWiimote_GetAttachedControllers)();
|
||||
|
||||
class PluginWiimote : public CPlugin {
|
||||
public:
|
||||
PluginWiimote(const char *_Filename);
|
||||
virtual ~PluginWiimote();
|
||||
virtual bool IsValid() {return validWiimote;};
|
||||
|
||||
TWiimote_ControlChannel Wiimote_ControlChannel;
|
||||
TWiimote_Input Wiimote_Input;
|
||||
TWiimote_InterruptChannel Wiimote_InterruptChannel;
|
||||
TWiimote_Update Wiimote_Update;
|
||||
TWiimote_UnPairWiimotes Wiimote_UnPairWiimotes;
|
||||
TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers;
|
||||
|
||||
private:
|
||||
bool validWiimote;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // _PLUGINWIIMOTE_H_
|
||||
+132
-12
@@ -45,7 +45,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -69,8 +69,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
@@ -115,7 +116,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -140,7 +141,7 @@
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
@@ -189,7 +190,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
@@ -213,8 +214,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
@@ -266,7 +268,7 @@
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
@@ -290,8 +292,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\Lua\$(OutDir)\Lua.lib""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\Lua\$(OutDir)\Lua.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
@@ -340,7 +343,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="true"
|
||||
@@ -363,8 +366,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
@@ -414,7 +418,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
@@ -437,7 +441,7 @@
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
@@ -794,6 +798,122 @@
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Wiimote"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\HW\Wiimote.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\Wiimote.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Emu"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\EmuSubroutines.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Encryption.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Encryption.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\MatrixMath.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Speaker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\UDPTLayer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\WiimoteEmu.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\WiimoteEmu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\WiimoteHid.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Attachment"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Attachment.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Attachment.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Classic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Classic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Drums.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Drums.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Guitar.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Guitar.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Nunchuk.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Nunchuk.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Turntable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteEmu\Attachment\Turntable.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Real"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteReal\WiimoteReal.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\HW\WiimoteReal\WiimoteReal.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="PowerPC"
|
||||
|
||||
@@ -171,7 +171,6 @@ void SConfig::SaveSettings()
|
||||
// Plugins
|
||||
ini.Set("Core", "GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
|
||||
ini.Set("Core", "DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
ini.Set("Core", "WiiMotePlugin",m_LocalCoreStartupParameter.m_strWiimotePlugin);
|
||||
|
||||
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
m_SYSCONF->Save();
|
||||
@@ -187,7 +186,6 @@ void SConfig::LoadSettings()
|
||||
// Hard coded defaults
|
||||
m_DefaultGFXPlugin = DEFAULT_GFX_PLUGIN;
|
||||
m_DefaultDSPPlugin = DEFAULT_DSP_PLUGIN;
|
||||
m_DefaultWiiMotePlugin = DEFAULT_WIIMOTE_PLUGIN;
|
||||
|
||||
// General
|
||||
{
|
||||
@@ -302,7 +300,6 @@ void SConfig::LoadSettings()
|
||||
// Plugins
|
||||
ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
|
||||
ini.Get("Core", "DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str());
|
||||
ini.Get("Core", "WiiMotePlugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin, m_DefaultWiiMotePlugin.c_str());
|
||||
}
|
||||
|
||||
m_SYSCONF = new SysConf();
|
||||
|
||||
@@ -50,7 +50,6 @@ struct SConfig
|
||||
// hard coded default plugins ...
|
||||
std::string m_DefaultGFXPlugin;
|
||||
std::string m_DefaultDSPPlugin;
|
||||
std::string m_DefaultWiiMotePlugin;
|
||||
|
||||
// name of the last used filename
|
||||
std::string m_LastFilename;
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "HW/GPFifo.h"
|
||||
#include "HW/CPU.h"
|
||||
#include "HW/GCPad.h"
|
||||
#include "HW/Wiimote.h"
|
||||
#include "HW/HW.h"
|
||||
#include "HW/DSP.h"
|
||||
#include "HW/GPFifo.h"
|
||||
@@ -382,20 +383,11 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
|
||||
Plugins.GetDSP()->Initialize((void *)&dspInit);
|
||||
|
||||
GCPad_Init(g_pWindowHandle);
|
||||
Pad::Initialize(g_pWindowHandle);
|
||||
|
||||
// Load and Init WiimotePlugin - only if we are booting in wii mode
|
||||
// Load and Init Wiimotes - only if we are booting in wii mode
|
||||
if (_CoreParameter.bWii)
|
||||
{
|
||||
SWiimoteInitialize WiimoteInitialize;
|
||||
WiimoteInitialize.hWnd = g_pWindowHandle;
|
||||
WiimoteInitialize.ISOId = Ascii2Hex(_CoreParameter.m_strUniqueID);
|
||||
WiimoteInitialize.pLog = Callback_WiimoteLog;
|
||||
WiimoteInitialize.pWiimoteInterruptChannel = Callback_WiimoteInterruptChannel;
|
||||
WiimoteInitialize.pRendererHasFocus = Callback_RendererHasFocus;
|
||||
// Wait for Wiiuse to find the number of connected Wiimotes
|
||||
Plugins.GetWiimote()->Initialize((void *)&WiimoteInitialize);
|
||||
}
|
||||
Wiimote::Initialize(g_pWindowHandle);
|
||||
|
||||
// The hardware is initialized.
|
||||
g_bHwInit = true;
|
||||
@@ -508,7 +500,8 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
if (_CoreParameter.bCPUThread)
|
||||
Plugins.ShutdownVideoPlugin();
|
||||
|
||||
GCPad_Deinit();
|
||||
Pad::Shutdown();
|
||||
Wiimote::Shutdown();
|
||||
Plugins.ShutdownPlugins();
|
||||
|
||||
NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Plugins shutdown").c_str());
|
||||
|
||||
@@ -126,7 +126,6 @@ struct SCoreStartupParameter
|
||||
// files
|
||||
std::string m_strVideoPlugin;
|
||||
std::string m_strDSPPlugin;
|
||||
std::string m_strWiimotePlugin;
|
||||
|
||||
std::string m_strFilename;
|
||||
std::string m_strBootROM;
|
||||
|
||||
@@ -23,47 +23,42 @@
|
||||
|
||||
#include "../../InputCommon/Src/InputConfig.h"
|
||||
|
||||
static InputPlugin g_plugin("GCPadNew", "Pad", "GCPad");
|
||||
namespace Pad
|
||||
{
|
||||
|
||||
InputPlugin *PAD_GetPlugin() {
|
||||
static InputPlugin g_plugin("GCPadNew", "Pad", "GCPad");
|
||||
InputPlugin *GetPlugin()
|
||||
{
|
||||
return &g_plugin;
|
||||
}
|
||||
|
||||
void GCPad_Deinit()
|
||||
void Shutdown()
|
||||
{
|
||||
if ( g_plugin.controller_interface.IsInit() )
|
||||
{
|
||||
std::vector<ControllerEmu*>::const_iterator
|
||||
i = g_plugin.controllers.begin(),
|
||||
e = g_plugin.controllers.end();
|
||||
for ( ; i!=e; ++i )
|
||||
delete *i;
|
||||
g_plugin.controllers.clear();
|
||||
std::vector<ControllerEmu*>::const_iterator
|
||||
i = g_plugin.controllers.begin(),
|
||||
e = g_plugin.controllers.end();
|
||||
for ( ; i!=e; ++i )
|
||||
delete *i;
|
||||
g_plugin.controllers.clear();
|
||||
|
||||
g_plugin.controller_interface.DeInit();
|
||||
}
|
||||
g_controller_interface.Shutdown();
|
||||
}
|
||||
|
||||
// if plugin isn't initialized, init and load config
|
||||
void GCPad_Init( void* const hwnd )
|
||||
void Initialize(void* const hwnd)
|
||||
{
|
||||
// i realize i am checking IsInit() twice, just too lazy to change it
|
||||
if ( false == g_plugin.controller_interface.IsInit() )
|
||||
{
|
||||
// add 4 gcpads
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
g_plugin.controllers.push_back(new GCPad(i));
|
||||
|
||||
// needed for Xlib
|
||||
g_plugin.controller_interface.SetHwnd(hwnd);
|
||||
g_plugin.controller_interface.Init();
|
||||
// add 4 gcpads
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
g_plugin.controllers.push_back(new GCPad(i));
|
||||
|
||||
// load the saved controller config
|
||||
g_plugin.LoadConfig();
|
||||
}
|
||||
g_controller_interface.SetHwnd(hwnd);
|
||||
g_controller_interface.Initialize();
|
||||
|
||||
// load the saved controller config
|
||||
g_plugin.LoadConfig();
|
||||
}
|
||||
|
||||
void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
{
|
||||
memset(_pPADStatus, 0, sizeof(*_pPADStatus));
|
||||
_pPADStatus->err = PAD_ERR_NONE;
|
||||
@@ -84,8 +79,8 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
static int _last_numPAD = 4;
|
||||
if (_numPAD <= _last_numPAD)
|
||||
{
|
||||
g_plugin.controller_interface.UpdateOutput();
|
||||
g_plugin.controller_interface.UpdateInput();
|
||||
g_controller_interface.UpdateOutput();
|
||||
g_controller_interface.UpdateInput();
|
||||
}
|
||||
_last_numPAD = _numPAD;
|
||||
|
||||
@@ -102,7 +97,7 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
|
||||
// input: PAD number, Command type (Stop=0, Rumble=1, Stop Hard=2) and strength of Rumble
|
||||
// output: none
|
||||
//
|
||||
void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
|
||||
void Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
|
||||
{
|
||||
// enter
|
||||
if ( g_plugin.controls_crit.TryEnter() )
|
||||
@@ -115,3 +110,5 @@ void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
|
||||
g_plugin.controls_crit.Leave();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,10 +19,20 @@
|
||||
#include "GCPadStatus.h"
|
||||
#include "../../InputCommon/Src/InputConfig.h"
|
||||
|
||||
void GCPad_Init( void* const hwnd );
|
||||
void GCPad_Deinit();
|
||||
#ifndef _GCPAD_H_
|
||||
#define _GCPAD_H_
|
||||
|
||||
void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus);
|
||||
void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength);
|
||||
namespace Pad
|
||||
{
|
||||
|
||||
InputPlugin *PAD_GetPlugin();
|
||||
void Shutdown();
|
||||
void Initialize(void* const hwnd);
|
||||
|
||||
InputPlugin *GetPlugin();
|
||||
|
||||
void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus);
|
||||
void Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -148,7 +148,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
DEBUG_LOG(AMBASEBOARDDEBUG, "GC-AM: CMD 10, %02x (READ STATUS&SWITCHES)", ptr(1));
|
||||
SPADStatus PadStatus;
|
||||
memset(&PadStatus, 0 ,sizeof(PadStatus));
|
||||
PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
Pad::GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
res[resp++] = 0x10;
|
||||
res[resp++] = 0x2;
|
||||
int d10_0 = 0xdf;
|
||||
@@ -313,7 +313,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
for (i=0; i<nr_players; ++i)
|
||||
{
|
||||
SPADStatus PadStatus;
|
||||
PAD_GetStatus(i, &PadStatus);
|
||||
Pad::GetStatus(i, &PadStatus);
|
||||
unsigned char player_data[2] = {0,0};
|
||||
if (PadStatus.button & PAD_BUTTON_START)
|
||||
player_data[0] |= 0x80;
|
||||
@@ -350,7 +350,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
int slots = *jvs_io++;
|
||||
msg.addData(1);
|
||||
SPADStatus PadStatus;
|
||||
PAD_GetStatus(0, &PadStatus);
|
||||
Pad::GetStatus(0, &PadStatus);
|
||||
while (slots--)
|
||||
{
|
||||
msg.addData(0);
|
||||
|
||||
@@ -131,7 +131,7 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
|
||||
SPADStatus PadStatus;
|
||||
memset(&PadStatus, 0, sizeof(PadStatus));
|
||||
|
||||
PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
Pad::GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
|
||||
u32 netValues[2] = {0};
|
||||
int NetPlay = 2;
|
||||
@@ -281,7 +281,7 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
|
||||
#endif
|
||||
|
||||
if (numPAD < 4)
|
||||
PAD_Rumble(numPAD, uType, uStrength);
|
||||
Pad::Rumble(numPAD, uType, uStrength);
|
||||
|
||||
if (!_Poll)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "Wiimote.h"
|
||||
#include "WiimoteReal/WiimoteReal.h"
|
||||
#include "WiimoteEmu/WiimoteEmu.h"
|
||||
|
||||
#include "ControllerInterface/ControllerInterface.h"
|
||||
|
||||
#include "../../InputCommon/Src/InputConfig.h"
|
||||
|
||||
namespace Wiimote
|
||||
{
|
||||
|
||||
static InputPlugin g_plugin(WIIMOTE_INI_NAME, "Wiimote", "Wiimote");
|
||||
InputPlugin *GetPlugin()
|
||||
{
|
||||
return &g_plugin;
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
std::vector<ControllerEmu*>::const_iterator
|
||||
i = g_plugin.controllers.begin(),
|
||||
e = g_plugin.controllers.end();
|
||||
for ( ; i!=e; ++i )
|
||||
delete *i;
|
||||
g_plugin.controllers.clear();
|
||||
|
||||
// WiimoteReal is shutdown on app exit
|
||||
//WiimoteReal::Shutdown();
|
||||
|
||||
g_controller_interface.Shutdown();
|
||||
}
|
||||
|
||||
// if plugin isn't initialized, init and load config
|
||||
void Initialize(void* const hwnd)
|
||||
{
|
||||
// add 4 wiimotes
|
||||
for (unsigned int i = 0; i<4; ++i)
|
||||
g_plugin.controllers.push_back(new WiimoteEmu::Wiimote(i));
|
||||
|
||||
g_controller_interface.SetHwnd(hwnd);
|
||||
g_controller_interface.Initialize();
|
||||
|
||||
g_plugin.LoadConfig();
|
||||
|
||||
WiimoteReal::Initialize();
|
||||
}
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// Function: Wiimote_Output
|
||||
// Purpose: An L2CAP packet is passed from the Core to the Wiimote,
|
||||
// on the HID CONTROL channel.
|
||||
// input: Da pakket.
|
||||
// output: none
|
||||
//
|
||||
void ControlChannel(int _number, u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number])
|
||||
((WiimoteEmu::Wiimote*)g_plugin.controllers[_number])->ControlChannel(_channelID, _pData, _Size);
|
||||
|
||||
if (WIIMOTE_SRC_REAL & g_wiimote_sources[_number])
|
||||
WiimoteReal::ControlChannel(_number, _channelID, _pData, _Size);
|
||||
}
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// Function: Wiimote_InterruptChannel
|
||||
// Purpose: An L2CAP packet is passed from the Core to the Wiimote,
|
||||
// on the HID INTERRUPT channel.
|
||||
// input: Da pakket.
|
||||
// output: none
|
||||
//
|
||||
void InterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size)
|
||||
{
|
||||
if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number])
|
||||
((WiimoteEmu::Wiimote*)g_plugin.controllers[_number])->InterruptChannel(_channelID, _pData, _Size);
|
||||
else
|
||||
WiimoteReal::InterruptChannel(_number, _channelID, _pData, _Size);
|
||||
}
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// Function: Wiimote_Update
|
||||
// Purpose: This function is called periodically by the Core.
|
||||
// input: none
|
||||
// output: none
|
||||
//
|
||||
void Update(int _number)
|
||||
{
|
||||
//PanicAlert( "Wiimote_Update" );
|
||||
|
||||
// TODO: change this to a TryEnter, and make it give empty input on failure
|
||||
g_plugin.controls_crit.Enter();
|
||||
|
||||
static int _last_number = 4;
|
||||
if (_number <= _last_number)
|
||||
{
|
||||
g_controller_interface.UpdateOutput();
|
||||
g_controller_interface.UpdateInput();
|
||||
}
|
||||
_last_number = _number;
|
||||
|
||||
if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number])
|
||||
((WiimoteEmu::Wiimote*)g_plugin.controllers[_number])->Update();
|
||||
else
|
||||
WiimoteReal::Update(_number);
|
||||
|
||||
g_plugin.controls_crit.Leave();
|
||||
}
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// Function: PAD_GetAttachedPads
|
||||
// Purpose: Get mask of attached pads (eg: controller 1 & 4 -> 0x9)
|
||||
// input: none
|
||||
// output: number of pads
|
||||
//
|
||||
unsigned int GetAttached()
|
||||
{
|
||||
unsigned int attached = 0;
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
if (g_wiimote_sources[i])
|
||||
attached |= (1 << i);
|
||||
return attached;
|
||||
}
|
||||
|
||||
// ___________________________________________________________________________
|
||||
// Function: DoState
|
||||
// Purpose: Saves/load state
|
||||
// input/output: ptr
|
||||
// input: mode
|
||||
//
|
||||
void DoState(unsigned char **ptr, int mode)
|
||||
{
|
||||
// TODO:
|
||||
|
||||
//PointerWrap p(ptr, mode);
|
||||
//for (unsigned int i=0; i<4; ++i)
|
||||
// ((WiimoteEmu::Wiimote*)g_plugin.controllers[i])->DoState(p);
|
||||
}
|
||||
|
||||
// ___________________________________________________________________________
|
||||
// Function: EmuStateChange
|
||||
// Purpose: Notifies the plugin of a change in emulation state
|
||||
// input: newState
|
||||
// output: none
|
||||
//
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
{
|
||||
// TODO
|
||||
WiimoteReal::StateChange(newState);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
#ifndef _WIIMOTE_H_
|
||||
#define _WIIMOTE_H_
|
||||
|
||||
#include "PluginSpecs.h"
|
||||
#include "../../InputCommon/Src/InputConfig.h"
|
||||
|
||||
#define MAX_WIIMOTES 4
|
||||
|
||||
#define WIIMOTE_INI_NAME "WiimoteNew"
|
||||
|
||||
//extern InputPlugin g_plugin;
|
||||
extern unsigned int g_wiimote_sources[MAX_WIIMOTES];
|
||||
|
||||
//extern SWiimoteInitialize g_WiimoteInitialize;
|
||||
|
||||
namespace Wiimote
|
||||
{
|
||||
|
||||
void Shutdown();
|
||||
void Initialize(void* const hwnd);
|
||||
|
||||
unsigned int GetAttached();
|
||||
void DoState(unsigned char **ptr, int mode);
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState);
|
||||
InputPlugin *GetPlugin();
|
||||
|
||||
void ControlChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
||||
void InterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
||||
void Update(int _number);
|
||||
|
||||
}
|
||||
|
||||
namespace WiimoteReal
|
||||
{
|
||||
|
||||
unsigned int Initialize();
|
||||
void Shutdown();
|
||||
void Refresh();
|
||||
|
||||
void LoadSettings();
|
||||
|
||||
#ifdef _WIN32
|
||||
int PairUp(bool unpair = false);
|
||||
int UnPair();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user