diff options
| author | hrydgard <hrydgard@gmail.com> | 2010-06-13 09:26:00 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2010-06-13 09:26:00 +0000 |
| commit | 7c47cd2ae585cbda208c4796b5e1acc1cdba7c7e (patch) | |
| tree | 8db99cae23c0a4aad3eb29a28f732f61d2f59ba9 /Source/Core | |
| parent | 8cae2fee56c56fdd87c8b3c11aa6614c6aec7651 (diff) | |
Rename pluginspecs_pad.h to GCPadStatus.h, and move it into InputCommon.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5671 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Common.vcproj | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/GCPad.cpp | 22 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/SI_DeviceGCController.h | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/OnFrame.h | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Frame.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/NetPlay.h | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/NetWindow.h | 1 | ||||
| -rw-r--r-- | Source/Core/InputCommon/InputCommon.vcproj | 4 | ||||
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerEmu.h | 12 | ||||
| -rw-r--r-- | Source/Core/InputCommon/Src/GCPadStatus.h | 39 |
11 files changed, 58 insertions, 40 deletions
diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj index bed1f25dbb..ab6088be32 100644 --- a/Source/Core/Common/Common.vcproj +++ b/Source/Core/Common/Common.vcproj @@ -507,10 +507,6 @@ > </File> <File - RelativePath="..\..\PluginSpecs\pluginspecs_pad.h" - > - </File> - <File RelativePath="..\..\PluginSpecs\pluginspecs_video.h" > </File> diff --git a/Source/Core/Core/Src/HW/GCPad.cpp b/Source/Core/Core/Src/HW/GCPad.cpp index c17fb37517..a2156bd629 100644 --- a/Source/Core/Core/Src/HW/GCPad.cpp +++ b/Source/Core/Core/Src/HW/GCPad.cpp @@ -16,7 +16,7 @@ // http://code.google.com/p/dolphin-emu/ #include "Common.h" -#include "pluginspecs_pad.h" +#include "GCPadStatus.h" #include "ControllerInterface/ControllerInterface.h" #include "GCPadEmu.h" @@ -31,7 +31,6 @@ InputPlugin *PAD_GetPlugin() { 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 @@ -84,14 +83,6 @@ void GCPad_Init( void* const hwnd ) } } -// 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) ); @@ -128,17 +119,6 @@ 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) -{ - // nofin -} - -// __________________________________________________________________________________________________ // Function: PAD_Rumble // Purpose: Pad rumble! // input: PAD number, Command type (Stop=0, Rumble=1, Stop Hard=2) and strength of Rumble diff --git a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp index c9ea0f3b5f..cb8d5706ec 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp @@ -15,12 +15,12 @@ // 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 "GCPadStatus.h" #include "GCPad.h" #include "../PluginManager.h" // for pad state diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.h b/Source/Core/Core/Src/HW/SI_DeviceGCController.h index 2a2db1f6f5..c4ad8196b2 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGCController.h +++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.h @@ -20,7 +20,7 @@ #include "../PluginManager.h" #include "SI_Device.h" -#include "pluginspecs_pad.h" +#include "GCPadStatus.h" // standard gamecube controller diff --git a/Source/Core/Core/Src/OnFrame.h b/Source/Core/Core/Src/OnFrame.h index 4b6da0859e..2f1c2c3b02 100644 --- a/Source/Core/Core/Src/OnFrame.h +++ b/Source/Core/Core/Src/OnFrame.h @@ -19,7 +19,7 @@ #define __FRAME_H #include "Common.h" -#include "pluginspecs_pad.h" +#include "GCPadStatus.h" #include <string> diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 5110fa2518..582e40640b 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -848,12 +848,14 @@ void CFrame::OnKeyDown(wxKeyEvent& event) State_UndoSaveState(); else if (event.GetModifiers() == wxMOD_SHIFT) State_UndoLoadState(); - else event.Skip(); + else + event.Skip(); } // screenshot hotkeys else if (event.GetKeyCode() == WXK_F9 && event.GetModifiers() == wxMOD_NONE) Core::ScreenShot(); - else event.Skip(); + else + event.Skip(); // Actually perform the wiimote connection or disconnection if (WiimoteId >= 0) @@ -883,7 +885,6 @@ void CFrame::OnKeyDown(wxKeyEvent& event) #endif // Send the keyboard status to the Input plugins - PAD_Input(event.GetKeyCode(), 1); // 1 = Down CPluginManager::GetInstance().GetWiimote()->Wiimote_Input(event.GetKeyCode(), 1); // 1 = Down } else @@ -895,7 +896,6 @@ void CFrame::OnKeyUp(wxKeyEvent& event) event.Skip(); if(Core::GetState() != Core::CORE_UNINITIALIZED) { - PAD_Input(event.GetKeyCode(), 0); // 0 = Up CPluginManager::GetInstance().GetWiimote()->Wiimote_Input(event.GetKeyCode(), 0); // 0 = Up } } diff --git a/Source/Core/DolphinWX/Src/NetPlay.h b/Source/Core/DolphinWX/Src/NetPlay.h index 0da13d92b0..89f5ab3066 100644 --- a/Source/Core/DolphinWX/Src/NetPlay.h +++ b/Source/Core/DolphinWX/Src/NetPlay.h @@ -11,7 +11,7 @@ #define _WINSOCK2API_ #include <SFML/Network.hpp> -#include "pluginspecs_pad.h" +#include "GCPadStatus.h" #include "svnrev.h" //#include <wx/wx.h> diff --git a/Source/Core/DolphinWX/Src/NetWindow.h b/Source/Core/DolphinWX/Src/NetWindow.h index fb6306a994..a5d3073aaa 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.h +++ b/Source/Core/DolphinWX/Src/NetWindow.h @@ -41,7 +41,6 @@ //#include "Common.h" //#include "NetStructs.h" //#include "Core.h" -//#include "pluginspecs_pad.h" //#include "HW/SI.h" //#include "HW/SI_Device.h" //#include "HW/SI_DeviceGCController.h" diff --git a/Source/Core/InputCommon/InputCommon.vcproj b/Source/Core/InputCommon/InputCommon.vcproj index 6c0f8ea4e8..7612b3fd06 100644 --- a/Source/Core/InputCommon/InputCommon.vcproj +++ b/Source/Core/InputCommon/InputCommon.vcproj @@ -497,6 +497,10 @@ > </File> <File + RelativePath=".\Src\GCPadStatus.h" + > + </File> + <File RelativePath=".\Src\InputCommon.h" > </File> diff --git a/Source/Core/InputCommon/Src/ControllerEmu.h b/Source/Core/InputCommon/Src/ControllerEmu.h index 90170c21cd..dbe2ec3491 100644 --- a/Source/Core/InputCommon/Src/ControllerEmu.h +++ b/Source/Core/InputCommon/Src/ControllerEmu.h @@ -21,17 +21,17 @@ // windows crap #define NOMINMAX -#include "pluginspecs_pad.h" +#include <cmath> +#include <vector> +#include <string> +#include <algorithm> + +#include "GCPadStatus.h" #include "pluginspecs_wiimote.h" -#include <math.h> #include "ControllerInterface/ControllerInterface.h" #include "IniFile.h" -#include <vector> -#include <string> -#include <algorithm> - #define sign(x) ((x)?(x)<0?-1:1:0) enum diff --git a/Source/Core/InputCommon/Src/GCPadStatus.h b/Source/Core/InputCommon/Src/GCPadStatus.h new file mode 100644 index 0000000000..138a79e1ba --- /dev/null +++ b/Source/Core/InputCommon/Src/GCPadStatus.h @@ -0,0 +1,39 @@ +#ifndef _GCPAD_H_INCLUDED__ +#define _GCPAD_H_INCLUDED__ + +#define PAD_ERR_NONE 0 +#define PAD_ERR_NO_CONTROLLER -1 +#define PAD_ERR_NOT_READY -2 +#define PAD_ERR_TRANSFER -3 + +#define PAD_USE_ORIGIN 0x0080 + +#define PAD_BUTTON_LEFT 0x0001 +#define PAD_BUTTON_RIGHT 0x0002 +#define PAD_BUTTON_DOWN 0x0004 +#define PAD_BUTTON_UP 0x0008 +#define PAD_TRIGGER_Z 0x0010 +#define PAD_TRIGGER_R 0x0020 +#define PAD_TRIGGER_L 0x0040 +#define PAD_BUTTON_A 0x0100 +#define PAD_BUTTON_B 0x0200 +#define PAD_BUTTON_X 0x0400 +#define PAD_BUTTON_Y 0x0800 +#define PAD_BUTTON_START 0x1000 + +typedef struct +{ + unsigned short button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits + unsigned char stickX; // 0 <= stickX <= 255 + unsigned char stickY; // 0 <= stickY <= 255 + unsigned char substickX; // 0 <= substickX <= 255 + unsigned char substickY; // 0 <= substickY <= 255 + unsigned char triggerLeft; // 0 <= triggerLeft <= 255 + unsigned char triggerRight; // 0 <= triggerRight <= 255 + unsigned char analogA; // 0 <= analogA <= 255 + unsigned char analogB; // 0 <= analogB <= 255 + bool MicButton; // HAX + signed char err; // one of PAD_ERR_* number +} SPADStatus; + +#endif |
