mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
added support for multi-controller
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@41 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
90c8c2185d
commit
1b2d7ef56d
@ -46,7 +46,7 @@ namespace Memory
|
|||||||
|
|
||||||
// GLOABL DEFINES
|
// GLOABL DEFINES
|
||||||
|
|
||||||
#define NOCHECK
|
// #define NOCHECK
|
||||||
|
|
||||||
static const bool bFakeVMEM = false;
|
static const bool bFakeVMEM = false;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "CPU.h"
|
#include "CPU.h"
|
||||||
|
|
||||||
#include "../PowerPC/PowerPC.h"
|
#include "../PowerPC/PowerPC.h"
|
||||||
|
#include "../Plugins/Plugin_PAD.h"
|
||||||
|
|
||||||
namespace SerialInterface
|
namespace SerialInterface
|
||||||
{
|
{
|
||||||
@ -226,11 +227,14 @@ void Init()
|
|||||||
g_Channel[i].m_InLo.Hex = 0;
|
g_Channel[i].m_InLo.Hex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Channel[0].m_pDevice = new CSIDevice_GCController(0);
|
for (int i=0; i<4; i++)
|
||||||
g_Channel[1].m_pDevice = new CSIDevice_Dummy(1);//new CSIDevice_GCController(1);
|
{
|
||||||
g_Channel[2].m_pDevice = new CSIDevice_Dummy(2);//new CSIDevice_GCController(2);
|
if (PluginPAD::PAD_GetNumberOfPads() & (1<i))
|
||||||
g_Channel[3].m_pDevice = new CSIDevice_Dummy(3);//new CSIDevice_GCController(3);
|
g_Channel[i].m_pDevice = new CSIDevice_GCController(i);
|
||||||
|
else
|
||||||
|
g_Channel[i].m_pDevice = new CSIDevice_Dummy(i);
|
||||||
|
}
|
||||||
|
|
||||||
g_Poll.Hex = 0;
|
g_Poll.Hex = 0;
|
||||||
g_ComCSR.Hex = 0;
|
g_ComCSR.Hex = 0;
|
||||||
g_StatusReg.Hex = 0;
|
g_StatusReg.Hex = 0;
|
||||||
|
@ -29,6 +29,8 @@ typedef void (__cdecl* TPAD_Initialize)(SPADInitialize);
|
|||||||
typedef void (__cdecl* TPAD_Shutdown)();
|
typedef void (__cdecl* TPAD_Shutdown)();
|
||||||
typedef void (__cdecl* TPAD_GetStatus)(BYTE, SPADStatus*);
|
typedef void (__cdecl* TPAD_GetStatus)(BYTE, SPADStatus*);
|
||||||
typedef void (__cdecl* TPAD_Rumble)(BYTE, unsigned int, unsigned int);
|
typedef void (__cdecl* TPAD_Rumble)(BYTE, unsigned int, unsigned int);
|
||||||
|
typedef unsigned int (__cdecl* TPAD_GetNumberOfPads)();
|
||||||
|
|
||||||
|
|
||||||
//! Function Pointer
|
//! Function Pointer
|
||||||
TGetDllInfo g_GetDllInfo = 0;
|
TGetDllInfo g_GetDllInfo = 0;
|
||||||
@ -38,6 +40,7 @@ TDllConfig g_DllConfig = 0;
|
|||||||
TPAD_Initialize g_PAD_Initialize = 0;
|
TPAD_Initialize g_PAD_Initialize = 0;
|
||||||
TPAD_GetStatus g_PAD_GetStatus = 0;
|
TPAD_GetStatus g_PAD_GetStatus = 0;
|
||||||
TPAD_Rumble g_PAD_Rumble = 0;
|
TPAD_Rumble g_PAD_Rumble = 0;
|
||||||
|
TPAD_GetNumberOfPads g_PAD_GetNumberOfPads = 0;
|
||||||
|
|
||||||
//! Library Instance
|
//! Library Instance
|
||||||
DynamicLibrary plugin;
|
DynamicLibrary plugin;
|
||||||
@ -71,6 +74,7 @@ bool LoadPlugin(const char *_Filename)
|
|||||||
g_PAD_Shutdown = reinterpret_cast<TPAD_Shutdown> (plugin.Get("PAD_Shutdown"));
|
g_PAD_Shutdown = reinterpret_cast<TPAD_Shutdown> (plugin.Get("PAD_Shutdown"));
|
||||||
g_PAD_GetStatus = reinterpret_cast<TPAD_GetStatus> (plugin.Get("PAD_GetStatus"));
|
g_PAD_GetStatus = reinterpret_cast<TPAD_GetStatus> (plugin.Get("PAD_GetStatus"));
|
||||||
g_PAD_Rumble = reinterpret_cast<TPAD_Rumble> (plugin.Get("PAD_Rumble"));
|
g_PAD_Rumble = reinterpret_cast<TPAD_Rumble> (plugin.Get("PAD_Rumble"));
|
||||||
|
g_PAD_GetNumberOfPads = reinterpret_cast<TPAD_GetNumberOfPads>(plugin.Get("PAD_GetNumberOfPads"));
|
||||||
|
|
||||||
if ((g_GetDllInfo != 0) &&
|
if ((g_GetDllInfo != 0) &&
|
||||||
(g_DllAbout != 0) &&
|
(g_DllAbout != 0) &&
|
||||||
@ -132,4 +136,12 @@ void PAD_Rumble(BYTE _numPAD, unsigned int _iType, unsigned int _iStrength)
|
|||||||
g_PAD_Rumble(_numPAD, _iType, _iStrength);
|
g_PAD_Rumble(_numPAD, _iType, _iStrength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int PAD_GetNumberOfPads()
|
||||||
|
{
|
||||||
|
if (g_PAD_GetNumberOfPads)
|
||||||
|
return g_PAD_GetNumberOfPads();
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
} // end of namespace PluginPAD
|
} // end of namespace PluginPAD
|
||||||
|
@ -38,6 +38,7 @@ void PAD_Initialize(SPADInitialize _PADInitialize);
|
|||||||
void PAD_Shutdown();
|
void PAD_Shutdown();
|
||||||
void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus);
|
void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus);
|
||||||
void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength);
|
void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength);
|
||||||
|
unsigned int PAD_GetNumberOfPads();
|
||||||
unsigned int SaveLoadState(char* _ptr, BOOL save);
|
unsigned int SaveLoadState(char* _ptr, BOOL save);
|
||||||
|
|
||||||
} // end of namespace PluginPAD
|
} // end of namespace PluginPAD
|
||||||
|
@ -125,6 +125,14 @@ EXPORT void CALL PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus);
|
|||||||
//
|
//
|
||||||
EXPORT void CALL PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength);
|
EXPORT void CALL PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength);
|
||||||
|
|
||||||
|
// __________________________________________________________________________________________________
|
||||||
|
// Function: PAD_GetNumberOfPads
|
||||||
|
// Purpose: Get number of pads (it is flag eg: controller 1 & 4 -> 5)
|
||||||
|
// input: none
|
||||||
|
// output: number of pads
|
||||||
|
//
|
||||||
|
EXPORT unsigned int CALL PAD_GetNumberOfPads();
|
||||||
|
|
||||||
// __________________________________________________________________________________________________
|
// __________________________________________________________________________________________________
|
||||||
// Function: SaveLoadState
|
// Function: SaveLoadState
|
||||||
// Purpose: Saves/load state
|
// Purpose: Saves/load state
|
||||||
|
Loading…
Reference in New Issue
Block a user