Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rpcs3/Emu/RSX/Overlays/BigPicture/overlay_big_picture.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "Emu/RSX/Overlays/overlays.h"
#include "Emu/Cell/ErrorCodes.h"
#include "overlay_big_picture_main_menu.h"

namespace rsx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "overlay_big_picture_game_details.h"
#include "Emu/RSX/Overlays/HomeMenu/overlay_home_menu_components.h"
#include "Emu/system_utils.hpp"

namespace rsx
{
Expand Down Expand Up @@ -51,9 +51,7 @@ namespace rsx

m_info_text.set_text(fmt::format("%s\n%s\n%s", info.serial, info.category, info.app_ver));

const std::string game_dir = fs::get_parent_dir(info.icon_path);

if (const std::string pic1_path = game_dir + "/PIC1.PNG"; fs::is_file(pic1_path))
if (const std::string pic1_path = rpcs3::utils::get_game_content_path(game_content_type::background_picture, info); !pic1_path.empty())
{
m_pic_data = std::make_unique<image_info>(pic1_path);
// The renderer's texture cache is keyed by this object's address, which can be reused by an
Expand All @@ -71,9 +69,9 @@ namespace rsx

m_pic_background.refresh();

if (const std::string icon1_path = game_dir + "/ICON1.PAM"; fs::is_file(icon1_path))
if (!info.movie_path.empty())
{
m_video = std::make_unique<video_view>(icon1_path, "", info.icon_path);
m_video = std::make_unique<video_view>(info.movie_path, "", info.icon_path);
m_video->set_pos(m_icon.x, m_icon.y);
m_video->set_size(m_icon.w, m_icon.h);
m_video->set_active(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ namespace rsx

GameInfo info{};
info.path = path;
info.icon_path = sfo_dir + "/ICON0.PNG";
info.serial = title_id;
info.name = std::string(psf::get_string(psf, "TITLE", title_id));
info.category = std::string(psf::get_string(psf, "CATEGORY"));
info.app_ver = std::string(psf::get_string(psf, "APP_VER"));
info.icon_path = rpcs3::utils::get_game_content_path(game_content_type::content_icon, info, sfo_dir);
info.movie_path = rpcs3::utils::get_game_content_path(game_content_type::content_video, info, sfo_dir);
info.audio_path = rpcs3::utils::get_game_content_path(game_content_type::content_sound, info, sfo_dir);

m_games.push_back({ std::move(info) });
}
Expand Down
25 changes: 17 additions & 8 deletions rpcs3/Emu/system_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "system_config.h"
#include "vfs_config.h"
#include "Emu/Io/pad_config.h"
#include "Emu/GameInfo.h"
#include "Emu/System.h"
#include "Emu/VFS.h"
#include "util/sysinfo.hpp"
Expand Down Expand Up @@ -594,19 +595,17 @@ namespace rpcs3::utils
return get_input_config_dir(title_id) + g_cfg_input_configs.default_config + ".yml";
}

std::string get_game_content_path(game_content_type type)
std::string get_game_content_path(game_content_type type, const std::string& serial, std::string sfo_dir, const std::string& disc_dir)
{
const std::string locale_suffix = fmt::format("_%02d", static_cast<s32>(g_cfg.sys.language.get()));
const std::string disc_dir = vfs::get("/dev_bdvd/PS3_GAME");
std::string hdd0_dir = Emu.GetSfoDir(false);

if (hdd0_dir == disc_dir)
if (sfo_dir == disc_dir)
{
hdd0_dir.clear(); // No hdd0 dir
sfo_dir.clear(); // No hdd0 dir
}

const bool check_disc = !disc_dir.empty();
const bool check_hdd0 = !hdd0_dir.empty() && !check_disc;
const bool check_hdd0 = !sfo_dir.empty() && !check_disc;

const auto find_content = [&](std::string_view name, std::string_view extension) -> std::string
{
Expand All @@ -618,7 +617,7 @@ namespace rpcs3::utils
// Check content on hdd0 first
if (check_hdd0)
{
if (std::string path = hdd0_dir + filename; fs::is_file(path))
if (std::string path = sfo_dir + filename; fs::is_file(path))
{
return path;
}
Expand Down Expand Up @@ -660,7 +659,7 @@ namespace rpcs3::utils
case game_content_type::background_picture_2:
{
// Try to find a custom background first
if (std::string path = fs::get_config_dir() + "/Icons/game_icons/" + Emu.GetTitleID() + "/PIC1.PNG"; fs::is_file(path))
if (std::string path = fs::get_config_dir() + "/Icons/game_icons/" + serial + "/PIC1.PNG"; fs::is_file(path))
{
return path;
}
Expand All @@ -673,6 +672,16 @@ namespace rpcs3::utils
return {};
}

std::string get_game_content_path(game_content_type type, const GameInfo& info, const std::string& sfo_dir)
{
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, {});
}

std::string get_game_content_path(game_content_type type)
{
return get_game_content_path(type, Emu.GetTitleID(), Emu.GetSfoDir(false), vfs::get("/dev_bdvd/PS3_GAME"));
}

bool version_is_bigger(std::string_view v0, std::string_view v1, std::string_view serial, bool is_fw)
{
std::add_pointer_t<char> ev0, ev1;
Expand Down
3 changes: 3 additions & 0 deletions rpcs3/Emu/system_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <set>
#include <vector>

struct GameInfo;

enum class game_content_type
{
content_icon, // ICON0.PNG
Expand Down Expand Up @@ -85,6 +87,7 @@ namespace rpcs3::utils
std::string get_input_config_dir(const std::string& title_id = "");
std::string get_custom_input_config_path(const std::string& title_id);

std::string get_game_content_path(game_content_type type, const GameInfo& info, const std::string& sfo_dir = {});
std::string get_game_content_path(game_content_type type);

bool version_is_bigger(std::string_view v0, std::string_view v1, std::string_view serial, bool is_fw);
Expand Down
51 changes: 27 additions & 24 deletions rpcs3/emucore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
<Filter Include="Emu\GPU\RSX\Program\Assembler\Passes\FP">
<UniqueIdentifier>{7fb59544-9761-4b4a-bb04-07deb43cf3c2}</UniqueIdentifier>
</Filter>
<Filter Include="Emu\GPU\RSX\Overlays\BigPicture">
<UniqueIdentifier>{37ae1158-fac7-4a4c-929a-115d8deb7505}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Crypto\aes.cpp">
Expand Down Expand Up @@ -1219,18 +1222,6 @@
<ClCompile Include="Emu\RSX\Overlays\HomeMenu\overlay_home_menu_sidebar_page.cpp">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture.cpp">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_details.cpp">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_grid.cpp">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_main_menu.cpp">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\overlay_animated_icon.cpp">
<Filter>Emu\GPU\RSX\Overlays</Filter>
</ClCompile>
Expand Down Expand Up @@ -1483,6 +1474,18 @@
<ClCompile Include="Emu\Io\gem_config.cpp">
<Filter>Emu\Io</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture.cpp">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_details.cpp">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_grid.cpp">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClCompile>
<ClCompile Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_main_menu.cpp">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Crypto\aes.h">
Expand Down Expand Up @@ -2611,18 +2614,6 @@
<ClInclude Include="Emu\RSX\Overlays\HomeMenu\overlay_home_menu_sidebar_page.h">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture.h">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_details.h">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_grid.h">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_main_menu.h">
<Filter>Emu\GPU\RSX\Overlays\HomeMenu\Pages</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\overlay_loading_icon.hpp">
<Filter>Emu\GPU\RSX\Overlays</Filter>
</ClInclude>
Expand Down Expand Up @@ -2983,6 +2974,18 @@
<ClInclude Include="Emu\RSX\Common\texture_cache_blit_helpers.h">
<Filter>Emu\GPU\RSX\Common</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_main_menu.h">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture.h">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_details.h">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClInclude>
<ClInclude Include="Emu\RSX\Overlays\BigPicture\overlay_big_picture_game_grid.h">
<Filter>Emu\GPU\RSX\Overlays\BigPicture</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Emu\RSX\Program\GLSLSnippets\GPUDeswizzle.glsl">
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/rpcs3qt/game_compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
#include "Crypto/unpkg.h"
#include "Loader/PSF.h"

#include <QApplication>
#include <QMessageBox>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>

LOG_CHANNEL(compat_log, "Compat");

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/rpcs3qt/game_compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <memory>

#include <QJsonObject>
#include <QObject>

class downloader;

Expand Down
1 change: 0 additions & 1 deletion rpcs3/rpcs3qt/gui_game_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "Emu/GameInfo.h"

#include <set>
#include <QPixmap>

/* Having the icons associated with the game info simplifies logic internally */
Expand Down
Loading