diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index 49ec2e06b1..d1fe7a9c31 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -50,7 +50,8 @@ s32 cellHddGameCheck(PPUThread& CPU, u32 version, vm::ptr dirName, u else { // TODO: Is cellHddGameCheck really responsible for writing the information in get->getParam ? (If not, delete this else) - const PSFLoader psf(vfsFile("/dev_hdd0/game/" + dir + "/PARAM.SFO")); + vfsFile f("/dev_hdd0/game/" + dir + "/PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { return CELL_HDDGAME_ERROR_BROKEN; @@ -103,7 +104,8 @@ s32 cellGameBootCheck(vm::ptr type, vm::ptr attributes, vm::ptrsysSizeKB = 0; } - const PSFLoader psf(vfsFile("/app_home/../PARAM.SFO")); + vfsFile f("/app_home/../PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { cellGame.Error("cellGameBootCheck(): CELL_GAME_ERROR_ACCESS_ERROR (cannot read PARAM.SFO)"); @@ -163,7 +165,8 @@ s32 cellGamePatchCheck(vm::ptr size, vm::ptr reserved size->sysSizeKB = 0; } - const PSFLoader psf(vfsFile("/app_home/../PARAM.SFO")); + vfsFile f("/app_home/../PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { cellGame.Error("cellGamePatchCheck(): CELL_GAME_ERROR_ACCESS_ERROR (cannot read PARAM.SFO)"); @@ -290,7 +293,8 @@ s32 cellGameDataCheckCreate2(PPUThread& CPU, u32 version, vm::ptr di return CELL_GAMEDATA_RET_OK; } - const PSFLoader psf(vfsFile("/app_home/../PARAM.SFO")); + vfsFile f("/app_home/../PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { cellGame.Error("cellGameDataCheckCreate2(): CELL_GAMEDATA_ERROR_BROKEN (cannot read PARAM.SFO)"); @@ -419,7 +423,8 @@ s32 cellGameGetParamInt(u32 id, vm::ptr value) cellGame.Warning("cellGameGetParamInt(id=%d, value=*0x%x)", id, value); // TODO: Access through cellGame***Check functions - const PSFLoader psf(vfsFile("/app_home/../PARAM.SFO")); + vfsFile f("/app_home/../PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { return CELL_GAME_ERROR_FAILURE; @@ -443,7 +448,8 @@ s32 cellGameGetParamString(u32 id, vm::ptr buf, u32 bufsize) cellGame.Warning("cellGameGetParamString(id=%d, buf=*0x%x, bufsize=%d)", id, buf, bufsize); // TODO: Access through cellGame***Check functions - const PSFLoader psf(vfsFile("/app_home/../PARAM.SFO")); + vfsFile f("/app_home/../PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { return CELL_GAME_ERROR_FAILURE; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index 18ff13b582..2826c7905f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -150,7 +150,8 @@ __noinline s32 savedata_op( listGet->dirNum++; // PSF parameters - const PSFLoader psf(vfsFile(base_dir + entry->name + "/PARAM.SFO")); + vfsFile f(base_dir + entry->name + "/PARAM.SFO"); + const PSFLoader psf(f); if (!psf) { @@ -351,7 +352,8 @@ __noinline s32 savedata_op( std::string dir_path = base_dir + save_entry.dirName + "/"; std::string sfo_path = dir_path + "PARAM.SFO"; - PSFLoader psf(vfsFile(sfo_path, vfsRead)); + vfsFile f(sfo_path); + PSFLoader psf(f); std::string dir_local_path; @@ -487,7 +489,9 @@ __noinline s32 savedata_op( if (psf) { Emu.GetVFS().CreateFile(sfo_path, true); - psf.Save(vfsFile(sfo_path, vfsWrite)); + + vfsFile f(sfo_path, vfsWrite); + psf.Save(f); } // Enter the loop where the save files are read/created/deleted diff --git a/rpcs3/Loader/PSF.h b/rpcs3/Loader/PSF.h index a1fef680a2..dfc8853ffd 100644 --- a/rpcs3/Loader/PSF.h +++ b/rpcs3/Loader/PSF.h @@ -61,7 +61,7 @@ public: const PSFEntry* SearchEntry(const std::string& key) const; - PSFEntry& PSFLoader::AddEntry(const std::string& key, u16 type); + PSFEntry& AddEntry(const std::string& key, u16 type); std::string GetString(const std::string& key, std::string def = "") const;