From e21f96ffde30d66337bd119c04a13f1025be159c Mon Sep 17 00:00:00 2001 From: FrozenAra Date: Mon, 27 Nov 2023 19:26:06 +0100 Subject: Fixed controller applet crashing when on FW17+ --- src/core/hle/service/hid/hid_server.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/hle/service/hid/hid_server.cpp') diff --git a/src/core/hle/service/hid/hid_server.cpp b/src/core/hle/service/hid/hid_server.cpp index 583142e35..a7d1578d9 100644 --- a/src/core/hle/service/hid/hid_server.cpp +++ b/src/core/hle/service/hid/hid_server.cpp @@ -208,6 +208,7 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr r {1001, &IHidServer::GetNpadCommunicationMode, "GetNpadCommunicationMode"}, {1002, &IHidServer::SetTouchScreenConfiguration, "SetTouchScreenConfiguration"}, {1003, &IHidServer::IsFirmwareUpdateNeededForNotification, "IsFirmwareUpdateNeededForNotification"}, + {1004, &IHidServer::SetTouchScreenResolution, "SetTouchScreenResolution"}, {2000, nullptr, "ActivateDigitizer"}, }; // clang-format on @@ -2363,6 +2364,21 @@ void IHidServer::IsFirmwareUpdateNeededForNotification(HLERequestContext& ctx) { rb.Push(false); } +void IHidServer::SetTouchScreenResolution(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto width{rp.Pop()}; + const auto height{rp.Pop()}; + const auto applet_resource_user_id{rp.Pop()}; + + GetResourceManager()->GetTouchScreen()->SetTouchscreenDimensions(width, height); + + LOG_INFO(Service_HID, "called, width={}, height={}, applet_resource_user_id={}", width, height, + applet_resource_user_id); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + std::shared_ptr IHidServer::GetResourceManager() { resource_manager->Initialize(); return resource_manager; -- cgit v1.2.3