Fix cellDiscGameGetBootDiscInfo on error

* Always set first dword to 0, other bytes are untouched,
This commit is contained in:
Eladash 2020-02-21 00:11:53 +02:00 committed by Ivan
parent 4d7e53d7a0
commit 0ba1f8f4ef

View File

@ -1045,16 +1045,18 @@ error_code cellDiscGameGetBootDiscInfo(vm::ptr<CellDiscGameSystemFileParam> getP
cellGame.warning("cellDiscGameGetBootDiscInfo(getParam=*0x%x)", getParam);
if (!getParam)
{
return CELL_DISCGAME_ERROR_PARAM;
}
// Always sets 0 at first dword
reinterpret_cast<nse_t<u32, 1>*>(getParam->titleId)[0] = 0;
// This is also called by non-disc games, see NPUB90029
const std::string dir = "/dev_bdvd/PS3_GAME"s;
static const std::string dir = "/dev_bdvd/PS3_GAME"s;
if (!fs::is_dir(vfs::get(dir)))
{
getParam->parentalLevel = 0;
strcpy_trunc(getParam->titleId, "0");
return CELL_DISCGAME_ERROR_NOT_DISCBOOT;
}