diff --git a/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp index cbdcb989da..ff6770136b 100644 --- a/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/FriendsList/overlay_friends_list_dialog.cpp @@ -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(); m_dim_background->set_size(virtual_width, virtual_height); m_dim_background->back_color.a = 0.5f; diff --git a/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp index 1291e7e216..c30a6fe878 100644 --- a/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/Trophies/overlay_trophy_list_dialog.cpp @@ -90,6 +90,8 @@ namespace rsx trophy_list_dialog::trophy_list_dialog() { + m_allow_input_on_pause = true; + m_dim_background = std::make_unique(); m_dim_background->set_size(virtual_width, virtual_height); m_dim_background->back_color.a = 0.9f; diff --git a/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp b/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp index ccba75b985..f38e750609 100644 --- a/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp +++ b/rpcs3/Emu/RSX/Program/ProgramStateCache.cpp @@ -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(&program.instruction_mask); + const __m128i* instMask128 = reinterpret_cast(&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(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(&program.instruction_mask); - const __m128i* instMask128 = reinterpret_cast(&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(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(&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; diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index ae17a264c2..2df8c722c6 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -763,6 +763,7 @@ + @@ -1385,6 +1386,7 @@ .\QTGeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp "$(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" + $(QTDIR)\bin\moc.exe;%(FullPath) diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index 3b0890fe49..407f9dfef6 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -1173,6 +1173,9 @@ Gui\utils + + Gui\game list + @@ -1379,6 +1382,9 @@ Gui\utils + + Gui\game list + diff --git a/rpcs3/rpcs3qt/CMakeLists.txt b/rpcs3/rpcs3qt/CMakeLists.txt index d4442d91cd..ffe2a96d9f 100644 --- a/rpcs3/rpcs3qt/CMakeLists.txt +++ b/rpcs3/rpcs3qt/CMakeLists.txt @@ -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 diff --git a/rpcs3/rpcs3qt/game_list_base.cpp b/rpcs3/rpcs3qt/game_list_base.cpp index a8a0cd959f..edc33634a8 100644 --- a/rpcs3/rpcs3qt/game_list_base.cpp +++ b/rpcs3/rpcs3qt/game_list_base.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "game_list_base.h" -#include "localized.h" #include #include @@ -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) diff --git a/rpcs3/rpcs3qt/game_list_base.h b/rpcs3/rpcs3qt/game_list_base.h index 5e21097b05..66012d9e34 100644 --- a/rpcs3/rpcs3qt/game_list_base.h +++ b/rpcs3/rpcs3qt/game_list_base.h @@ -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 -#include #include -/* 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 game_info; -Q_DECLARE_METATYPE(game_info) - class game_list_base { public: @@ -45,9 +24,6 @@ public: virtual void repaint_icons(std::vector& 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); diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 2df8852718..4f699106d6 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -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 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 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> 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] diff --git a/rpcs3/rpcs3qt/game_list_table.cpp b/rpcs3/rpcs3qt/game_list_table.cpp index 32a9419a74..49aa7962eb 100644 --- a/rpcs3/rpcs3qt/game_list_table.cpp +++ b/rpcs3/rpcs3qt/game_list_table.cpp @@ -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()) { diff --git a/rpcs3/rpcs3qt/gui_game_info.cpp b/rpcs3/rpcs3qt/gui_game_info.cpp new file mode 100644 index 0000000000..61187a6f11 --- /dev/null +++ b/rpcs3/rpcs3qt/gui_game_info.cpp @@ -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; +} diff --git a/rpcs3/rpcs3qt/gui_game_info.h b/rpcs3/rpcs3qt/gui_game_info.h new file mode 100644 index 0000000000..60f89ed9da --- /dev/null +++ b/rpcs3/rpcs3qt/gui_game_info.h @@ -0,0 +1,29 @@ +#pragma once + +#include "movie_item_base.h" +#include "game_compatibility.h" + +#include "Emu/GameInfo.h" + +#include + +/* 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 game_info; +Q_DECLARE_METATYPE(game_info) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index eaa72807f3..71adff9dbe 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -3070,18 +3070,7 @@ void main_window::CreateConnects() connect(ui->actionManage_Game_Patches, &QAction::triggered, this, [this] { - std::unordered_map> 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{}, "", "", this); patch_manager.exec(); }); diff --git a/rpcs3/rpcs3qt/patch_manager_dialog.cpp b/rpcs3/rpcs3qt/patch_manager_dialog.cpp index 47cc299160..21264e35bc 100644 --- a/rpcs3/rpcs3qt/patch_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/patch_manager_dialog.cpp @@ -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, std::unordered_map> games, const std::string& title_id, const std::string& version, QWidget* parent) +patch_manager_dialog::patch_manager_dialog(std::shared_ptr gui_settings, const std::vector& 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_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); diff --git a/rpcs3/rpcs3qt/patch_manager_dialog.h b/rpcs3/rpcs3qt/patch_manager_dialog.h index c554f6f309..4639afd454 100644 --- a/rpcs3/rpcs3qt/patch_manager_dialog.h +++ b/rpcs3/rpcs3qt/patch_manager_dialog.h @@ -5,6 +5,7 @@ #include #include +#include "gui_game_info.h" #include "Utilities/bin_patch.h" #include @@ -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, std::unordered_map> games, const std::string& title_id, const std::string& version, QWidget* parent = nullptr); + explicit patch_manager_dialog(std::shared_ptr gui_settings, const std::vector& games, const std::string& title_id, const std::string& version, QWidget* parent = nullptr); ~patch_manager_dialog(); int exec() override;