renamed plugin function

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@44 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2008-07-21 19:18:21 +00:00
parent e01fb56153
commit c5ae27c247
4 changed files with 12 additions and 11 deletions

View File

@ -227,9 +227,10 @@ void Init()
g_Channel[i].m_InLo.Hex = 0;
}
unsigned int AttachedPasMask = PluginPAD::PAD_GetAttachedPads();
for (int i=0; i<4; i++)
{
if (PluginPAD::PAD_GetNumberOfPads() & (1<<i))
if (AttachedPasMask & (1 << i))
g_Channel[i].m_pDevice = new CSIDevice_GCController(i);
else
g_Channel[i].m_pDevice = new CSIDevice_Dummy(i);

View File

@ -29,7 +29,7 @@ typedef void (__cdecl* TPAD_Initialize)(SPADInitialize);
typedef void (__cdecl* TPAD_Shutdown)();
typedef void (__cdecl* TPAD_GetStatus)(BYTE, SPADStatus*);
typedef void (__cdecl* TPAD_Rumble)(BYTE, unsigned int, unsigned int);
typedef unsigned int (__cdecl* TPAD_GetNumberOfPads)();
typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
//! Function Pointer
@ -40,7 +40,7 @@ TDllConfig g_DllConfig = 0;
TPAD_Initialize g_PAD_Initialize = 0;
TPAD_GetStatus g_PAD_GetStatus = 0;
TPAD_Rumble g_PAD_Rumble = 0;
TPAD_GetNumberOfPads g_PAD_GetNumberOfPads = 0;
TPAD_GetAttachedPads g_PAD_GetAttachedPads = 0;
//! Library Instance
DynamicLibrary plugin;
@ -74,7 +74,7 @@ bool LoadPlugin(const char *_Filename)
g_PAD_Shutdown = reinterpret_cast<TPAD_Shutdown> (plugin.Get("PAD_Shutdown"));
g_PAD_GetStatus = reinterpret_cast<TPAD_GetStatus> (plugin.Get("PAD_GetStatus"));
g_PAD_Rumble = reinterpret_cast<TPAD_Rumble> (plugin.Get("PAD_Rumble"));
g_PAD_GetNumberOfPads = reinterpret_cast<TPAD_GetNumberOfPads>(plugin.Get("PAD_GetNumberOfPads"));
g_PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>(plugin.Get("PAD_GetAttachedPads"));
if ((g_GetDllInfo != 0) &&
(g_DllAbout != 0) &&
@ -136,10 +136,10 @@ void PAD_Rumble(BYTE _numPAD, unsigned int _iType, unsigned int _iStrength)
g_PAD_Rumble(_numPAD, _iType, _iStrength);
}
unsigned int PAD_GetNumberOfPads()
unsigned int PAD_GetAttachedPads()
{
if (g_PAD_GetNumberOfPads)
return g_PAD_GetNumberOfPads();
if (g_PAD_GetAttachedPads)
return g_PAD_GetAttachedPads();
return 1;
}

View File

@ -38,7 +38,7 @@ void PAD_Initialize(SPADInitialize _PADInitialize);
void PAD_Shutdown();
void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus);
void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength);
unsigned int PAD_GetNumberOfPads();
unsigned int PAD_GetAttachedPads();
unsigned int SaveLoadState(char* _ptr, BOOL save);
} // end of namespace PluginPAD

View File

@ -126,12 +126,12 @@ EXPORT void CALL PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus);
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)
// Function: PAD_GetAttachedPads
// Purpose: Get mask of attached pads (eg: controller 1 & 4 -> 0x9)
// input: none
// output: number of pads
//
EXPORT unsigned int CALL PAD_GetNumberOfPads();
EXPORT unsigned int CALL PAD_GetAttachedPads();
// __________________________________________________________________________________________________
// Function: SaveLoadState