mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
SerialInterface and pads: Allow MAXPADS lower than 4
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1923 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -27,7 +27,7 @@ and stopped.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
//
|
||||
// -----------
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
@ -79,11 +79,14 @@ std::string GetLastErrorAsString()
|
||||
#endif
|
||||
}
|
||||
|
||||
// Loading means loading the dll with LoadLibrary() to get an instance to the dll.
|
||||
// This is done when Dolphin is started to determine which dlls are good, and
|
||||
// before opening the Config and Debugging windows from Plugin.cpp and
|
||||
// before opening the dll for running the emulation in Video_...cpp in Core.
|
||||
// Since this is fairly slow, TODO: think about implementing some sort of cache.
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Includes
|
||||
// -----------
|
||||
/* Function: Loading means loading the dll with LoadLibrary() to get an instance to the dll.
|
||||
This is done when Dolphin is started to determine which dlls are good, and before opening
|
||||
the Config and Debugging windows from Plugin.cpp and before opening the dll for running
|
||||
the emulation in Video_...cpp in Core. Since this is fairly slow, TODO: think about
|
||||
implementing some sort of cache. */
|
||||
int DynamicLibrary::Load(const char* filename)
|
||||
{
|
||||
if (!filename || strlen(filename) == 0)
|
||||
@ -147,11 +150,12 @@ void* DynamicLibrary::Get(const char* funcname) const
|
||||
PanicAlert("Can't find function %s - Library not loaded.");
|
||||
return NULL;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
retval = GetProcAddress(library, funcname);
|
||||
#else
|
||||
retval = dlsym(library, funcname);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
retval = GetProcAddress(library, funcname);
|
||||
#else
|
||||
retval = dlsym(library, funcname);
|
||||
#endif
|
||||
|
||||
if (!retval)
|
||||
{
|
||||
|
@ -30,11 +30,13 @@
|
||||
namespace Common
|
||||
{
|
||||
|
||||
CPlugin::~CPlugin() {
|
||||
CPlugin::~CPlugin()
|
||||
{
|
||||
m_hInstLib.Unload();
|
||||
}
|
||||
|
||||
CPlugin::CPlugin(const char* _szName) : valid(false) {
|
||||
CPlugin::CPlugin(const char* _szName) : valid(false)
|
||||
{
|
||||
if (m_hInstLib.Load(_szName)) {
|
||||
|
||||
m_GetDllInfo = reinterpret_cast<TGetDllInfo>
|
||||
@ -101,14 +103,17 @@ void CPlugin::DoState(unsigned char **ptr, int mode) {
|
||||
m_DoState(ptr, mode);
|
||||
}
|
||||
|
||||
void CPlugin::Initialize(void *init) {
|
||||
if (m_Initialize != 0)
|
||||
m_Initialize(init);
|
||||
// Run Initialize() in the plugin
|
||||
void CPlugin::Initialize(void *init)
|
||||
{
|
||||
/* We first check that we have found the Initialize() function, but there is no
|
||||
restriction on running this several times */
|
||||
if (m_Initialize != 0) m_Initialize(init);
|
||||
}
|
||||
|
||||
void CPlugin::Shutdown() {
|
||||
if (m_Shutdown != 0)
|
||||
m_Shutdown();
|
||||
void CPlugin::Shutdown()
|
||||
{
|
||||
if (m_Shutdown != 0) m_Shutdown();
|
||||
}
|
||||
|
||||
} // end of namespace Common
|
Reference in New Issue
Block a user