mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge the pad plugin into Dolphin. Since there's only one plugin left under active development, and it's awesome, we no longer have a need for a pad plugin mechanism.
In the future if we merge wiimote too, this will bring the advantage that the two will be able to cooperate, to no longer fight over control of input devices which can sometimes cause problems. Thanks shuffle2 for the patience. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5670 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="Common"
|
||||
ProjectGUID="{C573CAF7-EE6A-458E-8049-16C0BF34C2E9}"
|
||||
RootNamespace="Common"
|
||||
@ -471,14 +471,6 @@
|
||||
RelativePath=".\Src\PluginDSP.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginPAD.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginPAD.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\PluginVideo.cpp"
|
||||
>
|
||||
|
@ -132,7 +132,6 @@
|
||||
// Plugin files
|
||||
#define DEFAULT_GFX_PLUGIN PLUGIN_PREFIX "Plugin_VideoOGL" PLUGIN_SUFFIX
|
||||
#define DEFAULT_DSP_PLUGIN PLUGIN_PREFIX "Plugin_DSP_HLE" PLUGIN_SUFFIX
|
||||
#define DEFAULT_PAD_PLUGIN PLUGIN_PREFIX "Plugin_GCPadNew" PLUGIN_SUFFIX
|
||||
#define DEFAULT_WIIMOTE_PLUGIN PLUGIN_PREFIX "Plugin_Wiimote" PLUGIN_SUFFIX
|
||||
|
||||
// Sys files
|
||||
|
@ -1,40 +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 "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
|
@ -26,7 +26,6 @@ files = [
|
||||
"PluginDSP.cpp",
|
||||
"PluginWiimote.cpp",
|
||||
"PluginVideo.cpp",
|
||||
"PluginPAD.cpp",
|
||||
"SDCardUtil.cpp",
|
||||
"StringUtil.cpp",
|
||||
"SymbolDB.cpp",
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="Core"
|
||||
ProjectGUID="{F0B874CB-4476-4199-9315-8343D05AE684}"
|
||||
RootNamespace="Core"
|
||||
@ -773,6 +773,26 @@
|
||||
>
|
||||
</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"
|
||||
|
@ -168,7 +168,6 @@ void SConfig::SaveSettings()
|
||||
// Plugins
|
||||
ini.Set("Core", "GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin);
|
||||
ini.Set("Core", "DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
ini.Set("Core", "PadPlugin", m_LocalCoreStartupParameter.m_strPadPlugin);
|
||||
ini.Set("Core", "WiiMotePlugin",m_LocalCoreStartupParameter.m_strWiimotePlugin);
|
||||
|
||||
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
@ -185,7 +184,6 @@ void SConfig::LoadSettings()
|
||||
// Hard coded defaults
|
||||
m_DefaultGFXPlugin = DEFAULT_GFX_PLUGIN;
|
||||
m_DefaultDSPPlugin = DEFAULT_DSP_PLUGIN;
|
||||
m_DefaultPADPlugin = DEFAULT_PAD_PLUGIN;
|
||||
m_DefaultWiiMotePlugin = DEFAULT_WIIMOTE_PLUGIN;
|
||||
|
||||
// General
|
||||
@ -296,10 +294,7 @@ 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", "PadPlugin", &m_LocalCoreStartupParameter.m_strPadPlugin, m_DefaultPADPlugin.c_str());
|
||||
ini.Get("Core", "WiiMotePlugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin, m_DefaultWiiMotePlugin.c_str());
|
||||
|
||||
|
||||
}
|
||||
|
||||
m_SYSCONF = new SysConf();
|
||||
|
@ -49,7 +49,6 @@ struct SConfig
|
||||
// hard coded default plugins ...
|
||||
std::string m_DefaultGFXPlugin;
|
||||
std::string m_DefaultDSPPlugin;
|
||||
std::string m_DefaultPADPlugin;
|
||||
std::string m_DefaultWiiMotePlugin;
|
||||
|
||||
// name of the last used filename
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "HW/ProcessorInterface.h"
|
||||
#include "HW/GPFifo.h"
|
||||
#include "HW/CPU.h"
|
||||
#include "HW/GCPad.h"
|
||||
#include "HW/HW.h"
|
||||
#include "HW/DSP.h"
|
||||
#include "HW/GPFifo.h"
|
||||
@ -382,17 +383,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
|
||||
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()->Initialize(&PADInitialize);
|
||||
GCPad_Init(g_pWindowHandle);
|
||||
|
||||
// Load and Init WiimotePlugin - only if we are booting in wii mode
|
||||
if (_CoreParameter.bWii)
|
||||
@ -521,7 +512,9 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
if (_CoreParameter.bCPUThread)
|
||||
Plugins.ShutdownVideoPlugin();
|
||||
|
||||
GCPad_Deinit();
|
||||
Plugins.ShutdownPlugins();
|
||||
|
||||
NOTICE_LOG(CONSOLE, "%s", StopMessage(false, "Plugins shutdown").c_str());
|
||||
|
||||
NOTICE_LOG(CONSOLE, "%s", StopMessage(true, "Main thread stopped").c_str());
|
||||
|
@ -118,7 +118,6 @@ struct SCoreStartupParameter
|
||||
|
||||
// files
|
||||
std::string m_strVideoPlugin;
|
||||
std::string m_strPadPlugin;
|
||||
std::string m_strDSPPlugin;
|
||||
std::string m_strWiimotePlugin;
|
||||
|
||||
|
159
Source/Core/Core/Src/HW/GCPad.cpp
Normal file
159
Source/Core/Core/Src/HW/GCPad.cpp
Normal file
@ -0,0 +1,159 @@
|
||||
// Copyright (C) 2010 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 "pluginspecs_pad.h"
|
||||
|
||||
#include "ControllerInterface/ControllerInterface.h"
|
||||
#include "GCPadEmu.h"
|
||||
|
||||
#include "../../InputCommon/Src/InputConfig.h"
|
||||
|
||||
InputPlugin g_plugin("GCPadNew", "Pad", "GCPad");
|
||||
|
||||
InputPlugin *PAD_GetPlugin() {
|
||||
return &g_plugin;
|
||||
}
|
||||
|
||||
void GCPad_Deinit()
|
||||
{
|
||||
// i realize i am checking IsInit() twice, just too lazy to change it
|
||||
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();
|
||||
|
||||
g_plugin.controller_interface.DeInit();
|
||||
}
|
||||
}
|
||||
|
||||
// if plugin isn't initialized, init and load config
|
||||
void GCPad_Init( 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();
|
||||
|
||||
// load the saved controller config
|
||||
if (false == g_plugin.LoadConfig())
|
||||
{
|
||||
// load default config for pad 1
|
||||
g_plugin.controllers[0]->LoadDefaults();
|
||||
|
||||
// kinda silly, set default device(all controls) to first one found in ControllerInterface
|
||||
// should be the keyboard device
|
||||
if (g_plugin.controller_interface.Devices().size())
|
||||
{
|
||||
g_plugin.controllers[0]->default_device.FromDevice(g_plugin.controller_interface.Devices()[0]);
|
||||
g_plugin.controllers[0]->UpdateDefaultDevice();
|
||||
}
|
||||
}
|
||||
|
||||
// update control refs
|
||||
std::vector<ControllerEmu*>::const_iterator
|
||||
i = g_plugin.controllers.begin(),
|
||||
e = g_plugin.controllers.end();
|
||||
for ( ; i!=e; ++i )
|
||||
(*i)->UpdateReferences( g_plugin.controller_interface );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// I N T E R F A C E
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// Function:
|
||||
// Purpose:
|
||||
// input:
|
||||
// output:
|
||||
//
|
||||
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_plugin.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_plugin.interface_crit.TryEnter() )
|
||||
{
|
||||
g_plugin.controller_interface.UpdateOutput();
|
||||
g_plugin.controller_interface.UpdateInput();
|
||||
g_plugin.interface_crit.Leave();
|
||||
}
|
||||
_last_numPAD = _numPAD;
|
||||
|
||||
// get input
|
||||
((GCPad*)g_plugin.controllers[ _numPAD ])->GetInput( _pPADStatus );
|
||||
|
||||
// leave
|
||||
g_plugin.controls_crit.Leave();
|
||||
|
||||
}
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// 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)
|
||||
{
|
||||
// nofin
|
||||
}
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// 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, unsigned int _uType, unsigned int _uStrength)
|
||||
{
|
||||
// enter
|
||||
if ( g_plugin.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_plugin.controllers[ _numPAD ])->SetOutput( 1 == _uType && _uStrength > 2 );
|
||||
|
||||
// leave
|
||||
g_plugin.controls_crit.Leave();
|
||||
}
|
||||
}
|
203
Source/Core/Core/Src/HW/GCPadEmu.cpp
Normal file
203
Source/Core/Core/Src/HW/GCPadEmu.cpp
Normal file
@ -0,0 +1,203 @@
|
||||
// Copyright (C) 2010 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 "GCPadEmu.h"
|
||||
#include "../Host.h"
|
||||
|
||||
const u16 button_bitmasks[] =
|
||||
{
|
||||
PAD_BUTTON_A,
|
||||
PAD_BUTTON_B,
|
||||
PAD_BUTTON_X,
|
||||
PAD_BUTTON_Y,
|
||||
PAD_TRIGGER_Z,
|
||||
PAD_BUTTON_START
|
||||
};
|
||||
|
||||
const u16 trigger_bitmasks[] =
|
||||
{
|
||||
PAD_TRIGGER_L,
|
||||
PAD_TRIGGER_R,
|
||||
};
|
||||
|
||||
const u16 dpad_bitmasks[] =
|
||||
{
|
||||
PAD_BUTTON_UP, PAD_BUTTON_DOWN, PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT
|
||||
};
|
||||
|
||||
const char* const named_buttons[] =
|
||||
{
|
||||
"A",
|
||||
"B",
|
||||
"X",
|
||||
"Y",
|
||||
"Z",
|
||||
"Start",
|
||||
};
|
||||
|
||||
const char* const named_triggers[] =
|
||||
{
|
||||
"L", "R", "L-Analog", "R-Analog"
|
||||
};
|
||||
|
||||
GCPad::GCPad( const unsigned int index ) : m_index(index)
|
||||
{
|
||||
|
||||
// buttons
|
||||
groups.push_back( m_buttons = new Buttons( "Buttons" ) );
|
||||
for ( unsigned int i=0; i < sizeof(named_buttons)/sizeof(*named_buttons); ++i )
|
||||
m_buttons->controls.push_back( new ControlGroup::Input( named_buttons[i] ) );
|
||||
|
||||
// sticks
|
||||
groups.push_back( m_main_stick = new AnalogStick( "Main Stick" ) );
|
||||
groups.push_back( m_c_stick = new AnalogStick( "C-Stick" ) );
|
||||
|
||||
// triggers
|
||||
groups.push_back( m_triggers = new MixedTriggers( "Triggers" ) );
|
||||
for ( unsigned int i=0; i < sizeof(named_triggers)/sizeof(*named_triggers); ++i )
|
||||
m_triggers->controls.push_back( new ControlGroup::Input( named_triggers[i] ) );
|
||||
|
||||
// rumble
|
||||
groups.push_back( m_rumble = new ControlGroup( "Rumble" ) );
|
||||
m_rumble->controls.push_back( new ControlGroup::Output( "Motor" ) );
|
||||
|
||||
// dpad
|
||||
groups.push_back( m_dpad = new Buttons( "D-Pad" ) );
|
||||
for ( unsigned int i=0; i < 4; ++i )
|
||||
m_dpad->controls.push_back( new ControlGroup::Input( named_directions[i] ) );
|
||||
|
||||
// options
|
||||
groups.push_back( m_options = new ControlGroup( "Options" ) );
|
||||
m_options->settings.push_back( new ControlGroup::Setting( "Background Input", false ) );
|
||||
|
||||
}
|
||||
|
||||
std::string GCPad::GetName() const
|
||||
{
|
||||
return std::string("GCPad") + char('1'+m_index);
|
||||
}
|
||||
|
||||
void GCPad::GetInput( SPADStatus* const pad )
|
||||
{
|
||||
// if window has focus or background input enabled
|
||||
if (Host_RendererHasFocus() || m_options[0].settings[0]->value )
|
||||
{
|
||||
// buttons
|
||||
m_buttons->GetState( &pad->button, button_bitmasks );
|
||||
|
||||
// TODO: set analog A/B analog to full or w/e, prolly not needed
|
||||
|
||||
// dpad
|
||||
m_dpad->GetState( &pad->button, dpad_bitmasks );
|
||||
|
||||
// sticks
|
||||
m_main_stick->GetState( &pad->stickX, &pad->stickY, 0x80, 127 );
|
||||
m_c_stick->GetState( &pad->substickX, &pad->substickY, 0x80, 127 );
|
||||
|
||||
// triggers
|
||||
m_triggers->GetState( &pad->button, trigger_bitmasks, &pad->triggerLeft, 0xFF );
|
||||
}
|
||||
else
|
||||
{
|
||||
// center sticks
|
||||
memset( &pad->stickX, 0x80, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
void GCPad::SetOutput( const bool on )
|
||||
{
|
||||
// only rumble if window has focus or background input is enabled
|
||||
m_rumble->controls[0]->control_ref->State( on && (Host_RendererHasFocus() || m_options[0].settings[0]->value) );
|
||||
}
|
||||
|
||||
void GCPad::LoadDefaults()
|
||||
{
|
||||
#define set_control(group, num, str) (group)->controls[num]->control_ref->control_qualifier.name = (str)
|
||||
|
||||
// nvm, do the device part elsewhere
|
||||
//#ifdef _WIN32
|
||||
// default_device.FromString("DirectInput/0/Keyboard Mouse");
|
||||
//#elif __APPLE__
|
||||
// // keyboard mouse devices are named by their product name thing on OSX currently
|
||||
//#else
|
||||
// default_device.FromString("Xlib/0/Keyboard");
|
||||
//#endif
|
||||
|
||||
// Buttons
|
||||
set_control(m_buttons, 0, "X"); // A
|
||||
set_control(m_buttons, 1, "Z"); // B
|
||||
set_control(m_buttons, 2, "C"); // X
|
||||
set_control(m_buttons, 3, "S"); // Y
|
||||
set_control(m_buttons, 4, "D"); // Z
|
||||
#ifdef _WIN32
|
||||
set_control(m_buttons, 5, "RETURN"); // Start
|
||||
#else
|
||||
// osx/linux
|
||||
set_control(m_buttons, 5, "Return"); // Start
|
||||
#endif
|
||||
|
||||
// stick modifiers to 50 %
|
||||
m_main_stick->controls[4]->control_ref->range = 0.5f;
|
||||
m_c_stick->controls[4]->control_ref->range = 0.5f;
|
||||
|
||||
// D-Pad
|
||||
set_control(m_dpad, 0, "T"); // Up
|
||||
set_control(m_dpad, 1, "G"); // Down
|
||||
set_control(m_dpad, 2, "F"); // Left
|
||||
set_control(m_dpad, 3, "H"); // Right
|
||||
|
||||
// C-Stick
|
||||
set_control(m_c_stick, 0, "I"); // Up
|
||||
set_control(m_c_stick, 1, "K"); // Down
|
||||
set_control(m_c_stick, 2, "J"); // Left
|
||||
set_control(m_c_stick, 3, "L"); // Right
|
||||
#ifdef _WIN32
|
||||
set_control(m_c_stick, 4, "LCONTROL"); // Modifier
|
||||
|
||||
// Main Stick
|
||||
set_control(m_main_stick, 0, "UP"); // Up
|
||||
set_control(m_main_stick, 1, "DOWN"); // Down
|
||||
set_control(m_main_stick, 2, "LEFT"); // Left
|
||||
set_control(m_main_stick, 3, "RIGHT"); // Right
|
||||
set_control(m_main_stick, 4, "LSHIFT"); // Modifier
|
||||
|
||||
#elif __APPLE__
|
||||
set_control(m_c_stick, 4, "Left Control"); // Modifier
|
||||
|
||||
// Main Stick
|
||||
set_control(m_main_stick, 0, "Up Arrow"); // Up
|
||||
set_control(m_main_stick, 1, "Down Arrow"); // Down
|
||||
set_control(m_main_stick, 2, "Left Arrow"); // Left
|
||||
set_control(m_main_stick, 3, "Right Arrow"); // Right
|
||||
set_control(m_main_stick, 4, "Left Shift"); // Modifier
|
||||
#else
|
||||
// not sure if these are right
|
||||
|
||||
set_control(m_c_stick, 4, "Control_L"); // Modifier
|
||||
|
||||
// Main Stick
|
||||
set_control(m_main_stick, 0, "Up"); // Up
|
||||
set_control(m_main_stick, 1, "Down"); // Down
|
||||
set_control(m_main_stick, 2, "Left"); // Left
|
||||
set_control(m_main_stick, 3, "Right"); // Right
|
||||
set_control(m_main_stick, 4, "Shift_L"); // Modifier
|
||||
#endif
|
||||
|
||||
// Triggers
|
||||
set_control(m_triggers, 0, "Q"); // L
|
||||
set_control(m_triggers, 1, "W"); // R
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
// Copyright (C) 2010 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
|
||||
@ -15,33 +15,37 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _PLUGINPAD_H_
|
||||
#define _PLUGINPAD_H_
|
||||
#ifndef _CONEMU_GCPAD_H_
|
||||
#define _CONEMU_GCPAD_H_
|
||||
|
||||
#include "pluginspecs_pad.h"
|
||||
#include "Plugin.h"
|
||||
#include <string>
|
||||
|
||||
namespace Common {
|
||||
#include "ControllerEmu.h"
|
||||
|
||||
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 {
|
||||
class GCPad : public ControllerEmu
|
||||
{
|
||||
public:
|
||||
PluginPAD(const char *_Filename);
|
||||
virtual ~PluginPAD();
|
||||
virtual bool IsValid() {return validPAD;};
|
||||
|
||||
TPAD_GetStatus PAD_GetStatus;
|
||||
TPAD_Input PAD_Input;
|
||||
TPAD_Rumble PAD_Rumble;
|
||||
GCPad( const unsigned int index );
|
||||
void GetInput( SPADStatus* const pad );
|
||||
void SetOutput( const bool on );
|
||||
|
||||
std::string GetName() const;
|
||||
|
||||
void LoadDefaults();
|
||||
|
||||
private:
|
||||
bool validPAD;
|
||||
|
||||
Buttons* m_buttons;
|
||||
AnalogStick* m_main_stick;
|
||||
AnalogStick* m_c_stick;
|
||||
Buttons* m_dpad;
|
||||
MixedTriggers* m_triggers;
|
||||
ControlGroup* m_rumble;
|
||||
ControlGroup* m_options;
|
||||
|
||||
const unsigned int m_index;
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // _PLUGINPAD_H_
|
||||
#endif
|
@ -15,10 +15,14 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "pluginspecs_pad.h"
|
||||
|
||||
#include "SI.h"
|
||||
#include "SI_Device.h"
|
||||
#include "SI_DeviceAMBaseboard.h"
|
||||
|
||||
#include "GCPad.h"
|
||||
|
||||
#include "../PluginManager.h" // for pad state
|
||||
|
||||
// where to put baseboard debug
|
||||
@ -144,8 +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));
|
||||
CPluginManager::GetInstance().GetPad()
|
||||
->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
res[resp++] = 0x10;
|
||||
res[resp++] = 0x2;
|
||||
int d10_0 = 0xdf;
|
||||
@ -310,8 +313,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
for (i=0; i<nr_players; ++i)
|
||||
{
|
||||
SPADStatus PadStatus;
|
||||
CPluginManager::GetInstance().GetPad()
|
||||
->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;
|
||||
@ -348,8 +350,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
|
||||
int slots = *jvs_io++;
|
||||
msg.addData(1);
|
||||
SPADStatus PadStatus;
|
||||
CPluginManager::GetInstance().GetPad()
|
||||
->PAD_GetStatus(0, &PadStatus);
|
||||
PAD_GetStatus(0, &PadStatus);
|
||||
while (slots--)
|
||||
{
|
||||
msg.addData(0);
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "EXI_Device.h"
|
||||
#include "EXI_DeviceMic.h"
|
||||
|
||||
#include "GCPad.h"
|
||||
|
||||
#include "../OnFrame.h"
|
||||
|
||||
#include "Timer.h"
|
||||
@ -128,8 +130,8 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
|
||||
{
|
||||
SPADStatus PadStatus;
|
||||
memset(&PadStatus, 0, sizeof(PadStatus));
|
||||
Common::PluginPAD* pad = CPluginManager::GetInstance().GetPad();
|
||||
pad->PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
|
||||
PAD_GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
|
||||
|
||||
u32 netValues[2] = {0};
|
||||
int NetPlay = 2;
|
||||
@ -258,7 +260,6 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
|
||||
// SendCommand
|
||||
void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
|
||||
{
|
||||
Common::PluginPAD* pad = CPluginManager::GetInstance().GetPad();
|
||||
UCommand command(_Cmd);
|
||||
|
||||
switch (command.Command)
|
||||
@ -280,8 +281,7 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
|
||||
#endif
|
||||
|
||||
if (numPAD < 4)
|
||||
if (pad->PAD_Rumble)
|
||||
pad->PAD_Rumble(numPAD, uType, uStrength);
|
||||
PAD_Rumble(numPAD, uType, uStrength);
|
||||
|
||||
if (!_Poll)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "../PluginManager.h"
|
||||
#include "SI_Device.h"
|
||||
#include "pluginspecs_pad.h"
|
||||
|
||||
|
||||
// standard gamecube controller
|
||||
@ -102,7 +103,7 @@ public:
|
||||
virtual int RunBuffer(u8* _pBuffer, int _iLength);
|
||||
|
||||
// Send and Receive pad input from network
|
||||
static int NetPlay_GetInput(u8 numPAD, SPADStatus, u32 *PADStatus);
|
||||
static int NetPlay_GetInput(u8 numPAD, SPADStatus status, u32 *PADStatus);
|
||||
static u8 NetPlay_GetPadNum(u8 numPAD);
|
||||
|
||||
// Return true on new data
|
||||
|
@ -250,7 +250,6 @@ void EndRecordingInput()
|
||||
// header.author;
|
||||
// header.videoPlugin;
|
||||
// header.audioPlugin;
|
||||
// header.padPlugin;
|
||||
|
||||
fwrite(&header, sizeof(DTMHeader), 1, g_recordfd);
|
||||
|
||||
|
@ -80,7 +80,6 @@ typedef struct {
|
||||
u8 videoPlugin[16]; // UTF-8 representation of the video plugin
|
||||
u8 audioPlugin[16]; // UTF-8 representation of the audio plugin
|
||||
u8 padPlugin[16]; // UTF-8 representation of the input plugin
|
||||
|
||||
|
||||
bool padding[102]; // Padding to align the header to 1024 bits
|
||||
|
||||
|
@ -70,7 +70,6 @@ CPluginManager::CPluginManager()
|
||||
// Set initial values to NULL.
|
||||
m_video = NULL;
|
||||
m_dsp = NULL;
|
||||
m_pad = NULL;
|
||||
m_wiimote = NULL;
|
||||
}
|
||||
|
||||
@ -82,12 +81,6 @@ CPluginManager::~CPluginManager()
|
||||
delete m_PluginGlobals;
|
||||
delete m_dsp;
|
||||
|
||||
if (m_pad)
|
||||
{
|
||||
delete m_pad;
|
||||
m_pad = NULL;
|
||||
}
|
||||
|
||||
if (m_wiimote)
|
||||
{
|
||||
m_wiimote->Shutdown();
|
||||
@ -124,18 +117,6 @@ bool CPluginManager::InitPlugins()
|
||||
return false;
|
||||
}
|
||||
|
||||
// Init pad
|
||||
// Check that the plugin has a name
|
||||
if (!m_params->m_strPadPlugin.empty())
|
||||
GetPad();
|
||||
|
||||
// Check that GetPad succeeded
|
||||
if (!m_pad)
|
||||
{
|
||||
PanicAlert("Can't init PAD Plugin");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Init wiimote
|
||||
if (m_params->bWii)
|
||||
{
|
||||
@ -156,12 +137,6 @@ bool CPluginManager::InitPlugins()
|
||||
// for an explanation about the current LoadLibrary() and FreeLibrary() behavior.
|
||||
void CPluginManager::ShutdownPlugins()
|
||||
{
|
||||
if (m_pad)
|
||||
{
|
||||
m_pad->Shutdown();
|
||||
FreePad();
|
||||
}
|
||||
|
||||
if (m_wiimote)
|
||||
{
|
||||
m_wiimote->Shutdown();
|
||||
@ -246,7 +221,7 @@ void CPluginManager::GetPluginInfo(CPluginInfo *&info, std::string Filename)
|
||||
void *CPluginManager::LoadPlugin(const char *_rFilename)
|
||||
{
|
||||
if (!File::Exists((File::GetPluginsDirectory() + _rFilename).c_str())) {
|
||||
PanicAlert("Error loading %s: can't find file", _rFilename);
|
||||
PanicAlert("Error loading plugin %s: can't find file. Please re-select your plugins.", _rFilename);
|
||||
return NULL;
|
||||
}
|
||||
/* Avoid calling LoadLibrary() again and instead point to the plugin info that we found when
|
||||
@ -271,10 +246,6 @@ void *CPluginManager::LoadPlugin(const char *_rFilename)
|
||||
plugin = new Common::PluginDSP(_rFilename);
|
||||
break;
|
||||
|
||||
case PLUGIN_TYPE_PAD:
|
||||
plugin = new Common::PluginPAD(_rFilename);
|
||||
break;
|
||||
|
||||
case PLUGIN_TYPE_WIIMOTE:
|
||||
plugin = new Common::PluginWiimote(_rFilename);
|
||||
break;
|
||||
@ -347,27 +318,11 @@ void CPluginManager::ScanForPlugins()
|
||||
|
||||
|
||||
/* Create or return the already created plugin pointers. This will be called
|
||||
often for the Pad and Wiimote from the SI_.cpp files. And often for the DSP
|
||||
from the DSP files.
|
||||
often for Wiimote. 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()
|
||||
{
|
||||
if (m_pad != NULL)
|
||||
{
|
||||
if (m_pad->GetFilename() == m_params->m_strPadPlugin)
|
||||
return m_pad;
|
||||
else
|
||||
FreePad();
|
||||
}
|
||||
|
||||
// Else load a new plugin
|
||||
m_pad = (Common::PluginPAD*)LoadPlugin(m_params->m_strPadPlugin.c_str());
|
||||
return m_pad;
|
||||
}
|
||||
|
||||
Common::PluginWiimote *CPluginManager::GetWiimote()
|
||||
{
|
||||
@ -435,12 +390,6 @@ void CPluginManager::FreeDSP()
|
||||
m_dsp = NULL;
|
||||
}
|
||||
|
||||
void CPluginManager::FreePad()
|
||||
{
|
||||
delete m_pad;
|
||||
m_pad = NULL;
|
||||
}
|
||||
|
||||
void CPluginManager::FreeWiimote()
|
||||
{
|
||||
delete m_wiimote;
|
||||
@ -451,11 +400,6 @@ void CPluginManager::EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
{
|
||||
GetVideo()->EmuStateChange(newState);
|
||||
GetDSP()->EmuStateChange(newState);
|
||||
//TODO: OpenConfig below only uses GetXxx(0) aswell
|
||||
// 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()->EmuStateChange(newState);
|
||||
GetWiimote()->EmuStateChange(newState);
|
||||
}
|
||||
|
||||
@ -481,9 +425,6 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename, PLUGIN_TY
|
||||
case PLUGIN_TYPE_DSP:
|
||||
GetDSP()->Config((HWND)_Parent);
|
||||
break;
|
||||
case PLUGIN_TYPE_PAD:
|
||||
GetPad()->Config((HWND)_Parent);
|
||||
break;
|
||||
case PLUGIN_TYPE_WIIMOTE:
|
||||
GetWiimote()->Config((HWND)_Parent);
|
||||
break;
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "Plugin.h"
|
||||
#include "PluginDSP.h"
|
||||
#include "PluginPAD.h"
|
||||
#include "PluginVideo.h"
|
||||
#include "PluginWiimote.h"
|
||||
#include "CoreParameter.h"
|
||||
@ -46,17 +45,16 @@ class CPluginManager
|
||||
{
|
||||
public:
|
||||
static CPluginManager& GetInstance() {return(*m_Instance);}
|
||||
|
||||
static void Init();
|
||||
static void Shutdown();
|
||||
|
||||
Common::PluginVideo *GetVideo();
|
||||
Common::PluginDSP *GetDSP();
|
||||
Common::PluginPAD *GetPad();
|
||||
Common::PluginWiimote *GetWiimote();
|
||||
|
||||
void FreeVideo();
|
||||
void FreeDSP();
|
||||
void FreePad();
|
||||
void FreeWiimote();
|
||||
|
||||
void EmuStateChange(PLUGIN_EMUSTATE newState);
|
||||
@ -77,7 +75,6 @@ private:
|
||||
PLUGIN_GLOBALS *m_PluginGlobals;
|
||||
Common::PluginVideo *m_video;
|
||||
Common::PluginDSP *m_dsp;
|
||||
Common::PluginPAD *m_pad;
|
||||
Common::PluginWiimote *m_wiimote;
|
||||
|
||||
SCoreStartupParameter * m_params;
|
||||
|
@ -15,8 +15,8 @@ files = ["ActionReplay.cpp",
|
||||
"MemTools.cpp",
|
||||
"PatchEngine.cpp",
|
||||
"PluginManager.cpp",
|
||||
"LuaInterface.cpp",
|
||||
"State.cpp",
|
||||
"LuaInterface.cpp",
|
||||
"State.cpp",1
|
||||
"Tracer.cpp",
|
||||
"VolumeHandler.cpp",
|
||||
"Boot/Boot.cpp",
|
||||
@ -41,7 +41,8 @@ files = ["ActionReplay.cpp",
|
||||
"HW/EXI_DeviceMemoryCard.cpp",
|
||||
"HW/EXI_DeviceMic.cpp",
|
||||
"HW/EXI_DeviceEthernet.cpp",
|
||||
"HW/GPFifo.cpp",
|
||||
"HW/GCPad.cpp",
|
||||
"HW/GCPadEmu.cpp",
|
||||
"HW/HW.cpp",
|
||||
"HW/Memmap.cpp",
|
||||
"HW/MemmapFunctions.cpp",
|
||||
|
@ -92,7 +92,6 @@ void DoState(PointerWrap &p)
|
||||
CPluginManager &pm = CPluginManager::GetInstance();
|
||||
pm.GetVideo()->DoState(p.GetPPtr(), p.GetMode());
|
||||
pm.GetDSP()->DoState(p.GetPPtr(), p.GetMode());
|
||||
pm.GetPad()->DoState(p.GetPPtr(), p.GetMode());
|
||||
if (Core::g_CoreStartupParameter.bWii)
|
||||
pm.GetWiimote()->DoState(p.GetPPtr(), p.GetMode());
|
||||
PowerPC::DoState(p);
|
||||
|
@ -90,11 +90,11 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
AdditionalDependencies="SDL.lib xinput.lib Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile="../../../Binary/Win32/Dolphin.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\win32;..\..\..\Externals\wxWidgets\lib\vc_lib\Win32;../../../Externals/OpenAL/Win32/"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
@ -207,11 +207,11 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib"
|
||||
AdditionalDependencies="SDL.lib xinput.lib Iphlpapi.lib comctl32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib"
|
||||
OutputFile="../../../Binary/x64/Dolphin.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\x64;..\..\..\Externals\wxWidgets\lib\vc_lib\x64;../../../Externals/OpenAL/Win64/"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
@ -320,11 +320,11 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/TLBID:1"
|
||||
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
AdditionalDependencies="SDL.lib xinput.lib Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile="../../../Binary/Win32/DolphinD.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\win32;..\..\..\Externals\wxWidgets\lib\vc_lib\Win32;../../../Externals/OpenAL/Win32/"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
|
||||
@ -431,11 +431,11 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/TLBID:1"
|
||||
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib"
|
||||
AdditionalDependencies="SDL.lib xinput.lib Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib"
|
||||
OutputFile="../../../Binary/x64/DolphinD.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="$(SolutionDir)\$(ConfigurationName)\$(PlatformName);..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)"
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\x64;..\..\..\Externals\wxWidgets\lib\vc_lib\x64;../../../Externals/OpenAL/Win64/"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
|
||||
@ -545,11 +545,11 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/NODEFAULTLIB:msvcrt.lib
/NODEFAULTLIB:libcmtd.lib"
|
||||
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
AdditionalDependencies="SDL.lib xinput.lib Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile="../../../Binary/Win32/DolphinDF.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(SolutionDir)\Release\$(PlatformName)";"..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)""
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\win32;..\..\..\Externals\wxWidgets\lib\vc_lib\Win32;../../../Externals/OpenAL/Win32/"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
|
||||
@ -658,11 +658,11 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
AdditionalDependencies="SDL.lib xinput.lib Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
|
||||
OutputFile="../../../Binary/x64/DolphinDF.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""$(SolutionDir)\Release\$(PlatformName)";"..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)""
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\x64;..\..\..\Externals\wxWidgets\lib\vc_lib\x64;../../../Externals/OpenAL/Win64/"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
|
||||
|
@ -122,9 +122,6 @@ EVT_BUTTON(ID_GRAPHIC_CONFIG, CConfigMain::OnConfig)
|
||||
EVT_CHOICE(ID_DSP_CB, CConfigMain::OnSelectionChanged)
|
||||
EVT_BUTTON(ID_DSP_CONFIG, CConfigMain::OnConfig)
|
||||
|
||||
EVT_CHOICE(ID_PAD_CB, CConfigMain::OnSelectionChanged)
|
||||
EVT_BUTTON(ID_PAD_CONFIG, CConfigMain::OnConfig)
|
||||
|
||||
EVT_CHOICE(ID_WIIMOTE_CB, CConfigMain::OnSelectionChanged)
|
||||
EVT_BUTTON(ID_WIIMOTE_CONFIG, CConfigMain::OnConfig)
|
||||
|
||||
@ -191,7 +188,6 @@ void CConfigMain::UpdateGUI()
|
||||
// Disable stuff on PluginsPage
|
||||
GraphicSelection->Disable();
|
||||
DSPSelection->Disable();
|
||||
PADSelection->Disable();
|
||||
WiimoteSelection->Disable();
|
||||
}
|
||||
}
|
||||
@ -319,7 +315,6 @@ void CConfigMain::InitializeGUIValues()
|
||||
// Plugins
|
||||
FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
|
||||
FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
|
||||
FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
|
||||
}
|
||||
|
||||
@ -727,10 +722,6 @@ void CConfigMain::CreateGUIControls()
|
||||
DSPSelection = new wxChoice(PluginsPage, ID_DSP_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
DSPConfig = new wxButton(PluginsPage, ID_DSP_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
sbPadPlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginsPage, wxT("Gamecube Pad"));
|
||||
PADSelection = new wxChoice(PluginsPage, ID_PAD_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
PADConfig = new wxButton(PluginsPage, ID_PAD_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
sbWiimotePlugin = new wxStaticBoxSizer(wxHORIZONTAL, PluginsPage, wxT("Wiimote"));
|
||||
WiimoteSelection = new wxChoice(PluginsPage, ID_WIIMOTE_CB, wxDefaultPosition, wxDefaultSize, NULL, 0, wxDefaultValidator);
|
||||
WiimoteConfig = new wxButton(PluginsPage, ID_WIIMOTE_CONFIG, wxT("Config..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
@ -742,9 +733,6 @@ void CConfigMain::CreateGUIControls()
|
||||
sbDSPPlugin->Add(DSPSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbDSPPlugin->Add(DSPConfig, 0, wxALL, 5);
|
||||
|
||||
sbPadPlugin->Add(PADSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbPadPlugin->Add(PADConfig, 0, wxALL, 5);
|
||||
|
||||
sbWiimotePlugin->Add(WiimoteSelection, 1, wxEXPAND|wxALL, 5);
|
||||
sbWiimotePlugin->Add(WiimoteConfig, 0, wxALL, 5);
|
||||
|
||||
@ -752,14 +740,11 @@ void CConfigMain::CreateGUIControls()
|
||||
sPluginsPage = new wxBoxSizer(wxVERTICAL);
|
||||
sPluginsPage->Add(sbGraphicsPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
sPluginsPage->Add(sbDSPPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
sPluginsPage->Add(sbPadPlugin, 0, wxEXPAND|wxALL, 5);
|
||||
sPluginsPage->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
|
||||
|
||||
PluginsPage->SetSizer(sPluginsPage);
|
||||
sPluginsPage->Layout();
|
||||
|
||||
|
||||
|
||||
m_Ok = new wxButton(this, wxID_OK);
|
||||
|
||||
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
@ -1142,7 +1127,6 @@ void CConfigMain::OnSelectionChanged(wxCommandEvent& WXUNUSED (event))
|
||||
// Update plugin filenames
|
||||
GetFilename(GraphicSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
|
||||
GetFilename(DSPSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
|
||||
GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
|
||||
GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
|
||||
}
|
||||
|
||||
@ -1156,9 +1140,6 @@ void CConfigMain::OnConfig(wxCommandEvent& event)
|
||||
case ID_DSP_CONFIG:
|
||||
CallConfig(DSPSelection);
|
||||
break;
|
||||
case ID_PAD_CONFIG:
|
||||
CallConfig(PADSelection);
|
||||
break;
|
||||
case ID_WIIMOTE_CONFIG:
|
||||
CallConfig(WiimoteSelection);
|
||||
break;
|
||||
|
@ -139,7 +139,7 @@ private:
|
||||
|
||||
|
||||
wxBoxSizer* sPluginsPage; // Plugins settings
|
||||
wxStaticBoxSizer* sbGraphicsPlugin, *sbDSPPlugin, *sbPadPlugin, *sbWiimotePlugin; // Graphics, DSP, Pad and Wiimote sections
|
||||
wxStaticBoxSizer* sbGraphicsPlugin, *sbDSPPlugin, *sbWiimotePlugin; // Graphics, DSP, Wiimote sections
|
||||
|
||||
// Graphics
|
||||
wxChoice* GraphicSelection;
|
||||
@ -149,15 +149,10 @@ private:
|
||||
wxChoice* DSPSelection;
|
||||
wxButton* DSPConfig;
|
||||
|
||||
// Pad
|
||||
wxChoice* PADSelection;
|
||||
wxButton* PADConfig;
|
||||
|
||||
// Wiimote
|
||||
wxChoice* WiimoteSelection;
|
||||
wxButton* WiimoteConfig;
|
||||
|
||||
|
||||
wxButton* m_Ok;
|
||||
|
||||
FILE* pStream;
|
||||
@ -266,11 +261,6 @@ private:
|
||||
ID_DSP_CONFIG,
|
||||
ID_DSP_ABOUT,
|
||||
|
||||
ID_PAD_TEXT,
|
||||
ID_PAD_CB,
|
||||
ID_PAD_CONFIG,
|
||||
ID_PAD_ABOUT,
|
||||
|
||||
ID_WIIMOTE_TEXT,
|
||||
ID_WIIMOTE_CB,
|
||||
ID_WIIMOTE_CONFIG,
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "ConfigManager.h" // Core
|
||||
#include "Core.h"
|
||||
#include "HW/DVDInterface.h"
|
||||
#include "HW/GCPad.h"
|
||||
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
||||
#include "State.h"
|
||||
#include "VolumeHandler.h"
|
||||
@ -882,7 +883,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
#endif
|
||||
|
||||
// Send the keyboard status to the Input plugins
|
||||
CPluginManager::GetInstance().GetPad()->PAD_Input(event.GetKeyCode(), 1); // 1 = Down
|
||||
PAD_Input(event.GetKeyCode(), 1); // 1 = Down
|
||||
CPluginManager::GetInstance().GetWiimote()->Wiimote_Input(event.GetKeyCode(), 1); // 1 = Down
|
||||
}
|
||||
else
|
||||
@ -894,7 +895,7 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
|
||||
event.Skip();
|
||||
|
||||
if(Core::GetState() != Core::CORE_UNINITIALIZED) {
|
||||
CPluginManager::GetInstance().GetPad()->PAD_Input(event.GetKeyCode(), 0); // 0 = Up
|
||||
PAD_Input(event.GetKeyCode(), 0); // 0 = Up
|
||||
CPluginManager::GetInstance().GetWiimote()->Wiimote_Input(event.GetKeyCode(), 0); // 0 = Up
|
||||
}
|
||||
}
|
||||
|
@ -56,11 +56,13 @@ Core::GetWindowHandle().
|
||||
#include "PowerPC/PowerPC.h"
|
||||
#include "HW/DVDInterface.h"
|
||||
#include "HW/ProcessorInterface.h"
|
||||
#include "HW/GCPad.h"
|
||||
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
|
||||
#include "State.h"
|
||||
#include "VolumeHandler.h"
|
||||
#include "NANDContentLoader.h"
|
||||
#include "WXInputBase.h"
|
||||
#include "../../InputUICommon/Src/ConfigDiag.h"
|
||||
|
||||
#include <wx/datetime.h> // wxWidgets
|
||||
|
||||
@ -942,12 +944,23 @@ void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
|
||||
|
||||
void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
GetHandle(),
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str(),
|
||||
PLUGIN_TYPE_PAD
|
||||
);
|
||||
InputPlugin *pad_plugin = PAD_GetPlugin();
|
||||
bool was_init = false;
|
||||
if ( pad_plugin->controller_interface.IsInit() ) // check if game is running
|
||||
was_init = true;
|
||||
else
|
||||
{
|
||||
GCPad_Init(GetHandle());
|
||||
}
|
||||
InputConfigDialog* m_ConfigFrame = new InputConfigDialog(this, *pad_plugin, "GCPadNew", was_init );
|
||||
m_ConfigFrame->ShowModal();
|
||||
m_ConfigFrame->Destroy();
|
||||
if ( !was_init ) // if game is running
|
||||
{
|
||||
GCPad_Deinit();
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
CPluginManager::GetInstance().OpenConfig(
|
||||
|
@ -95,13 +95,11 @@ bool DolphinApp::OnInit()
|
||||
bool LoadElf = false;
|
||||
bool selectVideoPlugin = false;
|
||||
bool selectAudioPlugin = false;
|
||||
bool selectPadPlugin = false;
|
||||
bool selectWiimotePlugin = false;
|
||||
|
||||
wxString ElfFile;
|
||||
wxString videoPluginFilename;
|
||||
wxString audioPluginFilename;
|
||||
wxString padPluginFilename;
|
||||
wxString wiimotePluginFilename;
|
||||
|
||||
#if wxUSE_CMDLINE_PARSER // Parse command lines
|
||||
@ -201,12 +199,10 @@ bool DolphinApp::OnInit()
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
selectVideoPlugin = parser.Found("video_plugin", &videoPluginFilename);
|
||||
selectAudioPlugin = parser.Found("audio_plugin", &audioPluginFilename);
|
||||
selectPadPlugin = parser.Found("pad_plugin", &padPluginFilename);
|
||||
selectWiimotePlugin = parser.Found("wiimote_plugin", &wiimotePluginFilename);
|
||||
#else
|
||||
selectVideoPlugin = parser.Found(wxT("video_plugin"), &videoPluginFilename);
|
||||
selectAudioPlugin = parser.Found(wxT("audio_plugin"), &audioPluginFilename);
|
||||
selectPadPlugin = parser.Found(_T("pad_plugin"), &padPluginFilename);
|
||||
selectWiimotePlugin = parser.Found(wxT("wiimote_plugin"), &wiimotePluginFilename);
|
||||
#endif
|
||||
#endif // wxUSE_CMDLINE_PARSER
|
||||
@ -353,10 +349,6 @@ bool DolphinApp::OnInit()
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin =
|
||||
std::string(audioPluginFilename.mb_str());
|
||||
|
||||
if (selectPadPlugin && padPluginFilename != wxEmptyString)
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin =
|
||||
std::string(padPluginFilename.mb_str());
|
||||
|
||||
if (selectWiimotePlugin && wiimotePluginFilename != wxEmptyString)
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin =
|
||||
std::string(wiimotePluginFilename.mb_str());
|
||||
|
Reference in New Issue
Block a user