Skip to content

Commit

Permalink
Fix cellGameDataCheckCreate2 error broken check (#7976)
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Apr 7, 2020
1 parent 5834a46 commit 8f3ad8b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rpcs3/Emu/Cell/Modules/cellGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,13 @@ 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;

if (!new_data && psf::get_string(sfo, "CATEGORY", "") != "GD")
if (!new_data)
{
return CELL_GAMEDATA_ERROR_BROKEN;
const auto cat = psf::get_string(sfo, "CATEGORY", "");
if (cat != "GD" && cat != "DG")
{
return CELL_GAMEDATA_ERROR_BROKEN;
}
}

cbGet->isNewData = new_data;
Expand Down Expand Up @@ -628,7 +632,11 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>

if (setParam)
{
psf::assign(sfo, "CATEGORY", psf::string(3, "GD"));
if (new_data)
{
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", psf::string(CELL_GAME_SYSP_TITLE_SIZE, setParam->title));
psf::assign(sfo, "VERSION", psf::string(CELL_GAME_SYSP_VERSION_SIZE, setParam->dataVersion));
Expand Down

0 comments on commit 8f3ad8b

Please sign in to comment.