mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
Merge branch 'master' into NewDebugBranch
This commit is contained in:
commit
74792e83c1
15 changed files with 207 additions and 178 deletions
|
@ -113,6 +113,8 @@ namespace rsx
|
|||
: m_page_btn(120, 30)
|
||||
, m_extra_btn(120, 30)
|
||||
{
|
||||
m_allow_input_on_pause = true;
|
||||
|
||||
m_dim_background = std::make_unique<overlay_element>();
|
||||
m_dim_background->set_size(virtual_width, virtual_height);
|
||||
m_dim_background->back_color.a = 0.5f;
|
||||
|
|
|
@ -90,6 +90,8 @@ namespace rsx
|
|||
|
||||
trophy_list_dialog::trophy_list_dialog()
|
||||
{
|
||||
m_allow_input_on_pause = true;
|
||||
|
||||
m_dim_background = std::make_unique<overlay_element>();
|
||||
m_dim_background->set_size(virtual_width, virtual_height);
|
||||
m_dim_background->back_color.a = 0.9f;
|
||||
|
|
|
@ -35,85 +35,85 @@
|
|||
|
||||
using namespace program_hash_util;
|
||||
|
||||
AVX512_ICL_FUNC usz vertex_program_utils::get_vertex_program_ucode_hash(const RSXVertexProgram &program)
|
||||
{
|
||||
#ifdef ARCH_X64
|
||||
if (utils::has_avx512_icl())
|
||||
AVX512_ICL_FUNC usz get_vertex_program_ucode_hash_512(const RSXVertexProgram &program)
|
||||
{
|
||||
// Load all elements of the instruction_mask bitset
|
||||
const __m512i* instMask512 = reinterpret_cast<const __m512i*>(&program.instruction_mask);
|
||||
const __m128i* instMask128 = reinterpret_cast<const __m128i*>(&program.instruction_mask);
|
||||
|
||||
const __m512i lowerMask = _mm512_loadu_si512(instMask512);
|
||||
const __m128i upper128 = _mm_loadu_si128(instMask128 + 4);
|
||||
const __m512i upperMask = _mm512_zextsi128_si512(upper128);
|
||||
|
||||
__m512i maskIndex = _mm512_setzero_si512();
|
||||
const __m512i negativeOnes = _mm512_set1_epi64(-1);
|
||||
|
||||
// Special masks to test against bitset
|
||||
const __m512i testMask0 = _mm512_set_epi64(
|
||||
0x0808080808080808,
|
||||
0x0808080808080808,
|
||||
0x0404040404040404,
|
||||
0x0404040404040404,
|
||||
0x0202020202020202,
|
||||
0x0202020202020202,
|
||||
0x0101010101010101,
|
||||
0x0101010101010101);
|
||||
|
||||
const __m512i testMask1 = _mm512_set_epi64(
|
||||
0x8080808080808080,
|
||||
0x8080808080808080,
|
||||
0x4040404040404040,
|
||||
0x4040404040404040,
|
||||
0x2020202020202020,
|
||||
0x2020202020202020,
|
||||
0x1010101010101010,
|
||||
0x1010101010101010);
|
||||
|
||||
const __m512i* instBuffer = reinterpret_cast<const __m512i*>(program.data.data());
|
||||
__m512i acc0 = _mm512_setzero_si512();
|
||||
__m512i acc1 = _mm512_setzero_si512();
|
||||
|
||||
__m512i rotMask0 = _mm512_set_epi64(7, 6, 5, 4, 3, 2, 1, 0);
|
||||
__m512i rotMask1 = _mm512_set_epi64(15, 14, 13, 12, 11, 10, 9, 8);
|
||||
__m512i rotMaskAdd = _mm512_set_epi64(16, 16, 16, 16, 16, 16, 16, 16);
|
||||
|
||||
u32 instIndex = 0;
|
||||
|
||||
// If there is remainder, add an extra (masked) iteration
|
||||
u32 extraIteration = (program.data.size() % 32 != 0) ? 1 : 0;
|
||||
u32 length = (program.data.size() / 32) + extraIteration;
|
||||
|
||||
// The instruction mask will prevent us from reading out of bounds, we do not need a seperate masked loop
|
||||
// for the remainder, or a scalar loop.
|
||||
while (instIndex < (length))
|
||||
{
|
||||
// Load all elements of the instruction_mask bitset
|
||||
const __m512i* instMask512 = reinterpret_cast<const __m512i*>(&program.instruction_mask);
|
||||
const __m128i* instMask128 = reinterpret_cast<const __m128i*>(&program.instruction_mask);
|
||||
const __m512i masks = _mm512_permutex2var_epi8(lowerMask, maskIndex, upperMask);
|
||||
const __mmask8 result0 = _mm512_test_epi64_mask(masks, testMask0);
|
||||
const __mmask8 result1 = _mm512_test_epi64_mask(masks, testMask1);
|
||||
const __m512i load0 = _mm512_maskz_loadu_epi64(result0, (instBuffer + instIndex * 2));
|
||||
const __m512i load1 = _mm512_maskz_loadu_epi64(result1, (instBuffer + (instIndex * 2)+ 1));
|
||||
|
||||
const __m512i lowerMask = _mm512_loadu_si512(instMask512);
|
||||
const __m128i upper128 = _mm_loadu_si128(instMask128 + 4);
|
||||
const __m512i upperMask = _mm512_zextsi128_si512(upper128);
|
||||
|
||||
__m512i maskIndex = _mm512_setzero_si512();
|
||||
const __m512i negativeOnes = _mm512_set1_epi64(-1);
|
||||
const __m512i rotated0 = _mm512_rorv_epi64(load0, rotMask0);
|
||||
const __m512i rotated1 = _mm512_rorv_epi64(load1, rotMask1);
|
||||
|
||||
// Special masks to test against bitset
|
||||
const __m512i testMask0 = _mm512_set_epi64(
|
||||
0x0808080808080808,
|
||||
0x0808080808080808,
|
||||
0x0404040404040404,
|
||||
0x0404040404040404,
|
||||
0x0202020202020202,
|
||||
0x0202020202020202,
|
||||
0x0101010101010101,
|
||||
0x0101010101010101);
|
||||
acc0 = _mm512_add_epi64(acc0, rotated0);
|
||||
acc1 = _mm512_add_epi64(acc1, rotated1);
|
||||
|
||||
const __m512i testMask1 = _mm512_set_epi64(
|
||||
0x8080808080808080,
|
||||
0x8080808080808080,
|
||||
0x4040404040404040,
|
||||
0x4040404040404040,
|
||||
0x2020202020202020,
|
||||
0x2020202020202020,
|
||||
0x1010101010101010,
|
||||
0x1010101010101010);
|
||||
rotMask0 = _mm512_add_epi64(rotMask0, rotMaskAdd);
|
||||
rotMask1 = _mm512_add_epi64(rotMask1, rotMaskAdd);
|
||||
maskIndex = _mm512_sub_epi8(maskIndex, negativeOnes);
|
||||
|
||||
const __m512i* instBuffer = reinterpret_cast<const __m512i*>(program.data.data());
|
||||
__m512i acc0 = _mm512_setzero_si512();
|
||||
__m512i acc1 = _mm512_setzero_si512();
|
||||
|
||||
__m512i rotMask0 = _mm512_set_epi64(7, 6, 5, 4, 3, 2, 1, 0);
|
||||
__m512i rotMask1 = _mm512_set_epi64(15, 14, 13, 12, 11, 10, 9, 8);
|
||||
__m512i rotMaskAdd = _mm512_set_epi64(16, 16, 16, 16, 16, 16, 16, 16);
|
||||
|
||||
u32 instIndex = 0;
|
||||
|
||||
// If there is remainder, add an extra (masked) iteration
|
||||
u32 extraIteration = (program.data.size() % 32 != 0) ? 1 : 0;
|
||||
u32 length = (program.data.size() / 32) + extraIteration;
|
||||
|
||||
// The instruction mask will prevent us from reading out of bounds, we do not need a seperate masked loop
|
||||
// for the remainder, or a scalar loop.
|
||||
while (instIndex < (length))
|
||||
{
|
||||
const __m512i masks = _mm512_permutex2var_epi8(lowerMask, maskIndex, upperMask);
|
||||
const __mmask8 result0 = _mm512_test_epi64_mask(masks, testMask0);
|
||||
const __mmask8 result1 = _mm512_test_epi64_mask(masks, testMask1);
|
||||
const __m512i load0 = _mm512_maskz_loadu_epi64(result0, (instBuffer + instIndex * 2));
|
||||
const __m512i load1 = _mm512_maskz_loadu_epi64(result1, (instBuffer + (instIndex * 2)+ 1));
|
||||
|
||||
const __m512i rotated0 = _mm512_rorv_epi64(load0, rotMask0);
|
||||
const __m512i rotated1 = _mm512_rorv_epi64(load1, rotMask1);
|
||||
|
||||
acc0 = _mm512_add_epi64(acc0, rotated0);
|
||||
acc1 = _mm512_add_epi64(acc1, rotated1);
|
||||
|
||||
rotMask0 = _mm512_add_epi64(rotMask0, rotMaskAdd);
|
||||
rotMask1 = _mm512_add_epi64(rotMask1, rotMaskAdd);
|
||||
maskIndex = _mm512_sub_epi8(maskIndex, negativeOnes);
|
||||
|
||||
instIndex++;
|
||||
}
|
||||
|
||||
const __m512i result = _mm512_add_epi64(acc0, acc1);
|
||||
return _mm512_reduce_add_epi64(result);
|
||||
instIndex++;
|
||||
}
|
||||
|
||||
const __m512i result = _mm512_add_epi64(acc0, acc1);
|
||||
return _mm512_reduce_add_epi64(result);
|
||||
}
|
||||
#endif
|
||||
|
||||
usz vertex_program_utils::get_vertex_program_ucode_hash(const RSXVertexProgram &program)
|
||||
{
|
||||
// Checksum as hash with rotated data
|
||||
const void* instbuffer = program.data.data();
|
||||
u32 instIndex = 0;
|
||||
|
@ -427,7 +427,20 @@ vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vert
|
|||
|
||||
usz vertex_program_storage_hash::operator()(const RSXVertexProgram &program) const
|
||||
{
|
||||
#ifdef ARCH_X64
|
||||
usz ucode_hash;
|
||||
|
||||
if (utils::has_avx512_icl())
|
||||
{
|
||||
ucode_hash = get_vertex_program_ucode_hash_512(program);
|
||||
}
|
||||
else
|
||||
{
|
||||
ucode_hash = vertex_program_utils::get_vertex_program_ucode_hash(program);
|
||||
}
|
||||
#else
|
||||
const usz ucode_hash = vertex_program_utils::get_vertex_program_ucode_hash(program);
|
||||
#endif
|
||||
const u32 state_params[] =
|
||||
{
|
||||
program.ctrl,
|
||||
|
@ -439,21 +452,8 @@ usz vertex_program_storage_hash::operator()(const RSXVertexProgram &program) con
|
|||
return rpcs3::hash64(ucode_hash, metadata_hash);
|
||||
}
|
||||
|
||||
AVX512_ICL_FUNC bool vertex_program_compare::operator()(const RSXVertexProgram &binary1, const RSXVertexProgram &binary2) const
|
||||
{
|
||||
if (binary1.output_mask != binary2.output_mask)
|
||||
return false;
|
||||
if (binary1.ctrl != binary2.ctrl)
|
||||
return false;
|
||||
if (binary1.texture_state != binary2.texture_state)
|
||||
return false;
|
||||
if (binary1.data.size() != binary2.data.size())
|
||||
return false;
|
||||
if (binary1.jump_table != binary2.jump_table)
|
||||
return false;
|
||||
|
||||
#ifdef ARCH_X64
|
||||
if (utils::has_avx512_icl())
|
||||
AVX512_ICL_FUNC bool vertex_program_compare_512(const RSXVertexProgram &binary1, const RSXVertexProgram &binary2)
|
||||
{
|
||||
// Load all elements of the instruction_mask bitset
|
||||
const __m512i* instMask512 = reinterpret_cast<const __m512i*>(&binary1.instruction_mask);
|
||||
|
@ -530,6 +530,26 @@ AVX512_ICL_FUNC bool vertex_program_compare::operator()(const RSXVertexProgram &
|
|||
}
|
||||
#endif
|
||||
|
||||
bool vertex_program_compare::operator()(const RSXVertexProgram &binary1, const RSXVertexProgram &binary2) const
|
||||
{
|
||||
if (binary1.output_mask != binary2.output_mask)
|
||||
return false;
|
||||
if (binary1.ctrl != binary2.ctrl)
|
||||
return false;
|
||||
if (binary1.texture_state != binary2.texture_state)
|
||||
return false;
|
||||
if (binary1.data.size() != binary2.data.size())
|
||||
return false;
|
||||
if (binary1.jump_table != binary2.jump_table)
|
||||
return false;
|
||||
|
||||
#ifdef ARCH_X64
|
||||
if (utils::has_avx512_icl())
|
||||
{
|
||||
return vertex_program_compare_512(binary1, binary2);
|
||||
}
|
||||
#endif
|
||||
|
||||
const void* instBuffer1 = binary1.data.data();
|
||||
const void* instBuffer2 = binary2.data.data();
|
||||
usz instIndex = 0;
|
||||
|
|
|
@ -763,6 +763,7 @@
|
|||
<ClCompile Include="rpcs3qt\breakpoint_list.cpp" />
|
||||
<ClCompile Include="rpcs3qt\call_stack_list.cpp" />
|
||||
<ClCompile Include="rpcs3qt\camera_settings_dialog.cpp" />
|
||||
<ClCompile Include="rpcs3qt\gui_game_info.cpp" />
|
||||
<ClCompile Include="rpcs3qt\permissions.cpp" />
|
||||
<ClCompile Include="rpcs3qt\ps_move_tracker_dialog.cpp" />
|
||||
<ClCompile Include="rpcs3qt\cheat_manager.cpp" />
|
||||
|
@ -1385,6 +1386,7 @@
|
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DWIN64 -DWIN32_LEAN_AND_MEAN -DHAVE_VULKAN -DMINIUPNP_STATICLIB -DHAVE_SDL2 -DWITH_DISCORD_RPC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -DQT_WINEXTRAS_LIB -DQT_CONCURRENT_LIB -DQT_MULTIMEDIA_LIB -DQT_MULTIMEDIAWIDGETS_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\..\3rdparty\SoundTouch\soundtouch\include" "-I.\..\3rdparty\cubeb\extra" "-I.\..\3rdparty\cubeb\cubeb\include" "-I.\..\3rdparty\flatbuffers\include" "-I.\..\3rdparty\wolfssl\wolfssl" "-I.\..\3rdparty\curl\curl\include" "-I.\..\3rdparty\libusb\libusb\libusb" "-I$(VULKAN_SDK)\Include" "-I.\..\3rdparty\libsdl-org\SDL\include" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtANGLE" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I$(QTDIR)\mkspecs\win32-msvc2015" "-I.\QTGeneratedFiles\$(ConfigurationName)" "-I.\QTGeneratedFiles" "-I$(QTDIR)\include\QtWinExtras" "-I$(QTDIR)\include\QtConcurrent" "-I$(QTDIR)\include\QtMultimedia" "-I$(QTDIR)\include\QtMultimediaWidgets" "-I$(QTDIR)\include\QtSvg"</Command>
|
||||
</CustomBuild>
|
||||
<ClInclude Include="rpcs3qt\gui_game_info.h" />
|
||||
<ClInclude Include="rpcs3qt\gui_save.h" />
|
||||
<CustomBuild Include="rpcs3qt\patch_manager_dialog.h">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
|
|
|
@ -1173,6 +1173,9 @@
|
|||
<ClCompile Include="rpcs3qt\permissions.cpp">
|
||||
<Filter>Gui\utils</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rpcs3qt\gui_game_info.cpp">
|
||||
<Filter>Gui\game list</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Input\ds4_pad_handler.h">
|
||||
|
@ -1379,6 +1382,9 @@
|
|||
<ClInclude Include="rpcs3qt\permissions.h">
|
||||
<Filter>Gui\utils</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="rpcs3qt\gui_game_info.h">
|
||||
<Filter>Gui\game list</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
|
|
|
@ -38,6 +38,7 @@ add_library(rpcs3_ui STATIC
|
|||
gui_application.cpp
|
||||
gl_gs_frame.cpp
|
||||
gs_frame.cpp
|
||||
gui_game_info.cpp
|
||||
gui_settings.cpp
|
||||
infinity_dialog.cpp
|
||||
input_dialog.cpp
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "stdafx.h"
|
||||
#include "game_list_base.h"
|
||||
#include "localized.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QPainter>
|
||||
|
@ -189,17 +188,6 @@ QColor game_list_base::GetGridCompatibilityColor(const QString& string) const
|
|||
return QColor();
|
||||
}
|
||||
|
||||
std::string game_list_base::GetGameVersion(const game_info& game)
|
||||
{
|
||||
if (game->info.app_ver == Localized().category.unknown.toStdString())
|
||||
{
|
||||
// Fall back to Disc/Pkg Revision
|
||||
return game->info.version;
|
||||
}
|
||||
|
||||
return game->info.app_ver;
|
||||
}
|
||||
|
||||
QIcon game_list_base::GetCustomConfigIcon(const game_info& game)
|
||||
{
|
||||
if (!game)
|
||||
|
|
|
@ -1,31 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "movie_item_base.h"
|
||||
#include "game_compatibility.h"
|
||||
#include "Emu/GameInfo.h"
|
||||
#include "gui_game_info.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
#include <QWidget>
|
||||
|
||||
/* Having the icons associated with the game info simplifies logic internally */
|
||||
struct gui_game_info
|
||||
{
|
||||
GameInfo info{};
|
||||
QString localized_category;
|
||||
compat::status compat;
|
||||
QPixmap icon;
|
||||
QPixmap pxmap;
|
||||
bool hasCustomConfig = false;
|
||||
bool hasCustomPadConfig = false;
|
||||
bool has_hover_gif = false;
|
||||
bool has_hover_pam = false;
|
||||
movie_item_base* item = nullptr;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<gui_game_info> game_info;
|
||||
Q_DECLARE_METATYPE(game_info)
|
||||
|
||||
class game_list_base
|
||||
{
|
||||
public:
|
||||
|
@ -45,9 +24,6 @@ public:
|
|||
|
||||
virtual void repaint_icons(std::vector<game_info>& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio);
|
||||
|
||||
// Returns the visible version string in the game list
|
||||
static std::string GetGameVersion(const game_info& game);
|
||||
|
||||
/** Sets the custom config icon. */
|
||||
static QIcon GetCustomConfigIcon(const game_info& game);
|
||||
|
||||
|
|
|
@ -839,45 +839,44 @@ void game_list_frame::OnRefreshFinished()
|
|||
const std::string cat_unknown_localized = localized.category.unknown.toStdString();
|
||||
|
||||
// Try to update the app version for disc games if there is a patch
|
||||
for (const auto& entry : m_game_data)
|
||||
for (const game_info& entry : m_game_data)
|
||||
{
|
||||
if (entry->info.category == "DG")
|
||||
if (entry->info.category != "DG") continue;
|
||||
|
||||
for (const auto& other : m_game_data)
|
||||
{
|
||||
for (const auto& other : m_game_data)
|
||||
// The patch is game data and must have the same serial and an app version
|
||||
static constexpr auto version_is_bigger = [](const std::string& v0, const std::string& v1, const std::string& serial, bool is_fw)
|
||||
{
|
||||
// The patch is game data and must have the same serial and an app version
|
||||
static constexpr auto version_is_bigger = [](const std::string& v0, const std::string& v1, const std::string& serial, bool is_fw)
|
||||
std::add_pointer_t<char> ev0, ev1;
|
||||
const double ver0 = std::strtod(v0.c_str(), &ev0);
|
||||
const double ver1 = std::strtod(v1.c_str(), &ev1);
|
||||
|
||||
if (v0.c_str() + v0.size() == ev0 && v1.c_str() + v1.size() == ev1)
|
||||
{
|
||||
std::add_pointer_t<char> ev0, ev1;
|
||||
const double ver0 = std::strtod(v0.c_str(), &ev0);
|
||||
const double ver1 = std::strtod(v1.c_str(), &ev1);
|
||||
return ver0 > ver1;
|
||||
}
|
||||
|
||||
if (v0.c_str() + v0.size() == ev0 && v1.c_str() + v1.size() == ev1)
|
||||
{
|
||||
return ver0 > ver1;
|
||||
}
|
||||
game_list_log.error("Failed to update the displayed %s numbers for title ID %s\n'%s'-'%s'", is_fw ? "firmware version" : "version", serial, v0, v1);
|
||||
return false;
|
||||
};
|
||||
|
||||
game_list_log.error("Failed to update the displayed %s numbers for title ID %s\n'%s'-'%s'", is_fw ? "firmware version" : "version", serial, v0, v1);
|
||||
return false;
|
||||
};
|
||||
|
||||
if (entry->info.serial == other->info.serial && other->info.category != "DG" && other->info.app_ver != cat_unknown_localized)
|
||||
if (entry->info.serial == other->info.serial && other->info.category != "DG" && other->info.app_ver != cat_unknown_localized)
|
||||
{
|
||||
// Update the app version if it's higher than the disc's version (old games may not have an app version)
|
||||
if (entry->info.app_ver == cat_unknown_localized || version_is_bigger(other->info.app_ver, entry->info.app_ver, entry->info.serial, true))
|
||||
{
|
||||
// Update the app version if it's higher than the disc's version (old games may not have an app version)
|
||||
if (entry->info.app_ver == cat_unknown_localized || version_is_bigger(other->info.app_ver, entry->info.app_ver, entry->info.serial, true))
|
||||
{
|
||||
entry->info.app_ver = other->info.app_ver;
|
||||
}
|
||||
// Update the firmware version if possible and if it's higher than the disc's version
|
||||
if (other->info.fw != cat_unknown_localized && version_is_bigger(other->info.fw, entry->info.fw, entry->info.serial, false))
|
||||
{
|
||||
entry->info.fw = other->info.fw;
|
||||
}
|
||||
// Update the parental level if possible and if it's higher than the disc's level
|
||||
if (other->info.parental_lvl != 0 && other->info.parental_lvl > entry->info.parental_lvl)
|
||||
{
|
||||
entry->info.parental_lvl = other->info.parental_lvl;
|
||||
}
|
||||
entry->info.app_ver = other->info.app_ver;
|
||||
}
|
||||
// Update the firmware version if possible and if it's higher than the disc's version
|
||||
if (other->info.fw != cat_unknown_localized && version_is_bigger(other->info.fw, entry->info.fw, entry->info.serial, false))
|
||||
{
|
||||
entry->info.fw = other->info.fw;
|
||||
}
|
||||
// Update the parental level if possible and if it's higher than the disc's level
|
||||
if (other->info.parental_lvl != 0 && other->info.parental_lvl > entry->info.parental_lvl)
|
||||
{
|
||||
entry->info.parental_lvl = other->info.parental_lvl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1873,15 +1872,7 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
|||
});
|
||||
connect(configure_patches, &QAction::triggered, this, [this, gameinfo]()
|
||||
{
|
||||
std::unordered_map<std::string, std::set<std::string>> games;
|
||||
for (const auto& game : m_game_data)
|
||||
{
|
||||
if (game)
|
||||
{
|
||||
games[game->info.serial].insert(game_list::GetGameVersion(game));
|
||||
}
|
||||
}
|
||||
patch_manager_dialog patch_manager(m_gui_settings, games, gameinfo->info.serial, game_list::GetGameVersion(gameinfo), this);
|
||||
patch_manager_dialog patch_manager(m_gui_settings, m_game_data, gameinfo->info.serial, gameinfo->GetGameVersion(), this);
|
||||
patch_manager.exec();
|
||||
});
|
||||
connect(check_compat, &QAction::triggered, this, [serial]
|
||||
|
|
|
@ -332,7 +332,7 @@ void game_list_table::populate(
|
|||
}
|
||||
|
||||
// Version
|
||||
QString app_version = QString::fromStdString(game_list::GetGameVersion(game));
|
||||
QString app_version = QString::fromStdString(game->GetGameVersion());
|
||||
|
||||
if (game->info.bootable && !game->compat.latest_version.isEmpty())
|
||||
{
|
||||
|
|
14
rpcs3/rpcs3qt/gui_game_info.cpp
Normal file
14
rpcs3/rpcs3qt/gui_game_info.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "stdafx.h"
|
||||
#include "gui_game_info.h"
|
||||
#include "localized.h"
|
||||
|
||||
std::string gui_game_info::GetGameVersion() const
|
||||
{
|
||||
if (info.app_ver == Localized().category.unknown.toStdString())
|
||||
{
|
||||
// Fall back to Disc/Pkg Revision
|
||||
return info.version;
|
||||
}
|
||||
|
||||
return info.app_ver;
|
||||
}
|
29
rpcs3/rpcs3qt/gui_game_info.h
Normal file
29
rpcs3/rpcs3qt/gui_game_info.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "movie_item_base.h"
|
||||
#include "game_compatibility.h"
|
||||
|
||||
#include "Emu/GameInfo.h"
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
/* Having the icons associated with the game info simplifies logic internally */
|
||||
struct gui_game_info
|
||||
{
|
||||
GameInfo info{};
|
||||
QString localized_category;
|
||||
compat::status compat;
|
||||
QPixmap icon;
|
||||
QPixmap pxmap;
|
||||
bool hasCustomConfig = false;
|
||||
bool hasCustomPadConfig = false;
|
||||
bool has_hover_gif = false;
|
||||
bool has_hover_pam = false;
|
||||
movie_item_base* item = nullptr;
|
||||
|
||||
// Returns the visible version string in the game list
|
||||
std::string GetGameVersion() const;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<gui_game_info> game_info;
|
||||
Q_DECLARE_METATYPE(game_info)
|
|
@ -3070,18 +3070,7 @@ void main_window::CreateConnects()
|
|||
|
||||
connect(ui->actionManage_Game_Patches, &QAction::triggered, this, [this]
|
||||
{
|
||||
std::unordered_map<std::string, std::set<std::string>> games;
|
||||
if (m_game_list_frame)
|
||||
{
|
||||
for (const game_info& game : m_game_list_frame->GetGameInfo())
|
||||
{
|
||||
if (game)
|
||||
{
|
||||
games[game->info.serial].insert(game_list::GetGameVersion(game));
|
||||
}
|
||||
}
|
||||
}
|
||||
patch_manager_dialog patch_manager(m_gui_settings, games, "", "", this);
|
||||
patch_manager_dialog patch_manager(m_gui_settings, m_game_list_frame ? m_game_list_frame->GetGameInfo() : std::vector<game_info>{}, "", "", this);
|
||||
patch_manager.exec();
|
||||
});
|
||||
|
||||
|
|
|
@ -57,12 +57,11 @@ enum node_level : int
|
|||
|
||||
Q_DECLARE_METATYPE(patch_engine::patch_config_value);
|
||||
|
||||
patch_manager_dialog::patch_manager_dialog(std::shared_ptr<gui_settings> gui_settings, std::unordered_map<std::string, std::set<std::string>> games, const std::string& title_id, const std::string& version, QWidget* parent)
|
||||
patch_manager_dialog::patch_manager_dialog(std::shared_ptr<gui_settings> gui_settings, const std::vector<game_info>& games, const std::string& title_id, const std::string& version, QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, m_gui_settings(std::move(gui_settings))
|
||||
, m_expand_current_match(!title_id.empty() && !version.empty()) // Expand first search results
|
||||
, m_search_version(QString::fromStdString(version))
|
||||
, m_owned_games(std::move(games))
|
||||
, ui(new Ui::patch_manager_dialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
@ -71,6 +70,15 @@ patch_manager_dialog::patch_manager_dialog(std::shared_ptr<gui_settings> gui_set
|
|||
// Load gui settings
|
||||
m_show_owned_games_only = m_gui_settings->GetValue(gui::pm_show_owned).toBool();
|
||||
|
||||
// Get owned games
|
||||
for (const auto& game : games)
|
||||
{
|
||||
if (game && game->info.bootable)
|
||||
{
|
||||
m_owned_games[game->info.serial].insert(game->GetGameVersion());
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize gui controls
|
||||
ui->patch_filter->setText(QString::fromStdString(title_id));
|
||||
ui->cb_owned_games_only->setChecked(m_show_owned_games_only);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <QDragMoveEvent>
|
||||
#include <QMimeData>
|
||||
|
||||
#include "gui_game_info.h"
|
||||
#include "Utilities/bin_patch.h"
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -39,7 +40,7 @@ class patch_manager_dialog : public QDialog
|
|||
const QString tr_all_versions = tr("All versions");
|
||||
|
||||
public:
|
||||
explicit patch_manager_dialog(std::shared_ptr<gui_settings> gui_settings, std::unordered_map<std::string, std::set<std::string>> games, const std::string& title_id, const std::string& version, QWidget* parent = nullptr);
|
||||
explicit patch_manager_dialog(std::shared_ptr<gui_settings> gui_settings, const std::vector<game_info>& games, const std::string& title_id, const std::string& version, QWidget* parent = nullptr);
|
||||
~patch_manager_dialog();
|
||||
|
||||
int exec() override;
|
||||
|
|
Loading…
Add table
Reference in a new issue