summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Liam2023-02-19 15:29:42 -0500
committerGravatar Liam2023-02-21 12:19:25 -0500
commit87749d217e40d5aa785ced258c260aac6ab79ae9 (patch)
treedc27abacdae692f404e267a61a0f670dcc3a8da0 /src
parentsm:: support service registration deferral (diff)
downloadyuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.gz
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.tar.xz
yuzu-87749d217e40d5aa785ced258c260aac6ab79ae9.zip
cheat_engine: add check for hid initialization
Diffstat (limited to 'src')
-rw-r--r--src/core/memory/cheat_engine.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp
index 44ee39648..c2d96bbec 100644
--- a/src/core/memory/cheat_engine.cpp
+++ b/src/core/memory/cheat_engine.cpp
@@ -47,8 +47,13 @@ void StandardVmCallbacks::MemoryWrite(VAddr address, const void* data, u64 size)
47} 47}
48 48
49u64 StandardVmCallbacks::HidKeysDown() { 49u64 StandardVmCallbacks::HidKeysDown() {
50 const auto applet_resource = 50 const auto hid = system.ServiceManager().GetService<Service::HID::Hid>("hid");
51 system.ServiceManager().GetService<Service::HID::Hid>("hid")->GetAppletResource(); 51 if (hid == nullptr) {
52 LOG_WARNING(CheatEngine, "Attempted to read input state, but hid is not initialized!");
53 return 0;
54 }
55
56 const auto applet_resource = hid->GetAppletResource();
52 if (applet_resource == nullptr) { 57 if (applet_resource == nullptr) {
53 LOG_WARNING(CheatEngine, 58 LOG_WARNING(CheatEngine,
54 "Attempted to read input state, but applet resource is not initialized!"); 59 "Attempted to read input state, but applet resource is not initialized!");