diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index ecd89aaa6c..064c2f5d32 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -757,9 +757,21 @@ s32 cellGameThemeInstallFromBuffer() } -s32 cellDiscGameGetBootDiscInfo() +s32 cellDiscGameGetBootDiscInfo(vm::ptr getParam) { - UNIMPLEMENTED_FUNC(cellGame); + cellGame.warning("cellDiscGameGetBootDiscInfo(getParam=*0x%x)", getParam); + //this should only appear in disc games + const std::string dir = "/dev_bdvd/PS3_GAME"s; + + if (!fs::is_dir(vfs::get(dir))) + { + cellGame.warning("cellDiscGameGetBootDiscInfo(): directory '%s' not found", dir); + } + 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(); + if (psf.count("TITLE_ID") != 0) strcpy_trunc(getParam->titleId, psf.at("TITLE_ID").as_string()); + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/cellGame.h b/rpcs3/Emu/Cell/Modules/cellGame.h index 7eef52de10..fd689535dc 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.h +++ b/rpcs3/Emu/Cell/Modules/cellGame.h @@ -178,6 +178,8 @@ enum // old consts CELL_GAMEDATA_ERRDIALOG_NONE = 0, CELL_GAMEDATA_ERRDIALOG_ALWAYS = 1, + + CELL_DISCGAME_SYSP_TITLEID_SIZE=10, }; struct CellGameDataSystemFileParam @@ -192,6 +194,12 @@ struct CellGameDataSystemFileParam be_t attribute; char reserved2[256]; }; +struct CellDiscGameSystemFileParam { + char titleId[CELL_DISCGAME_SYSP_TITLEID_SIZE]; + char reserved0[2]; + be_t parentalLevel; + char reserved1[16]; +}; struct CellGameDataStatGet {