Added N64 Mouse support in NRage

This commit is contained in:
LuigiBlood 2015-05-11 22:39:29 +02:00 committed by luigiblood
parent 6f28b3e424
commit c967d4f46e
7 changed files with 72 additions and 44 deletions

View File

@ -253,6 +253,10 @@ bool ProcessKey( DWORD dwKey, DWORD dwSection, LPCSTR pszLine, LPTSTR pszFFDevic
if (pController) if (pController)
pController->fXInput = atoi(pszLine); pController->fXInput = atoi(pszLine);
break; break;
case CHK_N64MOUSE:
if (pController)
pController->fN64Mouse = atoi(pszLine);
break;
case CHK_PAKTYPE: case CHK_PAKTYPE:
if (pController) if (pController)
pController->PakType = atoi(pszLine); pController->PakType = atoi(pszLine);
@ -1485,6 +1489,7 @@ void DumpControllerSettings(FILE * fFile, int i, bool bIsINI)
fprintf(fFile, STRING_INI_PLUGGED "=%u\n", g_ivConfig->Controllers[i].fPlugged); fprintf(fFile, STRING_INI_PLUGGED "=%u\n", g_ivConfig->Controllers[i].fPlugged);
fprintf(fFile, STRING_INI_XINPUT "=%u\n", g_ivConfig->Controllers[i].fXInput); fprintf(fFile, STRING_INI_XINPUT "=%u\n", g_ivConfig->Controllers[i].fXInput);
fprintf(fFile, STRING_INI_N64MOUSE "=%u\n", g_ivConfig->Controllers[i].fN64Mouse);
fprintf(fFile, STRING_INI_RAWDATA "=%u\n", g_ivConfig->Controllers[i].fRawData); fprintf(fFile, STRING_INI_RAWDATA "=%u\n", g_ivConfig->Controllers[i].fRawData);
fprintf(fFile, STRING_INI_PAKTYPE "=%u\n", g_ivConfig->Controllers[i].PakType); fprintf(fFile, STRING_INI_PAKTYPE "=%u\n", g_ivConfig->Controllers[i].PakType);
fprintf(fFile, STRING_INI_REALN64RANGE "=%u\n", g_ivConfig->Controllers[i].fRealN64Range); fprintf(fFile, STRING_INI_REALN64RANGE "=%u\n", g_ivConfig->Controllers[i].fRealN64Range);

View File

@ -86,6 +86,7 @@ unsigned long djbHash(const char *str);
#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_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"
@ -154,6 +155,7 @@ unsigned long djbHash(const char *str);
#define CHK_PLUGGED 3378836077 #define CHK_PLUGGED 3378836077
#define CHK_XINPUT 3665436173 #define CHK_XINPUT 3665436173
#define CHK_N64MOUSE 863329606
#define CHK_RAWDATA 1238573385 #define CHK_RAWDATA 1238573385
#define CHK_PAKTYPE 2936974691 #define CHK_PAKTYPE 2936974691
#define CHK_REALN64RANGE 1279831790 #define CHK_REALN64RANGE 1279831790

View File

@ -548,6 +548,10 @@ BOOL CALLBACK ControllerTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
} }
return TRUE; // END IDC_XINPUT_ENABLER return TRUE; // END IDC_XINPUT_ENABLER
case IDC_N64MOUSE:
pcController->fN64Mouse = (IsDlgButtonChecked(hDlg, LOWORD(wParam)) == BST_CHECKED);
return TRUE;
default: default:
return FALSE; return FALSE;
} }
@ -556,6 +560,7 @@ BOOL CALLBACK ControllerTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
// for this dialog // for this dialog
CheckDlgButton( hDlg, IDC_PLUGGED, pcController->fPlugged ? BST_CHECKED : BST_UNCHECKED ); CheckDlgButton( hDlg, IDC_PLUGGED, pcController->fPlugged ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_XINPUT_ENABLER, pcController->fXInput ? BST_CHECKED : BST_UNCHECKED ); CheckDlgButton( hDlg, IDC_XINPUT_ENABLER, pcController->fXInput ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton( hDlg, IDC_N64MOUSE, pcController->fN64Mouse ? BST_CHECKED : BST_UNCHECKED);
if( hTabControl ) if( hTabControl )
DestroyWindow( hTabControl ); DestroyWindow( hTabControl );

View File

@ -602,9 +602,14 @@ EXPORT void CALL ReadController( int Control, BYTE * Command )
#ifdef ENABLE_RAWPAK_DEBUG #ifdef ENABLE_RAWPAK_DEBUG
WriteDatasA( "GetStatus-PreProcessing", Control, Command, 0); WriteDatasA( "GetStatus-PreProcessing", Control, Command, 0);
#endif #endif
Command[3] = RD_GAMEPAD | RD_ABSOLUTE; Command[3] = RD_GAMEPAD;
Command[4] = RD_NOEEPROM; Command[4] = RD_NOEEPROM;
if (g_pcControllers[Control].fN64Mouse) // Is Controller a mouse?
Command[3] |= RD_RELATIVE;
else
Command[3] |= RD_ABSOLUTE;
if( g_pcControllers[Control].fPakInitialized && g_pcControllers[Control].pPakData ) if( g_pcControllers[Control].fPakInitialized && g_pcControllers[Control].pPakData )
{ {
if( *(BYTE*)g_pcControllers[Control].pPakData == PAK_ADAPTOID ) if( *(BYTE*)g_pcControllers[Control].pPakData == PAK_ADAPTOID )

View File

@ -126,6 +126,7 @@ 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 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?

View File

@ -1,7 +1,6 @@
// Microsoft Visual C++ generated resource script. // Microsoft Visual C++ generated resource script.
// //
#include "resource.h" #include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@ -179,12 +178,13 @@ EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
CONTROL "Plugged",IDC_PLUGGED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,45,13 CONTROL "Plugged",IDC_PLUGGED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,45,13
PUSHBUTTON "Clear Controller",IDC_CLEARCONTROLLER,63,7,67,13 PUSHBUTTON "Clear Controller",IDC_CLEARCONTROLLER,104,7,67,13
PUSHBUTTON "Default Config",IDC_SETDEFAULT,63,21,67,13 PUSHBUTTON "Default Config",IDC_SETDEFAULT,104,21,67,13
PUSHBUTTON "Load Profile",IDC_LOADPROFILE,191,7,67,13 PUSHBUTTON "Load Profile",IDC_LOADPROFILE,191,7,67,13
PUSHBUTTON "Save Profile",IDC_SAVEPROFILE,272,7,67,13 PUSHBUTTON "Save Profile",IDC_SAVEPROFILE,272,7,67,13
CONTROL "PLACEHOLDER",IDC_CONTROLLERTAB,"SysTabControl32",WS_GROUP | WS_TABSTOP,0,38,375,196 CONTROL "PLACEHOLDER",IDC_CONTROLLERTAB,"SysTabControl32",WS_GROUP | WS_TABSTOP,0,38,375,196
CONTROL "XInput",IDC_XINPUT_ENABLER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,22,37,10 CONTROL "XInput",IDC_XINPUT_ENABLER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,22,37,10
CONTROL "N64 Mouse",IDC_N64MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,52,22,51,10
END END
IDD_SHORTCUT DIALOGEX 0, 0, 376, 235 IDD_SHORTCUT DIALOGEX 0, 0, 376, 235
@ -524,25 +524,29 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILE_VERSION FILEVERSION 2,4,0,4
PRODUCTVERSION VER_PRODUCT_VERSION PRODUCTVERSION 2,4,0,4
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
FILEFLAGS VER_FILEFLAGS #ifdef _DEBUG
FILEOS VER_FILEOS FILEFLAGS 0x1L
FILETYPE VER_FILETYPE #else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "000004b0" BLOCK "000004b0"
BEGIN BEGIN
VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0" VALUE "FileDescription", "N-Rage for Project64"
VALUE "FileVersion", VER_FILE_VERSION_STR "\0" VALUE "FileVersion", "2.4.0.4"
VALUE "InternalName", VER_INTERNAL_NAME_STR "\0" VALUE "InternalName", "N-Rage"
VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0" VALUE "LegalCopyright", "Copyright (C) 2015"
VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0" VALUE "OriginalFilename", "N-Rage.dll"
VALUE "ProductName", VER_PRODUCTNAME_STR VALUE "ProductName", "N-Rage"
VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0" VALUE "ProductVersion", "2.4.0.4"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
@ -551,6 +555,7 @@ BEGIN
END END
END END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// PROFILE // PROFILE
@ -716,11 +721,11 @@ BEGIN
IDS_POP_MOUSELOCKED "Mouse Locked" IDS_POP_MOUSELOCKED "Mouse Locked"
IDS_POP_CHANGEPAK "Player %i:\nPak changed to %s" IDS_POP_CHANGEPAK "Player %i:\nPak changed to %s"
IDS_ERR_MAPVIEW "Couldn't MapViewOfFile" IDS_ERR_MAPVIEW "Couldn't MapViewOfFile"
IDS_DLG_CPF "Controller Profile (*.cpf)\0*.cpf" IDS_DLG_CPF "Controller Profile (*.cpf)"
IDS_DLG_MPKN64 "MemPak (*.mpk)\0*.mpk\0Dexdrive Save (*.n64)\0*.n64" IDS_DLG_MPKN64 "MemPak (*.mpk)"
IDS_DLG_A64 "MemPak Note (*.a64)\0*.a64" IDS_DLG_A64 "MemPak Note (*.a64)"
IDS_DLG_GBGBC "GameBoy ROM (*.gb;*.gbc)\0*.gb;*.gbc" IDS_DLG_GBGBC "GameBoy ROM (*.gb;*.gbc)"
IDS_DLG_SVSAV "GameBoy Save (*.sv;*.sav)\0*.sv;*.sav" IDS_DLG_SVSAV "GameBoy Save (*.sv;*.sav)"
IDS_ERR_HANDLER "%s\n\n Error description: " IDS_ERR_HANDLER "%s\n\n Error description: "
IDS_ERR_MEM_NOSPEC "No MemPak specified; please configure plugin." IDS_ERR_MEM_NOSPEC "No MemPak specified; please configure plugin."
IDS_DLG_MEM_READONLY "Mempak %s opened with read-only access.\nAfter exiting the game, the MemPak will NOT be saved." IDS_DLG_MEM_READONLY "Mempak %s opened with read-only access.\nAfter exiting the game, the MemPak will NOT be saved."
@ -758,7 +763,7 @@ BEGIN
IDS_DLG_WARN_TITLE "N-Rage Input V2 Warning" IDS_DLG_WARN_TITLE "N-Rage Input V2 Warning"
IDS_PLUGIN_TITLE "N-Rage Input V2" IDS_PLUGIN_TITLE "N-Rage Input V2"
IDS_ERR_MPCREATE "Couldn't create MemPak." IDS_ERR_MPCREATE "Couldn't create MemPak."
IDS_DLG_SC "Shortcuts File (*.sc)\0*.sc" IDS_DLG_SC "Shortcuts File (*.sc)"
IDS_P_MEM_ERROR "ErrorCode %lu: " IDS_P_MEM_ERROR "ErrorCode %lu: "
IDS_P_R_NODEVICE "None" IDS_P_R_NODEVICE "None"
IDS_P_TRANS_NOCHANGE "Can't change paks while running" IDS_P_TRANS_NOCHANGE "Can't change paks while running"

View File

@ -2,9 +2,13 @@
// 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 VERSION_REVISION 0
#define VER_VER_DEBUG 0
#define VERSION_MAJOR 2
#define IDC_STOREINDB 3 #define IDC_STOREINDB 3
#define IDC_ERASEFROMDB 4 #define IDC_ERASEFROMDB 4
#define VERSION_MINOR 4
#define VERSION_BUILD 4
#define IDC_SAVEPROFILE 5 #define IDC_SAVEPROFILE 5
#define IDC_UPDATEDB 6 #define IDC_UPDATEDB 6
#define IDC_SAVEBINARY 6 #define IDC_SAVEBINARY 6
@ -361,6 +365,7 @@
#define IDC_XC_DPAD 1193 #define IDC_XC_DPAD 1193
#define IDC_XC_LTS 1194 #define IDC_XC_LTS 1194
#define IDC_XC_RTS 1195 #define IDC_XC_RTS 1195
#define IDC_N64MOUSE 1196
// Next default values for new objects // Next default values for new objects
// //
@ -368,7 +373,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 147 #define _APS_NEXT_RESOURCE_VALUE 147
#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1196 #define _APS_NEXT_CONTROL_VALUE 1197
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif