diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index 1266dee0fe..fe4f89b121 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -1295,7 +1295,7 @@ bool SELFDecrypter::GetKeyFromRap(u8* content_id, u8* npdrm_key) // Try to find a matching RAP file under exdata folder. const std::string ci_str = reinterpret_cast(content_id); - const std::string rap_path = fmt::format("/dev_hdd0/home/%s/exdata/%s.rap", Emu.GetUsr(), ci_str); + const std::string rap_path = "/dev_hdd0/home/" + Emu.GetUsr() + "/exdata/" + ci_str + ".rap"; // Open the RAP file and read the key. const fs::file rap_file(vfs::get(rap_path)); diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index c3621b28b0..46ff8eb6a8 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -1207,7 +1207,7 @@ s32 cellSaveDataUserFixedExport(ppu_thread& ppu, u32 userId, vm::cptr dirN s32 cellSaveDataUserGetListItem(u32 userId, vm::cptr dirName, vm::ptr dir, vm::ptr sysFileParam, vm::ptr bind, vm::ptr sizeKB) { - cellSaveData.warning("cellSaveDataGetListItem(dirName=%s, dir=*0x%x, sysFileParam=*0x%x, bind=*0x%x, sizeKB=*0x%x, userID=*0x%x)", dirName, dir, sysFileParam, bind, sizeKB, userId); + cellSaveData.warning("cellSaveDataUserGetListItem(dirName=%s, dir=*0x%x, sysFileParam=*0x%x, bind=*0x%x, sizeKB=*0x%x, userID=*0x%x)", dirName, dir, sysFileParam, bind, sizeKB, userId); return savedata_get_list_item(dirName, dir, sysFileParam, bind, sizeKB, userId); } diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index 59bce9f9aa..6a8b2f0c0a 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -65,7 +65,7 @@ s32 npDrmIsAvailable(vm::cptr k_licensee_addr, vm::cptr drm_path) npdrmkeys->devKlic.fill(0); npdrmkeys->rifKey.fill(0); - std::string rap_dir_path = fmt::format("/dev_hdd0/home/%s/exdata/", Emu.GetUsr()); + std::string rap_dir_path = "/dev_hdd0/home/" + Emu.GetUsr() + "/exdata/"; const std::string& enc_drm_path_local = vfs::get(enc_drm_path); const fs::file enc_file(enc_drm_path_local); @@ -144,7 +144,7 @@ s32 sceNpDrmVerifyUpgradeLicense(vm::cptr content_id) return SCE_NP_DRM_ERROR_INVALID_PARAM; } - if (!fs::is_file(vfs::get(fmt::format("/dev_hdd0/home/%s/exdata/%s.rap", Emu.GetUsr(), content_id.get_ptr())))) + if (!fs::is_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/exdata/" + content_id.get_ptr() + ".rap"))) { // Game hasn't been purchased therefore no RAP file present return SCE_NP_DRM_ERROR_LICENSE_NOT_FOUND; @@ -163,7 +163,7 @@ s32 sceNpDrmVerifyUpgradeLicense2(vm::cptr content_id) return SCE_NP_DRM_ERROR_INVALID_PARAM; } - if (!fs::is_file(vfs::get(fmt::format("/dev_hdd0/home/%s/exdata/%s.rap", Emu.GetUsr(), content_id.get_ptr())))) + if (!fs::is_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/exdata/" + content_id.get_ptr() + ".rap"))) { // Game hasn't been purchased therefore no RAP file present return SCE_NP_DRM_ERROR_LICENSE_NOT_FOUND; diff --git a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp index 2c17eda431..0784f4982e 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpTrophy.cpp @@ -296,7 +296,7 @@ error_code sceNpTrophyRegisterContext(ppu_thread& ppu, u32 context, u32 handle, } } - std::string trophyPath = fmt::format("/dev_hdd0/home/%s/trophy/%s", Emu.GetUsr(), ctxt->trp_name); + std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name; if (!trp.Install(trophyPath)) { return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; @@ -345,7 +345,7 @@ error_code sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, vm::ptr return SCE_NP_TROPHY_ERROR_UNKNOWN_HANDLE; } - if (!fs::is_dir(vfs::get(fmt::format("/dev_hdd0/home/%s/trophy/%s", Emu.GetUsr(), ctxt->trp_name)))) + if (!fs::is_dir(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name))) { TRPLoader trp(ctxt->trp_stream); @@ -404,7 +404,7 @@ error_code sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptrtrp_name))); + fs::file config(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPCONF.SFM")); if (!config) { @@ -503,7 +503,7 @@ error_code sceNpTrophyUnlockTrophy(u32 context, u32 handle, s32 trophyId, vm::pt return SCE_NP_TROPHY_ERROR_ALREADY_UNLOCKED; ctxt->tropusr->UnlockTrophy(trophyId, 0, 0); // TODO - std::string trophyPath = fmt::format("/dev_hdd0/home/%s/trophy/%s/TROPUSR.DAT", Emu.GetUsr(), ctxt->trp_name); + std::string trophyPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPUSR.DAT"; ctxt->tropusr->Save(trophyPath); if (platinumId) @@ -526,7 +526,7 @@ error_code sceNpTrophyUnlockTrophy(u32 context, u32 handle, s32 trophyId, vm::pt // Get icon for the notification. std::string paddedTrophyId = padding + std::to_string(trophyId); - std::string trophyIconPath = fmt::format("/dev_hdd0/home/%s/trophy/%s/TROP%s.PNG", Emu.GetUsr(), ctxt->trp_name, paddedTrophyId); + std::string trophyIconPath = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROP" + paddedTrophyId + ".PNG"; fs::file trophyIconFile = fs::file(vfs::get(trophyIconPath)); size_t iconSize = trophyIconFile.size(); std::vector trophyIconData; @@ -611,7 +611,7 @@ error_code sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, vm::p return SCE_NP_TROPHY_ERROR_UNKNOWN_HANDLE; } - fs::file config(vfs::get(fmt::format("/dev_hdd0/home/%s/trophy/%s/TROPCONF.SFM", Emu.GetUsr(), ctxt->trp_name))); + fs::file config(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/TROPCONF.SFM")); if (!config) { @@ -754,7 +754,7 @@ error_code sceNpTrophyGetGameIcon(u32 context, u32 handle, vm::ptr buffer, return SCE_NP_TROPHY_ERROR_UNKNOWN_HANDLE; } - fs::file icon_file(vfs::get(fmt::format("/dev_hdd0/home/%s/trophy/%s/ICON0.PNG", Emu.GetUsr(), ctxt->trp_name))); + fs::file icon_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/ICON0.PNG")); if (!icon_file) { @@ -807,7 +807,7 @@ error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::p return hidden ? SCE_NP_TROPHY_ERROR_HIDDEN : SCE_NP_TROPHY_ERROR_LOCKED; } - fs::file icon_file(vfs::get(fmt::format("/dev_hdd0/home/%s/trophy/%s/TROP%03d.PNG", Emu.GetUsr(), ctxt->trp_name, trophyId))); + fs::file icon_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + fmt::format("/TROP%03d.PNG", trophyId))); if (!icon_file) { diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 6ee29aecbd..ddbfaa1587 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1789,7 +1789,7 @@ void main_window::dropEvent(QDropEvent* event) { const std::string rapname = sstr(QFileInfo(rap).fileName()); - if (!fs::copy_file(sstr(rap), fmt::format("%s/home/%s/exdata/%s", Emu.GetHddDir(), Emu.GetUsr(), rapname), false)) + if (!fs::copy_file(sstr(rap), Emu.GetHddDir() + "/home/" + Emu.GetUsr() + "/exdata/" + rapname, false)) { LOG_WARNING(GENERAL, "Could not copy rap file by drop: %s", rapname); } diff --git a/rpcs3/rpcs3qt/trophy_manager_dialog.cpp b/rpcs3/rpcs3qt/trophy_manager_dialog.cpp index 426aef28e1..d1efe6ebd9 100644 --- a/rpcs3/rpcs3qt/trophy_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/trophy_manager_dialog.cpp @@ -58,7 +58,7 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr gui_s // Get the currently selected user's trophy path. - m_trophy_dir = fmt::format("/dev_hdd0/home/%s/trophy/", Emu.GetUsr()); + m_trophy_dir = "/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/"; // Game chooser combo box m_game_combo = new QComboBox(); diff --git a/rpcs3/rpcs3qt/user_manager_dialog.cpp b/rpcs3/rpcs3qt/user_manager_dialog.cpp index 5aedee4457..9c44b9e580 100644 --- a/rpcs3/rpcs3qt/user_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/user_manager_dialog.cpp @@ -208,11 +208,11 @@ void user_manager_dialog::GenerateUser(const std::string& username) const std::string homeDir = Emu.GetHddDir() + "home/"; const std::string userDir = homeDir + nextUserId; fs::create_dir(homeDir); - fs::create_dir(fmt::format("%s/", userDir)); - fs::create_dir(fmt::format("%s/exdata/", userDir)); - fs::create_dir(fmt::format("%s/savedata/", userDir)); - fs::create_dir(fmt::format("%s/trophy/", userDir)); - fs::write_file(fmt::format("%s/localusername", userDir), fs::create + fs::excl + fs::write, username); + fs::create_dir(userDir + "/"); + fs::create_dir(userDir + "/exdata/"); + fs::create_dir(userDir + "/savedata/"); + fs::create_dir(userDir + "/trophy/"); + fs::write_file(userDir + "/localusername", fs::create + fs::excl + fs::write, username); } bool user_manager_dialog::ValidateUsername(const QString& textToValidate)