Skip to content

Commit ba2518f

Browse files
committed
cellGame: Fix cellHddGameCheck dataVersion parameter
1 parent 3a6c71e commit ba2518f

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

rpcs3/Emu/Cell/Modules/cellGame.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
464464
{
465465
get->isNewData = CELL_HDDGAME_ISNEWDATA_NODIR;
466466
get->getParam = {};
467+
468+
cellGame.warning("cellHddGameCheck(): New data.");
467469
}
468470
else
469471
{
@@ -476,13 +478,22 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
476478
if (psf.contains("RESOLUTION")) get->getParam.resolution = ::at32(psf, "RESOLUTION").as_integer();
477479
if (psf.contains("SOUND_FORMAT")) get->getParam.soundFormat = ::at32(psf, "SOUND_FORMAT").as_integer();
478480
if (psf.contains("TITLE")) strcpy_trunc(get->getParam.title, ::at32(psf, "TITLE").as_string());
479-
if (psf.contains("APP_VER")) strcpy_trunc(get->getParam.dataVersion, ::at32(psf, "APP_VER").as_string());
480-
if (psf.contains("TITLE_ID")) strcpy_trunc(get->getParam.titleId, ::at32(psf, "TITLE_ID").as_string());
481+
482+
// Old games do not have APP_VER key
483+
strcpy_trunc(get->getParam.dataVersion, psf::get_string(psf, "APP_VER", psf::get_string(sfo, "VERSION", "")));
484+
485+
if (psf.contains("TITLE_ID"))
486+
{
487+
strcpy_trunc(get->getParam.titleId, ::at32(psf, "TITLE_ID").as_string());
488+
}
481489

482490
for (u32 i = 0; i < CELL_HDDGAME_SYSP_LANGUAGE_NUM; i++)
483491
{
484492
strcpy_trunc(get->getParam.titleLang[i], psf::get_string(psf, fmt::format("TITLE_%02d", i)));
485493
}
494+
495+
cellGame.warning("cellHddGameCheck(): Data exists:\nATTRIBUTE: 0x%x, RESOLUTION: 0x%x, RESOLUTION: 0x%x, SOUND_FORMAT: 0x%x, dataVersion: %s"
496+
, get->getParam.attribute, get->getParam.resolution, get->getParam.soundFormat, get->getParam.soundFormat, std::span<const u8>(reinterpret_cast<const u8*>(get->getParam.dataVersion), 6));
486497
}
487498

488499
// TODO ?

rpcs3/Emu/Cell/Modules/cellGame.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ enum
224224
struct CellGameDataSystemFileParam
225225
{
226226
char title[CELL_GAMEDATA_SYSP_TITLE_SIZE];
227-
char titleLang[CELL_GAMEDATA_SYSP_LANGUAGE_NUM][CELL_GAMEDATA_SYSP_TITLE_SIZE];
228-
char titleId[CELL_GAMEDATA_SYSP_TITLEID_SIZE];
227+
char titleLang[CELL_GAMEDATA_SYSP_LANGUAGE_NUM][CELL_GAMEDATA_SYSP_TITLE_SIZE]; // 0x80
228+
char titleId[CELL_GAMEDATA_SYSP_TITLEID_SIZE]; // 0xA80
229229
char reserved0[2];
230230
char dataVersion[CELL_GAMEDATA_SYSP_VERSION_SIZE];
231231
char reserved1[2];
@@ -248,13 +248,13 @@ struct CellGameDataStatGet
248248
{
249249
be_t<s32> hddFreeSizeKB;
250250
be_t<u32> isNewData;
251-
char contentInfoPath[CELL_GAMEDATA_PATH_MAX];
252-
char gameDataPath[CELL_GAMEDATA_PATH_MAX];
253-
char reserved0[2];
254-
be_t<s64> st_atime_;
255-
be_t<s64> st_mtime_;
256-
be_t<s64> st_ctime_;
257-
CellGameDataSystemFileParam getParam;
251+
char contentInfoPath[CELL_GAMEDATA_PATH_MAX]; // 0x8
252+
char gameDataPath[CELL_GAMEDATA_PATH_MAX]; // 0x427
253+
char reserved0[2]; // 0x846
254+
be_t<s64> st_atime_; // 0x848
255+
be_t<s64> st_mtime_; // 0x850
256+
be_t<s64> st_ctime_; // 0x858
257+
CellGameDataSystemFileParam getParam; // 0x860
258258
be_t<s32> sizeKB;
259259
be_t<s32> sysSizeKB;
260260
char reserved1[68];

0 commit comments

Comments
 (0)