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