2009-09-02 15:00:45 -06:00
|
|
|
|
2009-01-17 01:21:49 -07:00
|
|
|
//________________________________________________________________________________________
|
|
|
|
// File description: Common plugin spec, version #1.0 maintained by F|RES
|
2009-09-02 15:00:45 -06:00
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
#ifndef _PLUGINS_H_INCLUDED__
|
|
|
|
#define _PLUGINS_H_INCLUDED__
|
|
|
|
|
|
|
|
|
2009-09-02 15:00:45 -06:00
|
|
|
|
2009-01-17 01:21:49 -07:00
|
|
|
// Includes
|
|
|
|
// ------------
|
2008-12-07 21:46:09 -07:00
|
|
|
#ifdef _WIN32
|
2009-01-17 01:21:49 -07:00
|
|
|
#include <windows.h>
|
2008-12-07 21:46:09 -07:00
|
|
|
#endif
|
2009-01-17 01:21:49 -07:00
|
|
|
#include "CommonTypes.h"
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-01-07 14:40:55 -07:00
|
|
|
|
2009-09-02 15:00:45 -06:00
|
|
|
|
|
|
|
|
2009-09-07 06:40:43 -06:00
|
|
|
/* Plugin communication. I place this here rather in Common.h to rebuild less if any of this is changed */
|
2009-02-06 20:16:41 -07:00
|
|
|
// -----------------
|
|
|
|
enum PLUGIN_COMM
|
|
|
|
{
|
|
|
|
// Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
|
|
|
|
OPENGL_WM_USER_STOP = 10,
|
|
|
|
OPENGL_WM_USER_CREATE,
|
2009-09-06 07:36:05 -06:00
|
|
|
OPENGL_WM_USER_KEYDOWN,
|
2009-09-07 06:40:43 -06:00
|
|
|
OPENGL_VIDEO_STOP,
|
|
|
|
VIDEO_DESTROY, // The video debugging window was destroyed
|
|
|
|
AUDIO_DESTROY, // The audio debugging window was destroyed
|
2009-02-06 20:16:41 -07:00
|
|
|
NJOY_RELOAD, // Reload nJoy if DirectInput has failed
|
2009-02-16 00:17:34 -07:00
|
|
|
WIIMOTE_RECONNECT, // Reconnect the Wiimote if it has disconnected
|
2009-09-07 06:40:43 -06:00
|
|
|
INPUT_FRAME_COUNTER // Wind back the frame counter for rerecording
|
2009-02-06 20:16:41 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-09-02 15:00:45 -06:00
|
|
|
|
|
|
|
|
2009-01-17 01:32:44 -07:00
|
|
|
// System specific declarations and definitions
|
|
|
|
// ------------
|
2009-01-17 11:34:25 -07:00
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
#ifdef _WIN32
|
2009-01-17 01:21:49 -07:00
|
|
|
#define EXPORT __declspec(dllexport)
|
2009-01-17 13:15:41 -07:00
|
|
|
#define CALL __cdecl
|
2008-12-07 21:46:09 -07:00
|
|
|
#else
|
2009-01-17 01:21:49 -07:00
|
|
|
#define EXPORT __attribute__ ((visibility("default")))
|
2009-01-17 13:15:41 -07:00
|
|
|
#define __cdecl
|
|
|
|
#define CALL
|
2009-01-17 01:21:49 -07:00
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// simulate something that looks like win32
|
|
|
|
// long term, kill these
|
|
|
|
#define HWND void*
|
|
|
|
#define HINSTANCE void*
|
2008-12-07 21:46:09 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
2009-01-17 01:21:49 -07:00
|
|
|
extern "C" {
|
2008-12-07 21:46:09 -07:00
|
|
|
#endif
|
2009-01-17 01:32:44 -07:00
|
|
|
|
|
|
|
|
2009-09-02 15:00:45 -06:00
|
|
|
|
|
|
|
|
2009-01-17 01:32:44 -07:00
|
|
|
// Global values
|
|
|
|
// ------------
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-01-17 01:21:49 -07:00
|
|
|
// Plugin types
|
2009-01-14 23:48:15 -07:00
|
|
|
enum PLUGIN_TYPE {
|
|
|
|
PLUGIN_TYPE_VIDEO = 1,
|
|
|
|
PLUGIN_TYPE_DVD,
|
|
|
|
PLUGIN_TYPE_PAD,
|
|
|
|
PLUGIN_TYPE_AUDIO,
|
|
|
|
PLUGIN_TYPE_COMPILER,
|
|
|
|
PLUGIN_TYPE_DSP,
|
|
|
|
PLUGIN_TYPE_WIIMOTE,
|
|
|
|
};
|
2008-12-07 21:46:09 -07:00
|
|
|
|
|
|
|
#define STATE_MODE_READ 1
|
|
|
|
#define STATE_MODE_WRITE 2
|
|
|
|
#define STATE_MODE_MEASURE 3
|
|
|
|
|
2009-01-17 01:32:44 -07:00
|
|
|
|
|
|
|
// Export structs
|
|
|
|
// ------------
|
2008-12-07 21:46:09 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
u16 Version; // Set to 0x0100
|
2009-01-14 23:48:15 -07:00
|
|
|
PLUGIN_TYPE Type; // Set to PLUGIN_TYPE_DVD
|
2008-12-07 21:46:09 -07:00
|
|
|
char Name[100]; // Name of the DLL
|
|
|
|
} PLUGIN_INFO;
|
|
|
|
|
2009-09-13 03:07:22 -06:00
|
|
|
#ifndef MAX_PATH
|
|
|
|
// apparently a windows-ism.
|
|
|
|
#define MAX_PATH 260
|
|
|
|
#endif
|
|
|
|
|
2009-09-13 02:54:46 -06:00
|
|
|
// TODO: Remove, or at least remove the void pointers and replace with data.
|
|
|
|
// This design is just wrong and ugly - the plugins shouldn't have this much access.
|
2009-01-07 04:16:36 -07:00
|
|
|
typedef struct
|
2008-12-07 21:46:09 -07:00
|
|
|
{
|
2009-01-07 04:16:36 -07:00
|
|
|
void *eventHandler;
|
2009-03-18 11:17:58 -06:00
|
|
|
void *logManager;
|
2009-09-13 02:54:46 -06:00
|
|
|
char game_ini[MAX_PATH];
|
|
|
|
char unique_id[16];
|
2009-01-07 04:16:36 -07:00
|
|
|
} PLUGIN_GLOBALS;
|
2009-01-17 01:21:49 -07:00
|
|
|
|
2009-09-02 15:00:45 -06:00
|
|
|
// GLOBAL I N T E R F A C E
|
2009-01-07 11:21:22 -07:00
|
|
|
// ____________________________________________________________________________
|
|
|
|
// Function: GetDllInfo
|
|
|
|
// Purpose: This function allows the emulator to gather information
|
|
|
|
// about the DLL by filling in the PluginInfo structure.
|
|
|
|
// input: A pointer to a PLUGIN_INFO structure that needs to be
|
|
|
|
// filled by the function. (see def above)
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo);
|
|
|
|
|
|
|
|
// ___________________________________________________________________________
|
|
|
|
// Function: DllConfig
|
|
|
|
// Purpose: This function is optional function that is provided
|
|
|
|
// to allow the user to configure the DLL
|
|
|
|
// input: A handle to the window that calls this function
|
|
|
|
// output: none
|
|
|
|
//
|
2009-01-07 14:40:55 -07:00
|
|
|
EXPORT void CALL DllConfig(HWND _hParent);
|
2009-01-07 11:21:22 -07:00
|
|
|
|
|
|
|
// ___________________________________________________________________________
|
|
|
|
// Function: DllDebugger
|
|
|
|
// Purpose: Open the debugger
|
|
|
|
// input: a handle to the window that calls this function
|
|
|
|
// output: none
|
|
|
|
//
|
2009-01-07 14:40:55 -07:00
|
|
|
EXPORT void CALL DllDebugger(HWND _hParent, bool Show);
|
|
|
|
|
|
|
|
// ___________________________________________________________________________
|
|
|
|
// Function: DllSetGlobals
|
|
|
|
// Purpose: Set the pointer for globals variables
|
|
|
|
// input: a pointer to the global struct
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals);
|
2009-01-14 23:48:15 -07:00
|
|
|
|
2009-01-17 01:32:44 -07:00
|
|
|
// ___________________________________________________________________________
|
2009-01-14 23:48:15 -07:00
|
|
|
// Function: Initialize
|
|
|
|
// Purpose: Initialize the plugin
|
|
|
|
// input: Init
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Initialize(void *init);
|
2009-01-17 01:32:44 -07:00
|
|
|
|
|
|
|
// ___________________________________________________________________________
|
2009-01-14 23:48:15 -07:00
|
|
|
// Function: Shutdown
|
|
|
|
// Purpose: This function is called when the emulator is shutting down
|
|
|
|
// a game allowing the dll to de-initialise.
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Shutdown(void);
|
|
|
|
|
2009-01-17 01:32:44 -07:00
|
|
|
// ___________________________________________________________________________
|
2009-01-14 23:48:15 -07:00
|
|
|
// Function: DoState
|
|
|
|
// Purpose: Saves/load state
|
|
|
|
// input/output: ptr
|
|
|
|
// input: mode
|
|
|
|
//
|
|
|
|
EXPORT void CALL DoState(unsigned char **ptr, int mode);
|
2009-09-02 15:00:45 -06:00
|
|
|
|
2009-01-17 01:21:49 -07:00
|
|
|
|
2009-01-14 23:48:15 -07:00
|
|
|
|
2008-12-07 21:46:09 -07:00
|
|
|
#if defined(__cplusplus)
|
2009-01-17 01:21:49 -07:00
|
|
|
}
|
2008-12-07 21:46:09 -07:00
|
|
|
#endif
|
2009-01-17 01:21:49 -07:00
|
|
|
|
|
|
|
#endif // _PLUGINS_H_INCLUDED__
|