mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-24 18:39:56 +00:00
HLE: Implement ERROR_BROKEN in cellGameDataCheck (#8945)
This commit is contained in:
parent
5d50602397
commit
cf61198fe3
@ -462,13 +462,33 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
|
||||
|
||||
const auto perm = g_fxo->get<content_permission>();
|
||||
|
||||
const auto init = perm->init.init();
|
||||
auto init = perm->init.init();
|
||||
|
||||
if (!init)
|
||||
{
|
||||
return CELL_GAME_ERROR_BUSY;
|
||||
}
|
||||
|
||||
auto sfo = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO")));
|
||||
|
||||
if (psf::get_string(sfo, "CATEGORY") != [&]()
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CELL_GAME_GAMETYPE_HDD: return "HG"sv;
|
||||
case CELL_GAME_GAMETYPE_GAMEDATA: return "GD"sv;
|
||||
case CELL_GAME_GAMETYPE_DISC: return "DG"sv;
|
||||
default: ASSUME(0);
|
||||
}
|
||||
}())
|
||||
{
|
||||
if (fs::is_file(vfs::get(dir + "/PARAM.SFO")))
|
||||
{
|
||||
init.cancel();
|
||||
return CELL_GAME_ERROR_BROKEN;
|
||||
}
|
||||
}
|
||||
|
||||
if (size)
|
||||
{
|
||||
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
||||
@ -488,14 +508,14 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
|
||||
|
||||
perm->restrict_sfo_params = false;
|
||||
|
||||
if (!fs::is_dir(vfs::get(dir)))
|
||||
if (sfo.empty())
|
||||
{
|
||||
cellGame.warning("cellGameDataCheck(): directory '%s' not found", dir);
|
||||
return not_an_error(CELL_GAME_RET_NONE);
|
||||
}
|
||||
|
||||
perm->exists = true;
|
||||
perm->sfo = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO")));
|
||||
perm->sfo = std::move(sfo);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user