Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cellGameDataCheckCreate2 error broken check #7976

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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