mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
fcdd2a8e17
1. Fixed the dual mode. You should now be able to change between the real and emulated Wiimote at any time, even when the Nunchuck is connected. It also supports third party Wireless Nunchucks that never sends any calibration values. The Nunchuck status should be automatically updated. The Nunchuck stick may get stuck, but that should fix itself if you disconnect and reconnect again. The only important problems seems to be that the real Wiimote fails to answer sometimes so that the Core functions disconnect it. 2. Began looking at how to reconnect the Wiimote after an unwanted HCI disconnect command git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2129 8ced0084-cf51-0410-be5f-012b33b47a6e
173 lines
4.9 KiB
C
173 lines
4.9 KiB
C
//////////////////////////////////////////////////////////////////////////////////////////
|
|
//________________________________________________________________________________________
|
|
// File description: Common plugin spec, version #1.0 maintained by F|RES
|
|
///////////////////////////
|
|
|
|
#ifndef _PLUGINS_H_INCLUDED__
|
|
#define _PLUGINS_H_INCLUDED__
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
// Includes
|
|
// ------------
|
|
#ifdef _WIN32
|
|
#include <windows.h>
|
|
#endif
|
|
#include "CommonTypes.h"
|
|
///////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
/* Plugin communication. I place this here rather in Common.h since these messages are only received
|
|
at one place, by the CPanel in Frame.cpp. That way I don't have to rebuild if any of this is changed */
|
|
// -----------------
|
|
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,
|
|
NJOY_RELOAD, // Reload nJoy if DirectInput has failed
|
|
WIIMOTE_RECONNECT // Reconnect the Wiimote if it has disconnected
|
|
};
|
|
///////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
// System specific declarations and definitions
|
|
// ------------
|
|
|
|
#ifdef _WIN32
|
|
#define EXPORT __declspec(dllexport)
|
|
#define CALL __cdecl
|
|
#else
|
|
#define EXPORT __attribute__ ((visibility("default")))
|
|
#define __cdecl
|
|
#define CALL
|
|
#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*
|
|
#endif
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
///////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
// Global values
|
|
// ------------
|
|
|
|
// Plugin types
|
|
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,
|
|
};
|
|
|
|
#define STATE_MODE_READ 1
|
|
#define STATE_MODE_WRITE 2
|
|
#define STATE_MODE_MEASURE 3
|
|
|
|
///////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
// Export structs
|
|
// ------------
|
|
typedef struct
|
|
{
|
|
u16 Version; // Set to 0x0100
|
|
PLUGIN_TYPE Type; // Set to PLUGIN_TYPE_DVD
|
|
char Name[100]; // Name of the DLL
|
|
} PLUGIN_INFO;
|
|
|
|
typedef struct
|
|
{
|
|
void *eventHandler;
|
|
void *config;
|
|
void *messageLogger;
|
|
} PLUGIN_GLOBALS;
|
|
///////////////////////////////
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// GLOBAL I N T E R F A C E ///////////////////////////////////////////////////
|
|
// ____________________________________________________________________________
|
|
// 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
|
|
//
|
|
EXPORT void CALL DllConfig(HWND _hParent);
|
|
|
|
// ___________________________________________________________________________
|
|
// Function: DllDebugger
|
|
// Purpose: Open the debugger
|
|
// input: a handle to the window that calls this function
|
|
// output: none
|
|
//
|
|
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);
|
|
|
|
// ___________________________________________________________________________
|
|
// Function: Initialize
|
|
// Purpose: Initialize the plugin
|
|
// input: Init
|
|
// output: none
|
|
//
|
|
EXPORT void CALL Initialize(void *init);
|
|
|
|
// ___________________________________________________________________________
|
|
// 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);
|
|
|
|
// ___________________________________________________________________________
|
|
// Function: DoState
|
|
// Purpose: Saves/load state
|
|
// input/output: ptr
|
|
// input: mode
|
|
//
|
|
EXPORT void CALL DoState(unsigned char **ptr, int mode);
|
|
///////////////////////////////
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
#endif
|
|
|
|
#endif // _PLUGINS_H_INCLUDED__
|