diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index 7c31007793..371aa2a7b3 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -464,6 +464,8 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName { get->isNewData = CELL_HDDGAME_ISNEWDATA_NODIR; get->getParam = {}; + + cellGame.warning("cellHddGameCheck(): New data."); } else { @@ -476,13 +478,22 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName if (psf.contains("RESOLUTION")) get->getParam.resolution = ::at32(psf, "RESOLUTION").as_integer(); if (psf.contains("SOUND_FORMAT")) get->getParam.soundFormat = ::at32(psf, "SOUND_FORMAT").as_integer(); if (psf.contains("TITLE")) strcpy_trunc(get->getParam.title, ::at32(psf, "TITLE").as_string()); - if (psf.contains("APP_VER")) strcpy_trunc(get->getParam.dataVersion, ::at32(psf, "APP_VER").as_string()); - if (psf.contains("TITLE_ID")) strcpy_trunc(get->getParam.titleId, ::at32(psf, "TITLE_ID").as_string()); + + // Old games do not have APP_VER key + strcpy_trunc(get->getParam.dataVersion, psf::get_string(psf, "APP_VER", psf::get_string(sfo, "VERSION", ""))); + + if (psf.contains("TITLE_ID")) + { + strcpy_trunc(get->getParam.titleId, ::at32(psf, "TITLE_ID").as_string()); + } for (u32 i = 0; i < CELL_HDDGAME_SYSP_LANGUAGE_NUM; i++) { strcpy_trunc(get->getParam.titleLang[i], psf::get_string(psf, fmt::format("TITLE_%02d", i))); } + + cellGame.warning("cellHddGameCheck(): Data exists:\nATTRIBUTE: 0x%x, RESOLUTION: 0x%x, RESOLUTION: 0x%x, SOUND_FORMAT: 0x%x, dataVersion: %s" + , get->getParam.attribute, get->getParam.resolution, get->getParam.soundFormat, get->getParam.soundFormat, std::span(reinterpret_cast(get->getParam.dataVersion), 6)); } // TODO ? diff --git a/rpcs3/Emu/Cell/Modules/cellGame.h b/rpcs3/Emu/Cell/Modules/cellGame.h index a0506cef9d..4121b7fd83 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.h +++ b/rpcs3/Emu/Cell/Modules/cellGame.h @@ -224,8 +224,8 @@ enum struct CellGameDataSystemFileParam { char title[CELL_GAMEDATA_SYSP_TITLE_SIZE]; - char titleLang[CELL_GAMEDATA_SYSP_LANGUAGE_NUM][CELL_GAMEDATA_SYSP_TITLE_SIZE]; - char titleId[CELL_GAMEDATA_SYSP_TITLEID_SIZE]; + char titleLang[CELL_GAMEDATA_SYSP_LANGUAGE_NUM][CELL_GAMEDATA_SYSP_TITLE_SIZE]; // 0x80 + char titleId[CELL_GAMEDATA_SYSP_TITLEID_SIZE]; // 0xA80 char reserved0[2]; char dataVersion[CELL_GAMEDATA_SYSP_VERSION_SIZE]; char reserved1[2]; @@ -248,13 +248,13 @@ struct CellGameDataStatGet { be_t hddFreeSizeKB; be_t isNewData; - char contentInfoPath[CELL_GAMEDATA_PATH_MAX]; - char gameDataPath[CELL_GAMEDATA_PATH_MAX]; - char reserved0[2]; - be_t st_atime_; - be_t st_mtime_; - be_t st_ctime_; - CellGameDataSystemFileParam getParam; + char contentInfoPath[CELL_GAMEDATA_PATH_MAX]; // 0x8 + char gameDataPath[CELL_GAMEDATA_PATH_MAX]; // 0x427 + char reserved0[2]; // 0x846 + be_t st_atime_; // 0x848 + be_t st_mtime_; // 0x850 + be_t st_ctime_; // 0x858 + CellGameDataSystemFileParam getParam; // 0x860 be_t sizeKB; be_t sysSizeKB; char reserved1[68];