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

View File

@ -163,6 +163,9 @@ public:
IniEntry<bool> DBGAutoPauseSystemCall;
IniEntry<bool> DBGAutoPauseFunctionCall;
//Customed EmulationDir
IniEntry<std::string> SysEmulationDirPath;
// Language
IniEntry<u8> 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();
}
};