Nrage: Update version and change location of log and config dir

This commit is contained in:
zilmar 2015-02-18 20:52:23 +11:00
parent 93404e32dc
commit 9d607af14f
12 changed files with 44 additions and 27 deletions

View File

@ -8,6 +8,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64", "Source\Project
{731BD205-2826-4631-B7AF-117658E88DBC} = {731BD205-2826-4631-B7AF-117658E88DBC}
{A4D13408-A794-4199-8FC7-4A9A32505005} = {A4D13408-A794-4199-8FC7-4A9A32505005}
{3326E128-33AF-422C-BB7C-67CC6B915610} = {3326E128-33AF-422C-BB7C-67CC6B915610}
{FD617E80-9E40-4138-85DA-B94633972E6A} = {FD617E80-9E40-4138-85DA-B94633972E6A}
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421} = {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}
EndProjectSection
EndProject
@ -76,7 +77,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SortRdb", "Source\SortRdb\S
{B4A4B994-9111-42B1-93C2-6F1CA8BC4421} = {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NRage_Input_V2", "Source\nragev20\NRage_Input_V2.vcproj", "{FD617E80-9E40-4138-85DA-B94633972E6A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PJ64 NRage", "Source\nragev20\NRage_Input_V2.vcproj", "{FD617E80-9E40-4138-85DA-B94633972E6A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -293,7 +293,7 @@ void CSettings::AddHowToHandleSetting ()
AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin","RSP Dll", "RSP\\RSP 1.7.dll"));
AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin","Graphics Dll", "GFX\\Jabo_Direct3D8.dll"));
AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin","Audio Dll", "Audio\\Jabo_Dsound.dll"));
AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin","Controller Dll","Input\\Jabo_DInput.dll"));
AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin","Controller Dll","Input\\PJ64_NRage.dll"));
AddHandler(Plugin_RSP_CurVer, new CSettingTypeApplication("Plugin","RSP Dll Ver", ""));
AddHandler(Plugin_GFX_CurVer, new CSettingTypeApplication("Plugin","Graphics Dll Ver", ""));

View File

@ -176,7 +176,7 @@ EXPORT void CALL GetKeys(int Control, BUTTONS * Keys );
the emulator to know how to handle each controller.
output: none
*******************************************************************/
EXPORT void CALL InitiateControllers (CONTROL_INFO ControlInfo);
EXPORT void CALL InitiateControllers (CONTROL_INFO * ControlInfo);
/******************************************************************
Function: ReadController

View File

@ -41,7 +41,7 @@ void _DebugAnsiFileWrite( LPCSTR szRemark )
TCHAR szFile[] = _T("NRage-Debug.txt");
TCHAR szBuffer[MAX_PATH+1];
GetAbsoluteFileName( szBuffer, szFile, DIRECTORY_APPLICATION );
GetAbsoluteFileName( szBuffer, szFile, DIRECTORY_LOG );
hDebug = CreateFile( szBuffer, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
if (hDebug != INVALID_HANDLE_VALUE)
SetFilePointer(hDebug, 0, 0, FILE_END);

View File

@ -884,6 +884,8 @@ bool GetDirectory( LPTSTR pszDirectory, WORD wDirID )
*pSlash = 0;
}
break;
case DIRECTORY_LOG:
case DIRECTORY_CONFIG:
case DIRECTORY_APPLICATION:
break;
@ -911,6 +913,14 @@ bool GetDirectory( LPTSTR pszDirectory, WORD wDirID )
pSlash[2] = '\0';
}
if (bReturn && wDirID == DIRECTORY_CONFIG)
{
strcat(pszDirectory,"Config\\");
}
if (bReturn && wDirID == DIRECTORY_LOG)
{
strcat(pszDirectory,"Logs\\");
}
return bReturn;
}
@ -1280,7 +1290,7 @@ bool StoreConfigToINI()
return false;
TCHAR szFilename[MAX_PATH];
GetDirectory(szFilename, DIRECTORY_DLL);
GetDirectory(szFilename, DIRECTORY_CONFIG);
_tcscat(szFilename, _T("NRage.ini"));
FILE *fFile = _tfopen(szFilename, _T("wS")); // write, optimize for sequential
@ -1379,7 +1389,7 @@ bool LoadConfigFromINI()
char szLine[4096];
TCHAR szFilename[MAX_PATH];
GetDirectory(szFilename, DIRECTORY_DLL);
GetDirectory(szFilename, DIRECTORY_CONFIG);
_tcscat(szFilename, _T("NRage.ini"));
fFile = _tfopen(szFilename, _T("rS")); // read, optimize for sequential
@ -1419,7 +1429,7 @@ LANGID GetLanguageFromINI()
char szLine[4096];
TCHAR szFilename[MAX_PATH];
GetDirectory(szFilename, DIRECTORY_DLL);
GetDirectory(szFilename, DIRECTORY_CONFIG);
_tcscat(szFilename, _T("NRage.ini"));
fFile = _tfopen(szFilename, _T("rS")); // read, optimize for sequential

View File

@ -203,6 +203,8 @@ unsigned long djbHash(const char *str);
#define DIRECTORY_MEMPAK 0
#define DIRECTORY_GBROMS 1
#define DIRECTORY_GBSAVES 2
#define DIRECTORY_CONFIG 252
#define DIRECTORY_LOG 253
#define DIRECTORY_DLL 254
#define DIRECTORY_APPLICATION 255
#define DIRECTORY_INVALID 256

View File

@ -829,7 +829,7 @@ BOOL CALLBACK XControlsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case WM_USER_UPDATE:
{
TCHAR buffer[MAX_PATH];
GetDirectory( buffer, DIRECTORY_DLL );
GetDirectory( buffer, DIRECTORY_CONFIG );
_stprintf_s( buffer, _T("%sXInput Controller %d Config.xcc"), buffer, gController->nControl + 1 );
FILE *saveFile = _tfopen( buffer, _T("rS") );
if( saveFile )
@ -851,7 +851,7 @@ BOOL CALLBACK XControlsTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
StoreXInputControllerKeys( hDlg, gController );
{
TCHAR buffer[MAX_PATH];
GetDirectory( buffer, DIRECTORY_DLL );
GetDirectory( buffer, DIRECTORY_CONFIG );
_stprintf_s( buffer, _T("%sXInput Controller %d Config.xcc"), buffer, gController->nControl + 1 );
FILE *saveFile = _tfopen( buffer, _T("wS") );
SaveXInputConfigToFile( saveFile, gController );

View File

@ -32,6 +32,7 @@
#include "PakIO.h"
#include "DirectInput.h"
#include "International.h"
#include "version.h"
// ProtoTypes //
bool prepareHeap();
@ -148,12 +149,11 @@ BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpRe
EXPORT void CALL GetDllInfo ( PLUGIN_INFO* PluginInfo )
{
DebugWriteA("CALLED: GetDllInfo\n");
strncpy(PluginInfo->Name, STRING_PLUGINNAME
#ifdef _DEBUG
" (Debug)"
sprintf(PluginInfo->Name,"N-Rage For PJ64 (Debug): %s",VER_FILE_VERSION_STR);
#else
sprintf(PluginInfo->Name,"N-Rage For PJ64: %s",VER_FILE_VERSION_STR);
#endif
": " VERSIONNUMBER
, sizeof(PluginInfo->Name));
PluginInfo->Type = PLUGIN_TYPE_CONTROLLER;
PluginInfo->Version = SPECS_VERSION;
}
@ -312,7 +312,7 @@ EXPORT void CALL InitiateControllers( HWND hMainWindow, CONTROL Controls[4])
the emulator to know how to handle each controller.
output: none
*******************************************************************/
EXPORT void CALL InitiateControllers (CONTROL_INFO ControlInfo)
EXPORT void CALL InitiateControllers (CONTROL_INFO * ControlInfo)
#endif // SPECS_VERSION
{
@ -324,9 +324,9 @@ EXPORT void CALL InitiateControllers (CONTROL_INFO ControlInfo)
g_strEmuInfo.hMainWindow = hMainWindow;
// g_strEmuInfo.HEADER = NULL;
#elif SPECS_VERSION >= 0x0101
g_strEmuInfo.hMainWindow = ControlInfo.hMainWindow;
// g_strEmuInfo.MemoryBswaped = ControlInfo.MemoryBswaped;
// g_strEmuInfo.HEADER = ControlInfo.HEADER;
g_strEmuInfo.hMainWindow = ControlInfo->hMainWindow;
// g_strEmuInfo.MemoryBswaped = ControlInfo->MemoryBswaped;
// g_strEmuInfo.HEADER = ControlInfo->HEADER;
// UNDONE: Instead of just storing the header, figure out what ROM we're running and save that information somewhere
#endif // SPECS_VERSION
@ -434,7 +434,7 @@ EXPORT void CALL InitiateControllers (CONTROL_INFO ControlInfo)
#if SPECS_VERSION == 0x0100
FillControls(Controls);
#elif SPECS_VERSION >= 0x0101
FillControls(ControlInfo.Controls);
FillControls(ControlInfo->Controls);
#endif // SPECS_VERSION
return;

View File

@ -30,7 +30,7 @@
/////////////////////////////////////////////////////////////////////////////////
//General Plugin
#define STRING_PLUGINNAME "N-Rage Input Plugin V2"
#define STRING_PLUGINNAME "N-Rage For PJ64 "
#define TIMER_MESSAGEWINDOW 123

View File

@ -2,9 +2,9 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="NRage_Input_V2"
Name="PJ64 NRage"
ProjectGUID="{FD617E80-9E40-4138-85DA-B94633972E6A}"
RootNamespace="NRage_Input_V2"
RootNamespace="PJ64 NRage"
TargetFrameworkVersion="131072"
>
<Platforms>
@ -53,7 +53,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="xinput.lib dinput8.lib dxguid.lib Comctl32.lib"
OutputFile="$(Root)Plugin/Input/NRage_Input_V2_d.dll"
OutputFile="$(Root)Plugin/Input/PJ64_NRage_d.dll"
AdditionalLibraryDirectories="&quot;$(Root)Source\3rd Party\directx\lib&quot;"
/>
<Tool
@ -116,7 +116,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="xinput.lib dinput8.lib dxguid.lib Comctl32.lib"
OutputFile="$(Root)Plugin/Input/NRage_Input_V2.dll"
OutputFile="$(Root)Plugin/Input/PJ64_NRage.dll"
AdditionalLibraryDirectories="&quot;$(Root)Source\3rd Party\directx\lib&quot;"
/>
<Tool
@ -254,6 +254,10 @@
RelativePath="settings.h"
>
</File>
<File
RelativePath=".\Version.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"

View File

@ -140,7 +140,7 @@ LCleanup:
void AxisDeadzone( SHORT &AxisValue, long lDeadZoneValue, float fDeadZoneRelation )
{
short sign = AxisValue < 0 ? -1 : 1;
float value = AxisValue < 0 ? -AxisValue : AxisValue;
float value = (float)(AxisValue < 0 ? -AxisValue : AxisValue);
if(value < lDeadZoneValue)
value = 0;
@ -308,7 +308,7 @@ bool InitiateXInputController( LPXCONTROLLER gController, int nControl )
gController->nControl = nControl;
TCHAR buffer[MAX_PATH];
GetDirectory( buffer, DIRECTORY_DLL );
GetDirectory( buffer, DIRECTORY_CONFIG );
_stprintf_s( buffer, _T("%sXInput Controller %d Config.xcc"), buffer, gController->nControl + 1 );
FILE *file = _tfopen( buffer, _T("rS") );
if( file )

View File

@ -50,9 +50,9 @@ typedef const unsigned char *const unsigned char *;
#define DEFAULT_BUFFER 256
// conform to Plugin Specs 1.0
#define SPECS_VERSION 0x0100
//#define SPECS_VERSION 0x0100
// conform to Plugin Specs 1.1
// #define SPECS_VERSION 0x0101
#define SPECS_VERSION 0x0101
// use default settings for Release and Debugbuild
#define STDCONFIG