From 557e1c3694f6c8f54b1ae82975076a82d069b535 Mon Sep 17 00:00:00 2001 From: Ani Date: Tue, 28 Feb 2017 15:42:45 +0000 Subject: [PATCH] Fix cellDiscGameGetBootDiscInfo (#2430) cellDiscGameGetBootDiscInfo is called by non-disc games for some reason. That wasn't accounted for and therefore it would try to read PARAM.SFO from an unmounted path and throw an access violation. Tested with NBA Live 08 Demo NPUB90029, probably fixes similar games as well --- rpcs3/Emu/Cell/Modules/cellGame.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index 064c2f5d32..e5325335fe 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -760,13 +760,19 @@ s32 cellGameThemeInstallFromBuffer() s32 cellDiscGameGetBootDiscInfo(vm::ptr getParam) { cellGame.warning("cellDiscGameGetBootDiscInfo(getParam=*0x%x)", getParam); - //this should only appear in disc games + + // This is also called by non-disc games, see NPUB90029 const std::string dir = "/dev_bdvd/PS3_GAME"s; if (!fs::is_dir(vfs::get(dir))) { + // Not a disc game. TODO: Fetch PARAM.SFO from proper game dir cellGame.warning("cellDiscGameGetBootDiscInfo(): directory '%s' not found", dir); + getParam->parentalLevel = 0; + strcpy_trunc(getParam->titleId, "0"); + return CELL_OK; } + const auto& psf = psf::load_object(fs::file(vfs::get(dir + "/PARAM.SFO"))); if (psf.count("PARENTAL_LEVEL") != 0) getParam->parentalLevel = psf.at("PARENTAL_LEVEL").as_integer();