33#include " system_config.h"
44#include " vfs_config.h"
55#include " Emu/Io/pad_config.h"
6+ #include " Emu/GameInfo.h"
67#include " Emu/System.h"
78#include " Emu/VFS.h"
89#include " util/sysinfo.hpp"
@@ -594,19 +595,17 @@ namespace rpcs3::utils
594595 return get_input_config_dir (title_id) + g_cfg_input_configs.default_config + " .yml" ;
595596 }
596597
597- std::string get_game_content_path (game_content_type type)
598+ std::string get_game_content_path (game_content_type type, const std::string& serial, std::string sfo_dir, const std::string& disc_dir )
598599 {
599600 const std::string locale_suffix = fmt::format (" _%02d" , static_cast <s32>(g_cfg.sys .language .get ()));
600- const std::string disc_dir = vfs::get (" /dev_bdvd/PS3_GAME" );
601- std::string hdd0_dir = Emu.GetSfoDir (false );
602601
603- if (hdd0_dir == disc_dir)
602+ if (sfo_dir == disc_dir)
604603 {
605- hdd0_dir .clear (); // No hdd0 dir
604+ sfo_dir .clear (); // No hdd0 dir
606605 }
607606
608607 const bool check_disc = !disc_dir.empty ();
609- const bool check_hdd0 = !hdd0_dir .empty () && !check_disc;
608+ const bool check_hdd0 = !sfo_dir .empty () && !check_disc;
610609
611610 const auto find_content = [&](std::string_view name, std::string_view extension) -> std::string
612611 {
@@ -618,7 +617,7 @@ namespace rpcs3::utils
618617 // Check content on hdd0 first
619618 if (check_hdd0)
620619 {
621- if (std::string path = hdd0_dir + filename; fs::is_file (path))
620+ if (std::string path = sfo_dir + filename; fs::is_file (path))
622621 {
623622 return path;
624623 }
@@ -660,7 +659,7 @@ namespace rpcs3::utils
660659 case game_content_type::background_picture_2:
661660 {
662661 // Try to find a custom background first
663- if (std::string path = fs::get_config_dir () + " /Icons/game_icons/" + Emu. GetTitleID () + " /PIC1.PNG" ; fs::is_file (path))
662+ if (std::string path = fs::get_config_dir () + " /Icons/game_icons/" + serial + " /PIC1.PNG" ; fs::is_file (path))
664663 {
665664 return path;
666665 }
@@ -673,6 +672,16 @@ namespace rpcs3::utils
673672 return {};
674673 }
675674
675+ std::string get_game_content_path (game_content_type type, const GameInfo& info, const std::string& sfo_dir)
676+ {
677+ return get_game_content_path (type, info.serial , sfo_dir.empty () ? rpcs3::utils::get_sfo_dir_from_game_path (info.path , info.serial ) : sfo_dir, {});
678+ }
679+
680+ std::string get_game_content_path (game_content_type type)
681+ {
682+ return get_game_content_path (type, Emu.GetTitleID (), Emu.GetSfoDir (false ), vfs::get (" /dev_bdvd/PS3_GAME" ));
683+ }
684+
676685 bool version_is_bigger (std::string_view v0, std::string_view v1, std::string_view serial, bool is_fw)
677686 {
678687 std::add_pointer_t <char > ev0, ev1;
0 commit comments