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(); } };