addded the setdllglobals function to the specs
(no failure maybe warning on symbols git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1825 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
c4993bf036
commit
3a9eeeb144
|
@ -31,9 +31,10 @@ namespace Common
|
|||
{
|
||||
DynamicLibrary CPlugin::m_hInstLib;
|
||||
|
||||
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
|
||||
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
|
||||
void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent, bool Show) = 0;
|
||||
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
|
||||
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
|
||||
void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent, bool Show) = 0;
|
||||
void(__cdecl * CPlugin::m_SetDllGlobals) (PLUGIN_GLOBALS* _PluginGlobals) = 0;
|
||||
|
||||
void
|
||||
CPlugin::Release(void)
|
||||
|
@ -41,7 +42,8 @@ CPlugin::Release(void)
|
|||
m_GetDllInfo = 0;
|
||||
m_DllConfig = 0;
|
||||
m_DllDebugger = 0;
|
||||
|
||||
m_SetDllGlobals = 0;
|
||||
|
||||
m_hInstLib.Unload();
|
||||
}
|
||||
|
||||
|
@ -53,6 +55,7 @@ CPlugin::Load(const char* _szName)
|
|||
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*)) m_hInstLib.Get("GetDllInfo");
|
||||
m_DllConfig = (void (__cdecl*)(HWND)) m_hInstLib.Get("DllConfig");
|
||||
m_DllDebugger = (void (__cdecl*)(HWND, bool)) m_hInstLib.Get("DllDebugger");
|
||||
m_SetDllGlobals = (void (__cdecl*)(PLUGIN_GLOBALS*)) m_hInstLib.Get("SetDllGlobals");
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
@ -87,4 +90,13 @@ void CPlugin::Debug(HWND _hwnd, bool Show)
|
|||
m_DllDebugger(_hwnd, Show);
|
||||
}
|
||||
}
|
||||
|
||||
void CPlugin::SetGlobals(PLUGIN_GLOBALS& _pluginGlobals)
|
||||
{
|
||||
if (m_SetDllGlobals != 0)
|
||||
{
|
||||
m_SetDllGlobals(&_pluginGlobals);
|
||||
}
|
||||
}
|
||||
|
||||
} // end of namespace Common
|
||||
|
|
|
@ -32,6 +32,7 @@ class CPlugin
|
|||
static bool Load(const char* _szName);
|
||||
|
||||
static bool GetInfo(PLUGIN_INFO& _pluginInfo);
|
||||
static void SetGlobals(PLUGIN_GLOBALS& _PluginGlobals);
|
||||
|
||||
static void Config(HWND _hwnd);
|
||||
static void About(HWND _hwnd);
|
||||
|
@ -45,6 +46,8 @@ class CPlugin
|
|||
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
|
||||
static void (__cdecl * m_DllConfig)(HWND _hParent);
|
||||
static void (__cdecl * m_DllDebugger)(HWND _hParent, bool Show);
|
||||
static void (__cdecl * m_SetDllGlobals)(PLUGIN_GLOBALS* _PluginGlobals);
|
||||
|
||||
};
|
||||
} // end of namespace Common
|
||||
|
||||
|
|
|
@ -23,19 +23,20 @@ namespace PluginDSP
|
|||
{
|
||||
|
||||
// Function Pointer
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TSetDllGlobals SetDllGlobals = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TDllDebugger DllDebugger = 0;
|
||||
TDSP_Initialize DSP_Initialize = 0;
|
||||
TDSP_Shutdown DSP_Shutdown = 0;
|
||||
TDSP_Initialize DSP_Initialize = 0;
|
||||
TDSP_Shutdown DSP_Shutdown = 0;
|
||||
TDSP_ReadMailBox DSP_ReadMailboxHigh = 0;
|
||||
TDSP_ReadMailBox DSP_ReadMailboxLow = 0;
|
||||
TDSP_WriteMailBox DSP_WriteMailboxHigh = 0;
|
||||
TDSP_WriteMailBox DSP_WriteMailboxHigh = 0;
|
||||
TDSP_WriteMailBox DSP_WriteMailboxLow = 0;
|
||||
TDSP_ReadControlRegister DSP_ReadControlRegister = 0;
|
||||
TDSP_WriteControlRegister DSP_WriteControlRegister = 0;
|
||||
TDSP_Update DSP_Update = 0;
|
||||
TDSP_SendAIBuffer DSP_SendAIBuffer = 0;
|
||||
TDSP_Update DSP_Update = 0;
|
||||
TDSP_SendAIBuffer DSP_SendAIBuffer = 0;
|
||||
TDSP_DoState DSP_DoState = 0;
|
||||
|
||||
//! Library Instance
|
||||
|
@ -57,6 +58,7 @@ void UnloadPlugin()
|
|||
|
||||
// Set Functions to NULL
|
||||
GetDllInfo = 0;
|
||||
SetDllGlobals = 0;
|
||||
DllConfig = 0;
|
||||
DllDebugger = 0;
|
||||
DSP_Initialize = 0;
|
||||
|
@ -79,6 +81,7 @@ bool LoadPlugin(const char *_Filename)
|
|||
if (ret == 1)
|
||||
{
|
||||
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
|
||||
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
DllDebugger = reinterpret_cast<TDllDebugger> (plugin.Get("DllDebugger"));
|
||||
DSP_Initialize = reinterpret_cast<TDSP_Initialize> (plugin.Get("DSP_Initialize"));
|
||||
|
@ -104,7 +107,7 @@ bool LoadPlugin(const char *_Filename)
|
|||
(DSP_WriteControlRegister != 0) &&
|
||||
(DSP_Update != 0) &&
|
||||
(DSP_SendAIBuffer != 0) &&
|
||||
(DSP_DoState != 0))
|
||||
(DSP_DoState != 0))
|
||||
{
|
||||
//PanicAlert("return true: %i", ret);
|
||||
return true;
|
||||
|
|
|
@ -28,6 +28,7 @@ void UnloadPlugin();
|
|||
|
||||
// Function Types
|
||||
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl* TDllConfig)(HWND);
|
||||
typedef void (__cdecl* TDllDebugger)(HWND, bool);
|
||||
typedef void (__cdecl* TDSP_Initialize)(DSPInitialize);
|
||||
|
@ -41,19 +42,20 @@ typedef void (__cdecl* TDSP_SendAIBuffer)(unsigned int address, int sample_rate)
|
|||
typedef void (__cdecl* TDSP_DoState)(unsigned char **ptr, int mode);
|
||||
|
||||
// Function Pointers
|
||||
extern TGetDllInfo GetDllInfo;
|
||||
extern TDllConfig DllConfig;
|
||||
extern TDllDebugger DllDebugger;
|
||||
extern TDSP_Initialize DSP_Initialize;
|
||||
extern TDSP_Shutdown DSP_Shutdown;
|
||||
extern TDSP_ReadMailBox DSP_ReadMailboxHigh;
|
||||
extern TDSP_ReadMailBox DSP_ReadMailboxLow;
|
||||
extern TDSP_WriteMailBox DSP_WriteMailboxHigh;
|
||||
extern TGetDllInfo GetDllInfo;
|
||||
extern TSetDllGlobals SetDllGlobals;
|
||||
extern TDllConfig DllConfig;
|
||||
extern TDllDebugger DllDebugger;
|
||||
extern TDSP_Initialize DSP_Initialize;
|
||||
extern TDSP_Shutdown DSP_Shutdown;
|
||||
extern TDSP_ReadMailBox DSP_ReadMailboxHigh;
|
||||
extern TDSP_ReadMailBox DSP_ReadMailboxLow;
|
||||
extern TDSP_WriteMailBox DSP_WriteMailboxHigh;
|
||||
extern TDSP_WriteMailBox DSP_WriteMailboxLow;
|
||||
extern TDSP_ReadControlRegister DSP_ReadControlRegister;
|
||||
extern TDSP_WriteControlRegister DSP_WriteControlRegister;
|
||||
extern TDSP_Update DSP_Update;
|
||||
extern TDSP_SendAIBuffer DSP_SendAIBuffer;
|
||||
extern TDSP_SendAIBuffer DSP_SendAIBuffer;
|
||||
extern TDSP_DoState DSP_DoState;
|
||||
|
||||
} // end of namespace PluginDSP
|
||||
|
|
|
@ -22,13 +22,14 @@ namespace PluginPAD
|
|||
{
|
||||
|
||||
// Function Pointers
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TPAD_Shutdown PAD_Shutdown = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TPAD_Initialize PAD_Initialize = 0;
|
||||
TPAD_GetStatus PAD_GetStatus = 0;
|
||||
TPAD_Input PAD_Input = 0;
|
||||
TPAD_Rumble PAD_Rumble = 0;
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TSetDllGlobals SetDllGlobals = 0;
|
||||
TPAD_Shutdown PAD_Shutdown = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TPAD_Initialize PAD_Initialize = 0;
|
||||
TPAD_GetStatus PAD_GetStatus = 0;
|
||||
TPAD_Input PAD_Input = 0;
|
||||
TPAD_Rumble PAD_Rumble = 0;
|
||||
TPAD_GetAttachedPads PAD_GetAttachedPads = 0;
|
||||
|
||||
// Library Instance
|
||||
|
@ -44,6 +45,7 @@ void UnloadPlugin()
|
|||
plugin.Unload();
|
||||
// Set Functions to 0
|
||||
GetDllInfo = 0;
|
||||
SetDllGlobals = 0;
|
||||
PAD_Shutdown = 0;
|
||||
DllConfig = 0;
|
||||
PAD_Initialize = 0;
|
||||
|
@ -57,11 +59,12 @@ bool LoadPlugin(const char *_Filename)
|
|||
if (plugin.Load(_Filename))
|
||||
{
|
||||
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
|
||||
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
PAD_Initialize = reinterpret_cast<TPAD_Initialize> (plugin.Get("PAD_Initialize"));
|
||||
PAD_Shutdown = reinterpret_cast<TPAD_Shutdown> (plugin.Get("PAD_Shutdown"));
|
||||
PAD_GetStatus = reinterpret_cast<TPAD_GetStatus> (plugin.Get("PAD_GetStatus"));
|
||||
PAD_Input = reinterpret_cast<TPAD_Input> (plugin.Get("PAD_Input"));
|
||||
PAD_Input = reinterpret_cast<TPAD_Input> (plugin.Get("PAD_Input"));
|
||||
PAD_Rumble = reinterpret_cast<TPAD_Rumble> (plugin.Get("PAD_Rumble"));
|
||||
PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>(plugin.Get("PAD_GetAttachedPads"));
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ void UnloadPlugin();
|
|||
|
||||
// Function Types
|
||||
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl* TDllConfig)(HWND);
|
||||
typedef void (__cdecl* TPAD_Initialize)(SPADInitialize);
|
||||
typedef void (__cdecl* TPAD_Shutdown)();
|
||||
|
@ -39,6 +40,7 @@ typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
|
|||
|
||||
// Function Pointers
|
||||
extern TGetDllInfo GetDllInfo;
|
||||
extern TSetDllGlobals SetDllGlobals;
|
||||
extern TPAD_Shutdown PAD_Shutdown;
|
||||
extern TDllConfig DllConfig;
|
||||
extern TPAD_Initialize PAD_Initialize;
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace PluginVideo
|
|||
|
||||
// Function Pointer
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TSetDllGlobals SetDllGlobals = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TDllDebugger DllDebugger = 0;
|
||||
TVideo_Initialize Video_Initialize = 0;
|
||||
|
@ -59,8 +60,9 @@ void UnloadPlugin()
|
|||
|
||||
// set Functions to 0
|
||||
GetDllInfo = 0;
|
||||
SetDllGlobals = 0;
|
||||
DllConfig = 0;
|
||||
DllDebugger = 0;
|
||||
DllDebugger = 0;
|
||||
Video_Initialize = 0;
|
||||
Video_Prepare = 0;
|
||||
Video_Shutdown = 0;
|
||||
|
@ -89,6 +91,7 @@ bool LoadPlugin(const char *_Filename)
|
|||
if (ret == 1)
|
||||
{
|
||||
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
|
||||
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
DllDebugger = reinterpret_cast<TDllDebugger> (plugin.Get("DllDebugger"));
|
||||
Video_Initialize = reinterpret_cast<TVideo_Initialize> (plugin.Get("Video_Initialize"));
|
||||
|
|
|
@ -32,6 +32,7 @@ void UnloadPlugin();
|
|||
|
||||
// Function Types
|
||||
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl* TDllConfig)(HWND);
|
||||
typedef void (__cdecl* TDllDebugger)(HWND, bool);
|
||||
typedef void (__cdecl* TVideo_Initialize)(SVideoInitialize*);
|
||||
|
@ -47,8 +48,9 @@ typedef void (__cdecl* TVideo_Stop)();
|
|||
|
||||
// Function Pointers
|
||||
extern TGetDllInfo GetDllInfo;
|
||||
extern TSetDllGlobals SetDllGlobals;
|
||||
extern TDllConfig DllConfig;
|
||||
extern TDllDebugger DllDebugger;
|
||||
extern TDllDebugger DllDebugger;
|
||||
extern TVideo_Initialize Video_Initialize;
|
||||
extern TVideo_Prepare Video_Prepare;
|
||||
extern TVideo_Shutdown Video_Shutdown;
|
||||
|
|
|
@ -23,15 +23,16 @@ namespace PluginWiimote
|
|||
{
|
||||
|
||||
// Function Pointer
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TWiimote_Initialize Wiimote_Initialize = 0;
|
||||
TWiimote_Shutdown Wiimote_Shutdown = 0;
|
||||
TWiimote_Output Wiimote_ControlChannel = 0;
|
||||
TWiimote_Input Wiimote_InterruptChannel = 0;
|
||||
TWiimote_Update Wiimote_Update = 0;
|
||||
TGetDllInfo GetDllInfo = 0;
|
||||
TSetDllGlobals SetDllGlobals = 0;
|
||||
TDllConfig DllConfig = 0;
|
||||
TWiimote_Initialize Wiimote_Initialize = 0;
|
||||
TWiimote_Shutdown Wiimote_Shutdown = 0;
|
||||
TWiimote_Output Wiimote_ControlChannel = 0;
|
||||
TWiimote_Input Wiimote_InterruptChannel = 0;
|
||||
TWiimote_Update Wiimote_Update = 0;
|
||||
TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers = 0;
|
||||
TWiimote_DoState Wiimote_DoState = 0;
|
||||
TWiimote_DoState Wiimote_DoState = 0;
|
||||
|
||||
//! Library Instance
|
||||
DynamicLibrary plugin;
|
||||
|
@ -47,6 +48,7 @@ namespace PluginWiimote
|
|||
|
||||
// Set Functions to NULL
|
||||
GetDllInfo = 0;
|
||||
SetDllGlobals = 0;
|
||||
DllConfig = 0;
|
||||
Wiimote_Initialize = 0;
|
||||
Wiimote_Shutdown = 0;
|
||||
|
@ -61,26 +63,18 @@ namespace PluginWiimote
|
|||
{
|
||||
if (plugin.Load(_Filename))
|
||||
{
|
||||
LOG(MASTER_LOG, "getting Wiimote Plugin function pointers...");
|
||||
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
Wiimote_Initialize = reinterpret_cast<TWiimote_Initialize> (plugin.Get("Wiimote_Initialize"));
|
||||
Wiimote_Shutdown = reinterpret_cast<TWiimote_Shutdown> (plugin.Get("Wiimote_Shutdown"));
|
||||
Wiimote_ControlChannel = reinterpret_cast<TWiimote_Output> (plugin.Get("Wiimote_ControlChannel"));
|
||||
Wiimote_InterruptChannel = reinterpret_cast<TWiimote_Input> (plugin.Get("Wiimote_InterruptChannel"));
|
||||
Wiimote_Update = reinterpret_cast<TWiimote_Update> (plugin.Get("Wiimote_Update"));
|
||||
GetDllInfo = reinterpret_cast<TGetDllInfo> (plugin.Get("GetDllInfo"));
|
||||
SetDllGlobals = reinterpret_cast<TSetDllGlobals> (plugin.Get("SetDllGlobals"));
|
||||
DllConfig = reinterpret_cast<TDllConfig> (plugin.Get("DllConfig"));
|
||||
Wiimote_Initialize = reinterpret_cast<TWiimote_Initialize> (plugin.Get("Wiimote_Initialize"));
|
||||
Wiimote_Shutdown = reinterpret_cast<TWiimote_Shutdown> (plugin.Get("Wiimote_Shutdown"));
|
||||
Wiimote_ControlChannel = reinterpret_cast<TWiimote_Output> (plugin.Get("Wiimote_ControlChannel"));
|
||||
Wiimote_InterruptChannel = reinterpret_cast<TWiimote_Input> (plugin.Get("Wiimote_InterruptChannel"));
|
||||
Wiimote_Update = reinterpret_cast<TWiimote_Update> (plugin.Get("Wiimote_Update"));
|
||||
Wiimote_GetAttachedControllers = reinterpret_cast<TWiimote_GetAttachedControllers> (plugin.Get("Wiimote_GetAttachedControllers"));
|
||||
Wiimote_DoState = reinterpret_cast<TWiimote_DoState> (plugin.Get("Wiimote_DoState"));
|
||||
Wiimote_DoState = reinterpret_cast<TWiimote_DoState> (plugin.Get("Wiimote_DoState"));
|
||||
|
||||
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "GetDllInfo", GetDllInfo);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "DllConfig", DllConfig);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_Initialize", Wiimote_Initialize);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_Shutdown", Wiimote_Shutdown);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_ControlChannel", Wiimote_ControlChannel);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_InterruptChannel", Wiimote_InterruptChannel);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_Update", Wiimote_Update);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_GetAttachedControllers", Wiimote_GetAttachedControllers);
|
||||
LOG(MASTER_LOG, "%s: 0x%p", "Wiimote_DoState", Wiimote_DoState);
|
||||
if ((GetDllInfo != 0) &&
|
||||
(Wiimote_Initialize != 0) &&
|
||||
(Wiimote_Shutdown != 0) &&
|
||||
|
|
|
@ -28,6 +28,7 @@ void UnloadPlugin();
|
|||
|
||||
// Function Types
|
||||
typedef void (__cdecl* TGetDllInfo)(PLUGIN_INFO*);
|
||||
typedef void (__cdecl* TSetDllGlobals)(PLUGIN_GLOBALS*);
|
||||
typedef void (__cdecl* TDllConfig)(HWND);
|
||||
typedef bool (__cdecl* TWiimote_Initialize)(SWiimoteInitialize);
|
||||
typedef void (__cdecl* TWiimote_Shutdown)();
|
||||
|
@ -38,15 +39,16 @@ typedef unsigned int (__cdecl* TWiimote_GetAttachedControllers)();
|
|||
typedef void (__cdecl* TWiimote_DoState)(void *ptr, int mode);
|
||||
|
||||
// Function Pointers
|
||||
extern TGetDllInfo GetDllInfo;
|
||||
extern TDllConfig DllConfig;
|
||||
extern TWiimote_Initialize Wiimote_Initialize;
|
||||
extern TWiimote_Shutdown Wiimote_Shutdown;
|
||||
extern TWiimote_Output Wiimote_ControlChannel;
|
||||
extern TWiimote_Input Wiimote_InterruptChannel;
|
||||
extern TWiimote_Update Wiimote_Update;
|
||||
extern TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers;
|
||||
extern TWiimote_DoState Wiimote_DoState;
|
||||
extern TGetDllInfo GetDllInfo;
|
||||
extern TSetDllGlobals SetDllGlobals;
|
||||
extern TDllConfig DllConfig;
|
||||
extern TWiimote_Initialize Wiimote_Initialize;
|
||||
extern TWiimote_Shutdown Wiimote_Shutdown;
|
||||
extern TWiimote_Output Wiimote_ControlChannel;
|
||||
extern TWiimote_Input Wiimote_InterruptChannel;
|
||||
extern TWiimote_Update Wiimote_Update;
|
||||
extern TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers;
|
||||
extern TWiimote_DoState Wiimote_DoState;
|
||||
|
||||
} // end of namespace PluginWiimote
|
||||
|
||||
|
|
Loading…
Reference in New Issue