diff --git a/plugins/FWnull/FW.cpp b/plugins/FWnull/FW.cpp index 1d96d063d0..be68f68184 100644 --- a/plugins/FWnull/FW.cpp +++ b/plugins/FWnull/FW.cpp @@ -28,8 +28,8 @@ const u8 build = 7; // increase that with each version static char *libraryName = "FWnull Driver"; -string s_strIniPath="inis/"; -string s_strLogPath = "logs/"; +string s_strIniPath="inis"; +string s_strLogPath = "logs"; u8 phyregs[16]; s8 *fwregs; @@ -48,7 +48,7 @@ void LogInit() EXPORT_C_(void) FWsetLogDir(const char* dir) { // Get the path to the log directory. - s_strLogPath = (dir==NULL) ? "logs/" : dir; + s_strLogPath = (dir==NULL) ? "logs" : dir; // Reload the log file after updated the path FWLog.Close(); @@ -269,7 +269,7 @@ EXPORT_C_(void) FWirqCallback(void (*callback)()) EXPORT_C_(void) FWsetSettingsDir(const char* dir) { // Find out from pcsx2 where we are supposed to put our ini file. - s_strIniPath = (dir == NULL) ? "inis/" : dir; + s_strIniPath = (dir == NULL) ? "inis" : dir; } EXPORT_C_(s32) FWfreeze(int mode, freezeData *data) diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 52327e4ef7..f4135e0690 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -39,7 +39,7 @@ u32 GSKeyEvent = 0; bool GSShift = false, GSAlt = false; string s_strIniPath="inis"; -std::string s_strLogPath("logs/"); +std::string s_strLogPath("logs"); const char* s_iniFilename = "GSnull.ini"; GSVars gs; @@ -72,7 +72,7 @@ EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) bool OpenLog() { bool result = true; #ifdef GS_LOG - const std::string LogFile(s_strLogPath + "GSnull.log"); + const std::string LogFile(s_strLogPath + "/GSnull.log"); gsLog = fopen(LogFile.c_str(), "w"); if (gsLog != NULL) @@ -127,13 +127,13 @@ void SysPrintf(const char *fmt, ...) // basic funcs EXPORT_C_(void) GSsetSettingsDir(const char* dir) { - s_strIniPath = (dir == NULL) ? "inis/" : dir; + s_strIniPath = (dir == NULL) ? "inis" : dir; } EXPORT_C_(void) GSsetLogDir(const char* dir) { // Get the path to the log directory. - s_strLogPath = (dir==NULL) ? "logs/" : dir; + s_strLogPath = (dir==NULL) ? "logs" : dir; // Reload the log file after updated the path if (gsLog) { diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 75964a5300..7aab2a4d74 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -272,16 +272,15 @@ wchar_t *GetCommandStringW(u8 command, int port, int slot) { return L""; } -static wchar_t iniFile[MAX_PATH*2] = L"inis\\LilyPad.ini"; +static wchar_t iniFile[MAX_PATH*2] = L"inis/LilyPad.ini"; void CALLBACK PADsetSettingsDir( const char *dir ) { - // emulator assures a trailing slash/backslash (yay!) - //swprintf_s( iniFile, L"%S", (dir==NULL) ? "inis\\" : dir ); + //swprintf_s( iniFile, L"%S", (dir==NULL) ? "inis" : dir ); //uint targlen = MultiByteToWideChar(CP_ACP, 0, dir, -1, NULL, 0); MultiByteToWideChar(CP_ACP, 0, dir, -1, iniFile, MAX_PATH*2); - wcscat_s(iniFile, L"LilyPad.ini"); + wcscat_s(iniFile, L"/LilyPad.ini"); createIniDir = false; } diff --git a/plugins/PadNull/Pad.cpp b/plugins/PadNull/Pad.cpp index c818cbde80..b84184b059 100644 --- a/plugins/PadNull/Pad.cpp +++ b/plugins/PadNull/Pad.cpp @@ -26,8 +26,8 @@ const u8 revision = 0; const u8 build = 1; // increase that with each version static char *libraryName = "Padnull Driver"; -string s_strIniPath="inis/"; -string s_strLogPath="logs/"; +string s_strIniPath="inis"; +string s_strLogPath="logs"; FILE *padLog; Config conf; @@ -74,7 +74,7 @@ void __LogToConsole(const char *fmt, ...) EXPORT_C_(void) PADsetSettingsDir(const char* dir) { - s_strIniPath = (dir == NULL) ? "inis/" : dir; + s_strIniPath = (dir == NULL) ? "inis" : dir; } bool OpenLog() { @@ -99,7 +99,7 @@ bool OpenLog() { EXPORT_C_(void) PADsetLogDir(const char* dir) { // Get the path to the log directory. - s_strLogPath = (dir==NULL) ? "logs/" : dir; + s_strLogPath = (dir==NULL) ? "logs" : dir; // Reload the log file after updated the path if (padLog) { diff --git a/plugins/SSSPSXPAD/PadSSSPSX.cpp b/plugins/SSSPSXPAD/PadSSSPSX.cpp index a495cde467..883791bcf6 100644 --- a/plugins/SSSPSXPAD/PadSSSPSX.cpp +++ b/plugins/SSSPSXPAD/PadSSSPSX.cpp @@ -22,7 +22,7 @@ static const unsigned char buildfix = 1; HMODULE hInstance; HWND hTargetWnd; -static std::string s_strIniPath( "inis/" ); +static std::string s_strIniPath( "inis" ); static CRITICAL_SECTION update_lock; static CRITICAL_SECTION init_lock; @@ -350,7 +350,7 @@ static std::string MakeConfigFileName() //GetModuleFileName (hInstance, fname, 256); //strcpy (fname + strlen (fname) - 3, "cfg"); - return s_strIniPath + "PadSSSPSX.cfg"; + return s_strIniPath + "/PadSSSPSX.cfg"; } static void SaveConfig (void) @@ -1140,7 +1140,7 @@ s32 CALLBACK PADtest (void) void CALLBACK PADsetSettingsDir(const char* dir) { - s_strIniPath = (dir==NULL) ? "inis/" : dir; + s_strIniPath = (dir==NULL) ? "inis" : dir; } // Returns 0 on success, -1 on error. diff --git a/plugins/USBnull/USB.cpp b/plugins/USBnull/USB.cpp index 679aedaa57..732948e78c 100644 --- a/plugins/USBnull/USB.cpp +++ b/plugins/USBnull/USB.cpp @@ -18,8 +18,8 @@ using namespace std; #include "USB.h" -string s_strIniPath="inis/"; -string s_strLogPath="logs/"; +string s_strIniPath="inis"; +string s_strLogPath="logs"; const unsigned char version = PS2E_USB_VERSION; const unsigned char revision = 0; @@ -43,7 +43,7 @@ void LogInit() EXPORT_C_(void) USBsetLogDir(const char* dir) { // Get the path to the log directory. - s_strLogPath = (dir==NULL) ? "logs/" : dir; + s_strLogPath = (dir==NULL) ? "logs" : dir; // Reload the log file after updated the path USBLog.Close(); @@ -239,7 +239,7 @@ EXPORT_C_(void) USBsetRAM(void *mem) EXPORT_C_(void) USBsetSettingsDir(const char* dir) { // Get the path to the ini directory. - s_strIniPath = (dir==NULL) ? "inis/" : dir; + s_strIniPath = (dir==NULL) ? "inis" : dir; } // extended funcs diff --git a/plugins/cdvdGigaherz/src/Windows/config.cpp b/plugins/cdvdGigaherz/src/Windows/config.cpp index a5b4d9afd1..aecbdd7a09 100644 --- a/plugins/cdvdGigaherz/src/Windows/config.cpp +++ b/plugins/cdvdGigaherz/src/Windows/config.cpp @@ -29,16 +29,15 @@ char source_drive; char source_file[MAX_PATH]; -char CfgFile[MAX_PATH+10] = "inis\\cdvdGigaherz.ini"; +char CfgFile[MAX_PATH+10] = "inis/cdvdGigaherz.ini"; void CfgSetSettingsDir( const char* dir ) { // a better std::string version, but it's inconvenient for other reasons. - //CfgFile = std::string(( dir == NULL ) ? "inis\\" : dir) + "cdvdGigaherz.ini"; + //CfgFile = std::string(( dir == NULL ) ? "inis/" : dir) + "cdvdGigaherz.ini"; - // emulator assures a trailing slash/backslash (yay!) - strcpy_s(CfgFile, (dir==NULL) ? "inis\\" : dir); - strcat_s(CfgFile, "cdvdGigaherz.ini"); + strcpy_s(CfgFile, (dir==NULL) ? "inis" : dir); + strcat_s(CfgFile, "/cdvdGigaherz.ini"); } diff --git a/plugins/dev9null/DEV9.cpp b/plugins/dev9null/DEV9.cpp index 608663027e..2885f4deb2 100644 --- a/plugins/dev9null/DEV9.cpp +++ b/plugins/dev9null/DEV9.cpp @@ -43,8 +43,8 @@ void (*DEV9irq)(int); __aligned16 s8 dev9regs[0x10000]; -string s_strIniPath = "inis/"; -string s_strLogPath="logs/"; +string s_strIniPath = "inis"; +string s_strLogPath="logs"; PluginLog Dev9Log; Config conf; @@ -59,7 +59,7 @@ void LogInit() EXPORT_C_(void) DEV9setLogDir(const char* dir) { // Get the path to the log directory. - s_strLogPath = (dir==NULL) ? "logs/" : dir; + s_strLogPath = (dir==NULL) ? "logs" : dir; // Reload the log file after updated the path Dev9Log.Close(); @@ -275,7 +275,7 @@ EXPORT_C_(DEV9handler) DEV9irqHandler(void) EXPORT_C_(void) DEV9setSettingsDir(const char* dir) { // Grab the ini directory. - s_strIniPath = (dir == NULL) ? "inis/" : dir; + s_strIniPath = (dir == NULL) ? "inis" : dir; } // extended funcs diff --git a/plugins/spu2-x/src/Windows/CfgHelpers.cpp b/plugins/spu2-x/src/Windows/CfgHelpers.cpp index eb789a30cd..724b4fcff0 100644 --- a/plugins/spu2-x/src/Windows/CfgHelpers.cpp +++ b/plugins/spu2-x/src/Windows/CfgHelpers.cpp @@ -51,7 +51,7 @@ void SysMessage(const wchar_t *fmt, ...) #include "Utilities/Path.h" -static wxString CfgFile( L"inis\\SPU2-X.ini" ); +static wxString CfgFile( L"inis/SPU2-X.ini" ); void CfgSetSettingsDir( const char* dir ) { diff --git a/plugins/spu2-x/src/Windows/ConfigDebug.cpp b/plugins/spu2-x/src/Windows/ConfigDebug.cpp index 8e7fc77050..69f4c2de2e 100644 --- a/plugins/spu2-x/src/Windows/ConfigDebug.cpp +++ b/plugins/spu2-x/src/Windows/ConfigDebug.cpp @@ -59,8 +59,8 @@ wxString RegDumpFileName; void CfgSetLogDir( const char* dir ) { - LogsFolder = (dir==NULL) ? wxString(L"logs") : fromUTF8(dir); - DumpsFolder = (dir==NULL) ? wxString(L"logs") : fromUTF8(dir); + LogsFolder = (dir==NULL) ? wxString(L"logs") : wxString(dir, wxConvFile); + DumpsFolder = (dir==NULL) ? wxString(L"logs") : wxString(dir, wxConvFile); LogLocationSetByPcsx2 = (dir!=NULL); } diff --git a/plugins/zerogs/dx/GSmain.cpp b/plugins/zerogs/dx/GSmain.cpp index 5f02399b0f..8da09281c3 100644 --- a/plugins/zerogs/dx/GSmain.cpp +++ b/plugins/zerogs/dx/GSmain.cpp @@ -158,7 +158,7 @@ void __LogToConsole(const char *fmt, ...) { } void CALLBACK GSsetSettingsDir(const char* dir) { - s_strIniPath = (dir==NULL) ? "inis/" : dir; + s_strIniPath = (dir==NULL) ? "inis" : dir; } void CALLBACK GSsetBaseMem(void* pmem) { diff --git a/plugins/zerogs/dx/Windows/Conf.cpp b/plugins/zerogs/dx/Windows/Conf.cpp index 4ea5a27cac..0de325db6c 100644 --- a/plugins/zerogs/dx/Windows/Conf.cpp +++ b/plugins/zerogs/dx/Windows/Conf.cpp @@ -12,7 +12,7 @@ extern HINSTANCE hInst; void SaveConfig() { char szValue[256]; - const std::string iniFile( s_strIniPath + "zerogs.ini" ); + const std::string iniFile( s_strIniPath + "/zerogs.ini" ); sprintf(szValue,"%u",conf.interlace); WritePrivateProfileString("Settings", "Interlace",szValue,iniFile.c_str()); @@ -29,7 +29,7 @@ void SaveConfig() { void LoadConfig() { char szValue[256]; - const std::string iniFile( s_strIniPath + "zerogs.ini" ); + const std::string iniFile( s_strIniPath + "/zerogs.ini" ); memset(&conf, 0, sizeof(conf)); conf.interlace = 0; // on, mode 1 diff --git a/plugins/zerospu2/Windows/Win32.cpp b/plugins/zerospu2/Windows/Win32.cpp index 2afbfb5c0b..53569611f9 100644 --- a/plugins/zerospu2/Windows/Win32.cpp +++ b/plugins/zerospu2/Windows/Win32.cpp @@ -131,7 +131,7 @@ void SaveConfig() Config *Conf1 = &conf; char szValue[256]; - string iniFile( s_strIniPath + "zerospu2.ini" ); + string iniFile( s_strIniPath + "/zerospu2.ini" ); sprintf_s(szValue,"%u",Conf1->Log); WritePrivateProfileString("Interface", "Logging",szValue, iniFile.c_str()); @@ -145,7 +145,7 @@ void LoadConfig() Config *Conf1 = &conf; char szValue[256]; - string iniFile( s_strIniPath + "zerospu2.ini" ); + string iniFile( s_strIniPath + "/zerospu2.ini" ); fopen_s(&fp, iniFile.c_str(), "rt");//check if zerospu2.ini really exists diff --git a/plugins/zerospu2/zerospu2.cpp b/plugins/zerospu2/zerospu2.cpp index 3e8c4d6e8f..8fae19f53d 100644 --- a/plugins/zerospu2/zerospu2.cpp +++ b/plugins/zerospu2/zerospu2.cpp @@ -57,7 +57,7 @@ s32 s_buffers[NSSIZE][2]; // left and right buffers // mixer thread variables bool s_bThreadExit = true; s32 s_nDropPacket = 0; -string s_strIniPath( "inis/" ); +string s_strIniPath( "inis" ); #ifdef _WIN32 LARGE_INTEGER g_counterfreq; @@ -201,7 +201,7 @@ void __LogToConsole(const char *fmt, ...) void CALLBACK SPU2setSettingsDir(const char* dir) { - s_strIniPath = (dir==NULL) ? "inis/" : dir; + s_strIniPath = (dir==NULL) ? "inis" : dir; } void InitApi() diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 1faef27253..ef9751c1e2 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -46,7 +46,7 @@ float fFPS = 0; void (*GSirq)(); u8* g_pBasePS2Mem = NULL; -string s_strIniPath("inis/"); // Air's new ini path (r2361) +wxString s_strIniPath(L"inis"); // Air's new ini path (r2361) bool SaveStateExists = true; // We could not know save slot status before first change occured const char* SaveStateFile = NULL; // Name of SaveFile for access check. @@ -112,7 +112,7 @@ void CALLBACK GSsetBaseMem(void* pmem) void CALLBACK GSsetSettingsDir(const char* dir) { - s_strIniPath = (dir == NULL) ? "inis/" : dir; + s_strIniPath = (dir == NULL) ? wxString(L"inis") : wxString(dir, wxConvFile); } void CALLBACK GSsetLogDir(const char* dir) diff --git a/plugins/zzogl-pg/opengl/Util.h b/plugins/zzogl-pg/opengl/Util.h index ed148ac7c1..4bec3e82df 100644 --- a/plugins/zzogl-pg/opengl/Util.h +++ b/plugins/zzogl-pg/opengl/Util.h @@ -64,7 +64,7 @@ extern "C" char* CALLBACK PS2EgetLibName(void); #include "Utilities/MemcpyFast.h" #define memcpy_amd memcpy_fast -extern std::string s_strIniPath; // Air's new (r2361) new constant for ini file path +extern wxString s_strIniPath; // Air's new (r2361) new constant for ini file path typedef struct { diff --git a/plugins/zzogl-pg/opengl/Win32/Conf.cpp b/plugins/zzogl-pg/opengl/Win32/Conf.cpp index c72d1b69b3..bd08dd94a0 100644 --- a/plugins/zzogl-pg/opengl/Win32/Conf.cpp +++ b/plugins/zzogl-pg/opengl/Win32/Conf.cpp @@ -2,6 +2,7 @@ #include "GS.h" #include "Win32.h" +#include "Utilities/Path.h" extern HINSTANCE hInst; @@ -9,7 +10,7 @@ extern HINSTANCE hInst; void SaveConfig() { wxChar szValue[256]; - const wxString iniFile( wxString::FromUTF8(s_strIniPath.c_str()) + L"zzogl-pg.ini"); + const wxString iniFile(Path::Combine(s_strIniPath, L"zzogl-pg.ini")); wxSprintf(szValue, L"%u", conf.interlace); WritePrivateProfileString(L"Settings", L"Interlace", szValue, iniFile); @@ -32,7 +33,7 @@ void SaveConfig() void LoadConfig() { wxChar szValue[256]; - const wxString iniFile( wxString::FromUTF8(s_strIniPath.c_str()) + L"zzogl-pg.ini"); + const wxString iniFile(Path::Combine(s_strIniPath, L"zzogl-pg.ini")); memset(&conf, 0, sizeof(conf)); conf.interlace = 0; // on, mode 1 @@ -50,7 +51,7 @@ void LoadConfig() if (!fp) { SysMessage("Unable to open ZZOgl-PG's ini file!"); - CreateDirectory(wxString::FromUTF8(s_strIniPath.c_str()), NULL); + CreateDirectory(s_strIniPath, NULL); SaveConfig();//save and return return ; } diff --git a/plugins/zzogl-pg/opengl/ZZLog.cpp b/plugins/zzogl-pg/opengl/ZZLog.cpp index 191d81733d..668a0d6dbd 100644 --- a/plugins/zzogl-pg/opengl/ZZLog.cpp +++ b/plugins/zzogl-pg/opengl/ZZLog.cpp @@ -19,7 +19,7 @@ #include #include "ZZLog.h" -#include +#include #include extern GSconf conf; @@ -59,7 +59,7 @@ void ZZAddMessage(const char* pstr, u32 ms) namespace ZZLog { -std::string s_strLogPath("logs/"); +std::string s_strLogPath("logs"); FILE *gsLog; bool IsLogging() @@ -71,7 +71,7 @@ bool IsLogging() void Open() { - const std::string LogFile(s_strLogPath + "GSzzogl.log"); + const std::string LogFile(s_strLogPath + "/GSzzogl.log"); gsLog = fopen(LogFile.c_str(), "w"); if (gsLog != NULL) @@ -92,7 +92,7 @@ void Close() void SetDir(const char* dir) { // Get the path to the log directory. - s_strLogPath = (dir==NULL) ? "logs/" : dir; + s_strLogPath = (dir==NULL) ? "logs" : dir; // Reload previously open log file if (gsLog) {