2015-01-30 21:01:21 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
2015-02-24 21:44:06 +00:00
|
|
|
class CPlugin :
|
|
|
|
private CDebugSettings
|
2015-01-30 21:01:21 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CPlugin();
|
|
|
|
virtual ~CPlugin();
|
2015-02-26 10:57:51 +00:00
|
|
|
inline const char * PluginName() const { return m_PluginInfo.Name; }
|
2015-01-30 21:01:21 +00:00
|
|
|
inline bool Initilized() { return m_Initilized; }
|
|
|
|
|
|
|
|
virtual int GetDefaultSettingStartRange() const = 0;
|
|
|
|
virtual int GetSettingStartRange() const = 0;
|
|
|
|
|
|
|
|
bool Load ( const char * FileName );
|
|
|
|
|
|
|
|
void RomOpened();
|
|
|
|
void RomClose();
|
|
|
|
void GameReset();
|
|
|
|
void Close();
|
|
|
|
|
|
|
|
void(__cdecl *DllAbout) (HWND hWnd);
|
|
|
|
void(__cdecl *DllConfig) (DWORD hParent);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void UnloadPlugin();
|
2015-02-12 10:58:28 +00:00
|
|
|
const char * PluginType () const;
|
|
|
|
TraceType PluginTraceType () const;
|
2015-01-30 21:01:21 +00:00
|
|
|
virtual void UnloadPluginDetails() = 0;
|
|
|
|
virtual PLUGIN_TYPE type() = 0;
|
|
|
|
virtual bool LoadFunctions ( void ) = 0;
|
|
|
|
|
|
|
|
void(__cdecl *CloseDLL) (void);
|
|
|
|
void(__cdecl *RomOpen) (void);
|
|
|
|
void(__cdecl *RomClosed) (void);
|
|
|
|
void(__cdecl *PluginOpened)(void);
|
|
|
|
void(__cdecl *SetSettingInfo) (PLUGIN_SETTINGS *);
|
|
|
|
void(__cdecl *SetSettingInfo2) (PLUGIN_SETTINGS2 *);
|
|
|
|
void(__cdecl *SetSettingInfo3) (PLUGIN_SETTINGS3 *);
|
|
|
|
|
|
|
|
void * m_hDll;
|
|
|
|
bool m_Initilized, m_RomOpen;
|
|
|
|
PLUGIN_INFO m_PluginInfo;
|
|
|
|
|
|
|
|
// Loads a function pointer from the currently loaded DLL
|
|
|
|
template <typename T>
|
|
|
|
void _LoadFunction(const char * szFunctionName, T & functionPointer) {
|
|
|
|
functionPointer = (T)GetProcAddress((HMODULE)m_hDll, szFunctionName);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Simple wrapper around _LoadFunction() to avoid having to specify the same two arguments
|
|
|
|
// i.e. _LoadFunction("CloseDLL", CloseDLL);
|
|
|
|
#define LoadFunction(functionName) _LoadFunction(#functionName, functionName)
|
|
|
|
};
|