mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
Merge pull request #914 from raven02/patch-1
RSX : Reapply fmt::merge change & VFS change
This commit is contained in:
commit
a9647152f7
4 changed files with 15 additions and 21 deletions
|
@ -137,14 +137,17 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
|
|||
|
||||
std::string fmt::merge(std::vector<std::string> source, const std::string& separator)
|
||||
{
|
||||
if (!source.size())
|
||||
return "";
|
||||
|
||||
std::string result;
|
||||
|
||||
for (auto &s : source)
|
||||
for (int i = 0; i < source.size() - 1; ++i)
|
||||
{
|
||||
result += s + separator;
|
||||
result += source[i] + separator;
|
||||
}
|
||||
|
||||
return result;
|
||||
return result + source[source.size() - 1];
|
||||
}
|
||||
|
||||
std::string fmt::merge(std::initializer_list<std::vector<std::string>> sources, const std::string& separator)
|
||||
|
|
|
@ -32,21 +32,12 @@ std::string simplify_path(const std::string& path, bool is_dir)
|
|||
{
|
||||
std::vector<std::string> path_blocks = simplify_path_blocks(path);
|
||||
|
||||
std::string result;
|
||||
|
||||
if (path_blocks.empty())
|
||||
return result;
|
||||
return "";
|
||||
|
||||
if (is_dir)
|
||||
{
|
||||
result = fmt::merge(path_blocks, "/");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = fmt::merge(std::vector<std::string>(path_blocks.begin(), path_blocks.end() - 1), "/") + path_blocks[path_blocks.size() - 1];
|
||||
}
|
||||
std::string result = fmt::merge(path_blocks, "/");
|
||||
|
||||
return result;
|
||||
return is_dir ? result + "/" : result;
|
||||
}
|
||||
|
||||
VFS::~VFS()
|
||||
|
|
|
@ -30,7 +30,7 @@ int cellGameBootCheck(vm::ptr<u32> type, vm::ptr<u32> attributes, vm::ptr<CellGa
|
|||
size->sysSizeKB = 0;
|
||||
}
|
||||
|
||||
vfsFile f("/app_home/../PARAM.SFO");
|
||||
vfsFile f("/app_home/../../PARAM.SFO");
|
||||
if (!f.IsOpened())
|
||||
{
|
||||
cellGame->Error("cellGameBootCheck(): CELL_GAME_ERROR_ACCESS_ERROR (cannot open PARAM.SFO)");
|
||||
|
@ -100,7 +100,7 @@ int cellGamePatchCheck(vm::ptr<CellGameContentSize> size, u32 reserved_addr)
|
|||
size->sysSizeKB = 0;
|
||||
}
|
||||
|
||||
vfsFile f("/app_home/../PARAM.SFO");
|
||||
vfsFile f("/app_home/../../PARAM.SFO");
|
||||
if (!f.IsOpened())
|
||||
{
|
||||
cellGame->Error("cellGamePatchCheck(): CELL_GAME_ERROR_ACCESS_ERROR (cannot open PARAM.SFO)");
|
||||
|
@ -335,7 +335,7 @@ int cellGameGetParamInt(u32 id, vm::ptr<u32> value)
|
|||
cellGame->Warning("cellGameGetParamInt(id=%d, value_addr=0x%x)", id, value.addr());
|
||||
|
||||
// TODO: Access through cellGame***Check functions
|
||||
vfsFile f("/app_home/../PARAM.SFO");
|
||||
vfsFile f("/app_home/../../PARAM.SFO");
|
||||
PSFLoader psf(f);
|
||||
if(!psf.Load(false))
|
||||
return CELL_GAME_ERROR_FAILURE;
|
||||
|
@ -358,7 +358,7 @@ int cellGameGetParamString(u32 id, vm::ptr<char> buf, u32 bufsize)
|
|||
cellGame->Warning("cellGameGetParamString(id=%d, buf_addr=0x%x, bufsize=%d)", id, buf.addr(), bufsize);
|
||||
|
||||
// TODO: Access through cellGame***Check functions
|
||||
vfsFile f("/app_home/../PARAM.SFO");
|
||||
vfsFile f("/app_home/../../PARAM.SFO");
|
||||
PSFLoader psf(f);
|
||||
if(!psf.Load(false))
|
||||
return CELL_GAME_ERROR_FAILURE;
|
||||
|
|
|
@ -96,7 +96,7 @@ int sceNpTrophyCreateContext(vm::ptr<u32> context, vm::ptr<SceNpCommunicationId>
|
|||
// TODO: There are other possible errors
|
||||
|
||||
// TODO: Is the TROPHY.TRP file necessarily located in this path?
|
||||
vfsDir dir("/app_home/../TROPDIR/");
|
||||
vfsDir dir("/app_home/../../TROPDIR/");
|
||||
if(!dir.IsOpened())
|
||||
return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST;
|
||||
|
||||
|
@ -105,7 +105,7 @@ int sceNpTrophyCreateContext(vm::ptr<u32> context, vm::ptr<SceNpCommunicationId>
|
|||
{
|
||||
if (entry->flags & DirEntry_TypeDir)
|
||||
{
|
||||
vfsStream* stream = Emu.GetVFS().OpenFile("/app_home/../TROPDIR/" + entry->name + "/TROPHY.TRP", vfsRead);
|
||||
vfsStream* stream = Emu.GetVFS().OpenFile("/app_home/../../TROPDIR/" + entry->name + "/TROPHY.TRP", vfsRead);
|
||||
|
||||
if (stream && stream->IsOpened())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue