summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-01-24 12:09:30 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-01-24 12:09:30 +0000
commitfa7e857161a249ac75386070273dc39ecda51f89 (patch)
tree529c6a509351eb760e76da69df70235066b60ed4 /Source/Core/Common
parentfb3e523401c27f698070b3f2a522846d9370d261 (diff)
nJoy: Readded some fixes to nJoy (Notice: these changes have nothing to do with the argument earlier. These are only for fixing nJoy (point one and three in the 1991 revision)). Now opening the Wiimote plugin doesn't crash either (it was just a typo in GetWiimote()).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2000 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/Plugin.cpp2
-rw-r--r--Source/Core/Common/Src/Plugin.h2
-rw-r--r--Source/Core/Common/Src/PluginPAD.cpp36
-rw-r--r--Source/Core/Common/Src/PluginVideo.h25
4 files changed, 35 insertions, 30 deletions
diff --git a/Source/Core/Common/Src/Plugin.cpp b/Source/Core/Common/Src/Plugin.cpp
index 15bd184bcf..35c5026086 100644
--- a/Source/Core/Common/Src/Plugin.cpp
+++ b/Source/Core/Common/Src/Plugin.cpp
@@ -64,6 +64,8 @@ CPlugin::CPlugin(const char* _szName) : valid(false)
m_DoState != 0)
valid = true;
+ // Save the filename for this plugin
+ Filename = _szName;
}
void *CPlugin::LoadSymbol(const char *sym) {
diff --git a/Source/Core/Common/Src/Plugin.h b/Source/Core/Common/Src/Plugin.h
index 0be36eeb24..d896c41690 100644
--- a/Source/Core/Common/Src/Plugin.h
+++ b/Source/Core/Common/Src/Plugin.h
@@ -40,6 +40,7 @@ class CPlugin
~CPlugin();
virtual bool IsValid() {return valid;};
+ virtual std::string GetFilename() {return Filename;};
bool GetInfo(PLUGIN_INFO& _pluginInfo);
void SetGlobals(PLUGIN_GLOBALS* _PluginGlobals);
@@ -56,6 +57,7 @@ class CPlugin
DynamicLibrary m_hInstLib;
bool valid;
+ std::string Filename;
// Functions
TGetDllInfo m_GetDllInfo;
diff --git a/Source/Core/Common/Src/PluginPAD.cpp b/Source/Core/Common/Src/PluginPAD.cpp
index b5a0d072e0..a85e74cfa0 100644
--- a/Source/Core/Common/Src/PluginPAD.cpp
+++ b/Source/Core/Common/Src/PluginPAD.cpp
@@ -1,24 +1,24 @@
#include "PluginPAD.h"
-namespace Common {
- PluginPAD::PluginPAD(const char *_Filename) : CPlugin(_Filename), validPAD(false) {
-
- PAD_GetStatus = reinterpret_cast<TPAD_GetStatus>
- (LoadSymbol("PAD_GetStatus"));
- PAD_Input = reinterpret_cast<TPAD_Input>
- (LoadSymbol("PAD_Input"));
- PAD_Rumble = reinterpret_cast<TPAD_Rumble>
- (LoadSymbol("PAD_Rumble"));
- PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>
- (LoadSymbol("PAD_GetAttachedPads"));
+namespace Common
+{
+ PluginPAD::PluginPAD(const char *_Filename) : CPlugin(_Filename), validPAD(false)
+ {
+ PAD_GetStatus = reinterpret_cast<TPAD_GetStatus>
+ (LoadSymbol("PAD_GetStatus"));
+ PAD_Input = reinterpret_cast<TPAD_Input>
+ (LoadSymbol("PAD_Input"));
+ PAD_Rumble = reinterpret_cast<TPAD_Rumble>
+ (LoadSymbol("PAD_Rumble"));
+ PAD_GetAttachedPads = reinterpret_cast<TPAD_GetAttachedPads>
+ (LoadSymbol("PAD_GetAttachedPads"));
- if ((PAD_GetStatus != 0) &&
- (PAD_Input != 0) &&
- (PAD_Rumble != 0) &&
- (PAD_GetAttachedPads != 0))
- validPAD = true;
+ if ((PAD_GetStatus != 0) &&
+ (PAD_Input != 0) &&
+ (PAD_Rumble != 0) &&
+ (PAD_GetAttachedPads != 0))
+ validPAD = true;
}
- PluginPAD::~PluginPAD() {
- }
+ PluginPAD::~PluginPAD() {}
}
diff --git a/Source/Core/Common/Src/PluginVideo.h b/Source/Core/Common/Src/PluginVideo.h
index f679191177..fae20d434f 100644
--- a/Source/Core/Common/Src/PluginVideo.h
+++ b/Source/Core/Common/Src/PluginVideo.h
@@ -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 {
+ class PluginVideo : public CPlugin
+ {
public:
- PluginVideo(const char *_Filename);
- ~PluginVideo();
- virtual bool IsValid() {return validVideo;};
+ 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;
};
}