From d140cffc08abad816d9e0f9d28a39742fb10e4c3 Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Wed, 8 Apr 2015 22:43:29 +0200 Subject: [PATCH 1/9] remove the publicly accessible version of the template parameter in lwmutex::const_be_u32_t because it's never used and causes linker errors in clang 3.4 (and allegedly gcc 4.8.4) --- rpcs3/Emu/SysCalls/lv2/sys_lwmutex.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.h b/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.h index 4a26d65909..e39802b8fd 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.h @@ -25,11 +25,9 @@ namespace lwmutex template struct const_be_u32_t { - static const u32 value = _value; - operator const be_t() const { - return be_t::make(value); + return be_t::make(_value); } }; From 080e42ec9fda4aef3153b4aed0ba2d376ade8b27 Mon Sep 17 00:00:00 2001 From: luxsie Date: Wed, 8 Apr 2015 23:04:01 +0800 Subject: [PATCH 2/9] Stop overwriting the ADDITIONAL_LIBS setting for CMake. --- rpcs3/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 11d668aebd..4681657712 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -44,8 +44,7 @@ endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") #on some Linux distros shm_unlink and similar functions are in librt only - set(ADDITIONAL_LIBS "rt") - set(ADDITIONAL_LIBS "X11") + set(ADDITIONAL_LIBS "rt" "X11") elseif(UNIX) #it seems like glibc includes the iconv functions we use but other libc #implementations like the one on OSX don't seem implement them From da85fba0156ab66aa8b6bbdb6d82ac69c4417dca Mon Sep 17 00:00:00 2001 From: luxsie Date: Thu, 9 Apr 2015 02:02:54 +0800 Subject: [PATCH 3/9] Modify .travis.yml to enable Travis. Fix the master git repo name in Github, also the one in git-version-gen.cmd. Display Shell Export List to help debugging our Travis Build. --- .travis.yml | 11 ++++++++++- README.md | 2 +- Utilities/git-version-gen.cmd | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8fef9bddc8..2d8150cbd0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,8 @@ before_install: aria2c -x 16 http://www.cmake.org/files/v3.0/cmake-3.0.0-Linux-i386.sh && chmod a+x cmake-3.0.0-Linux-i386.sh && sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr; +# Add coverall for C++ so coverity could be triggered. Even it should be --coverage and gcov. + - sudo pip install cpp-coveralls before_script: - git submodule update --init asmjit ffmpeg llvm @@ -51,5 +53,12 @@ addons: build_command: "make -j 4" branch_pattern: coverity_scan +# These modifys are from https://github.com/devernay/cminpack/blob/master/.travis.yml +# It passed but when coverall it failed. script: - - if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then make -j 4; fi +# Add a command to show all the variables now. maybe only useful for debugging travis. + - echo "--Shell Export Lists START--" ; export -p; echo "--Shell Export Lists STOP--" + - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then make -j 4; fi +after_success: + - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then coveralls --extension .c --extension .cpp --extension .h; fi + diff --git a/README.md b/README.md index 7d5516bbac..cbcc27e346 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ RPCS3 ===== -[![Build Status](https://travis-ci.org/DHrpcs3/rpcs3.svg?branch=master)](https://travis-ci.org/DHrpcs3/rpcs3) +[![Build Status](https://travis-ci.org/RPCS3/rpcs3.svg?branch=master)](https://travis-ci.org/RPCS3/rpcs3) Coverity Scan Build Status NUL 2> NUL if errorlevel 1 ( echo Git not on path, trying default Msysgit paths set GIT="%ProgramFiles(x86)%\Git\bin\git.exe" - call !GIT! describe > NUL 2> NUL + call %GIT% describe > NUL 2> NUL if errorlevel 1 ( set GIT="%ProgramFiles%\Git\bin\git.exe" ) From a2ab685ba92f5251d165f712e2e3a4f6471632ab Mon Sep 17 00:00:00 2001 From: luxsie Date: Thu, 9 Apr 2015 20:43:46 +0800 Subject: [PATCH 4/9] Small change for Badges in README.md. --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index cbcc27e346..51ab3095f2 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,7 @@ RPCS3 ===== [![Build Status](https://travis-ci.org/RPCS3/rpcs3.svg?branch=master)](https://travis-ci.org/RPCS3/rpcs3) - - - Coverity Scan Build Status - - +[![Coverity Status](https://scan.coverity.com/projects/3960/badge.svg)](https://scan.coverity.com/projects/3960) [![Coverage Status](https://coveralls.io/repos/DHrpcs3/rpcs3/badge.svg)](https://coveralls.io/r/DHrpcs3/rpcs3) An open-source PlayStation 3 emulator/debugger written in C++. From ef7166057a100c1e67235ee23f4597054c3ce0be Mon Sep 17 00:00:00 2001 From: luxsie Date: Thu, 9 Apr 2015 21:30:24 +0800 Subject: [PATCH 5/9] Revert Non-Necessary Change. Thank Bigpet. --- Utilities/git-version-gen.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/git-version-gen.cmd b/Utilities/git-version-gen.cmd index 2852592086..4ec3e10d20 100644 --- a/Utilities/git-version-gen.cmd +++ b/Utilities/git-version-gen.cmd @@ -25,7 +25,7 @@ call %GIT% describe > NUL 2> NUL if errorlevel 1 ( echo Git not on path, trying default Msysgit paths set GIT="%ProgramFiles(x86)%\Git\bin\git.exe" - call %GIT% describe > NUL 2> NUL + call !GIT! describe > NUL 2> NUL if errorlevel 1 ( set GIT="%ProgramFiles%\Git\bin\git.exe" ) From 5f6afca18a5eefd2b83b75e539d611f357e47dec Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 22:49:34 +0800 Subject: [PATCH 6/9] Added SysEmulationDir to set $(EmulationDir) to custom location. --- rpcs3/Emu/FS/VFS.cpp | 7 ++++++- rpcs3/Ini.h | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index a44003e460..ead5bf62a0 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -5,6 +5,7 @@ #include "vfsDeviceLocalFile.h" #include "Ini.h" #include "Emu/System.h" +#include "Utilities/Log.h" #undef CreateFile @@ -429,7 +430,11 @@ void VFS::Init(const std::string& path) std::string mpath = entry.path; // TODO: This shouldn't use current dir - fmt::Replace(mpath, "$(EmulatorDir)", Emu.GetEmulatorPath()); + // If no value assigned to SysEmulationDirPath in INI, use the path that with executable. + if (Ini.SysEmulationDirPath.GetValue().empty()) + Ini.SysEmulationDirPath.SetValue(Emu.GetEmulatorPath()); + LOG_NOTICE(GENERAL, "$(EmulatorDir) binded to %s.", Ini.SysEmulationDirPath.GetValue()); + fmt::Replace(mpath, "$(EmulatorDir)", Ini.SysEmulationDirPath.GetValue()); fmt::Replace(mpath, "$(GameDir)", cwd); Mount(entry.mount, mpath, dev); } diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index 08b0ea3b86..2d20b42f28 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -163,6 +163,9 @@ public: IniEntry DBGAutoPauseSystemCall; IniEntry DBGAutoPauseFunctionCall; + //Customed EmulationDir + IniEntry SysEmulationDirPath; + // Language IniEntry SysLanguage; @@ -240,6 +243,9 @@ public: DBGAutoPauseFunctionCall.Init("DBG_AutoPauseFunctionCall", path); DBGAutoPauseSystemCall.Init("DBG_AutoPauseSystemCall", path); + // Customed EmulationDir + SysEmulationDirPath.Init("System_EmulationDir", path); + // Language SysLanguage.Init("Sytem_SysLanguage", path); } @@ -316,6 +322,8 @@ public: // Language SysLanguage.Load(1); + // Customed EmulationDir + SysEmulationDirPath.Load(""); } void Save() @@ -389,6 +397,9 @@ public: // Language SysLanguage.Save(); + + // Customed EmulationDir + SysEmulationDirPath.Save(); } }; From a3d69194317208e7c58fd5410a7519dc2c19e05d Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 23:10:02 +0800 Subject: [PATCH 7/9] Add notice for the custom path, and add an option to Configuration - System panel. Not Tested. --- rpcs3/Emu/FS/VFS.cpp | 17 +++++++++++++---- rpcs3/Gui/MainFrame.cpp | 16 ++++++++++++++++ rpcs3/Ini.h | 3 +++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index ead5bf62a0..36351a896c 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -431,10 +431,19 @@ void VFS::Init(const std::string& path) std::string mpath = entry.path; // TODO: This shouldn't use current dir // If no value assigned to SysEmulationDirPath in INI, use the path that with executable. - if (Ini.SysEmulationDirPath.GetValue().empty()) - Ini.SysEmulationDirPath.SetValue(Emu.GetEmulatorPath()); - LOG_NOTICE(GENERAL, "$(EmulatorDir) binded to %s.", Ini.SysEmulationDirPath.GetValue()); - fmt::Replace(mpath, "$(EmulatorDir)", Ini.SysEmulationDirPath.GetValue()); + if (Ini.SysEmulationDirPathEnable.GetValue()) + { + if (Ini.SysEmulationDirPath.GetValue().empty()) + Ini.SysEmulationDirPath.SetValue(Emu.GetEmulatorPath()); + LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is On, Binded $(EmulatorDir) to %s.", + Ini.SysEmulationDirPath.GetValue()); + fmt::Replace(mpath, "$(EmulatorDir)", Ini.SysEmulationDirPath.GetValue()); + } + else + { + LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is Off, Binded $(EmulatorDir) to %s.", Emu.GetEmulatorPath()); + fmt::Replace(mpath, "$(EmulatorDir)", Emu.GetEmulatorPath()); + } fmt::Replace(mpath, "$(GameDir)", cwd); Mount(entry.mount, mpath, dev); } diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index dd0298777e..c20dbbc466 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -436,6 +436,10 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxCheckBox* chbox_dbg_ap_systemcall = new wxCheckBox(p_hle, wxID_ANY, "Auto Pause at System Call"); wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_hle, wxID_ANY, "Auto Pause at Function Call"); + //Custom EmulationDir + wxCheckBox* chbox_emulationdir_enable = new wxCheckBox(p_system, wxID_ANY, "Use Custom EmulationDir Path?"); + wxTextCtrl* txt_emulationdir_path = new wxTextCtrl(p_system, wxID_ANY, "EmulationDir Path, Need Restart"); + cbox_cpu_decoder->Append("PPU Interpreter"); cbox_cpu_decoder->Append("PPU Interpreter 2"); cbox_cpu_decoder->Append("PPU JIT (LLVM)"); @@ -533,6 +537,10 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) chbox_dbg_ap_systemcall ->SetValue(Ini.DBGAutoPauseSystemCall.GetValue()); chbox_dbg_ap_functioncall->SetValue(Ini.DBGAutoPauseFunctionCall.GetValue()); + //Custom EmulationDir + chbox_emulationdir_enable->SetValue(Ini.SysEmulationDirPathEnable.GetValue()); + txt_emulationdir_path ->SetValue(Ini.SysEmulationDirPath.GetValue()); + cbox_cpu_decoder ->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() : 0); cbox_spu_decoder ->SetSelection(Ini.SPUDecoderMode.GetValue() ? Ini.SPUDecoderMode.GetValue() : 0); cbox_gs_render ->SetSelection(Ini.GSRenderMode.GetValue()); @@ -614,6 +622,10 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) // System s_subpanel_system->Add(s_round_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand()); + + //Custom EmulationDir + s_subpanel_system->Add(chbox_emulationdir_enable, wxSizerFlags().Border(wxALL, 5).Expand()); + s_subpanel_system->Add(txt_emulationdir_path, wxSizerFlags().Border(wxALL, 5).Expand()); // Buttons wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); @@ -667,6 +679,10 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) Ini.DBGAutoPauseFunctionCall.SetValue(chbox_dbg_ap_functioncall->GetValue()); Ini.DBGAutoPauseSystemCall.SetValue(chbox_dbg_ap_systemcall->GetValue()); + //Custom EmulationDir + Ini.SysEmulationDirPathEnable.SetValue(chbox_emulationdir_enable->GetValue()); + Ini.SysEmulationDirPath.SetValue(txt_emulationdir_path->GetValue().ToStdString()); + Ini.Save(); } diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index 2d20b42f28..69f0e6fe63 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -165,6 +165,7 @@ public: //Customed EmulationDir IniEntry SysEmulationDirPath; + IniEntry SysEmulationDirPathEnable; // Language IniEntry SysLanguage; @@ -245,6 +246,7 @@ public: // Customed EmulationDir SysEmulationDirPath.Init("System_EmulationDir", path); + SysEmulationDirPathEnable.Init("System_EmulationDirEnable", path); // Language SysLanguage.Init("Sytem_SysLanguage", path); @@ -324,6 +326,7 @@ public: // Customed EmulationDir SysEmulationDirPath.Load(""); + SysEmulationDirPathEnable.Load(false); } void Save() From 64ab14b237a34fe89bb1f193a41202cb304ee79c Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 23:23:20 +0800 Subject: [PATCH 8/9] I forgot to save the EmulationDirEnable.. Also just show the bind once. --- rpcs3/Emu/FS/VFS.cpp | 16 +++++++++++----- rpcs3/Ini.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index 36351a896c..c7179fdb2d 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -433,15 +433,10 @@ void VFS::Init(const std::string& path) // If no value assigned to SysEmulationDirPath in INI, use the path that with executable. if (Ini.SysEmulationDirPathEnable.GetValue()) { - if (Ini.SysEmulationDirPath.GetValue().empty()) - Ini.SysEmulationDirPath.SetValue(Emu.GetEmulatorPath()); - LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is On, Binded $(EmulatorDir) to %s.", - Ini.SysEmulationDirPath.GetValue()); fmt::Replace(mpath, "$(EmulatorDir)", Ini.SysEmulationDirPath.GetValue()); } else { - LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is Off, Binded $(EmulatorDir) to %s.", Emu.GetEmulatorPath()); fmt::Replace(mpath, "$(EmulatorDir)", Emu.GetEmulatorPath()); } fmt::Replace(mpath, "$(GameDir)", cwd); @@ -482,6 +477,17 @@ void VFS::SaveLoadDevices(std::vector& res, bool is_load) entries_count.SaveValue(count); } + //Custom EmulationDir. should check if that is a valid directory. + if (Ini.SysEmulationDirPathEnable.GetValue()) + { + if (Ini.SysEmulationDirPath.GetValue().empty()) + Ini.SysEmulationDirPath.SetValue(Emu.GetEmulatorPath()); + LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is On, Binded $(EmulatorDir) to %s.", Ini.SysEmulationDirPath.GetValue()); + } + else + { + LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is Off, Binded $(EmulatorDir) to %s.", Emu.GetEmulatorPath()); + } for(int i=0; i entry_path; diff --git a/rpcs3/Ini.h b/rpcs3/Ini.h index 69f0e6fe63..5f1155489d 100644 --- a/rpcs3/Ini.h +++ b/rpcs3/Ini.h @@ -403,6 +403,7 @@ public: // Customed EmulationDir SysEmulationDirPath.Save(); + SysEmulationDirPathEnable.Save(); } }; From ea17e08ae65d7c8605fab45070b01183ffccf84f Mon Sep 17 00:00:00 2001 From: luxsie Date: Fri, 10 Apr 2015 23:56:38 +0800 Subject: [PATCH 9/9] Tested Enable/Disable this Custom EmulationDir Feature, and it can check whether directory exists. But there is still problem with its log. --- rpcs3/Emu/FS/VFS.cpp | 28 +++++++++++++++++++++++----- rpcs3/Gui/MainFrame.cpp | 4 ++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index c7179fdb2d..ceab7d7b19 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -6,6 +6,7 @@ #include "Ini.h" #include "Emu/System.h" #include "Utilities/Log.h" +#include // To check whether directory exists #undef CreateFile @@ -477,17 +478,34 @@ void VFS::SaveLoadDevices(std::vector& res, bool is_load) entries_count.SaveValue(count); } - //Custom EmulationDir. should check if that is a valid directory. + // Custom EmulationDir. + // TODO:: should have a better log that would show results before loading a game? if (Ini.SysEmulationDirPathEnable.GetValue()) { - if (Ini.SysEmulationDirPath.GetValue().empty()) + std::string EmulationDir = Ini.SysEmulationDirPath.GetValue(); + if (EmulationDir.empty()) Ini.SysEmulationDirPath.SetValue(Emu.GetEmulatorPath()); - LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is On, Binded $(EmulatorDir) to %s.", Ini.SysEmulationDirPath.GetValue()); + struct stat fstatinfo; + if ((stat(EmulationDir.c_str(), &fstatinfo))) + { + LOG_NOTICE(GENERAL, "Custom EmualtionDir: Tried %s but it doesn't exists. Maybe you add some not needed chars like '\"'?"); + Ini.SysEmulationDirPathEnable.SetValue(false); + } + else if (fstatinfo.st_mode & S_IFDIR) + LOG_NOTICE(GENERAL, "Custom EmualtionDir: On, Binded $(EmulatorDir) to %s.", EmulationDir); + else + { + // If that is not directory turn back to use original one. + LOG_NOTICE(GENERAL, "Custom EmulationDir: Cause path %s is not a valid directory.", EmulationDir); + Ini.SysEmulationDirPathEnable.SetValue(false); + } } - else + // I left this to check again just to catch those failed in directory checks. + if (!Ini.SysEmulationDirPathEnable.GetValue()) { - LOG_NOTICE(GENERAL, "EmualtionDir: Custom EmulationDir is Off, Binded $(EmulatorDir) to %s.", Emu.GetEmulatorPath()); + LOG_NOTICE(GENERAL, "Custom EmualtionDir: Off, Binded $(EmulatorDir) to %s.", Emu.GetEmulatorPath()); } + for(int i=0; i entry_path; diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index c20dbbc466..ae4ae0556a 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -437,8 +437,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_hle, wxID_ANY, "Auto Pause at Function Call"); //Custom EmulationDir - wxCheckBox* chbox_emulationdir_enable = new wxCheckBox(p_system, wxID_ANY, "Use Custom EmulationDir Path?"); - wxTextCtrl* txt_emulationdir_path = new wxTextCtrl(p_system, wxID_ANY, "EmulationDir Path, Need Restart"); + wxCheckBox* chbox_emulationdir_enable = new wxCheckBox(p_system, wxID_ANY, "Use Path Below as EmulationDir ? (Need Restart)"); + wxTextCtrl* txt_emulationdir_path = new wxTextCtrl(p_system, wxID_ANY, Emu.GetEmulatorPath()); cbox_cpu_decoder->Append("PPU Interpreter"); cbox_cpu_decoder->Append("PPU Interpreter 2");