Added SysEmulationDir to set $(EmulationDir) to custom location.

This commit is contained in:
luxsie 2015-04-10 22:49:34 +08:00
parent 952098c00f
commit 5f6afca18a
2 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,7 @@
#include "vfsDeviceLocalFile.h" #include "vfsDeviceLocalFile.h"
#include "Ini.h" #include "Ini.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Utilities/Log.h"
#undef CreateFile #undef CreateFile
@ -429,7 +430,11 @@ void VFS::Init(const std::string& path)
std::string mpath = entry.path; std::string mpath = entry.path;
// TODO: This shouldn't use current dir // 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); fmt::Replace(mpath, "$(GameDir)", cwd);
Mount(entry.mount, mpath, dev); Mount(entry.mount, mpath, dev);
} }

View File

@ -163,6 +163,9 @@ public:
IniEntry<bool> DBGAutoPauseSystemCall; IniEntry<bool> DBGAutoPauseSystemCall;
IniEntry<bool> DBGAutoPauseFunctionCall; IniEntry<bool> DBGAutoPauseFunctionCall;
//Customed EmulationDir
IniEntry<std::string> SysEmulationDirPath;
// Language // Language
IniEntry<u8> SysLanguage; IniEntry<u8> SysLanguage;
@ -240,6 +243,9 @@ public:
DBGAutoPauseFunctionCall.Init("DBG_AutoPauseFunctionCall", path); DBGAutoPauseFunctionCall.Init("DBG_AutoPauseFunctionCall", path);
DBGAutoPauseSystemCall.Init("DBG_AutoPauseSystemCall", path); DBGAutoPauseSystemCall.Init("DBG_AutoPauseSystemCall", path);
// Customed EmulationDir
SysEmulationDirPath.Init("System_EmulationDir", path);
// Language // Language
SysLanguage.Init("Sytem_SysLanguage", path); SysLanguage.Init("Sytem_SysLanguage", path);
} }
@ -316,6 +322,8 @@ public:
// Language // Language
SysLanguage.Load(1); SysLanguage.Load(1);
// Customed EmulationDir
SysEmulationDirPath.Load("");
} }
void Save() void Save()
@ -389,6 +397,9 @@ public:
// Language // Language
SysLanguage.Save(); SysLanguage.Save();
// Customed EmulationDir
SysEmulationDirPath.Save();
} }
}; };