Fix cellGameDataCheckCreate2 error broken check (#7976)

This commit is contained in:
Eladash 2020-04-07 14:03:03 +03:00 committed by GitHub
parent 5834a466cd
commit 8f3ad8b81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -565,10 +565,14 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
const u32 new_data = sfo.empty() && !fs::is_file(vfs::get(dir + "/PARAM.SFO")) ? CELL_GAMEDATA_ISNEWDATA_YES : CELL_GAMEDATA_ISNEWDATA_NO; const u32 new_data = sfo.empty() && !fs::is_file(vfs::get(dir + "/PARAM.SFO")) ? CELL_GAMEDATA_ISNEWDATA_YES : CELL_GAMEDATA_ISNEWDATA_NO;
if (!new_data && psf::get_string(sfo, "CATEGORY", "") != "GD") if (!new_data)
{
const auto cat = psf::get_string(sfo, "CATEGORY", "");
if (cat != "GD" && cat != "DG")
{ {
return CELL_GAMEDATA_ERROR_BROKEN; return CELL_GAMEDATA_ERROR_BROKEN;
} }
}
cbGet->isNewData = new_data; cbGet->isNewData = new_data;
@ -627,8 +631,12 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
} }
if (setParam) if (setParam)
{
if (new_data)
{ {
psf::assign(sfo, "CATEGORY", psf::string(3, "GD")); psf::assign(sfo, "CATEGORY", psf::string(3, "GD"));
}
psf::assign(sfo, "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, setParam->titleId)); psf::assign(sfo, "TITLE_ID", psf::string(CELL_GAME_SYSP_TITLEID_SIZE, setParam->titleId));
psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title)); psf::assign(sfo, "TITLE", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion)); psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));