[nrage] some code clean up
This commit is contained in:
parent
7c3f24b20d
commit
43f175ce70
|
@ -12,11 +12,11 @@ http://www.emutalk.net/cgi-bin/ikonboard/ikonboard.cgi?s=3bd272222f66ffff;act=SF
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Note: BOOL, BYTE, WORD, DWORD, TRUE, FALSE are defined in windows.h */
|
/* Note: BOOL, BYTE, WORD, DWORD, TRUE, FALSE are defined in windows.h */
|
||||||
|
|
||||||
#define PLUGIN_TYPE_CONTROLLER 4
|
#define PLUGIN_TYPE_CONTROLLER 4
|
||||||
|
|
||||||
/*** Conteroller plugin's ****/
|
/*** Conteroller plugin's ****/
|
||||||
#define PLUGIN_NONE 1
|
#define PLUGIN_NONE 1
|
||||||
#define PLUGIN_MEMPAK 2
|
#define PLUGIN_MEMPAK 2
|
||||||
// not implemeted for non raw data
|
// not implemeted for non raw data
|
||||||
|
@ -26,36 +26,40 @@ extern "C" {
|
||||||
// the controller plugin is passed in raw data
|
// the controller plugin is passed in raw data
|
||||||
#define PLUGIN_RAW 5
|
#define PLUGIN_RAW 5
|
||||||
|
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
Note about Conteroller plugin's:
|
Note about Conteroller plugin's:
|
||||||
the rumble pak needs a function for the force feed back joystick and tranfer pak
|
the rumble pak needs a function for the force feed back joystick and tranfer pak
|
||||||
probaly needs a function for the plugin to be able to select the GB rom and
|
probaly needs a function for the plugin to be able to select the GB rom and
|
||||||
eeprom... maybe this should be done by the emu instead of the plugin, but I think
|
eeprom... maybe this should be done by the emu instead of the plugin, but I think
|
||||||
it probaly should be done by the plugin. I will see about adding these functions
|
it probaly should be done by the plugin. I will see about adding these functions
|
||||||
in the next spec
|
in the next spec
|
||||||
**********************************************************************************/
|
**********************************************************************************/
|
||||||
|
|
||||||
#define EXPORT __declspec(dllexport)
|
#define EXPORT __declspec(dllexport)
|
||||||
#define CALL _cdecl
|
#define CALL _cdecl
|
||||||
|
|
||||||
/***** Structures *****/
|
/***** Structures *****/
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
WORD Version; /* Should be set to 0x0101 */
|
WORD Version; /* Should be set to 0x0101 */
|
||||||
WORD Type; /* Set to PLUGIN_TYPE_CONTROLLER */
|
WORD Type; /* Set to PLUGIN_TYPE_CONTROLLER */
|
||||||
char Name[100]; /* Name of the DLL */
|
char Name[100]; /* Name of the DLL */
|
||||||
BOOL Reserved1;
|
BOOL Reserved1;
|
||||||
BOOL Reserved2;
|
BOOL Reserved2;
|
||||||
} PLUGIN_INFO;
|
} PLUGIN_INFO;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
BOOL Present;
|
BOOL Present;
|
||||||
BOOL RawData;
|
BOOL RawData;
|
||||||
int Plugin;
|
int Plugin;
|
||||||
} CONTROL;
|
} CONTROL;
|
||||||
|
|
||||||
typedef union {
|
typedef union
|
||||||
|
{
|
||||||
DWORD Value;
|
DWORD Value;
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
unsigned R_DPAD : 1;
|
unsigned R_DPAD : 1;
|
||||||
unsigned L_DPAD : 1;
|
unsigned L_DPAD : 1;
|
||||||
unsigned D_DPAD : 1;
|
unsigned D_DPAD : 1;
|
||||||
|
@ -78,9 +82,10 @@ typedef union {
|
||||||
|
|
||||||
signed X_AXIS : 8;
|
signed X_AXIS : 8;
|
||||||
};
|
};
|
||||||
} BUTTONS;
|
} BUTTONS;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
HWND hMainWindow;
|
HWND hMainWindow;
|
||||||
HINSTANCE hinst;
|
HINSTANCE hinst;
|
||||||
|
|
||||||
|
@ -91,18 +96,18 @@ typedef struct {
|
||||||
BYTE * HEADER; // This is the rom header (first 40h bytes of the rom)
|
BYTE * HEADER; // This is the rom header (first 40h bytes of the rom)
|
||||||
CONTROL *Controls; // A pointer to an array of 4 controllers .. eg:
|
CONTROL *Controls; // A pointer to an array of 4 controllers .. eg:
|
||||||
// CONTROL Controls[4];
|
// CONTROL Controls[4];
|
||||||
} CONTROL_INFO;
|
} CONTROL_INFO;
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: CloseDLL
|
Function: CloseDLL
|
||||||
Purpose: This function is called when the emulator is closing
|
Purpose: This function is called when the emulator is closing
|
||||||
down allowing the dll to de-initialise.
|
down allowing the dll to de-initialise.
|
||||||
input: none
|
input: none
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL CloseDLL (void);
|
EXPORT void CALL CloseDLL(void);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: ControllerCommand
|
Function: ControllerCommand
|
||||||
Purpose: To process the raw data that has just been sent to a
|
Purpose: To process the raw data that has just been sent to a
|
||||||
specific controller.
|
specific controller.
|
||||||
|
@ -117,57 +122,57 @@ EXPORT void CALL CloseDLL (void);
|
||||||
the data that is being processed looks like this:
|
the data that is being processed looks like this:
|
||||||
initilize controller: 01 03 00 FF FF FF
|
initilize controller: 01 03 00 FF FF FF
|
||||||
read controller: 01 04 01 FF FF FF FF
|
read controller: 01 04 01 FF FF FF FF
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL ControllerCommand ( int Control, BYTE * Command);
|
EXPORT void CALL ControllerCommand(int Control, BYTE * Command);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: DllAbout
|
Function: DllAbout
|
||||||
Purpose: This function is optional function that is provided
|
Purpose: This function is optional function that is provided
|
||||||
to give further information about the DLL.
|
to give further information about the DLL.
|
||||||
input: a handle to the window that calls this function
|
input: a handle to the window that calls this function
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL DllAbout ( HWND hParent );
|
EXPORT void CALL DllAbout(HWND hParent);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: DllConfig
|
Function: DllConfig
|
||||||
Purpose: This function is optional function that is provided
|
Purpose: This function is optional function that is provided
|
||||||
to allow the user to configure the dll
|
to allow the user to configure the dll
|
||||||
input: a handle to the window that calls this function
|
input: a handle to the window that calls this function
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL DllConfig ( HWND hParent );
|
EXPORT void CALL DllConfig(HWND hParent);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: DllTest
|
Function: DllTest
|
||||||
Purpose: This function is optional function that is provided
|
Purpose: This function is optional function that is provided
|
||||||
to allow the user to test the dll
|
to allow the user to test the dll
|
||||||
input: a handle to the window that calls this function
|
input: a handle to the window that calls this function
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL DllTest ( HWND hParent );
|
EXPORT void CALL DllTest(HWND hParent);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: GetDllInfo
|
Function: GetDllInfo
|
||||||
Purpose: This function allows the emulator to gather information
|
Purpose: This function allows the emulator to gather information
|
||||||
about the dll by filling in the PluginInfo structure.
|
about the dll by filling in the PluginInfo structure.
|
||||||
input: a pointer to a PLUGIN_INFO stucture that needs to be
|
input: a pointer to a PLUGIN_INFO stucture that needs to be
|
||||||
filled by the function. (see def above)
|
filled by the function. (see def above)
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo );
|
EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: GetKeys
|
Function: GetKeys
|
||||||
Purpose: To get the current state of the controllers buttons.
|
Purpose: To get the current state of the controllers buttons.
|
||||||
input: - Controller Number (0 to 3)
|
input: - Controller Number (0 to 3)
|
||||||
- A pointer to a BUTTONS structure to be filled with
|
- A pointer to a BUTTONS structure to be filled with
|
||||||
the controller state.
|
the controller state.
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL GetKeys(int Control, BUTTONS * Keys );
|
EXPORT void CALL GetKeys(int Control, BUTTONS * Keys);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: InitiateControllers
|
Function: InitiateControllers
|
||||||
Purpose: This function initialises how each of the controllers
|
Purpose: This function initialises how each of the controllers
|
||||||
should be handled.
|
should be handled.
|
||||||
|
@ -175,10 +180,10 @@ EXPORT void CALL GetKeys(int Control, BUTTONS * Keys );
|
||||||
- A controller structure that needs to be filled for
|
- A controller structure that needs to be filled for
|
||||||
the emulator to know how to handle each controller.
|
the emulator to know how to handle each controller.
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL InitiateControllers (CONTROL_INFO * ControlInfo);
|
EXPORT void CALL InitiateControllers(CONTROL_INFO * ControlInfo);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: ReadController
|
Function: ReadController
|
||||||
Purpose: To process the raw data in the pif ram that is about to
|
Purpose: To process the raw data in the pif ram that is about to
|
||||||
be read.
|
be read.
|
||||||
|
@ -188,46 +193,45 @@ EXPORT void CALL InitiateControllers (CONTROL_INFO * ControlInfo);
|
||||||
output: none
|
output: none
|
||||||
note: This function is only needed if the DLL is allowing raw
|
note: This function is only needed if the DLL is allowing raw
|
||||||
data.
|
data.
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL ReadController ( int Control, BYTE * Command );
|
EXPORT void CALL ReadController(int Control, BYTE * Command);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: RomClosed
|
Function: RomClosed
|
||||||
Purpose: This function is called when a rom is closed.
|
Purpose: This function is called when a rom is closed.
|
||||||
input: none
|
input: none
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL RomClosed (void);
|
EXPORT void CALL RomClosed(void);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: RomOpen
|
Function: RomOpen
|
||||||
Purpose: This function is called when a rom is open. (from the
|
Purpose: This function is called when a rom is open. (from the
|
||||||
emulation thread)
|
emulation thread)
|
||||||
input: none
|
input: none
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL RomOpen (void);
|
EXPORT void CALL RomOpen(void);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: WM_KeyDown
|
Function: WM_KeyDown
|
||||||
Purpose: To pass the WM_KeyDown message from the emulator to the
|
Purpose: To pass the WM_KeyDown message from the emulator to the
|
||||||
plugin.
|
plugin.
|
||||||
input: wParam and lParam of the WM_KEYDOWN message.
|
input: wParam and lParam of the WM_KEYDOWN message.
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL WM_KeyDown( WPARAM wParam, LPARAM lParam );
|
EXPORT void CALL WM_KeyDown(WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: WM_KeyUp
|
Function: WM_KeyUp
|
||||||
Purpose: To pass the WM_KEYUP message from the emulator to the
|
Purpose: To pass the WM_KEYUP message from the emulator to the
|
||||||
plugin.
|
plugin.
|
||||||
input: wParam and lParam of the WM_KEYDOWN message.
|
input: wParam and lParam of the WM_KEYDOWN message.
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL WM_KeyUp( WPARAM wParam, LPARAM lParam );
|
EXPORT void CALL WM_KeyUp(WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
Author`s Email: norbert.wladyka@chello.at
|
Author`s Email: norbert.wladyka@chello.at
|
||||||
Website: http://go.to/nrage
|
Website: http://go.to/nrage
|
||||||
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the free Software Foundation; either version 2 of the License, or
|
the free Software Foundation; either version 2 of the License, or
|
||||||
|
@ -19,7 +18,7 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the free Software
|
along with this program; if not, write to the free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _NRAGEPLUGIN_
|
#ifndef _NRAGEPLUGIN_
|
||||||
#define _NRAGEPLUGIN_
|
#define _NRAGEPLUGIN_
|
||||||
|
@ -32,9 +31,9 @@
|
||||||
|
|
||||||
#define TIMER_MESSAGEWINDOW 123
|
#define TIMER_MESSAGEWINDOW 123
|
||||||
|
|
||||||
// maximum number of devices other than SysMouse
|
// maximum number of devices other than SysMouse
|
||||||
#define MAX_DEVICES 32
|
#define MAX_DEVICES 32
|
||||||
// maximum number of modifiers
|
// maximum number of modifiers
|
||||||
#define MAX_MODIFIERS 256
|
#define MAX_MODIFIERS 256
|
||||||
|
|
||||||
#define DEFAULT_STICKRANGE 66
|
#define DEFAULT_STICKRANGE 66
|
||||||
|
@ -52,11 +51,9 @@
|
||||||
#define PAK_VOICE 4
|
#define PAK_VOICE 4
|
||||||
#define PAK_ADAPTOID 7
|
#define PAK_ADAPTOID 7
|
||||||
|
|
||||||
// just used to display text in GUI
|
// just used to display text in GUI
|
||||||
#define PAK_NONRAW 16
|
#define PAK_NONRAW 16
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _EMULATOR_INFO
|
typedef struct _EMULATOR_INFO
|
||||||
{
|
{
|
||||||
bool fInitialisedPlugin;
|
bool fInitialisedPlugin;
|
||||||
|
@ -65,11 +62,11 @@ typedef struct _EMULATOR_INFO
|
||||||
LANGID Language;
|
LANGID Language;
|
||||||
bool fDisplayShortPop; // do we display shortcut message popups?
|
bool fDisplayShortPop; // do we display shortcut message popups?
|
||||||
|
|
||||||
// BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
// BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
||||||
// bswap on a dword (32 bits) boundry, only effects header.
|
// bswap on a dword (32 bits) boundry, only effects header.
|
||||||
// eg. the first 8 bytes are stored like this:
|
// eg. the first 8 bytes are stored like this:
|
||||||
// 4 3 2 1 8 7 6 5
|
// 4 3 2 1 8 7 6 5
|
||||||
// BYTE * HEADER; // This is the rom header (first 40h bytes of the rom)
|
// BYTE * HEADER; // This is the rom header (first 40h bytes of the rom)
|
||||||
} EMULATOR_INFO, *LPEMULATOR_INFO;
|
} EMULATOR_INFO, *LPEMULATOR_INFO;
|
||||||
|
|
||||||
typedef struct _DEVICE
|
typedef struct _DEVICE
|
||||||
|
@ -80,7 +77,8 @@ typedef struct _DEVICE
|
||||||
GUID guidInstance;
|
GUID guidInstance;
|
||||||
DWORD dwDevType; // can be DI8DEVTYPE_KEYBOARD, DI8DEVTYPE_MOUSE, etc
|
DWORD dwDevType; // can be DI8DEVTYPE_KEYBOARD, DI8DEVTYPE_MOUSE, etc
|
||||||
BYTE bEffType; // What rumble effects does this device support?
|
BYTE bEffType; // What rumble effects does this device support?
|
||||||
union INPUTSTATE { // the last polled data from this device
|
union INPUTSTATE // the last polled data from this device
|
||||||
|
{
|
||||||
DIJOYSTATE joyState;
|
DIJOYSTATE joyState;
|
||||||
DIMOUSESTATE2 mouseState;
|
DIMOUSESTATE2 mouseState;
|
||||||
BYTE rgbButtons[256]; // keyboard state
|
BYTE rgbButtons[256]; // keyboard state
|
||||||
|
@ -112,14 +110,14 @@ typedef struct _MODIFIER
|
||||||
#define MDT_MACRO 2
|
#define MDT_MACRO 2
|
||||||
#define MDT_CONFIG 3
|
#define MDT_CONFIG 3
|
||||||
|
|
||||||
// buffered
|
// buffered
|
||||||
#define MM_BUFF 0
|
#define MM_BUFF 0
|
||||||
// absolute
|
// absolute
|
||||||
#define MM_ABS 1
|
#define MM_ABS 1
|
||||||
// deadpan
|
// deadpan
|
||||||
#define MM_DEAD 2
|
#define MM_DEAD 2
|
||||||
|
|
||||||
// Number of analog axes. Standard N64 controller has just 2: X and Y joystick.
|
// Number of analog axes. Standard N64 controller has just 2: X and Y joystick.
|
||||||
#define PF_AXESETS 2
|
#define PF_AXESETS 2
|
||||||
|
|
||||||
typedef struct _CONTROLLER // AN N64 CONTROLLER
|
typedef struct _CONTROLLER // AN N64 CONTROLLER
|
||||||
|
@ -165,11 +163,11 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
|
||||||
BYTE bRapidFireRate;
|
BYTE bRapidFireRate;
|
||||||
BYTE bRapidFireCounter;
|
BYTE bRapidFireCounter;
|
||||||
|
|
||||||
TCHAR szMempakFile[MAX_PATH+1]; // MemPak-FileName
|
TCHAR szMempakFile[MAX_PATH + 1]; // MemPak-FileName
|
||||||
TCHAR szTransferRom[MAX_PATH+1]; // GameBoyRom-Filename
|
TCHAR szTransferRom[MAX_PATH + 1]; // GameBoyRom-Filename
|
||||||
TCHAR szTransferSave[MAX_PATH+1]; // GameBoyEEPRom-Filename
|
TCHAR szTransferSave[MAX_PATH + 1]; // GameBoyEEPRom-Filename
|
||||||
|
|
||||||
BUTTON aButton[14+PF_AXESETS*4]; // Ten buttons, 4 d-pad directions times two (for Config 1 and Config 2)
|
BUTTON aButton[14 + PF_AXESETS * 4]; // Ten buttons, 4 d-pad directions times two (for Config 1 and Config 2)
|
||||||
|
|
||||||
MODIFIER *pModifiers; // Array of Modifiers
|
MODIFIER *pModifiers; // Array of Modifiers
|
||||||
|
|
||||||
|
@ -180,7 +178,7 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
|
||||||
} CONTROLLER, *LPCONTROLLER;
|
} CONTROLLER, *LPCONTROLLER;
|
||||||
|
|
||||||
// This is the Index of WORD PROFILE.Button[X]
|
// This is the Index of WORD PROFILE.Button[X]
|
||||||
// Buttons:
|
// Buttons:
|
||||||
#define PF_DPADR 0
|
#define PF_DPADR 0
|
||||||
#define PF_DPADL 1
|
#define PF_DPADL 1
|
||||||
#define PF_DPADD 2
|
#define PF_DPADD 2
|
||||||
|
@ -196,22 +194,19 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
|
||||||
#define PF_TRIGGERR 12
|
#define PF_TRIGGERR 12
|
||||||
#define PF_TRIGGERL 13
|
#define PF_TRIGGERL 13
|
||||||
|
|
||||||
// Analog Stick
|
// Analog Stick
|
||||||
// cause you can assign Buttons to it, I need 4 of 'em
|
// cause you can assign Buttons to it, I need 4 of 'em
|
||||||
#define PF_APADR 14
|
#define PF_APADR 14
|
||||||
#define PF_APADL 15
|
#define PF_APADL 15
|
||||||
#define PF_APADD 16
|
#define PF_APADD 16
|
||||||
#define PF_APADU 17
|
#define PF_APADU 17
|
||||||
|
|
||||||
// second Set
|
// second Set
|
||||||
// #define PF_APADR 18
|
// #define PF_APADR 18
|
||||||
// #define PF_APADL 19
|
// #define PF_APADL 19
|
||||||
// #define PF_APADD 20
|
// #define PF_APADD 20
|
||||||
// #define PF_APADU 21
|
// #define PF_APADU 21
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Data Format of DWORD Controller.Button:
|
// Data Format of DWORD Controller.Button:
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -221,27 +216,27 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
|
||||||
|
|
||||||
// BYTE bBtnType : Determines the Device and general Type of Control
|
// BYTE bBtnType : Determines the Device and general Type of Control
|
||||||
#define DT_UNASSIGNED 0
|
#define DT_UNASSIGNED 0
|
||||||
// Joystick
|
// Joystick
|
||||||
#define DT_JOYBUTTON 1
|
#define DT_JOYBUTTON 1
|
||||||
#define DT_JOYAXE 2
|
#define DT_JOYAXE 2
|
||||||
#define DT_JOYPOV 3
|
#define DT_JOYPOV 3
|
||||||
#define DT_JOYSLIDER 4
|
#define DT_JOYSLIDER 4
|
||||||
|
|
||||||
// Keyboard
|
// Keyboard
|
||||||
#define DT_KEYBUTTON 5
|
#define DT_KEYBUTTON 5
|
||||||
|
|
||||||
// Mouse
|
// Mouse
|
||||||
#define DT_MOUSEBUTTON 6
|
#define DT_MOUSEBUTTON 6
|
||||||
#define DT_MOUSEAXE 7
|
#define DT_MOUSEAXE 7
|
||||||
|
|
||||||
// BYTE bAxisID : AxeIndentifier, Tells which range of the Axe/POV is important
|
// BYTE bAxisID : AxeIndentifier, Tells which range of the Axe/POV is important
|
||||||
|
|
||||||
// Positive Range of an Axe
|
// Positive Range of an Axe
|
||||||
#define AI_AXE_P 0
|
#define AI_AXE_P 0
|
||||||
// Negative Range
|
// Negative Range
|
||||||
#define AI_AXE_N 1
|
#define AI_AXE_N 1
|
||||||
|
|
||||||
// Applies to POVs obviously
|
// Applies to POVs obviously
|
||||||
#define AI_POV_UP 0
|
#define AI_POV_UP 0
|
||||||
#define AI_POV_RIGHT 1
|
#define AI_POV_RIGHT 1
|
||||||
#define AI_POV_DOWN 2
|
#define AI_POV_DOWN 2
|
||||||
|
@ -249,7 +244,6 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
|
||||||
|
|
||||||
// BYTE bOffset : Offset in the DirectInput data structure
|
// BYTE bOffset : Offset in the DirectInput data structure
|
||||||
|
|
||||||
|
|
||||||
typedef union _MODSPEC_MOVE
|
typedef union _MODSPEC_MOVE
|
||||||
{
|
{
|
||||||
DWORD dwValue;
|
DWORD dwValue;
|
||||||
|
@ -270,30 +264,30 @@ typedef union _MODSPEC_MACRO
|
||||||
};
|
};
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned fDigitalRight :1;
|
unsigned fDigitalRight : 1;
|
||||||
unsigned fDigitalLeft :1;
|
unsigned fDigitalLeft : 1;
|
||||||
unsigned fDigitalDown :1;
|
unsigned fDigitalDown : 1;
|
||||||
unsigned fDigitalUp :1;
|
unsigned fDigitalUp : 1;
|
||||||
unsigned fStart :1;
|
unsigned fStart : 1;
|
||||||
unsigned fTriggerZ :1;
|
unsigned fTriggerZ : 1;
|
||||||
unsigned fBButton :1;
|
unsigned fBButton : 1;
|
||||||
unsigned fAButton :1;
|
unsigned fAButton : 1;
|
||||||
unsigned fCRight :1;
|
unsigned fCRight : 1;
|
||||||
unsigned fCLeft :1;
|
unsigned fCLeft : 1;
|
||||||
unsigned fCDown :1;
|
unsigned fCDown : 1;
|
||||||
unsigned fCUp :1;
|
unsigned fCUp : 1;
|
||||||
unsigned fTriggerR :1;
|
unsigned fTriggerR : 1;
|
||||||
unsigned fTriggerL :1;
|
unsigned fTriggerL : 1;
|
||||||
unsigned :2;
|
unsigned : 2;
|
||||||
|
|
||||||
unsigned fAnalogRight :1;
|
unsigned fAnalogRight : 1;
|
||||||
unsigned fAnalogLeft :1;
|
unsigned fAnalogLeft : 1;
|
||||||
unsigned fAnalogDown :1;
|
unsigned fAnalogDown : 1;
|
||||||
unsigned fAnalogUp :1;
|
unsigned fAnalogUp : 1;
|
||||||
unsigned fRapidFire :1;
|
unsigned fRapidFire : 1;
|
||||||
unsigned fRapidFireRate :1;
|
unsigned fRapidFireRate : 1;
|
||||||
unsigned fPrevFireState :1;
|
unsigned fPrevFireState : 1;
|
||||||
unsigned fPrevFireState2 :1;
|
unsigned fPrevFireState2 : 1;
|
||||||
};
|
};
|
||||||
} MODSPEC_MACRO, *LPMODSPEC_MACRO;
|
} MODSPEC_MACRO, *LPMODSPEC_MACRO;
|
||||||
|
|
||||||
|
@ -308,15 +302,14 @@ typedef union _MODSPEC_CONFIG
|
||||||
};
|
};
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned fChangeAnalogConfig :1;
|
unsigned fChangeAnalogConfig : 1;
|
||||||
unsigned fAnalogStickMode :7;
|
unsigned fAnalogStickMode : 7;
|
||||||
unsigned fChangeMouseXAxis :1;
|
unsigned fChangeMouseXAxis : 1;
|
||||||
unsigned fChangeMouseYAxis :1;
|
unsigned fChangeMouseYAxis : 1;
|
||||||
unsigned :6;
|
unsigned : 6;
|
||||||
unsigned fChangeKeyboardXAxis :1;
|
unsigned fChangeKeyboardXAxis : 1;
|
||||||
unsigned fChangeKeyboardYAxis :1;
|
unsigned fChangeKeyboardYAxis : 1;
|
||||||
unsigned :6;
|
unsigned : 6;
|
||||||
|
|
||||||
};
|
};
|
||||||
} MODSPEC_CONFIG, *LPMODSPEC_CONFIG;
|
} MODSPEC_CONFIG, *LPMODSPEC_CONFIG;
|
||||||
|
|
||||||
|
@ -329,8 +322,8 @@ typedef union _MODSPEC_CONFIG
|
||||||
#define SC_SWMEMRUMB 6
|
#define SC_SWMEMRUMB 6
|
||||||
#define SC_SWMEMADAPT 7
|
#define SC_SWMEMADAPT 7
|
||||||
|
|
||||||
// total arraysize of aButtons in SHORTCUTSPL;
|
// total arraysize of aButtons in SHORTCUTSPL;
|
||||||
// make sure you update this if you change the list above
|
// make sure you update this if you change the list above
|
||||||
#define SC_TOTAL 8
|
#define SC_TOTAL 8
|
||||||
|
|
||||||
typedef struct _SHORTCUTSPL
|
typedef struct _SHORTCUTSPL
|
||||||
|
@ -357,10 +350,8 @@ typedef struct _MSHORTCUT {
|
||||||
int iShortcut;
|
int iShortcut;
|
||||||
} MSHORTCUT, *LPMSHORTCUT; // shortcut message
|
} MSHORTCUT, *LPMSHORTCUT; // shortcut message
|
||||||
|
|
||||||
|
|
||||||
#define CHECK_WHITESPACES( str ) ( str == '\r' || str == '\n' || str == '\t' )
|
#define CHECK_WHITESPACES( str ) ( str == '\r' || str == '\n' || str == '\t' )
|
||||||
|
|
||||||
|
|
||||||
extern HANDLE g_hHeap;
|
extern HANDLE g_hHeap;
|
||||||
extern HMODULE g_hDirectInputDLL;
|
extern HMODULE g_hDirectInputDLL;
|
||||||
extern HMODULE g_hXInputDLL;
|
extern HMODULE g_hXInputDLL;
|
||||||
|
@ -383,12 +374,12 @@ extern bool g_bExclusiveMouse;
|
||||||
|
|
||||||
extern int g_iFirstController;
|
extern int g_iFirstController;
|
||||||
|
|
||||||
int WarningMessage( UINT uTextID, UINT uType );
|
int WarningMessage(UINT uTextID, UINT uType);
|
||||||
int FindDeviceinList( const TCHAR *pszProductName, BYTE bProductCounter, bool fFindSimilar );
|
int FindDeviceinList(const TCHAR *pszProductName, BYTE bProductCounter, bool fFindSimilar);
|
||||||
int FindDeviceinList( REFGUID rGUID );
|
int FindDeviceinList(REFGUID rGUID);
|
||||||
void freePakData( CONTROLLER *pcController );
|
void freePakData(CONTROLLER *pcController);
|
||||||
void freeModifiers( CONTROLLER *pcController );
|
void freeModifiers(CONTROLLER *pcController);
|
||||||
void CheckShortcuts();
|
void CheckShortcuts();
|
||||||
bool ErrorMessage( UINT uID, DWORD dwError, bool fUserChoose );
|
bool ErrorMessage(UINT uID, DWORD dwError, bool fUserChoose);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue