diff --git a/Project64.vs2008.sln b/Project64.vs2008.sln index 469a57a49..676b82a9c 100644 --- a/Project64.vs2008.sln +++ b/Project64.vs2008.sln @@ -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 diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index a9baa97af..f79f939ac 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -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", "")); diff --git a/Source/nragev20/ControllerSpecs/Controller #1.1.h b/Source/nragev20/ControllerSpecs/Controller #1.1.h index 41d2bf38d..d2fede161 100644 --- a/Source/nragev20/ControllerSpecs/Controller #1.1.h +++ b/Source/nragev20/ControllerSpecs/Controller #1.1.h @@ -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 diff --git a/Source/nragev20/Debug.cpp b/Source/nragev20/Debug.cpp index 9ece78be2..012993db3 100644 --- a/Source/nragev20/Debug.cpp +++ b/Source/nragev20/Debug.cpp @@ -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); diff --git a/Source/nragev20/FileAccess.cpp b/Source/nragev20/FileAccess.cpp index 79ad98853..c788e6bc7 100644 --- a/Source/nragev20/FileAccess.cpp +++ b/Source/nragev20/FileAccess.cpp @@ -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 diff --git a/Source/nragev20/FileAccess.h b/Source/nragev20/FileAccess.h index cbf773924..3da65671a 100644 --- a/Source/nragev20/FileAccess.h +++ b/Source/nragev20/FileAccess.h @@ -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 diff --git a/Source/nragev20/Interface.cpp b/Source/nragev20/Interface.cpp index 2b37b3dcf..c0da0f324 100644 --- a/Source/nragev20/Interface.cpp +++ b/Source/nragev20/Interface.cpp @@ -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 ); diff --git a/Source/nragev20/NRagePluginV2.cpp b/Source/nragev20/NRagePluginV2.cpp index 02ddc2924..4bfab275d 100644 --- a/Source/nragev20/NRagePluginV2.cpp +++ b/Source/nragev20/NRagePluginV2.cpp @@ -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; diff --git a/Source/nragev20/NRagePluginV2.h b/Source/nragev20/NRagePluginV2.h index 2a4259701..b08fd6698 100644 --- a/Source/nragev20/NRagePluginV2.h +++ b/Source/nragev20/NRagePluginV2.h @@ -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 diff --git a/Source/nragev20/NRage_Input_V2.vcproj b/Source/nragev20/NRage_Input_V2.vcproj index d51876493..9dfaf9522 100644 --- a/Source/nragev20/NRage_Input_V2.vcproj +++ b/Source/nragev20/NRage_Input_V2.vcproj @@ -2,9 +2,9 @@ @@ -53,7 +53,7 @@ + + 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 ) diff --git a/Source/nragev20/settings.h b/Source/nragev20/settings.h index dd80e1e04..ebfa3748b 100644 --- a/Source/nragev20/settings.h +++ b/Source/nragev20/settings.h @@ -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