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:
nakeee 2009-01-07 22:07:51 +00:00
parent c4993bf036
commit 3a9eeeb144
10 changed files with 92 additions and 66 deletions

View File

@ -34,6 +34,7 @@ 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_SetDllGlobals) (PLUGIN_GLOBALS* _PluginGlobals) = 0;
void
CPlugin::Release(void)
@ -41,6 +42,7 @@ 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

View File

@ -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

View File

@ -24,6 +24,7 @@ namespace PluginDSP
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TDllConfig DllConfig = 0;
TDllDebugger DllDebugger = 0;
TDSP_Initialize DSP_Initialize = 0;
@ -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"));

View File

@ -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);
@ -42,6 +43,7 @@ typedef void (__cdecl* TDSP_DoState)(unsigned char **ptr, int mode);
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TDllConfig DllConfig;
extern TDllDebugger DllDebugger;
extern TDSP_Initialize DSP_Initialize;

View File

@ -23,6 +23,7 @@ namespace PluginPAD
// Function Pointers
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TPAD_Shutdown PAD_Shutdown = 0;
TDllConfig DllConfig = 0;
TPAD_Initialize PAD_Initialize = 0;
@ -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,6 +59,7 @@ 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"));

View File

@ -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;

View File

@ -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,6 +60,7 @@ void UnloadPlugin()
// set Functions to 0
GetDllInfo = 0;
SetDllGlobals = 0;
DllConfig = 0;
DllDebugger = 0;
Video_Initialize = 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"));

View File

@ -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,6 +48,7 @@ typedef void (__cdecl* TVideo_Stop)();
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TDllConfig DllConfig;
extern TDllDebugger DllDebugger;
extern TVideo_Initialize Video_Initialize;

View File

@ -24,6 +24,7 @@ namespace PluginWiimote
// Function Pointer
TGetDllInfo GetDllInfo = 0;
TSetDllGlobals SetDllGlobals = 0;
TDllConfig DllConfig = 0;
TWiimote_Initialize Wiimote_Initialize = 0;
TWiimote_Shutdown Wiimote_Shutdown = 0;
@ -47,6 +48,7 @@ namespace PluginWiimote
// Set Functions to NULL
GetDllInfo = 0;
SetDllGlobals = 0;
DllConfig = 0;
Wiimote_Initialize = 0;
Wiimote_Shutdown = 0;
@ -61,8 +63,8 @@ namespace PluginWiimote
{
if (plugin.Load(_Filename))
{
LOG(MASTER_LOG, "getting Wiimote Plugin function pointers...");
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"));
@ -72,15 +74,7 @@ namespace PluginWiimote
Wiimote_GetAttachedControllers = reinterpret_cast<TWiimote_GetAttachedControllers> (plugin.Get("Wiimote_GetAttachedControllers"));
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) &&

View File

@ -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)();
@ -39,6 +40,7 @@ typedef void (__cdecl* TWiimote_DoState)(void *ptr, int mode);
// Function Pointers
extern TGetDllInfo GetDllInfo;
extern TSetDllGlobals SetDllGlobals;
extern TDllConfig DllConfig;
extern TWiimote_Initialize Wiimote_Initialize;
extern TWiimote_Shutdown Wiimote_Shutdown;