2014-09-11 07:38:56 +00:00
|
|
|
#ifndef COMMONPLUGINAPI_H
|
|
|
|
#define COMMONPLUGINAPI_H
|
|
|
|
|
|
|
|
#ifdef MUPENPLUSAPI
|
2022-02-19 15:00:57 +00:00
|
|
|
#ifndef NOMINMAX
|
|
|
|
#define NOMINMAX
|
|
|
|
#endif
|
2014-09-11 07:38:56 +00:00
|
|
|
#include "m64p_plugin.h"
|
|
|
|
#else
|
2016-11-20 05:07:15 +00:00
|
|
|
#include "windows/GLideN64_windows.h"
|
2014-09-11 07:38:56 +00:00
|
|
|
#include "ZilmarGFX_1_3.h"
|
2016-02-27 05:58:56 +00:00
|
|
|
#include "FrameBufferInfoAPI.h"
|
2017-11-20 14:11:24 +00:00
|
|
|
//#define RSPTHREAD
|
2014-09-11 07:38:56 +00:00
|
|
|
#endif
|
|
|
|
|
2017-09-06 18:08:41 +00:00
|
|
|
#ifdef RSPTHREAD
|
|
|
|
#include <thread>
|
|
|
|
#include <condition_variable>
|
|
|
|
#endif
|
|
|
|
|
2015-11-23 13:42:34 +00:00
|
|
|
class APICommand;
|
2014-09-19 02:47:35 +00:00
|
|
|
|
2014-09-19 03:10:06 +00:00
|
|
|
class PluginAPI
|
2014-09-11 07:38:56 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-09-19 03:10:06 +00:00
|
|
|
#ifdef RSPTHREAD
|
|
|
|
~PluginAPI()
|
|
|
|
{
|
|
|
|
delete m_pRspThread;
|
|
|
|
m_pRspThread = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-09-11 07:38:56 +00:00
|
|
|
// Common
|
|
|
|
void MoveScreen(int /*_xpos*/, int /*_ypos*/) {}
|
|
|
|
void ViStatusChanged() {}
|
|
|
|
void ViWidthChanged() {}
|
|
|
|
|
|
|
|
void ProcessDList();
|
2014-10-07 10:59:54 +00:00
|
|
|
void ProcessRDPList();
|
2014-09-11 07:38:56 +00:00
|
|
|
void RomClosed();
|
2022-01-16 17:27:17 +00:00
|
|
|
int RomOpen(const char* romName = nullptr);
|
2014-09-11 07:38:56 +00:00
|
|
|
void ShowCFB();
|
|
|
|
void UpdateScreen();
|
|
|
|
int InitiateGFX(const GFX_INFO & _gfxInfo);
|
|
|
|
void ChangeWindow();
|
|
|
|
|
2015-02-04 09:23:21 +00:00
|
|
|
void FindPluginPath(wchar_t * _strPath);
|
2015-05-23 11:53:08 +00:00
|
|
|
void GetUserDataPath(wchar_t * _strPath);
|
|
|
|
void GetUserCachePath(wchar_t * _strPath);
|
2022-01-25 15:34:26 +00:00
|
|
|
#ifdef M64P_GLIDENUI
|
|
|
|
void GetUserConfigPath(wchar_t * _strPath);
|
|
|
|
#endif // M64P_GLIDENUI
|
2017-12-14 15:50:14 +00:00
|
|
|
bool isRomOpen() const { return m_bRomOpen; }
|
2015-02-04 09:23:21 +00:00
|
|
|
|
2014-09-11 07:38:56 +00:00
|
|
|
#ifndef MUPENPLUSAPI
|
|
|
|
// Zilmar
|
|
|
|
void DllTest(HWND /*_hParent*/) {}
|
|
|
|
void DrawScreen() {}
|
|
|
|
void CloseDLL(void) {}
|
|
|
|
|
|
|
|
void CaptureScreen(char * _Directory);
|
|
|
|
void DllConfig(HWND _hParent);
|
|
|
|
void GetDllInfo (PLUGIN_INFO * PluginInfo);
|
|
|
|
void ReadScreen(void **_dest, long *_width, long *_height);
|
|
|
|
|
2015-04-17 15:27:37 +00:00
|
|
|
void DllAbout(/*HWND _hParent*/);
|
2016-02-27 05:58:56 +00:00
|
|
|
|
|
|
|
// FrameBufferInfo extension
|
|
|
|
void FBWrite(unsigned int addr, unsigned int size);
|
|
|
|
void FBWList(FrameBufferModifyEntry *plist, unsigned int size);
|
|
|
|
void FBRead(unsigned int addr);
|
|
|
|
void FBGetFrameBufferInfo(void *pinfo);
|
2014-09-11 07:38:56 +00:00
|
|
|
#else
|
|
|
|
// MupenPlus
|
2014-10-01 09:04:15 +00:00
|
|
|
void ResizeVideoOutput(int _Width, int _Height);
|
2014-10-02 09:18:28 +00:00
|
|
|
void ReadScreen2(void * _dest, int * _width, int * _height, int _front);
|
2014-09-11 07:38:56 +00:00
|
|
|
|
|
|
|
m64p_error PluginStartup(m64p_dynlib_handle _CoreLibHandle);
|
2020-06-19 13:06:17 +00:00
|
|
|
#ifdef M64P_GLIDENUI
|
|
|
|
m64p_error PluginConfig();
|
|
|
|
#endif // M64P_GLIDENUI
|
2014-09-11 07:38:56 +00:00
|
|
|
m64p_error PluginShutdown();
|
|
|
|
m64p_error PluginGetVersion(
|
|
|
|
m64p_plugin_type * _PluginType,
|
|
|
|
int * _PluginVersion,
|
|
|
|
int * _APIVersion,
|
|
|
|
const char ** _PluginNamePtr,
|
|
|
|
int * _Capabilities
|
|
|
|
);
|
|
|
|
void SetRenderingCallback(void (*callback)(int));
|
2016-02-27 05:58:56 +00:00
|
|
|
|
|
|
|
// FrameBufferInfo extension
|
|
|
|
void FBWrite(unsigned int addr, unsigned int size);
|
|
|
|
void FBRead(unsigned int addr);
|
|
|
|
void FBGetFrameBufferInfo(void *pinfo);
|
2014-09-11 07:38:56 +00:00
|
|
|
#endif
|
|
|
|
|
2015-03-31 12:44:41 +00:00
|
|
|
static PluginAPI & get();
|
2014-09-11 07:38:56 +00:00
|
|
|
|
|
|
|
private:
|
2014-09-19 03:10:06 +00:00
|
|
|
PluginAPI()
|
2017-12-14 15:50:14 +00:00
|
|
|
: m_bRomOpen(false)
|
2014-09-19 03:10:06 +00:00
|
|
|
#ifdef RSPTHREAD
|
2017-12-14 15:50:14 +00:00
|
|
|
, m_pRspThread(NULL)
|
|
|
|
, m_pCommand(nullptr)
|
2015-02-04 09:23:21 +00:00
|
|
|
#endif
|
2014-09-19 03:10:06 +00:00
|
|
|
{}
|
2017-11-18 15:07:27 +00:00
|
|
|
PluginAPI(const PluginAPI &) = delete;
|
2014-09-11 07:38:56 +00:00
|
|
|
|
2014-09-19 03:10:06 +00:00
|
|
|
void _initiateGFX(const GFX_INFO & _gfxInfo) const;
|
|
|
|
|
2017-12-14 15:50:14 +00:00
|
|
|
bool m_bRomOpen;
|
2014-09-19 03:10:06 +00:00
|
|
|
#ifdef RSPTHREAD
|
2015-11-23 13:42:34 +00:00
|
|
|
void _callAPICommand(APICommand & _command);
|
2014-09-19 03:10:06 +00:00
|
|
|
std::mutex m_rspThreadMtx;
|
|
|
|
std::mutex m_pluginThreadMtx;
|
|
|
|
std::condition_variable_any m_rspThreadCv;
|
|
|
|
std::condition_variable_any m_pluginThreadCv;
|
|
|
|
std::thread * m_pRspThread;
|
2015-11-23 13:42:34 +00:00
|
|
|
APICommand * m_pCommand;
|
2014-09-19 03:10:06 +00:00
|
|
|
#endif
|
2014-09-11 07:38:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inline PluginAPI & api()
|
|
|
|
{
|
|
|
|
return PluginAPI::get();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // COMMONPLUGINAPI_H
|