[Nrage-input] Tabs -> spaces

This commit is contained in:
oddMLan 2020-02-09 04:36:49 -07:00
parent 891e43878b
commit 2b15003e77
22 changed files with 10328 additions and 10328 deletions

View File

@ -12,179 +12,179 @@ 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
#ifndef SPECS_VERSION #ifndef SPECS_VERSION
#define SPECS_VERSION 0x0101 #define SPECS_VERSION 0x0101
#endif #endif
/*** 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
#define PLUGIN_RUMBLE_PAK 3 #define PLUGIN_RUMBLE_PAK 3
// not implemeted for non raw data // not implemeted for non raw data
#define PLUGIN_TRANSFER_PAK 4 #define PLUGIN_TRANSFER_PAK 4
// 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;
unsigned U_DPAD : 1; unsigned U_DPAD : 1;
unsigned START_BUTTON : 1; unsigned START_BUTTON : 1;
unsigned Z_TRIG : 1; unsigned Z_TRIG : 1;
unsigned B_BUTTON : 1; unsigned B_BUTTON : 1;
unsigned A_BUTTON : 1; unsigned A_BUTTON : 1;
unsigned R_CBUTTON : 1; unsigned R_CBUTTON : 1;
unsigned L_CBUTTON : 1; unsigned L_CBUTTON : 1;
unsigned D_CBUTTON : 1; unsigned D_CBUTTON : 1;
unsigned U_CBUTTON : 1; unsigned U_CBUTTON : 1;
unsigned R_TRIG : 1; unsigned R_TRIG : 1;
unsigned L_TRIG : 1; unsigned L_TRIG : 1;
unsigned Reserved1 : 1; unsigned Reserved1 : 1;
unsigned Reserved2 : 1; unsigned Reserved2 : 1;
signed Y_AXIS : 8; signed Y_AXIS : 8;
signed X_AXIS : 8; signed X_AXIS : 8;
}; };
} BUTTONS; } BUTTONS;
typedef struct typedef struct
{ {
HWND hMainWindow; HWND hMainWindow;
HINSTANCE hinst; HINSTANCE hinst;
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)
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.
input: - Controller Number (0 to 3) and -1 signalling end of input: - Controller Number (0 to 3) and -1 signalling end of
processing the pif ram. processing the pif ram.
- Pointer of data to be processed. - Pointer of data to be processed.
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, or the plugin is set to raw data, or the plugin is set to raw
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.
input: - The handle to the main window. input: - The handle to the main window.
- 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
*******************************************************************/ *******************************************************************/
#if (SPECS_VERSION < 0x0101) #if (SPECS_VERSION < 0x0101)
EXPORT void CALL InitiateControllers(void * hMainWindow, CONTROL Controls[4]); EXPORT void CALL InitiateControllers(void * hMainWindow, CONTROL Controls[4]);
#elif (SPECS_VERSION == 0x0101) #elif (SPECS_VERSION == 0x0101)
@ -194,53 +194,53 @@ EXPORT void CALL InitiateControllers(CONTROL_INFO ControlInfo);
EXPORT void CALL InitiateControllers(CONTROL_INFO * ControlInfo); EXPORT void CALL InitiateControllers(CONTROL_INFO * ControlInfo);
#endif #endif
/****************************************************************** /******************************************************************
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.
input: - Controller Number (0 to 3) and -1 signalling end of input: - Controller Number (0 to 3) and -1 signalling end of
processing the pif ram. processing the pif ram.
- Pointer of data to be processed. - Pointer of data to be processed.
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)
} }

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -34,125 +34,125 @@ HANDLE hDebug = INVALID_HANDLE_VALUE;
void _DebugAnsiFileWrite( LPCSTR szRemark ) void _DebugAnsiFileWrite( LPCSTR szRemark )
{ {
if( !bDebug ) if( !bDebug )
return; return;
if (hDebug == INVALID_HANDLE_VALUE) if (hDebug == INVALID_HANDLE_VALUE)
{ {
TCHAR szFile[] = _T("NRage-Debug.txt"); TCHAR szFile[] = _T("NRage-Debug.txt");
TCHAR szBuffer[MAX_PATH+1]; TCHAR szBuffer[MAX_PATH+1];
GetAbsoluteFileName( szBuffer, szFile, DIRECTORY_LOG ); GetAbsoluteFileName( szBuffer, szFile, DIRECTORY_LOG );
hDebug = CreateFile( szBuffer, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); hDebug = CreateFile( szBuffer, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
if (hDebug != INVALID_HANDLE_VALUE) if (hDebug != INVALID_HANDLE_VALUE)
SetFilePointer(hDebug, 0, 0, FILE_END); SetFilePointer(hDebug, 0, 0, FILE_END);
} }
if( hDebug != INVALID_HANDLE_VALUE ) if( hDebug != INVALID_HANDLE_VALUE )
{ {
DWORD dwWritten; DWORD dwWritten;
LPCSTR szText = szRemark; LPCSTR szText = szRemark;
if( szText == NULL ) if( szText == NULL )
szText = "\r\n"; szText = "\r\n";
LPCSTR szCurrPos = szText; LPCSTR szCurrPos = szText;
while( ( szCurrPos = strchr( szCurrPos, '\n' )) != NULL ) while( ( szCurrPos = strchr( szCurrPos, '\n' )) != NULL )
{ {
DWORD length = szCurrPos - szText; DWORD length = szCurrPos - szText;
if( length > 0 && szCurrPos[-1] == '\r' ) if( length > 0 && szCurrPos[-1] == '\r' )
--length; --length;
if( length > 0 ) if( length > 0 )
WriteFile( hDebug, (LPCVOID)szText, length, &dwWritten, NULL ); WriteFile( hDebug, (LPCVOID)szText, length, &dwWritten, NULL );
WriteFile( hDebug, "\r\n", 2, &dwWritten, NULL ); WriteFile( hDebug, "\r\n", 2, &dwWritten, NULL );
szText = ++szCurrPos; szText = ++szCurrPos;
} }
DWORD length = lstrlenA( szText ); DWORD length = lstrlenA( szText );
if( length > 0 ) if( length > 0 )
WriteFile( hDebug, (LPCVOID)szText, length, &dwWritten, NULL ); WriteFile( hDebug, (LPCVOID)szText, length, &dwWritten, NULL );
} }
return; return;
} }
void _cdecl _DebugWriteA( LPCSTR szFormat, ... ) void _cdecl _DebugWriteA( LPCSTR szFormat, ... )
{ {
if( szFormat != NULL ) if( szFormat != NULL )
{ {
char szBuffer[4096]; char szBuffer[4096];
va_list val; va_list val;
va_start( val,szFormat ); va_start( val,szFormat );
wvsprintfA( szBuffer, szFormat, val ); wvsprintfA( szBuffer, szFormat, val );
va_end( val ); va_end( val );
szBuffer[sizeof(szBuffer)-1] = '\0'; szBuffer[sizeof(szBuffer)-1] = '\0';
_DebugAnsiFileWrite( szBuffer ); _DebugAnsiFileWrite( szBuffer );
} }
else else
_DebugAnsiFileWrite( NULL ); _DebugAnsiFileWrite( NULL );
} }
void _cdecl _DebugWriteW( const LPCWSTR szFormat, ... ) void _cdecl _DebugWriteW( const LPCWSTR szFormat, ... )
{ {
if( szFormat != NULL ) if( szFormat != NULL )
{ {
WCHAR szBuffer[4096]; WCHAR szBuffer[4096];
va_list val; va_list val;
va_start( val,szFormat ); va_start( val,szFormat );
wvsprintfW( szBuffer, szFormat, val ); wvsprintfW( szBuffer, szFormat, val );
va_end( val ); va_end( val );
szBuffer[(sizeof(szBuffer) / sizeof(WCHAR))-1] = L'\0'; szBuffer[(sizeof(szBuffer) / sizeof(WCHAR))-1] = L'\0';
char szAnsi[sizeof(szBuffer) / sizeof(WCHAR)]; char szAnsi[sizeof(szBuffer) / sizeof(WCHAR)];
WideCharToMultiByte( CP_ACP, 0, szBuffer, -1, szAnsi, sizeof(szAnsi), NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, szBuffer, -1, szAnsi, sizeof(szAnsi), NULL, NULL );
_DebugAnsiFileWrite( szAnsi ); _DebugAnsiFileWrite( szAnsi );
} }
else else
_DebugAnsiFileWrite( NULL ); _DebugAnsiFileWrite( NULL );
} }
void _WriteDatasA( LPCSTR Header, const int Control, const unsigned char * Data, const HRESULT hr ) void _WriteDatasA( LPCSTR Header, const int Control, const unsigned char * Data, const HRESULT hr )
{ {
if( !bDebug || Data == NULL ) if( !bDebug || Data == NULL )
return; return;
_DebugWriteA( "%d:%s\n", Control, Header); _DebugWriteA( "%d:%s\n", Control, Header);
if( hr ) if( hr )
{ {
_DebugWriteA( "Failed! ErrorCode: %08X\n", hr ); _DebugWriteA( "Failed! ErrorCode: %08X\n", hr );
} }
int iEnd = Data[0] + Data[1] + 2; int iEnd = Data[0] + Data[1] + 2;
for( int i = -1; i < iEnd; i += 8 ) for( int i = -1; i < iEnd; i += 8 )
{ {
_DebugWriteA( "%02X%02X%02X%02X %02X%02X%02X%02X\n", Data[i+0], Data[i+1], Data[i+2], Data[i+3], Data[i+4], Data[i+5], Data[i+6], Data[i+7] ); _DebugWriteA( "%02X%02X%02X%02X %02X%02X%02X%02X\n", Data[i+0], Data[i+1], Data[i+2], Data[i+3], Data[i+4], Data[i+5], Data[i+6], Data[i+7] );
} }
return; return;
} }
void _CloseDebugFile() void _CloseDebugFile()
{ {
if( hDebug != INVALID_HANDLE_VALUE ) if( hDebug != INVALID_HANDLE_VALUE )
{ {
_DebugWriteA("---DEBUG FILE CLOSED---\n"); _DebugWriteA("---DEBUG FILE CLOSED---\n");
CloseHandle( hDebug ); CloseHandle( hDebug );
} }
} }
void _DebugFlush() void _DebugFlush()
{ {
if( hDebug != INVALID_HANDLE_VALUE ) if( hDebug != INVALID_HANDLE_VALUE )
{ {
FlushFileBuffers(hDebug); FlushFileBuffers(hDebug);
} }
} }

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -37,9 +37,9 @@ void _cdecl _DebugWriteW( LPCWSTR szFormat, ... );
void _CloseDebugFile(); void _CloseDebugFile();
void _DebugFlush(); void _DebugFlush();
#define DebugWriteA _DebugWriteA #define DebugWriteA _DebugWriteA
#define DebugWriteW _DebugWriteW #define DebugWriteW _DebugWriteW
#define WriteDatasA( header, control, data, hr ) _WriteDatasA( header, control, data, hr ) #define WriteDatasA( header, control, data, hr ) _WriteDatasA( header, control, data, hr )
#define CloseDebugFile() _CloseDebugFile() #define CloseDebugFile() _CloseDebugFile()
#define DebugWriteByteA(str) DebugWriteA("%02X", str) #define DebugWriteByteA(str) DebugWriteA("%02X", str)
#define DebugWriteWordA(str) DebugWriteA("%04X", str) #define DebugWriteWordA(str) DebugWriteA("%04X", str)
@ -48,9 +48,9 @@ void _DebugFlush();
#else // #ifndef _DEBUG #else // #ifndef _DEBUG
#define DebugWriteByteA(str) #define DebugWriteByteA(str)
#define DebugWriteWordA(str) #define DebugWriteWordA(str)
#define DebugWriteA ;// #define DebugWriteA ;//
#define DebugWriteW ;// #define DebugWriteW ;//
#define WriteDatasA(header,control,data,hr) #define WriteDatasA(header,control,data,hr)
#define CloseDebugFile() #define CloseDebugFile()
#define DebugFlush() #define DebugFlush()

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -55,103 +55,103 @@ HRESULT ReadAdaptoidPak( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD addr, L
HRESULT WriteAdaptoidPak( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD addr, LPBYTE data ); HRESULT WriteAdaptoidPak( LPDIRECTINPUTDEVICE8 lpDirectInputDevice, DWORD addr, LPBYTE data );
#define MINAXISVALUE -32767 #define MINAXISVALUE -32767
#define MAXAXISVALUE 32767 #define MAXAXISVALUE 32767
#define ZEROVALUE 0 #define ZEROVALUE 0
#define THRESHOLD 50 #define THRESHOLD 50
#define RANGERELATIVE (MAXAXISVALUE - ZEROVALUE + 1) #define RANGERELATIVE (MAXAXISVALUE - ZEROVALUE + 1)
#define ABSTHRESHOLD (RANGERELATIVE * THRESHOLD / 100) #define ABSTHRESHOLD (RANGERELATIVE * THRESHOLD / 100)
// plus or minus this many 1/100 degrees counts as GetJoyPadPOV being pressed // plus or minus this many 1/100 degrees counts as GetJoyPadPOV being pressed
#define POVANGLETHRESH 5675 #define POVANGLETHRESH 5675
#define MOUSEMOVE 5 #define MOUSEMOVE 5
// by default, scale the mouse input by this much // by default, scale the mouse input by this much
#define MOUSESCALEVALUE 10 #define MOUSESCALEVALUE 10
// percent to decay mouse buffer every frame. // percent to decay mouse buffer every frame.
// Tweak this from 0-100 to control how much the mouse drifts; values closer to 100 drift more, // Tweak this from 0-100 to control how much the mouse drifts; values closer to 100 drift more,
// while values closer to 0 are very stiff (deadpan) and don't turn well // while values closer to 0 are very stiff (deadpan) and don't turn well
#define MOUSEBUFFERDECAY 80 #define MOUSEBUFFERDECAY 80
#define N64DIVIDER 258 #define N64DIVIDER 258
#define DID_KEYBOARD 0 #define DID_KEYBOARD 0
#define DID_MOUSE 1 #define DID_MOUSE 1
#define DID_GAMEPAD 2 #define DID_GAMEPAD 2
#define DIB_KEYBOARD DISCL_NONEXCLUSIVE | DISCL_FOREGROUND #define DIB_KEYBOARD DISCL_NONEXCLUSIVE | DISCL_FOREGROUND
#define DIB_MOUSE DISCL_EXCLUSIVE | DISCL_FOREGROUND #define DIB_MOUSE DISCL_EXCLUSIVE | DISCL_FOREGROUND
#define DIB_FF DISCL_EXCLUSIVE | DISCL_BACKGROUND #define DIB_FF DISCL_EXCLUSIVE | DISCL_BACKGROUND
#define DIB_DEVICE DISCL_NONEXCLUSIVE | DISCL_BACKGROUND #define DIB_DEVICE DISCL_NONEXCLUSIVE | DISCL_BACKGROUND
#define DIB_CONFIG DISCL_NONEXCLUSIVE | DISCL_BACKGROUND #define DIB_CONFIG DISCL_NONEXCLUSIVE | DISCL_BACKGROUND
#define RUMBLE_NONE 0x00 #define RUMBLE_NONE 0x00
#define RUMBLE_CONSTANT 0x01 #define RUMBLE_CONSTANT 0x01
#define RUMBLE_RAMP 0x02 #define RUMBLE_RAMP 0x02
#define RUMBLE_CONDITION 0x04 #define RUMBLE_CONDITION 0x04
#define RUMBLE_PERIODIC 0x08 #define RUMBLE_PERIODIC 0x08
#define RUMBLE_CUSTOM 0x10 #define RUMBLE_CUSTOM 0x10
#define RUMBLE_DIRECT 0x80 #define RUMBLE_DIRECT 0x80
#define RUMBLE_EFF1 RUMBLE_CONSTANT #define RUMBLE_EFF1 RUMBLE_CONSTANT
#define RUMBLE_EFF2 RUMBLE_RAMP #define RUMBLE_EFF2 RUMBLE_RAMP
#define RUMBLE_EFF3 RUMBLE_DIRECT #define RUMBLE_EFF3 RUMBLE_DIRECT
// Reported Name of the Adaptoid // Reported Name of the Adaptoid
#define STRING_ADAPTOID "Adaptoid" #define STRING_ADAPTOID "Adaptoid"
#define STRING_GUID_SYSKEYBOARD _T("Keyboard") #define STRING_GUID_SYSKEYBOARD _T("Keyboard")
#define STRING_GUID_SYSMOUSE _T("SysMouse") #define STRING_GUID_SYSMOUSE _T("SysMouse")
// Query API - pass in command #, returns 0xB0CAB0CA if supported // Query API - pass in command #, returns 0xB0CAB0CA if supported
#define ADAPT_TEST 0x7834BB00 #define ADAPT_TEST 0x7834BB00
// Send command to rumble pack (DWORD 0=stop, 1=go) // Send command to rumble pack (DWORD 0=stop, 1=go)
#define ADAPT_RUMBLE 0x7834BB08 #define ADAPT_RUMBLE 0x7834BB08
// Initialize pak (returns pak status bit flags) // Initialize pak (returns pak status bit flags)
#define ADAPT_INIT 0x7834BB0C #define ADAPT_INIT 0x7834BB0C
// Read from pak (reads 32 bytes of data) // Read from pak (reads 32 bytes of data)
#define ADAPT_READPAK 0x7834BB0D #define ADAPT_READPAK 0x7834BB0D
// Write to pak (writes 32 bytes of data) // Write to pak (writes 32 bytes of data)
#define ADAPT_WRITEPAK 0x7834BB0E #define ADAPT_WRITEPAK 0x7834BB0E
// Send command directly to controller - synchronous // Send command directly to controller - synchronous
#define ADAPT_DIRECTCOMMAND 0x7834BB28 #define ADAPT_DIRECTCOMMAND 0x7834BB28
// The following inline functions are all overloads for existing functions // The following inline functions are all overloads for existing functions
inline bool CreateEffectHandle( int iDevice, BYTE bRumbleTyp, long lStrength ) inline bool CreateEffectHandle( int iDevice, BYTE bRumbleTyp, long lStrength )
{ {
return CreateEffectHandle( g_strEmuInfo.hMainWindow, g_apFFDevice[iDevice], g_apdiEffect[iDevice], bRumbleTyp, lStrength ); return CreateEffectHandle( g_strEmuInfo.hMainWindow, g_apFFDevice[iDevice], g_apdiEffect[iDevice], bRumbleTyp, lStrength );
} }
// this used to exist, but it was only used once and makes things more confusing. Removed. --rabid // this used to exist, but it was only used once and makes things more confusing. Removed. --rabid
//inline void ReleaseEffect( int iEffect ) //inline void ReleaseEffect( int iEffect )
//{ //{
// ReleaseEffect( g_apdiEffect[iEffect] ); // ReleaseEffect( g_apdiEffect[iEffect] );
//} //}
inline BYTE GetAdaptoidStatus( int iDevice ) inline BYTE GetAdaptoidStatus( int iDevice )
{ {
return GetAdaptoidStatus( g_apFFDevice[iDevice] ); return GetAdaptoidStatus( g_apFFDevice[iDevice] );
} }
inline HRESULT WriteAdaptoidPak( int iDevice, DWORD addr, LPBYTE data ) inline HRESULT WriteAdaptoidPak( int iDevice, DWORD addr, LPBYTE data )
{ {
return WriteAdaptoidPak( g_apFFDevice[iDevice], addr, data ); return WriteAdaptoidPak( g_apFFDevice[iDevice], addr, data );
} }
inline HRESULT ReadAdaptoidPak( int iDevice, DWORD addr, LPBYTE data ) inline HRESULT ReadAdaptoidPak( int iDevice, DWORD addr, LPBYTE data )
{ {
return ReadAdaptoidPak( g_apFFDevice[iDevice], addr, data ); return ReadAdaptoidPak( g_apFFDevice[iDevice], addr, data );
} }
inline HRESULT InitializeAdaptoid( int iDevice, LPBYTE status ) inline HRESULT InitializeAdaptoid( int iDevice, LPBYTE status )
{ {
return InitializeAdaptoid( g_apFFDevice[iDevice], status ); return InitializeAdaptoid( g_apFFDevice[iDevice], status );
} }
inline HRESULT DirectRumbleCommand( int iDevice, DWORD cmd ) inline HRESULT DirectRumbleCommand( int iDevice, DWORD cmd )
{ {
return DirectRumbleCommand( g_apFFDevice[iDevice], cmd ); return DirectRumbleCommand( g_apFFDevice[iDevice], cmd );
} }
inline bool IsAdaptoidCommandSupported( int iDevice, DWORD cmd ) inline bool IsAdaptoidCommandSupported( int iDevice, DWORD cmd )
{ {
return IsAdaptoidCommandSupported( g_apFFDevice[iDevice], cmd ); return IsAdaptoidCommandSupported( g_apFFDevice[iDevice], cmd );
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -55,75 +55,75 @@ inline bool StringtoGUIDA( LPGUID guid, const char * szGUIDbuf );
unsigned long djbHash(const char *str); unsigned long djbHash(const char *str);
#ifdef _UNICODE #ifdef _UNICODE
#define TCHAR_TO_CHAR(x,y,z) wcstombs(x,y,z) #define TCHAR_TO_CHAR(x,y,z) wcstombs(x,y,z)
#define CHAR_TO_TCHAR(x,y,z) mbstowcs(x,y,z) #define CHAR_TO_TCHAR(x,y,z) mbstowcs(x,y,z)
#else #else
#define TCHAR_TO_CHAR(x,y,z) strncpy(x,y,z) #define TCHAR_TO_CHAR(x,y,z) strncpy(x,y,z)
#define CHAR_TO_TCHAR(x,y,z) strncpy(x,y,z) #define CHAR_TO_TCHAR(x,y,z) strncpy(x,y,z)
#endif #endif
#define STRING_DEF_MEMPAKFILE _T("MemPaks") #define STRING_DEF_MEMPAKFILE _T("MemPaks")
#define STRING_DEF_GBROMFILE _T("GBxRoms") #define STRING_DEF_GBROMFILE _T("GBxRoms")
#define STRING_DEF_GBROMSAVE _T("GBxSaves") #define STRING_DEF_GBROMSAVE _T("GBxSaves")
#define STRING_INI_HEADER "# Generated by NRage input plugin V2 version " VER_FILE_VERSION_STR "\n" #define STRING_INI_HEADER "# Generated by NRage input plugin V2 version " VER_FILE_VERSION_STR "\n"
// We use these names for loading from INI files and NRage config files // We use these names for loading from INI files and NRage config files
#define STRING_INI_GENERAL "General" #define STRING_INI_GENERAL "General"
#define STRING_INI_CONTROLLER "Controller" #define STRING_INI_CONTROLLER "Controller"
#define STRING_INI_FOLDERS "Folders" #define STRING_INI_FOLDERS "Folders"
#define STRING_INI_BROWSER "lastBrowserDir" #define STRING_INI_BROWSER "lastBrowserDir"
#define STRING_INI_CONTROLS "Controls" #define STRING_INI_CONTROLS "Controls"
#define STRING_INI_SHORTCUTS "Shortcuts" #define STRING_INI_SHORTCUTS "Shortcuts"
#define STRING_INI_MODIFIERS "Modifiers" #define STRING_INI_MODIFIERS "Modifiers"
#define STRING_INI_LANGUAGE "Language" #define STRING_INI_LANGUAGE "Language"
#define STRING_INI_SHOWMESSAGES "ShowMessages" #define STRING_INI_SHOWMESSAGES "ShowMessages"
#define STRING_INI_BRPROFILE "Profile" #define STRING_INI_BRPROFILE "Profile"
#define STRING_INI_BRNOTE "Note" #define STRING_INI_BRNOTE "Note"
#define STRING_INI_BRMEMPAK "Mempak" #define STRING_INI_BRMEMPAK "Mempak"
#define STRING_INI_BRGBROM "GBxRom" #define STRING_INI_BRGBROM "GBxRom"
#define STRING_INI_BRGBSAVE "GBxSave" #define STRING_INI_BRGBSAVE "GBxSave"
// #define STRING_INI_BRSHORTCUTS STRING_INI_SHORTCUTS // #define STRING_INI_BRSHORTCUTS STRING_INI_SHORTCUTS
#define STRING_INI_PLUGGED "Plugged" #define STRING_INI_PLUGGED "Plugged"
#define STRING_INI_XINPUT "xInput" #define STRING_INI_XINPUT "xInput"
#define STRING_INI_N64MOUSE "N64Mouse" #define STRING_INI_N64MOUSE "N64Mouse"
#define STRING_INI_BACKGROUNDINPUT "BackgroundInput" #define STRING_INI_BACKGROUNDINPUT "BackgroundInput"
#define STRING_INI_RAWDATA "RawData" #define STRING_INI_RAWDATA "RawData"
#define STRING_INI_PAKTYPE "PakType" #define STRING_INI_PAKTYPE "PakType"
#define STRING_INI_REALN64RANGE "RealN64Range" #define STRING_INI_REALN64RANGE "RealN64Range"
#define STRING_INI_RAPIDFIREENABLED "RapidFireEnabled" #define STRING_INI_RAPIDFIREENABLED "RapidFireEnabled"
#define STRING_INI_RAPIDFIRERATE "RapidFireRate" #define STRING_INI_RAPIDFIRERATE "RapidFireRate"
#define STRING_INI_STICKRANGE "StickRange" #define STRING_INI_STICKRANGE "StickRange"
#define STRING_INI_MOUSEMOVEX "MouseMoveX" #define STRING_INI_MOUSEMOVEX "MouseMoveX"
#define STRING_INI_MOUSEMOVEY "MouseMoveY" #define STRING_INI_MOUSEMOVEY "MouseMoveY"
#define STRING_INI_AXISSET "AxisSet" #define STRING_INI_AXISSET "AxisSet"
#define STRING_INI_KEYABSOLUTEX "KeyAbsoluteX" #define STRING_INI_KEYABSOLUTEX "KeyAbsoluteX"
#define STRING_INI_KEYABSOLUTEY "KeyAbsoluteY" #define STRING_INI_KEYABSOLUTEY "KeyAbsoluteY"
#define STRING_INI_PADDEADZONE "PadDeadZone" #define STRING_INI_PADDEADZONE "PadDeadZone"
#define STRING_INI_MOUSESENSX "MouseSensitivityX" #define STRING_INI_MOUSESENSX "MouseSensitivityX"
#define STRING_INI_MOUSESENSY "MouseSensitivityY" #define STRING_INI_MOUSESENSY "MouseSensitivityY"
#define STRING_INI_RUMBLETYPE "RumbleType" #define STRING_INI_RUMBLETYPE "RumbleType"
#define STRING_INI_RUMBLESTRENGTH "RumbleStrength" #define STRING_INI_RUMBLESTRENGTH "RumbleStrength"
#define STRING_INI_VISUALRUMBLE "VisualRumble" #define STRING_INI_VISUALRUMBLE "VisualRumble"
#define STRING_INI_FFDEVICEGUID "FFDeviceGUID" #define STRING_INI_FFDEVICEGUID "FFDeviceGUID"
#define STRING_INI_MEMPAKFILE "MemPakFile" #define STRING_INI_MEMPAKFILE "MemPakFile"
#define STRING_INI_GBROMFILE "GBRomFile" #define STRING_INI_GBROMFILE "GBRomFile"
#define STRING_INI_GBROMSAVE "GBRomSave" #define STRING_INI_GBROMSAVE "GBRomSave"
#define STRING_INI_DINPUTGUID "DInputGUID" #define STRING_INI_DINPUTGUID "DInputGUID"
#define STRING_INI_BUTTON "Button" #define STRING_INI_BUTTON "Button"
#define STRING_INI_MODIFIER "Modifier" #define STRING_INI_MODIFIER "Modifier"
// The following are not found in INI files; only profile and shortcuts files // The following are not found in INI files; only profile and shortcuts files
#define STRING_PROFILEVERSION22 "Controller Profile 2.2" #define STRING_PROFILEVERSION22 "Controller Profile 2.2"
#define STRING_PROFILEVERSION STRING_PROFILEVERSION22 #define STRING_PROFILEVERSION STRING_PROFILEVERSION22
#define STRING_INI_FFDEVICENAME "FFDeviceName" #define STRING_INI_FFDEVICENAME "FFDeviceName"
#define STRING_INI_FFDEVICENR "FFDeviceNr" #define STRING_INI_FFDEVICENR "FFDeviceNr"
#define STRING_INI_DINPUTNAME "DInputName" #define STRING_INI_DINPUTNAME "DInputName"
#define STRING_INI_DINPUTNR "DInputNr" #define STRING_INI_DINPUTNR "DInputNr"
// the following are hashes for the string values above // the following are hashes for the string values above
@ -197,40 +197,40 @@ unsigned long djbHash(const char *str);
// If any of the following values conflict with djbHash return values (such as a blank string), there will be problems! // If any of the following values conflict with djbHash return values (such as a blank string), there will be problems!
// nothing // nothing
#define PL_NOHIT 0 #define PL_NOHIT 0
// [Category] // [Category]
#define PL_CATEGORY 1 #define PL_CATEGORY 1
// @STRING_PROFILEVERSION // @STRING_PROFILEVERSION
#define PL_VERSIONSTRING 10 #define PL_VERSIONSTRING 10
// resets the static vars in ProcessKey // resets the static vars in ProcessKey
#define PL_RESET 200 #define PL_RESET 200
#define DIRECTORY_MEMPAK 0 #define DIRECTORY_MEMPAK 0
#define DIRECTORY_GBROMS 1 #define DIRECTORY_GBROMS 1
#define DIRECTORY_GBSAVES 2 #define DIRECTORY_GBSAVES 2
#define DIRECTORY_CONFIG 252 #define DIRECTORY_CONFIG 252
#define DIRECTORY_LOG 253 #define DIRECTORY_LOG 253
#define DIRECTORY_DLL 254 #define DIRECTORY_DLL 254
#define DIRECTORY_APPLICATION 255 #define DIRECTORY_APPLICATION 255
#define DIRECTORY_INVALID 256 #define DIRECTORY_INVALID 256
#define FILIST_MEM 1 #define FILIST_MEM 1
#define FILIST_TRANSFER 2 #define FILIST_TRANSFER 2
#define BF_LOAD false #define BF_LOAD false
#define BF_SAVE true #define BF_SAVE true
#define BF_MEMPAK 0 #define BF_MEMPAK 0
#define BF_GBROM 1 #define BF_GBROM 1
#define BF_GBSAVE 2 #define BF_GBSAVE 2
#define BF_PROFILE 3 #define BF_PROFILE 3
#define BF_NOTE 4 #define BF_NOTE 4
#define BF_SHORTCUTS 5 #define BF_SHORTCUTS 5
// 32 hex characters, 4 hyphens, 2 end braces // 32 hex characters, 4 hyphens, 2 end braces
#define GUID_STRINGLENGTH 32+4+2 #define GUID_STRINGLENGTH 32+4+2
#endif // #ifndef _FILEACCESS_H_ #endif // #ifndef _FILEACCESS_H_

File diff suppressed because it is too large Load Diff

View File

@ -21,27 +21,27 @@ typedef struct _gbCartRTC {
typedef struct _GBCART typedef struct _GBCART
{ {
unsigned int iCurrentRomBankNo; unsigned int iCurrentRomBankNo;
unsigned int iCurrentRamBankNo; unsigned int iCurrentRamBankNo;
int iCartType; int iCartType;
bool bHasRam; bool bHasRam;
bool bHasBattery; bool bHasBattery;
bool bHasTimer; bool bHasTimer;
bool bHasRumble; bool bHasRumble;
bool bRamEnableState; bool bRamEnableState;
bool bMBC1RAMbanking; // if false, use 2 magic bits for Most Significant Bits of ROM banking (default); if true, use the 2 magic bits for RAM banking bool bMBC1RAMbanking; // if false, use 2 magic bits for Most Significant Bits of ROM banking (default); if true, use the 2 magic bits for RAM banking
unsigned int iNumRomBanks; unsigned int iNumRomBanks;
unsigned int iNumRamBanks; unsigned int iNumRamBanks;
BYTE TimerData[5]; BYTE TimerData[5];
BYTE LatchedTimerData[5]; BYTE LatchedTimerData[5];
time_t timerLastUpdate; time_t timerLastUpdate;
bool TimerDataLatched; bool TimerDataLatched;
HANDLE hRomFile; // a file mapping handle HANDLE hRomFile; // a file mapping handle
HANDLE hRamFile; // a file mapping handle, must be NULL if malloc'd ram is being used instead of a valid memory mapped file HANDLE hRamFile; // a file mapping handle, must be NULL if malloc'd ram is being used instead of a valid memory mapped file
const unsigned char * RomData; // max [0x200 * 0x4000]; const unsigned char * RomData; // max [0x200 * 0x4000];
LPBYTE RamData; // max [0x10 * 0x2000]; LPBYTE RamData; // max [0x10 * 0x2000];
bool (*ptrfnReadCart)(_GBCART * Cart, WORD dwAddress, BYTE *Data); // ReadCart handler bool (*ptrfnReadCart)(_GBCART * Cart, WORD dwAddress, BYTE *Data); // ReadCart handler
bool (*ptrfnWriteCart)(_GBCART * Cart, WORD dwAddress, BYTE *Data); // WriteCart handler bool (*ptrfnWriteCart)(_GBCART * Cart, WORD dwAddress, BYTE *Data); // WriteCart handler
} GBCART, *LPGBCART; } GBCART, *LPGBCART;
bool LoadCart(LPGBCART Cart, LPCTSTR RomFile, LPCTSTR RamFile, LPCTSTR TdfFile); bool LoadCart(LPGBCART Cart, LPCTSTR RomFile, LPCTSTR RamFile, LPCTSTR TdfFile);
@ -65,15 +65,15 @@ iCartType values:
Note, that 7 and up are not implemented yet. Note, that 7 and up are not implemented yet.
*/ */
#define GB_NORM 0x00 #define GB_NORM 0x00
#define GB_MBC1 0x01 #define GB_MBC1 0x01
#define GB_MBC2 0x02 #define GB_MBC2 0x02
#define GB_MMMO1 0x03 #define GB_MMMO1 0x03
#define GB_MBC3 0x04 #define GB_MBC3 0x04
#define GB_MBC5 0x05 #define GB_MBC5 0x05
#define GB_CAMERA 0x06 #define GB_CAMERA 0x06
#define GB_TAMA5 0x07 #define GB_TAMA5 0x07
#define GB_HUC3 0x08 #define GB_HUC3 0x08
#define GB_HUC1 0x09 #define GB_HUC1 0x09
#endif // #ifndef _GBCART_H_ #endif // #ifndef _GBCART_H_

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -29,64 +29,64 @@ void SetModifier( CONTROLLER *pcController );
void SetControllerDefaults( CONTROLLER *pcController ); void SetControllerDefaults( CONTROLLER *pcController );
// application internal message // application internal message
#define WM_USER_UPDATE WM_USER + 1 #define WM_USER_UPDATE WM_USER + 1
// application internal message // application internal message
#define WM_USER_READVALUES WM_USER + 2 #define WM_USER_READVALUES WM_USER + 2
#define CONFIGTHRESHOLD 50 #define CONFIGTHRESHOLD 50
#define MOUSE_THRESHOLD 10 #define MOUSE_THRESHOLD 10
#define SC_SCANSUCCEED 0x01 #define SC_SCANSUCCEED 0x01
#define SC_SCANESCAPE 0x10 #define SC_SCANESCAPE 0x10
#define TIMER_BUTTON 1 #define TIMER_BUTTON 1
#define INTERVAL_BUTTON 20 #define INTERVAL_BUTTON 20
#define INTERVAL_RUMBLETEST 20 #define INTERVAL_RUMBLETEST 20
#define MPAK_FORMATABLE 0x01 #define MPAK_FORMATABLE 0x01
#define MPAK_READABLE 0x02 #define MPAK_READABLE 0x02
#define MPAK_WRITEABLE 0x04 #define MPAK_WRITEABLE 0x04
#define MPAK_OK 0x07 #define MPAK_OK 0x07
#define MPAK_INUSE 0x12 #define MPAK_INUSE 0x12
#define MPAK_WRONGSIZE 0x27 #define MPAK_WRONGSIZE 0x27
#define MPAK_DAMAGED 0x71 #define MPAK_DAMAGED 0x71
#define MPAK_ERROR 0x81 #define MPAK_ERROR 0x81
#define MPAK_NOSELECTION 0xF0 #define MPAK_NOSELECTION 0xF0
#define BSET_CONTROLS 1 #define BSET_CONTROLS 1
#define BSET_SHORTCUTS 2 #define BSET_SHORTCUTS 2
typedef struct _IFDEVICE typedef struct _IFDEVICE
{ {
TCHAR szProductName[MAX_PATH+1]; TCHAR szProductName[MAX_PATH+1];
BYTE bProductCounter; BYTE bProductCounter;
} IFDEVICE, *LPIFDEVICE; } IFDEVICE, *LPIFDEVICE;
typedef struct _INTERFACEVALUES typedef struct _INTERFACEVALUES
{ {
BYTE ChosenTab; BYTE ChosenTab;
CONTROLLER Controllers[4]; CONTROLLER Controllers[4];
IFDEVICE FFDevices[4]; IFDEVICE FFDevices[4];
SHORTCUTS Shortcuts; SHORTCUTS Shortcuts;
LANGID Language; LANGID Language;
bool fDisplayShortPop; bool fDisplayShortPop;
} INTERFACEVALUES, *LPINTERFACEVALUES; } INTERFACEVALUES, *LPINTERFACEVALUES;
#define TAB_CONTROLLER1 0 #define TAB_CONTROLLER1 0
#define TAB_CONTROLLER2 1 #define TAB_CONTROLLER2 1
#define TAB_CONTROLLER3 2 #define TAB_CONTROLLER3 2
#define TAB_CONTROLLER4 3 #define TAB_CONTROLLER4 3
#define TAB_SHORTCUTS 4 #define TAB_SHORTCUTS 4
#define TAB_FOLDERS 5 #define TAB_FOLDERS 5
#define TAB_CONTROLS 0 #define TAB_CONTROLS 0
#define TAB_DEVICES 1 #define TAB_DEVICES 1
#define TAB_MODIFIERS 2 #define TAB_MODIFIERS 2
#define TAB_PAK 3 #define TAB_PAK 3
extern INTERFACEVALUES *g_ivConfig; extern INTERFACEVALUES *g_ivConfig;

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -41,29 +41,29 @@ BOOL CALLBACK EnumLangProc(HANDLE hModule, LPCTSTR lpszType, LPCTSTR lpszName, W
// "If it ain't broke, don't fix it." // "If it ain't broke, don't fix it."
// Loads the satellite DLL specified for the language DesiredLanguage // Loads the satellite DLL specified for the language DesiredLanguage
HMODULE LoadLanguageDLL(LANGID DesiredLanguage) HMODULE LoadLanguageDLL(LANGID DesiredLanguage)
{ {
TCHAR SatellitePath[MAX_PATH]; TCHAR SatellitePath[MAX_PATH];
HMODULE hDLL; HMODULE hDLL;
// First try to load the library with the fully specified language // First try to load the library with the fully specified language
_stprintf(SatellitePath, _T("NRage-Language-%u.dll"), DesiredLanguage); _stprintf(SatellitePath, _T("NRage-Language-%u.dll"), DesiredLanguage);
hDLL = LoadLibraryEx(SatellitePath, 0, 0); hDLL = LoadLibraryEx(SatellitePath, 0, 0);
if( hDLL ) if( hDLL )
return hDLL; return hDLL;
else else
{ // try the primary language ID { // try the primary language ID
DesiredLanguage = PRIMARYLANGID(DesiredLanguage); DesiredLanguage = PRIMARYLANGID(DesiredLanguage);
_stprintf(SatellitePath, _T("NRage-Language-%u.dll"), DesiredLanguage); _stprintf(SatellitePath, _T("NRage-Language-%u.dll"), DesiredLanguage);
hDLL = LoadLibraryEx(SatellitePath, 0, 0); hDLL = LoadLibraryEx(SatellitePath, 0, 0);
if( hDLL ) if( hDLL )
return hDLL; return hDLL;
else else
{ {
DebugWrite(_T("Couldn't load library: %s\n"), SatellitePath); DebugWrite(_T("Couldn't load library: %s\n"), SatellitePath);
return NULL; return NULL;
} }
} }
} }
// The following functions contain code to // The following functions contain code to
@ -71,7 +71,7 @@ HMODULE LoadLanguageDLL(LANGID DesiredLanguage)
// user interface should be displayed // user interface should be displayed
BOOL CALLBACK EnumLangProc(HANDLE hModule, LPCTSTR lpszType, LPCTSTR lpszName, BOOL CALLBACK EnumLangProc(HANDLE hModule, LPCTSTR lpszType, LPCTSTR lpszName,
WORD wIDLanguage, LONG_PTR lParam) WORD wIDLanguage, LONG_PTR lParam)
{ {
PLANGINFO LangInfo; PLANGINFO LangInfo;
@ -113,7 +113,7 @@ BOOL IsHongKongVersion()
{ {
HMODULE hMod; HMODULE hMod;
BOOL bRet=FALSE; BOOL bRet=FALSE;
typedef BOOL (WINAPI *IMMRELEASECONTEXT)(HWND,HIMC); typedef BOOL (WINAPI *IMMRELEASECONTEXT)(HWND,HIMC);
IMMRELEASECONTEXT pImmReleaseContext; IMMRELEASECONTEXT pImmReleaseContext;
hMod = LoadLibrary(_T("imm32.dll")); hMod = LoadLibrary(_T("imm32.dll"));
@ -133,65 +133,65 @@ BOOL IsHongKongVersion()
LANGID DetectLanguage() LANGID DetectLanguage()
{ {
#define MAX_KEY_BUFFER 80 #define MAX_KEY_BUFFER 80
OSVERSIONINFO VersionInfo; OSVERSIONINFO VersionInfo;
LANGID uiLangID = 0; LANGID uiLangID = 0;
HKEY hKey; HKEY hKey;
DWORD Type, BuffLen = MAX_KEY_BUFFER; DWORD Type, BuffLen = MAX_KEY_BUFFER;
TCHAR LangKeyValue[MAX_KEY_BUFFER]; TCHAR LangKeyValue[MAX_KEY_BUFFER];
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if( !GetVersionEx(&VersionInfo) ) if( !GetVersionEx(&VersionInfo) )
return(0); return(0);
switch( VersionInfo.dwPlatformId ) switch( VersionInfo.dwPlatformId )
{ {
// On Windows NT, Windows 2000 or higher // On Windows NT, Windows 2000 or higher
case VER_PLATFORM_WIN32_NT: case VER_PLATFORM_WIN32_NT:
if( VersionInfo.dwMajorVersion >= 5) // Windows 2000 or higher if( VersionInfo.dwMajorVersion >= 5) // Windows 2000 or higher
{ {
// we need to dynamically link the GetUserDefaultUILanguage func // we need to dynamically link the GetUserDefaultUILanguage func
HMODULE hmKernDLL = LoadLibrary(_T("kernel32.dll")); HMODULE hmKernDLL = LoadLibrary(_T("kernel32.dll"));
if (hmKernDLL) if (hmKernDLL)
{ {
LANGID (*fpGetLang)() = NULL; LANGID (*fpGetLang)() = NULL;
fpGetLang = (LANGID(*)(void))GetProcAddress(hmKernDLL, "GetUserDefaultUILanguage"); fpGetLang = (LANGID(*)(void))GetProcAddress(hmKernDLL, "GetUserDefaultUILanguage");
uiLangID = fpGetLang(); uiLangID = fpGetLang();
} // and if we couldn't load kernel32.dll, just fall back to default language } // and if we couldn't load kernel32.dll, just fall back to default language
} }
else else
{ // for NT4 check the language of ntdll.dll { // for NT4 check the language of ntdll.dll
uiLangID = GetNTDLLNativeLangID(); uiLangID = GetNTDLLNativeLangID();
if (uiLangID == 1033) if (uiLangID == 1033)
{ // special processing for Honkong SAR version of NT4 { // special processing for Honkong SAR version of NT4
if (IsHongKongVersion()) if (IsHongKongVersion())
{ {
uiLangID = 3076; uiLangID = 3076;
} }
} }
} }
break; break;
// On Windows 95, Windows 98 or Windows ME // On Windows 95, Windows 98 or Windows ME
case VER_PLATFORM_WIN32_WINDOWS: case VER_PLATFORM_WIN32_WINDOWS:
// Open the registry key for the UI language // Open the registry key for the UI language
if( RegOpenKeyEx(HKEY_CURRENT_USER,_T("Default\\Control Panel\\Desktop\\ResourceLocale"), 0, if( RegOpenKeyEx(HKEY_CURRENT_USER,_T("Default\\Control Panel\\Desktop\\ResourceLocale"), 0,
KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS ) KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS )
{ {
// Get the type of the default key // Get the type of the default key
if( RegQueryValueEx(hKey, NULL, NULL, &Type, NULL, NULL) == ERROR_SUCCESS if( RegQueryValueEx(hKey, NULL, NULL, &Type, NULL, NULL) == ERROR_SUCCESS
&& Type == REG_SZ ) && Type == REG_SZ )
{ // Read the key value { // Read the key value
if( RegQueryValueEx(hKey, NULL, NULL, &Type, (LPBYTE)LangKeyValue, &BuffLen) if( RegQueryValueEx(hKey, NULL, NULL, &Type, (LPBYTE)LangKeyValue, &BuffLen)
== ERROR_SUCCESS ) == ERROR_SUCCESS )
{ {
uiLangID = _ttoi(LangKeyValue); uiLangID = _ttoi(LangKeyValue);
} }
} }
RegCloseKey(hKey); RegCloseKey(hKey);
} }
break; break;
} }
if (uiLangID == 0) if (uiLangID == 0)
{ {

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -30,15 +30,15 @@
typedef struct LANGINFO_DEF typedef struct LANGINFO_DEF
{ {
int Count; int Count;
LANGID LangID; LANGID LangID;
} LANGINFO; } LANGINFO;
typedef LANGINFO *PLANGINFO; typedef LANGINFO *PLANGINFO;
// only export these functions if UNICODE support is enabled // only export these functions if UNICODE support is enabled
#ifdef _UNICODE #ifdef _UNICODE
LANGID DetectLanguage(); LANGID DetectLanguage();
HMODULE LoadLanguageDLL(LANGID DesiredLanguage); HMODULE LoadLanguageDLL(LANGID DesiredLanguage);
#endif // #ifdef _UNICODE #endif // #ifdef _UNICODE
#endif // #ifndef _NRINTERNATIONAL_ #endif // #ifndef _NRINTERNATIONAL_

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,24 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
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_
@ -30,38 +30,38 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
//General Plugin //General Plugin
#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
#define DEFAULT_DEADZONE 5 #define DEFAULT_DEADZONE 5
#define DEFAULT_RUMBLETYP RUMBLE_EFF1 #define DEFAULT_RUMBLETYP RUMBLE_EFF1
#define DEFAULT_RUMBLESTRENGTH 80 #define DEFAULT_RUMBLESTRENGTH 80
#define DEFAULT_MOUSESENSIVITY 100 #define DEFAULT_MOUSESENSIVITY 100
#define DEFAULT_PAKTYPE PAK_MEM #define DEFAULT_PAKTYPE PAK_MEM
#define DEFAULT_MOUSEMOVE MM_BUFF #define DEFAULT_MOUSEMOVE MM_BUFF
#define PAK_NONE 0 #define PAK_NONE 0
#define PAK_MEM 1 #define PAK_MEM 1
#define PAK_RUMBLE 2 #define PAK_RUMBLE 2
#define PAK_TRANSFER 3 #define PAK_TRANSFER 3
#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;
HWND hMainWindow; HWND hMainWindow;
HINSTANCE hinst; HINSTANCE hinst;
LANGID Language; LANGID Language;
bool fDisplayShortPop; // do we display shortcut message popups? bool fDisplayShortPop; // do we display shortcut message popups?
/* /*
* 2015.11.09 cxd4 * 2015.11.09 cxd4
@ -71,152 +71,152 @@ typedef struct _EMULATOR_INFO
*/ */
CONTROL * controllers; CONTROL * controllers;
// 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
{ {
LPDIRECTINPUTDEVICE8 didHandle; LPDIRECTINPUTDEVICE8 didHandle;
TCHAR szProductName[MAX_PATH]; TCHAR szProductName[MAX_PATH];
BYTE bProductCounter; BYTE bProductCounter;
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
} stateAs; } stateAs;
} DEVICE, *LPDEVICE; } DEVICE, *LPDEVICE;
typedef struct _BUTTON typedef struct _BUTTON
{ {
bool fPrevPressed; // Was this button pressed last time we checked? (not to be saved in config) bool fPrevPressed; // Was this button pressed last time we checked? (not to be saved in config)
BYTE bOffset; // Offset in the DirectInput data structure BYTE bOffset; // Offset in the DirectInput data structure
BYTE bAxisID; // Tells which range of the Axe/POV is important (see AI_AXE_P, AI_POV_UP, etc) BYTE bAxisID; // Tells which range of the Axe/POV is important (see AI_AXE_P, AI_POV_UP, etc)
BYTE bBtnType; // Type of device/button: Keyboard key, Joystick axis, Joystick button, Mouse axis, etc BYTE bBtnType; // Type of device/button: Keyboard key, Joystick axis, Joystick button, Mouse axis, etc
LPDEVICE parentDevice; // pointer to the DEVICE this assignment came from LPDEVICE parentDevice; // pointer to the DEVICE this assignment came from
} BUTTON, *LPBUTTON; } BUTTON, *LPBUTTON;
// Modifiers are a feature built into NRage. Emulator turbo buttons, macros, stuff like that. // Modifiers are a feature built into NRage. Emulator turbo buttons, macros, stuff like that.
typedef struct _MODIFIER typedef struct _MODIFIER
{ {
BUTTON btnButton; // button to associate with BUTTON btnButton; // button to associate with
BYTE bModType; // Type of modifier (None, Movement, Macro, Config) BYTE bModType; // Type of modifier (None, Movement, Macro, Config)
BOOL fToggle; // false if you have to hold the button down to activate, true if the modifier toggles on button press BOOL fToggle; // false if you have to hold the button down to activate, true if the modifier toggles on button press
BOOL fStatus; // if true, control defaults to ACTIVE, and deactivates on button press BOOL fStatus; // if true, control defaults to ACTIVE, and deactivates on button press
DWORD32 dwSpecific; // will be cast to MODSPEC_MOVE, MODSPEC_MACRO, or MODSPEC_CONFIG DWORD32 dwSpecific; // will be cast to MODSPEC_MOVE, MODSPEC_MACRO, or MODSPEC_CONFIG
} MODIFIER, *LPMODIFIER; } MODIFIER, *LPMODIFIER;
// bModType (modifiers) // bModType (modifiers)
#define MDT_NONE 0 #define MDT_NONE 0
#define MDT_MOVE 1 #define MDT_MOVE 1
#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
{ {
unsigned fPlugged; // is the controller "plugged" (i.e. does the emulator see a controller on this port?) unsigned fPlugged; // is the controller "plugged" (i.e. does the emulator see a controller on this port?)
unsigned fXInput; // is the controller an xInput device? unsigned fXInput; // is the controller an xInput device?
unsigned fN64Mouse; // is the controller a N64 Mouse (Relative)? unsigned fN64Mouse; // is the controller a N64 Mouse (Relative)?
unsigned fRawData; // are we using RAW mode for this controller? unsigned fRawData; // are we using RAW mode for this controller?
unsigned fIsAdaptoid; // is it an adaptoid? unsigned fIsAdaptoid; // is it an adaptoid?
unsigned fKeyboard; // does it use a keyboard? unsigned fKeyboard; // does it use a keyboard?
unsigned fMouse; // does it use a mouse? unsigned fMouse; // does it use a mouse?
unsigned fGamePad; // does it use a gamepad/joystick? unsigned fGamePad; // does it use a gamepad/joystick?
unsigned fRealN64Range; // does it have the "Real N64 Range" flag set? unsigned fRealN64Range; // does it have the "Real N64 Range" flag set?
unsigned bAxisSet; // which set of axes are we using? (Control 1, Control 2) unsigned bAxisSet; // which set of axes are we using? (Control 1, Control 2)
unsigned bMouseMoveX; // does it use buffered/absolute mouse for X? MM_BUFF, MM_ABS, MM_DEAD unsigned bMouseMoveX; // does it use buffered/absolute mouse for X? MM_BUFF, MM_ABS, MM_DEAD
unsigned bMouseMoveY; // does it use buffered/absolute mouse for Y? unsigned bMouseMoveY; // does it use buffered/absolute mouse for Y?
unsigned fKeyAbsoluteX; // does it use absolute key for X? unsigned fKeyAbsoluteX; // does it use absolute key for X?
unsigned fKeyAbsoluteY; // does it use absolute key for Y? unsigned fKeyAbsoluteY; // does it use absolute key for Y?
unsigned fPakInitialized; // Has our pak been initialized? Used to make sure we don't try to write to a mempak that doesn't point to anything. unsigned fPakInitialized; // Has our pak been initialized? Used to make sure we don't try to write to a mempak that doesn't point to anything.
unsigned fPakCRCError; // The ROM sends CRC data when it tries to write to a mempak. Is the CRC incorrect? Usually indicates a bad ROM. unsigned fPakCRCError; // The ROM sends CRC data when it tries to write to a mempak. Is the CRC incorrect? Usually indicates a bad ROM.
unsigned PakType; // what type of controller pak? mempak? rumble? transfer? etc unsigned PakType; // what type of controller pak? mempak? rumble? transfer? etc
unsigned fVisualRumble; // is visual rumble enabled for this controller? unsigned fVisualRumble; // is visual rumble enabled for this controller?
unsigned bBackgroundInput; // allow input while main window isn't focused? unsigned bBackgroundInput; // allow input while main window isn't focused?
BYTE bRumbleTyp; // what type of rumble effect? none, constant, ramp, or direct? BYTE bRumbleTyp; // what type of rumble effect? none, constant, ramp, or direct?
GUID guidFFDevice; // GUID of the device that rumble gets sent to GUID guidFFDevice; // GUID of the device that rumble gets sent to
BYTE bStickRange; // our "range modifier". BYTE bStickRange; // our "range modifier".
long wAxeBuffer[4]; // makes pseudo-relative Movement possible through keyboard or buttons long wAxeBuffer[4]; // makes pseudo-relative Movement possible through keyboard or buttons
// also acts as a mouse buffer // also acts as a mouse buffer
WORD wMouseSensitivityX; // set per N64 controller, that's OK WORD wMouseSensitivityX; // set per N64 controller, that's OK
WORD wMouseSensitivityY; WORD wMouseSensitivityY;
BYTE bPadDeadZone; // our manual dead zone, set per N64 controller BYTE bPadDeadZone; // our manual dead zone, set per N64 controller
BYTE bRumbleStrength; // set per N64 controller BYTE bRumbleStrength; // set per N64 controller
unsigned short nModifiers; // number of modifiers unsigned short nModifiers; // number of modifiers
bool bRapidFireEnabled; bool bRapidFireEnabled;
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
void *pPakData; // Pointer to Pak Data (specific): see PakIO.h void *pPakData; // Pointer to Pak Data (specific): see PakIO.h
// pPakData->bPakType will always be a BYTE indicating what the current pak type is // pPakData->bPakType will always be a BYTE indicating what the current pak type is
XCONTROLLER xiController; // To handle an XInput enabled controller --tecnicors XCONTROLLER xiController; // To handle an XInput enabled controller --tecnicors
} 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
#define PF_DPADU 3 #define PF_DPADU 3
#define PF_START 4 #define PF_START 4
#define PF_TRIGGERZ 5 #define PF_TRIGGERZ 5
#define PF_BBUTTON 6 #define PF_BBUTTON 6
#define PF_ABUTTON 7 #define PF_ABUTTON 7
#define PF_CBUTTONR 8 #define PF_CBUTTONR 8
#define PF_CBUTTONL 9 #define PF_CBUTTONL 9
#define PF_CBUTTOND 10 #define PF_CBUTTOND 10
#define PF_CBUTTONU 11 #define PF_CBUTTONU 11
#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:
// //
@ -226,140 +226,140 @@ typedef struct _CONTROLLER // AN N64 CONTROLLER
// BYTE bOffset : Offset in the DirectInput data structure // BYTE bOffset : Offset in the DirectInput data structure
// 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
#define AI_POV_LEFT 3 #define AI_POV_LEFT 3
// 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;
struct struct
{ {
short XModification; short XModification;
short YModification; short YModification;
}; };
} MODSPEC_MOVE, *LPMODSPEC_MOVE; } MODSPEC_MOVE, *LPMODSPEC_MOVE;
typedef union _MODSPEC_MACRO typedef union _MODSPEC_MACRO
{ {
DWORD dwValue; DWORD dwValue;
struct struct
{ {
unsigned short aButtons; unsigned short aButtons;
unsigned short aFlags; unsigned short aFlags;
}; };
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;
typedef union _MODSPEC_CONFIG typedef union _MODSPEC_CONFIG
{ {
DWORD dwValue; DWORD dwValue;
struct struct
{ {
BYTE bAnalogStick; BYTE bAnalogStick;
BYTE bMouse; BYTE bMouse;
BYTE bKeyboard; BYTE bKeyboard;
}; };
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;
#define SC_NOPAK 0 #define SC_NOPAK 0
#define SC_MEMPAK 1 #define SC_MEMPAK 1
#define SC_RUMBPAK 2 #define SC_RUMBPAK 2
#define SC_TRANSPAK 3 #define SC_TRANSPAK 3
#define SC_VOICEPAK 4 #define SC_VOICEPAK 4
#define SC_ADAPTPAK 5 #define SC_ADAPTPAK 5
#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
{ {
BUTTON aButtons[SC_TOTAL]; BUTTON aButtons[SC_TOTAL];
//BUTTON NoPakButton; //BUTTON NoPakButton;
//BUTTON MemPakButton; //BUTTON MemPakButton;
//BUTTON RumblePakButton; //BUTTON RumblePakButton;
//BUTTON TransferPakButton; //BUTTON TransferPakButton;
//BUTTON VoicePakButton; //BUTTON VoicePakButton;
//BUTTON AdaptoidPakButton; //BUTTON AdaptoidPakButton;
//BUTTON SwMemRumbleButton; //BUTTON SwMemRumbleButton;
//BUTTON SwMemAdaptoidButton; //BUTTON SwMemAdaptoidButton;
} SHORTCUTSPL, *LPSHORTCUTSPL; } SHORTCUTSPL, *LPSHORTCUTSPL;
typedef struct _SHORTCUTS typedef struct _SHORTCUTS
{ {
SHORTCUTSPL Player[4]; SHORTCUTSPL Player[4];
BUTTON bMouseLock; BUTTON bMouseLock;
} SHORTCUTS, *LPSHORTCUTS; } SHORTCUTS, *LPSHORTCUTS;
typedef struct _MSHORTCUT { typedef struct _MSHORTCUT {
int iControl; int iControl;
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' )

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -54,65 +54,65 @@ void HextoTextA( const unsigned char * Data, LPSTR szText, const int nBytes );
//byte 2 = number of bytes to recieve //byte 2 = number of bytes to recieve
//byte 3 = Command Type //byte 3 = Command Type
// get status // get status
#define RD_GETSTATUS 0x00 #define RD_GETSTATUS 0x00
// read button values // read button values
#define RD_READKEYS 0x01 #define RD_READKEYS 0x01
// read from controllerpak // read from controllerpak
#define RD_READPAK 0x02 #define RD_READPAK 0x02
// write to controllerpack // write to controllerpack
#define RD_WRITEPAK 0x03 #define RD_WRITEPAK 0x03
// reset controller // reset controller
#define RD_RESETCONTROLLER 0xff #define RD_RESETCONTROLLER 0xff
// read eeprom // read eeprom
#define RD_READEEPROM 0x04 #define RD_READEEPROM 0x04
// write eeprom // write eeprom
#define RD_WRITEEPROM 0x05 #define RD_WRITEEPROM 0x05
// Codes for retrieving status // Codes for retrieving status
// 0x010300 - A1B2C3FF // 0x010300 - A1B2C3FF
//A1 //A1
// Default GamePad // Default GamePad
#define RD_ABSOLUTE 0x01 #define RD_ABSOLUTE 0x01
#define RD_RELATIVE 0x02 #define RD_RELATIVE 0x02
// Default GamePad // Default GamePad
#define RD_GAMEPAD 0x04 #define RD_GAMEPAD 0x04
//B2 //B2
#define RD_EEPROM 0x80 #define RD_EEPROM 0x80
#define RD_NOEEPROM 0x00 #define RD_NOEEPROM 0x00
//C3 //C3
// No Plugin in Controller // No Plugin in Controller
#define RD_NOPLUGIN 0x00 #define RD_NOPLUGIN 0x00
// Plugin in Controller (Mempack, RumblePack etc) // Plugin in Controller (Mempack, RumblePack etc)
#define RD_PLUGIN 0x01 #define RD_PLUGIN 0x01
// Pak interface was uninitialized before the call // Pak interface was uninitialized before the call
#define RD_NOTINITIALIZED 0x02 #define RD_NOTINITIALIZED 0x02
// Address of last Pak I/O was invalid // Address of last Pak I/O was invalid
#define RD_ADDRCRCERR 0x04 #define RD_ADDRCRCERR 0x04
// eeprom busy // eeprom busy
#define RD_EEPROMBUSY 0x80 #define RD_EEPROMBUSY 0x80
// The Error values are as follows: // The Error values are as follows:
// 0x01ER00 - ........ // 0x01ER00 - ........
//ER //ER
// no error, operation successful. // no error, operation successful.
#define RD_OK 0x00 #define RD_OK 0x00
// error, device not present for specified command. // error, device not present for specified command.
#define RD_ERROR 0x80 #define RD_ERROR 0x80
// error, unable to send/recieve the number bytes for command type. // error, unable to send/recieve the number bytes for command type.
#define RD_WRONGSIZE 0x40 #define RD_WRONGSIZE 0x40
// the address where rumble-commands are sent to // the address where rumble-commands are sent to
// this is really 0xC01B but our addressing code truncates the last several bits. // this is really 0xC01B but our addressing code truncates the last several bits.
#define PAK_IO_RUMBLE 0xC000 #define PAK_IO_RUMBLE 0xC000
// 32 KB mempak // 32 KB mempak
#define PAK_MEM_SIZE 32*1024 #define PAK_MEM_SIZE 32*1024
#define PAK_MEM_DEXOFFSET 0x1040 #define PAK_MEM_DEXOFFSET 0x1040
// Pak Specific Data // // Pak Specific Data //
// First BYTE always determines current Paktype // First BYTE always determines current Paktype
@ -125,49 +125,49 @@ void HextoTextA( const unsigned char * Data, LPSTR szText, const int nBytes );
//PAK_MEM //PAK_MEM
typedef struct _MEMPAK typedef struct _MEMPAK
{ {
BYTE bPakType; // set to PAK_MEM BYTE bPakType; // set to PAK_MEM
HANDLE hMemPakHandle; // a file mapping handle HANDLE hMemPakHandle; // a file mapping handle
bool fDexSave; // true if .n64 file, false if .mpk file bool fDexSave; // true if .n64 file, false if .mpk file
bool fReadonly; // set if we can't open mempak file in "write" mode bool fReadonly; // set if we can't open mempak file in "write" mode
LPBYTE aMemPakData; //[PAK_MEM_SIZE]; LPBYTE aMemPakData; //[PAK_MEM_SIZE];
BYTE aMemPakTemp[0x100]; // some extra on the top for "test" (temporary) data BYTE aMemPakTemp[0x100]; // some extra on the top for "test" (temporary) data
} MEMPAK, *LPMEMPAK; } MEMPAK, *LPMEMPAK;
//PAK_RUMBLE //PAK_RUMBLE
typedef struct _RUMBLEPAK typedef struct _RUMBLEPAK
{ {
BYTE bPakType; BYTE bPakType;
// BYTE bRumbleTyp; // obsolete: use g_pcControllers[i].xyz instead --rabid // BYTE bRumbleTyp; // obsolete: use g_pcControllers[i].xyz instead --rabid
// BYTE bRumbleStrength; // BYTE bRumbleStrength;
// bool fVisualRumble; // bool fVisualRumble;
bool fLastData; // true if the last data sent to block 0x8000 was nonzero bool fLastData; // true if the last data sent to block 0x8000 was nonzero
} RUMBLEPAK, *LPRUMBLEPAK; } RUMBLEPAK, *LPRUMBLEPAK;
#include "GBCart.h" #include "GBCart.h"
//PAK_TRANSFER //PAK_TRANSFER
typedef struct _TRANSFERPAK typedef struct _TRANSFERPAK
{ {
BYTE bPakType; BYTE bPakType;
int iCurrentBankNo; int iCurrentBankNo;
int iCurrentAccessMode; int iCurrentAccessMode;
int iAccessModeChanged; int iAccessModeChanged;
bool iEnableState; bool iEnableState;
bool bPakInserted; bool bPakInserted;
GBCART gbCart; GBCART gbCart;
} TRANSFERPAK, *LPTRANSFERPAK; } TRANSFERPAK, *LPTRANSFERPAK;
//PAK_VOICE //PAK_VOICE
typedef struct _VOICEPAK //not supported typedef struct _VOICEPAK //not supported
{ {
BYTE bPakType; BYTE bPakType;
} VOICEPAK, *LPVOICEPAK; } VOICEPAK, *LPVOICEPAK;
//PAK_ADAPTOID //PAK_ADAPTOID
typedef struct _ADAPTOIDPAK typedef struct _ADAPTOIDPAK
{ {
BYTE bPakType; BYTE bPakType;
BYTE bIdentifier; BYTE bIdentifier;
bool fRumblePak; bool fRumblePak;
} ADAPTOIDPAK, *LPADAPTOIDPAK; } ADAPTOIDPAK, *LPADAPTOIDPAK;
#endif // #ifndef _PAKIO_H_ #endif // #ifndef _PAKIO_H_

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
/* /*
XInput Controller support for N-Rage`s Dinput8 Plugin XInput Controller support for N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka - N-Rage`s Dinput8 Plugin (C) 2002, 2006 Norbert Wladyka - N-Rage`s Dinput8 Plugin
(C) 2009 Daniel Rehren - XInput Controller support (C) 2009 Daniel Rehren - XInput Controller support
N-Rage`s Dinput8 Plugin: N-Rage`s Dinput8 Plugin:
Author`s Email: norbert.wladyka@chello.at Author`s Email: norbert.wladyka@chello.at
Website: http://go.to/nrage Website: http://go.to/nrage
XInput Controller support: XInput Controller support:
Author's Email: rehren_007@hotmail.com Author's Email: rehren_007@hotmail.com
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
@ -33,7 +33,7 @@
/* fixes undefined FILE, etc. type errors in MSVC 2010 build -- cxd4 */ /* fixes undefined FILE, etc. type errors in MSVC 2010 build -- cxd4 */
#include <stdio.h> #include <stdio.h>
#ifndef SAFE_RELEASE // when Windows Media Device M? is not present #ifndef SAFE_RELEASE // when Windows Media Device M? is not present
#define SAFE_RELEASE(x) \ #define SAFE_RELEASE(x) \
if(x != NULL) \ if(x != NULL) \
{ \ { \
@ -51,10 +51,10 @@ BOOL IsXInputDevice( const GUID* pGuidProductFromDirectInput );
//END conde from ... //END conde from ...
/* /*
Xinput header for NRage Plugin, by tecnicors. Xinput header for NRage Plugin, by tecnicors.
XInput Controller is going to take over the N64 control that matches its XInput Controller is going to take over the N64 control that matches its
number, ie. first XInput controller is first N64 player, etc. number, ie. first XInput controller is first N64 player, etc.
*/ */
#include "commonIncludes.h" #include "commonIncludes.h"
@ -68,34 +68,34 @@ BOOL IsXInputDevice( const GUID* pGuidProductFromDirectInput );
//enums //enums
namespace N64_BUTTONS namespace N64_BUTTONS
{ {
// Whith this we can asign buttons to the xinput struct // Whith this we can asign buttons to the xinput struct
enum _N64_BUTTONS { A = 0x0080, B = 0x0040, Z = 0x0020, R = 0x1000, L = 0x2000, XAxis = 0x4000, enum _N64_BUTTONS { A = 0x0080, B = 0x0040, Z = 0x0020, R = 0x1000, L = 0x2000, XAxis = 0x4000,
Start = 0x0010, DUp = 0x0008, DDown = 0x0004, DLeft = 0x0002, YAxis = 0x8000, Start = 0x0010, DUp = 0x0008, DDown = 0x0004, DLeft = 0x0002, YAxis = 0x8000,
DRight = 0x0001, CUp = 0x0800, CDown = 0x0400, CLeft = 0x0200, CRight = 0x0100, DRight = 0x0001, CUp = 0x0800, CDown = 0x0400, CLeft = 0x0200, CRight = 0x0100,
None = 0x0 }; None = 0x0 };
} }
//structures //structures
typedef struct _XCONTROLLER // XInput controller struct typedef struct _XCONTROLLER // XInput controller struct
{ {
int nControl; int nControl;
bool bConfigured; bool bConfigured;
struct _N64_BUTTONS // For button configurations struct _N64_BUTTONS // For button configurations
{ {
int iA, iB; int iA, iB;
int iStart; int iStart;
int iL, iR, iZ; int iL, iR, iZ;
int iXAxis, iYAxis; int iXAxis, iYAxis;
int iDUp, iDDown, iDLeft, iDRight; int iDUp, iDDown, iDLeft, iDRight;
int iCUp, iCDown, iCLeft, iCRight; int iCUp, iCDown, iCLeft, iCRight;
}stButtons; }stButtons;
struct _XINPUT_ANALOGS // For analog configurations struct _XINPUT_ANALOGS // For analog configurations
{ {
int iLeftTrigger, iRightTrigger; int iLeftTrigger, iRightTrigger;
unsigned int iRXAxis, iRYAxis, iLXAxis, iLYAxis; unsigned int iRXAxis, iRYAxis, iLXAxis, iLYAxis;
}stAnalogs; }stAnalogs;
}XCONTROLLER; }XCONTROLLER;
@ -132,32 +132,32 @@ void StoreXInputControllerKeys( HWND hDlg, LPXCONTROLLER gController );
// Fills N64 button comobox with its buttons. // Fills N64 button comobox with its buttons.
inline void FillN64ButtonComboBox( HWND hDlg, int ComboBox ) inline void FillN64ButtonComboBox( HWND hDlg, int ComboBox )
{ {
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "None" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "None" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "A" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "A" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "B" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "B" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "Z" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "Z" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "L" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "L" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "R" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "R" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "Start" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "Start" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Up" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Up" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Left" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Left" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Down" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Down" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Right" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C-Right" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Up" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Up" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Left" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Left" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Down" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Down" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Right" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "D-Right" ));
SendDlgItemMessage( hDlg, ComboBox, CB_SETCURSEL, 0, ( LPARAM )0 ); SendDlgItemMessage( hDlg, ComboBox, CB_SETCURSEL, 0, ( LPARAM )0 );
} }
inline void FillN64AnalogComboBox( HWND hDlg, int ComboBox ) inline void FillN64AnalogComboBox( HWND hDlg, int ComboBox )
{ {
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "None" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "None" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "DPad" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "DPad" ));
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C Buttons" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "C Buttons" ));
if( ComboBox != IDC_XC_DPAD ) if( ComboBox != IDC_XC_DPAD )
SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "Analog Stick" )); SendDlgItemMessage( hDlg, ComboBox, CB_ADDSTRING, 0, ( LPARAM )_T( "Analog Stick" ));
SendDlgItemMessage( hDlg, ComboBox, CB_SETCURSEL, 0, ( LPARAM )0); SendDlgItemMessage( hDlg, ComboBox, CB_SETCURSEL, 0, ( LPARAM )0);
} }
// Save/Load Keys from own config file // Save/Load Keys from own config file

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -40,7 +40,7 @@
#define P_malloc( size ) HeapAlloc( g_hHeap, 0, size ) #define P_malloc( size ) HeapAlloc( g_hHeap, 0, size )
#define P_free( memory ) HeapFree( g_hHeap, 0, memory ) #define P_free( memory ) HeapFree( g_hHeap, 0, memory )
#define P_realloc( memory, size ) \ #define P_realloc( memory, size ) \
( (memory == NULL) ? P_malloc(size) : HeapReAlloc( g_hHeap, 0, memory, size ) ) ( (memory == NULL) ? P_malloc(size) : HeapReAlloc( g_hHeap, 0, memory, size ) )
#ifdef ARRAYSIZE #ifdef ARRAYSIZE
#undef ARRAYSIZE #undef ARRAYSIZE

View File

@ -2,7 +2,7 @@
// Microsoft Visual C++ generated include file. // Microsoft Visual C++ generated include file.
// Used by NRagePluginV2.rc // Used by NRagePluginV2.rc
// //
#define IDC_STATIC -1 #define IDC_STATIC -1
#define IDC_STOREINDB 3 #define IDC_STOREINDB 3
#define IDC_ERASEFROMDB 4 #define IDC_ERASEFROMDB 4
#define IDC_SAVEPROFILE 5 #define IDC_SAVEPROFILE 5

View File

@ -1,9 +1,9 @@
/* /*
N-Rage`s Dinput8 Plugin N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka (C) 2002, 2006 Norbert Wladyka
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
@ -44,31 +44,31 @@
#endif // #ifdef __GNUC__ #endif // #ifdef __GNUC__
// Our default buffer size for TCHAR arrays (resources get loaded through here) // Our default buffer size for TCHAR arrays (resources get loaded through here)
// MAKE SURE localized resources do not exceed this limit, or they will be cut off. // MAKE SURE localized resources do not exceed this limit, or they will be cut off.
#define DEFAULT_BUFFER 256 #define DEFAULT_BUFFER 256
// use default settings for Release and Debugbuild // use default settings for Release and Debugbuild
#define STDCONFIG #define STDCONFIG
#ifndef STDCONFIG #ifndef STDCONFIG
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// custom (nonstandard) settings here // custom (nonstandard) settings here
// workaround for a Adaptoiddriver bug; // workaround for a Adaptoiddriver bug;
// basically if the Adaptoid USB driver doesn't respond that there's a pak, say there is one anyway // basically if the Adaptoid USB driver doesn't respond that there's a pak, say there is one anyway
#define ADAPTOIDPAK_RUMBLEFIX #define ADAPTOIDPAK_RUMBLEFIX
// remove unimplemented Elements of the GUI // remove unimplemented Elements of the GUI
// #define HIDEUNIMPLEMENTED // #define HIDEUNIMPLEMENTED
// check controllercommands for valid CRC // check controllercommands for valid CRC
// #define MAKEADRESSCRCCHECK // #define MAKEADRESSCRCCHECK
// display Button for writing Shortcuts binary // display Button for writing Shortcuts binary
// #define RAWPROFILEWRITE // #define RAWPROFILEWRITE
// enable selection of Transferpak // enable selection of Transferpak
// #define V_TRANSFERPAK // #define V_TRANSFERPAK
// enable selection of VoicePak // enable selection of VoicePak
// #define V_VOICEPAK // #define V_VOICEPAK
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -78,20 +78,20 @@
#ifdef _DEBUG #ifdef _DEBUG
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Standard Debug Settings // Standard Debug Settings
// workaround for a Adaptoiddriver bug // workaround for a Adaptoiddriver bug
#define ADAPTOIDPAK_RUMBLEFIX #define ADAPTOIDPAK_RUMBLEFIX
// remove unimplemented Elements of the GUI // remove unimplemented Elements of the GUI
// #define HIDEUNIMPLEMENTED // #define HIDEUNIMPLEMENTED
// check controllercommands for valid CRC // check controllercommands for valid CRC
#define MAKEADRESSCRCCHECK #define MAKEADRESSCRCCHECK
// display Button for writing Shortcuts binary // display Button for writing Shortcuts binary
#define RAWPROFILEWRITE #define RAWPROFILEWRITE
// enable selection of Transferpak // enable selection of Transferpak
#define V_TRANSFERPAK #define V_TRANSFERPAK
// enable selection of VoicePak // enable selection of VoicePak
#define V_VOICEPAK #define V_VOICEPAK
// spits out loads of extra info for ControllerCommand and ReadController // spits out loads of extra info for ControllerCommand and ReadController
@ -102,20 +102,20 @@
#else #else
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Standard Release Settings // Standard Release Settings
// workaround for a Adaptoiddriver bug // workaround for a Adaptoiddriver bug
#define ADAPTOIDPAK_RUMBLEFIX #define ADAPTOIDPAK_RUMBLEFIX
// remove unimplemented Elements of the GUI // remove unimplemented Elements of the GUI
#define HIDEUNIMPLEMENTED #define HIDEUNIMPLEMENTED
// check controllercommands for valid CRC // check controllercommands for valid CRC
// #define MAKEADRESSCRCCHECK // #define MAKEADRESSCRCCHECK
// display Button for writing Shortcuts binary // display Button for writing Shortcuts binary
// #define RAWPROFILEWRITE // #define RAWPROFILEWRITE
// enable selection of Transferpak // enable selection of Transferpak
#define V_TRANSFERPAK #define V_TRANSFERPAK
// enable selection of VoicePak // enable selection of VoicePak
// #define V_VOICEPAK // #define V_VOICEPAK
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------