Merge pull request #1 from project64/master

is this how I get update to my fork from master?
This commit is contained in:
MelchiorGaspar 2015-02-20 22:59:45 -05:00
commit 79aefdfa42
9 changed files with 63 additions and 33 deletions

View File

@ -25,6 +25,7 @@
#define _FILEACCESS_H_
#include "NRagePluginV2.h"
#include "Version.h"
#include <string>
using std::string;
@ -63,7 +64,7 @@ unsigned long djbHash(const char *str);
#define STRING_DEF_GBROMFILE _T("GBxRoms")
#define STRING_DEF_GBROMSAVE _T("GBxSaves")
#define STRING_INI_HEADER "# Generated by NRage input plugin V2 version " VERSIONNUMBER "\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
#define STRING_INI_GENERAL "General"
#define STRING_INI_CONTROLLER "Controller"

View File

@ -32,6 +32,7 @@
#include "PakIO.h"
#include "Interface.h"
#include "International.h"
#include "Version.h"
// Prototypes //
BOOL CALLBACK ControllerTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
@ -102,7 +103,7 @@ BOOL CALLBACK MainDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
TCHAR tszBuffer[DEFAULT_BUFFER], tszMsg[DEFAULT_BUFFER / 2];
LoadString( g_hResourceDLL, IDS_VERSTRING, tszBuffer, DEFAULT_BUFFER / 2);
_stprintf(tszMsg, tszBuffer, VERSIONINFO);
_stprintf(tszMsg, tszBuffer, VER_FILE_VERSION_STR);
SetDlgItemText( hDlg, IDC_VERSIONSTRING, tszMsg );
}

View File

@ -32,7 +32,7 @@
#include "PakIO.h"
#include "DirectInput.h"
#include "International.h"
#include "version.h"
#include "Version.h"
// ProtoTypes //
bool prepareHeap();
@ -77,7 +77,7 @@ BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpRe
DisableThreadLibraryCalls( hModule );
if( !prepareHeap())
return FALSE;
DebugWriteA("*** DLL Attach (" VERSIONNUMBER "-Debugbuild | built on " __DATE__ " at " __TIME__")\n");
DebugWriteA("*** DLL Attach (" VER_FILE_VERSION_STR "-Debugbuild | built on " __DATE__ " at " __TIME__")\n");
ZeroMemory( &g_strEmuInfo, sizeof(g_strEmuInfo) );
ZeroMemory( g_devList, sizeof(g_devList) );
ZeroMemory( &g_sysMouse, sizeof(g_sysMouse) );
@ -172,9 +172,9 @@ EXPORT void CALL DllAbout ( HWND hParent )
LoadString( g_hResourceDLL, IDS_DLG_ABOUT_TITLE, tszTitle, DEFAULT_BUFFER );
TCHAR szText[DEFAULT_BUFFER * 4] = _T(STRING_PLUGINNAME) _T("\n\n") \
TCHAR szText[DEFAULT_BUFFER * 4] = _T(VER_FILE_DESCRIPTION_STR) _T("\n\n") \
_T("Visit my site for support: >>http://go.to/nrage<<\n\n") \
_T("Version ") VERSIONINFO _T(" (") _T(__DATE__) _T(")\n") \
_T("Version ") VER_FILE_VERSION_STR _T(" (") _T(__DATE__) _T(")\n") \
_T("Done by N-Rage\n") \
_T("\n") \
_T(" - - - - -\n") \

View File

@ -30,8 +30,6 @@
/////////////////////////////////////////////////////////////////////////////////
//General Plugin
#define STRING_PLUGINNAME "N-Rage For PJ64 "
#define TIMER_MESSAGEWINDOW 123
// maximum number of devices other than SysMouse

View File

@ -1,6 +1,7 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@ -523,39 +524,33 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,3,0,2
PRODUCTVERSION 2,3,0,2
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
FILEVERSION VER_FILE_VERSION
PRODUCTVERSION VER_PRODUCT_VERSION
FILEFLAGSMASK 0x3fL
FILEFLAGS VER_FILEFLAGS
FILEOS VER_FILEOS
FILETYPE VER_FILETYPE
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "Comments", "Release Version"
VALUE "FileDescription", "Zilmar Spec Plugin for N64 Emulators"
VALUE "FileVersion", "2.3c"
VALUE "InternalName", "NRage_Input_V2"
VALUE "LegalCopyright", "Copyright © 2001-2015 N-Rage, compiled under GPL licensing"
VALUE "OriginalFilename", "NRage_Input_V2.dll"
VALUE "ProductName", "NRage_Input_V2"
VALUE "ProductVersion", "2.3c"
VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0"
VALUE "FileVersion", VER_FILE_VERSION_STR "\0"
VALUE "InternalName", VER_INTERNAL_NAME_STR "\0"
VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0"
VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0"
VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// PROFILE

View File

@ -62,6 +62,7 @@
<ClCompile Include="XInputController.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Version.h" />
<ClInclude Include="XInputController.h" />
<ClInclude Include="commonIncludes.h" />
<ClInclude Include="ControllerSpecs\Controller #1.0.h" />

View File

@ -86,6 +86,9 @@
<ClInclude Include="settings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="configs\Controller1.cpf">

View File

@ -155,6 +155,22 @@ void AxisDeadzone( SHORT &AxisValue, long lDeadZoneValue, float fDeadZoneRelati
void GetXInputControllerKeys( const int indexController, LPDWORD Keys )
{
HMODULE hInput = LoadLibrary("Xinput1_4.dll");
if (hInput == NULL)
{
hInput = LoadLibrary("Xinput9_1_0.dll");
}
if (hInput == NULL)
{
return;
}
DWORD(WINAPI * fnXInputGetState) (DWORD dwUserIndex, XINPUT_STATE* pState) = NULL;
if (fnXInputGetState == NULL)
{
return;
}
using namespace N64_BUTTONS;
LPCONTROLLER pcController = &g_pcControllers[indexController];
@ -168,7 +184,7 @@ void GetXInputControllerKeys( const int indexController, LPDWORD Keys )
DWORD result;
XINPUT_STATE state;
result = XInputGetState(gController->nControl, &state);
result = fnXInputGetState(gController->nControl, &state);
if( result != ERROR_SUCCESS )
return;
@ -298,11 +314,27 @@ void VibrateXInputController( DWORD nController, int LeftMotorVal, int RightMoto
bool InitiateXInputController( LPXCONTROLLER gController, int nControl )
{
HMODULE hInput = LoadLibrary("Xinput1_4.dll");
if (hInput == NULL)
{
hInput = LoadLibrary("Xinput9_1_0.dll");
}
if (hInput == NULL)
{
return false;
}
DWORD(WINAPI * fnXInputGetState) (DWORD dwUserIndex, XINPUT_STATE* pState) = NULL;
fnXInputGetState = (DWORD(WINAPI *) (DWORD, XINPUT_STATE*))GetProcAddress(hInput, "XInputGetState");
if (fnXInputGetState == NULL)
{
return false;
}
DWORD result;
XINPUT_STATE state;
ZeroMemory( &state, sizeof( XINPUT_STATE ) );
result = XInputGetState( nControl, &state );
result = fnXInputGetState(nControl, &state);
gController->bConnected = result == ERROR_SUCCESS;
gController->nControl = nControl;

View File

@ -25,7 +25,6 @@
#define _SETTINGS_H_
#define DIRECTINPUT_VERSION 0x0800
#define VERSIONNUMBER "2.3c"
// hacks for GNU C compilers
#ifdef __GNUC__