From c9cd938dfd8fc40ec58d61dc453bc31d3b811496 Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Tue, 14 Nov 2023 21:34:27 -0600 Subject: service: hid: Split hid.cpp into individual interfaces --- src/core/memory/cheat_engine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/core/memory/cheat_engine.cpp') diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index 53a89cc8f..da140c01c 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp @@ -10,7 +10,8 @@ #include "core/hle/kernel/k_page_table.h" #include "core/hle/kernel/k_process.h" #include "core/hle/service/hid/controllers/npad.h" -#include "core/hle/service/hid/hid.h" +#include "core/hle/service/hid/hid_server.h" +#include "core/hle/service/hid/resource_manager.h" #include "core/hle/service/sm/sm.h" #include "core/memory.h" #include "core/memory/cheat_engine.h" @@ -54,13 +55,13 @@ void StandardVmCallbacks::MemoryWrite(VAddr address, const void* data, u64 size) } u64 StandardVmCallbacks::HidKeysDown() { - const auto hid = system.ServiceManager().GetService("hid"); + const auto hid = system.ServiceManager().GetService("hid"); if (hid == nullptr) { LOG_WARNING(CheatEngine, "Attempted to read input state, but hid is not initialized!"); return 0; } - const auto applet_resource = hid->GetAppletResource(); + const auto applet_resource = hid->GetResourceManager(); if (applet_resource == nullptr) { LOG_WARNING(CheatEngine, "Attempted to read input state, but applet resource is not initialized!"); -- cgit v1.2.3 From cff2d0e19e164d879b57bab9d06306fa70a1049e Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Fri, 17 Nov 2023 11:46:26 -0600 Subject: service: hid: Create appropriate hid resources --- src/core/memory/cheat_engine.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/core/memory/cheat_engine.cpp') diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index da140c01c..db30ba598 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp @@ -68,10 +68,7 @@ u64 StandardVmCallbacks::HidKeysDown() { return 0; } - const auto press_state = - applet_resource - ->GetController(Service::HID::HidController::NPad) - .GetAndResetPressState(); + const auto press_state = applet_resource->GetNpad()->GetAndResetPressState(); return static_cast(press_state & HID::NpadButton::All); } -- cgit v1.2.3