From d02dea5df2411efa235d39118014c5dfefef1bd7 Mon Sep 17 00:00:00 2001 From: RipleyTom Date: Tue, 13 May 2025 12:58:25 +0200 Subject: [PATCH 1/4] Make Disable IPv6 text translatable --- rpcs3/rpcs3qt/rpcn_settings_dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp b/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp index bdbb09ce17..6da91185f7 100644 --- a/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/rpcn_settings_dialog.cpp @@ -162,7 +162,7 @@ rpcn_account_dialog::rpcn_account_dialog(QWidget* parent) QPushButton* btn_test = new QPushButton(tr("Test Account")); QLabel* label_npid = new QLabel(); - QCheckBox* checkbox_disable_ipv6 = new QCheckBox("Disable IPv6"); + QCheckBox* checkbox_disable_ipv6 = new QCheckBox(tr("Disable IPv6")); checkbox_disable_ipv6->setCheckState(g_cfg_rpcn.get_ipv6_support() ? Qt::Unchecked : Qt::Checked); const auto update_npid_label = [label_npid]() From f4dc18c872e474f7551b68c18c50969a49a9ff76 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Tue, 13 May 2025 03:06:32 +0300 Subject: [PATCH 2/4] rsx: Don't trigger surface swap-in/swap-out handlers when replacing self --- rpcs3/Emu/RSX/Common/surface_utils.h | 2 +- rpcs3/Emu/RSX/GL/GLTextureCache.h | 7 ++++--- rpcs3/Emu/RSX/VK/VKTextureCache.h | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/surface_utils.h b/rpcs3/Emu/RSX/Common/surface_utils.h index 05e1993780..03c5b5e6f2 100644 --- a/rpcs3/Emu/RSX/Common/surface_utils.h +++ b/rpcs3/Emu/RSX/Common/surface_utils.h @@ -435,7 +435,7 @@ namespace rsx memory_tag_samples[0].second = ~memory_tag_samples[0].second; } - bool test() + bool test() const { for (const auto& e : memory_tag_samples) { diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index 7348fd5936..45d787c184 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -69,7 +69,10 @@ namespace gl void create(u16 w, u16 h, u16 depth, u16 mipmaps, gl::texture* image, u32 rsx_pitch, bool managed, gl::texture::format gl_format = gl::texture::format::rgba, gl::texture::type gl_type = gl::texture::type::ubyte, bool swap_bytes = false) { - if (vram_texture && !managed_texture && get_protection() == utils::protection::no) + auto new_texture = static_cast(image); + ensure(!exists() || !is_managed() || vram_texture == new_texture); + + if (vram_texture != new_texture && !managed_texture && get_protection() == utils::protection::no) { // In-place image swap, still locked. Likely a color buffer that got rebound as depth buffer or vice-versa. gl::as_rtt(vram_texture)->on_swap_out(); @@ -81,8 +84,6 @@ namespace gl } } - auto new_texture = static_cast(image); - ensure(!exists() || !is_managed() || vram_texture == new_texture); vram_texture = new_texture; if (managed) diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index d7d3f81e8d..0228bd538e 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -47,7 +47,10 @@ namespace vk void create(u16 w, u16 h, u16 depth, u16 mipmaps, vk::image* image, u32 rsx_pitch, bool managed, u32 gcm_format, bool pack_swap_bytes = false) { - if (vram_texture && !managed_texture && get_protection() == utils::protection::no) + auto new_texture = static_cast(image); + ensure(!exists() || !is_managed() || vram_texture == new_texture); + + if (vram_texture != new_texture && !managed_texture && get_protection() == utils::protection::no) { // In-place image swap, still locked. Likely a color buffer that got rebound as depth buffer or vice-versa. vk::as_rtt(vram_texture)->on_swap_out(); @@ -59,8 +62,6 @@ namespace vk } } - auto new_texture = static_cast(image); - ensure(!exists() || !is_managed() || vram_texture == new_texture); vram_texture = new_texture; ensure(rsx_pitch); From fa744121fc936d35b9d880c6bbc587c49aa51b1e Mon Sep 17 00:00:00 2001 From: elad335 <18193363+elad335@users.noreply.github.com> Date: Tue, 13 May 2025 16:27:23 +0300 Subject: [PATCH 3/4] Fix CallFromMainThread execution condition --- rpcs3/Emu/System.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index dde9d572f0..3fdcfae9ab 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -169,10 +169,10 @@ void fmt_class_string::format(std::string& out, u64 arg) void Emulator::CallFromMainThread(std::function&& func, atomic_t* wake_up, bool track_emu_state, u64 stop_ctr, std::source_location src_loc) const { - std::function final_func = [this, before = IsStopped(), track_emu_state, thread_name = thread_ctrl::get_name(), src = src_loc + std::function final_func = [this, before = IsStopped(true), track_emu_state, thread_name = thread_ctrl::get_name(), src = src_loc , count = (stop_ctr == umax ? +m_stop_ctr : stop_ctr), func = std::move(func)] { - const bool call_it = (!track_emu_state || (count == m_stop_ctr && before == IsStopped())); + const bool call_it = (!track_emu_state || (count == m_stop_ctr && before == IsStopped(true))); sys_log.trace("Callback from thread '%s' at [%s] is %s", thread_name, src, call_it ? "called" : "skipped"); From bc18b3592c8a3f929d15e67c1cfd1a15c7b9357a Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 13 May 2025 19:39:15 +0200 Subject: [PATCH 4/4] SDL/input: Log GUID --- rpcs3/Input/sdl_pad_handler.cpp | 14 ++++++++++++-- rpcs3/Input/sdl_pad_handler.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rpcs3/Input/sdl_pad_handler.cpp b/rpcs3/Input/sdl_pad_handler.cpp index a9f1f0dc02..21a59cba2c 100644 --- a/rpcs3/Input/sdl_pad_handler.cpp +++ b/rpcs3/Input/sdl_pad_handler.cpp @@ -11,6 +11,15 @@ LOG_CHANNEL(sdl_log, "SDL"); +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + const SDL_GUID& guid = get_object(arg); + char str[sizeof(SDL_GUID) * 2 + 1] {}; + SDL_GUIDToString(guid, str, sizeof(str)); + fmt::append(out, "%s", str); +} + sdl_pad_handler::sdl_pad_handler() : PadHandlerBase(pad_handler::sdl) { button_list = @@ -258,6 +267,7 @@ SDLDevice::sdl_info sdl_pad_handler::get_sdl_info(SDL_JoystickID id) info.type = SDL_GetGamepadType(info.gamepad); info.real_type = SDL_GetRealGamepadType(info.gamepad); + info.guid = SDL_GetGamepadGUIDForID(id); info.vid = SDL_GetGamepadVendor(info.gamepad); info.pid = SDL_GetGamepadProduct(info.gamepad); info.product_version = SDL_GetGamepadProductVersion(info.gamepad); @@ -291,8 +301,8 @@ SDLDevice::sdl_info sdl_pad_handler::get_sdl_info(SDL_JoystickID id) } } - sdl_log.notice("Found game pad %d: type=%d, real_type=%d, name='%s', path='%s', serial='%s', vid=0x%x, pid=0x%x, product_version=0x%x, firmware_version=0x%x, has_led=%d, has_player_led=%d, has_mono_led=%d, has_rumble=%d, has_rumble_triggers=%d, has_accel=%d, has_gyro=%d", - id, static_cast(info.type), static_cast(info.real_type), info.name, info.path, info.serial, info.vid, info.pid, info.product_version, info.firmware_version, info.has_led, info.has_player_led, info.has_mono_led, info.has_rumble, info.has_rumble_triggers, info.has_accel, info.has_gyro); + sdl_log.error("Found game pad %d: type=%d, real_type=%d, name='%s', guid='%s', path='%s', serial='%s', vid=0x%x, pid=0x%x, product_version=0x%x, firmware_version=0x%x, has_led=%d, has_player_led=%d, has_mono_led=%d, has_rumble=%d, has_rumble_triggers=%d, has_accel=%d, has_gyro=%d", + id, static_cast(info.type), static_cast(info.real_type), info.name, info.guid, info.path, info.serial, info.vid, info.pid, info.product_version, info.firmware_version, info.has_led, info.has_player_led, info.has_mono_led, info.has_rumble, info.has_rumble_triggers, info.has_accel, info.has_gyro); if (info.has_accel) { diff --git a/rpcs3/Input/sdl_pad_handler.h b/rpcs3/Input/sdl_pad_handler.h index 58ddcfda63..0fb5633a81 100644 --- a/rpcs3/Input/sdl_pad_handler.h +++ b/rpcs3/Input/sdl_pad_handler.h @@ -36,6 +36,7 @@ public: SDL_Gamepad* gamepad = nullptr; SDL_GamepadType type = SDL_GamepadType::SDL_GAMEPAD_TYPE_UNKNOWN; SDL_GamepadType real_type = SDL_GamepadType::SDL_GAMEPAD_TYPE_UNKNOWN; + SDL_GUID guid {}; int power_level = 0; int last_power_level = 0;