mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
nJoy and PluginManager:
1. Avoided LoadLibrary() and FreeLibrary() in favor of using an existing LoadLibrary() because of an unresolved crash related to LoadLibrary() and nJoy. After several times of LoadLibrary() and FreeLibrary() of nJoy these seems to be some kind of memory corruption that brings up several error boxes from different places (not just nJoy) and then cause a crash. 2. Slowed down the moving of the pad initialization to InputCommon. I'm not against InputCommon at all, but I have to spend some more time with it before it works on Windows 3. Partly fixed a somewhat frequent failure of nJoy with SDL 1.3 that would give a strange DirectInput error message and cause the pads to not function. It's still present before the nJoy config windows is opened. It's only fixed on booting a game. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1991 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -37,8 +37,10 @@ CPlugin::~CPlugin()
|
||||
|
||||
CPlugin::CPlugin(const char* _szName) : valid(false)
|
||||
{
|
||||
if (m_hInstLib.Load(_szName)) {
|
||||
if (m_hInstLib.Load(_szName))
|
||||
{
|
||||
|
||||
// Create pointers to the DLL functions
|
||||
m_GetDllInfo = reinterpret_cast<TGetDllInfo>
|
||||
(m_hInstLib.Get("GetDllInfo"));
|
||||
m_DllConfig = reinterpret_cast<TDllConfig>
|
||||
@ -56,24 +58,28 @@ CPlugin::CPlugin(const char* _szName) : valid(false)
|
||||
}
|
||||
|
||||
if (m_GetDllInfo != 0 &&
|
||||
m_DllConfig != 0 &&
|
||||
m_DllDebugger != 0 &&
|
||||
m_SetDllGlobals != 0 &&
|
||||
m_Initialize != 0 &&
|
||||
m_Shutdown != 0 &&
|
||||
m_DoState != 0)
|
||||
m_DllConfig != 0 &&
|
||||
m_DllDebugger != 0 &&
|
||||
m_SetDllGlobals != 0 &&
|
||||
m_Initialize != 0 &&
|
||||
m_Shutdown != 0 &&
|
||||
m_DoState != 0)
|
||||
valid = true;
|
||||
|
||||
// Save the filename for this plugin
|
||||
Filename = _szName;
|
||||
}
|
||||
|
||||
void *CPlugin::LoadSymbol(const char *sym) {
|
||||
void *CPlugin::LoadSymbol(const char *sym)
|
||||
{
|
||||
return m_hInstLib.Get(sym);
|
||||
}
|
||||
|
||||
|
||||
// ______________________________________________________________________________________
|
||||
// GetInfo: Get DLL info
|
||||
bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo) {
|
||||
bool CPlugin::GetInfo(PLUGIN_INFO& _pluginInfo)
|
||||
{
|
||||
if (m_GetDllInfo != 0)
|
||||
{
|
||||
m_GetDllInfo(&_pluginInfo);
|
||||
|
@ -36,35 +36,37 @@ class CPlugin
|
||||
{
|
||||
public:
|
||||
|
||||
CPlugin(const char* _szName);
|
||||
~CPlugin();
|
||||
CPlugin(const char* _szName);
|
||||
~CPlugin();
|
||||
|
||||
virtual bool IsValid() {return valid;};
|
||||
virtual bool IsValid() {return valid;};
|
||||
virtual std::string GetFilename() {return Filename;};
|
||||
|
||||
bool GetInfo(PLUGIN_INFO& _pluginInfo);
|
||||
void SetGlobals(PLUGIN_GLOBALS* _PluginGlobals);
|
||||
void *LoadSymbol(const char *sym);
|
||||
bool GetInfo(PLUGIN_INFO& _pluginInfo);
|
||||
void SetGlobals(PLUGIN_GLOBALS* _PluginGlobals);
|
||||
void *LoadSymbol(const char *sym);
|
||||
|
||||
void Config(HWND _hwnd);
|
||||
void About(HWND _hwnd);
|
||||
void Debug(HWND _hwnd, bool Show);
|
||||
void DoState(unsigned char **ptr, int mode);
|
||||
void Initialize(void *init);
|
||||
void Shutdown();
|
||||
void Config(HWND _hwnd);
|
||||
void About(HWND _hwnd);
|
||||
void Debug(HWND _hwnd, bool Show);
|
||||
void DoState(unsigned char **ptr, int mode);
|
||||
void Initialize(void *init);
|
||||
void Shutdown();
|
||||
|
||||
private:
|
||||
|
||||
DynamicLibrary m_hInstLib;
|
||||
bool valid;
|
||||
DynamicLibrary m_hInstLib;
|
||||
bool valid;
|
||||
std::string Filename;
|
||||
|
||||
// Functions
|
||||
TGetDllInfo m_GetDllInfo;
|
||||
TDllConfig m_DllConfig;
|
||||
TDllDebugger m_DllDebugger;
|
||||
TSetDllGlobals m_SetDllGlobals;
|
||||
TInitialize m_Initialize;
|
||||
TShutdown m_Shutdown;
|
||||
TDoState m_DoState;
|
||||
// Functions
|
||||
TGetDllInfo m_GetDllInfo;
|
||||
TDllConfig m_DllConfig;
|
||||
TDllDebugger m_DllDebugger;
|
||||
TSetDllGlobals m_SetDllGlobals;
|
||||
TInitialize m_Initialize;
|
||||
TShutdown m_Shutdown;
|
||||
TDoState m_DoState;
|
||||
};
|
||||
} // end of namespace Common
|
||||
|
||||
|
@ -4,25 +4,27 @@
|
||||
#include "pluginspecs_pad.h"
|
||||
#include "Plugin.h"
|
||||
|
||||
namespace Common {
|
||||
namespace Common
|
||||
{
|
||||
typedef void (__cdecl* TPAD_GetStatus)(u8, SPADStatus*);
|
||||
typedef void (__cdecl* TPAD_Input)(u16, u8);
|
||||
typedef void (__cdecl* TPAD_Rumble)(u8, unsigned int, unsigned int);
|
||||
typedef unsigned int (__cdecl* TPAD_GetAttachedPads)();
|
||||
|
||||
class PluginPAD : public CPlugin {
|
||||
class PluginPAD : public CPlugin
|
||||
{
|
||||
public:
|
||||
PluginPAD(const char *_Filename);
|
||||
~PluginPAD();
|
||||
virtual bool IsValid() {return validPAD;};
|
||||
PluginPAD(const char *_Filename);
|
||||
~PluginPAD();
|
||||
virtual bool IsValid() {return validPAD;};
|
||||
|
||||
TPAD_GetStatus PAD_GetStatus;
|
||||
TPAD_Input PAD_Input;
|
||||
TPAD_Rumble PAD_Rumble;
|
||||
TPAD_GetAttachedPads PAD_GetAttachedPads;
|
||||
TPAD_GetStatus PAD_GetStatus;
|
||||
TPAD_Input PAD_Input;
|
||||
TPAD_Rumble PAD_Rumble;
|
||||
TPAD_GetAttachedPads PAD_GetAttachedPads;
|
||||
|
||||
private:
|
||||
bool validPAD;
|
||||
bool validPAD;
|
||||
|
||||
};
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
#include "PluginVideo.h"
|
||||
|
||||
namespace Common {
|
||||
PluginVideo::PluginVideo(const char *_Filename) : CPlugin(_Filename), validVideo(false) {
|
||||
namespace Common
|
||||
{
|
||||
PluginVideo::PluginVideo(const char *_Filename) :
|
||||
CPlugin(_Filename),
|
||||
validVideo(false)
|
||||
{
|
||||
|
||||
Video_Prepare = reinterpret_cast<TVideo_Prepare>
|
||||
(LoadSymbol("Video_Prepare"));
|
||||
|
@ -13,22 +13,23 @@ namespace Common {
|
||||
typedef void (__cdecl* TVideo_AddMessage)(const char* pstr, unsigned int milliseconds);
|
||||
typedef void (__cdecl* TVideo_Stop)();
|
||||
|
||||
class PluginVideo : public CPlugin {
|
||||
public:
|
||||
PluginVideo(const char *_Filename);
|
||||
~PluginVideo();
|
||||
virtual bool IsValid() {return validVideo;};
|
||||
class PluginVideo : public CPlugin
|
||||
{
|
||||
public:
|
||||
PluginVideo(const char *_Filename);
|
||||
~PluginVideo();
|
||||
virtual bool IsValid() {return validVideo;};
|
||||
|
||||
TVideo_Prepare Video_Prepare;
|
||||
TVideo_SendFifoData Video_SendFifoData;
|
||||
TVideo_UpdateXFB Video_UpdateXFB;
|
||||
TVideo_Screenshot Video_Screenshot;
|
||||
TVideo_EnterLoop Video_EnterLoop;
|
||||
TVideo_AddMessage Video_AddMessage;
|
||||
TVideo_Stop Video_Stop;
|
||||
TVideo_Prepare Video_Prepare;
|
||||
TVideo_SendFifoData Video_SendFifoData;
|
||||
TVideo_UpdateXFB Video_UpdateXFB;
|
||||
TVideo_Screenshot Video_Screenshot;
|
||||
TVideo_EnterLoop Video_EnterLoop;
|
||||
TVideo_AddMessage Video_AddMessage;
|
||||
TVideo_Stop Video_Stop;
|
||||
|
||||
private:
|
||||
bool validVideo;
|
||||
bool validVideo;
|
||||
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user