summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-11-22 15:58:00 -0500
committerGravatar Zach Hilman2018-11-22 15:58:11 -0500
commitf820e58be4532d7c845c828ba6ec609a5b277723 (patch)
treea42d50e1d662bee9bcb88b218fac8405f82cefbf
parentapplets: Add StubApplet (diff)
downloadyuzu-f820e58be4532d7c845c828ba6ec609a5b277723.tar.gz
yuzu-f820e58be4532d7c845c828ba6ec609a5b277723.tar.xz
yuzu-f820e58be4532d7c845c828ba6ec609a5b277723.zip
am: Return StubApplet instead of nullptr when AppletId not found
-rw-r--r--src/core/hle/service/am/am.cpp10
-rw-r--r--src/core/hle/service/am/applets/stub_applet.cpp5
-rw-r--r--src/core/hle/service/am/applets/stub_applet.h7
3 files changed, 11 insertions, 11 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 11181a0af..f4127701f 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -6,8 +6,6 @@
6#include <cinttypes> 6#include <cinttypes>
7#include <cstring> 7#include <cstring>
8#include <stack> 8#include <stack>
9#include "applets/applets.h"
10#include "applets/software_keyboard.h"
11#include "audio_core/audio_renderer.h" 9#include "audio_core/audio_renderer.h"
12#include "core/core.h" 10#include "core/core.h"
13#include "core/hle/ipc_helpers.h" 11#include "core/hle/ipc_helpers.h"
@@ -18,6 +16,9 @@
18#include "core/hle/service/am/am.h" 16#include "core/hle/service/am/am.h"
19#include "core/hle/service/am/applet_ae.h" 17#include "core/hle/service/am/applet_ae.h"
20#include "core/hle/service/am/applet_oe.h" 18#include "core/hle/service/am/applet_oe.h"
19#include "core/hle/service/am/applets/applets.h"
20#include "core/hle/service/am/applets/software_keyboard.h"
21#include "core/hle/service/am/applets/stub_applet.h"
21#include "core/hle/service/am/idle.h" 22#include "core/hle/service/am/idle.h"
22#include "core/hle/service/am/omm.h" 23#include "core/hle/service/am/omm.h"
23#include "core/hle/service/am/spsm.h" 24#include "core/hle/service/am/spsm.h"
@@ -761,8 +762,9 @@ static std::shared_ptr<Applets::Applet> GetAppletFromId(AppletId id) {
761 case AppletId::SoftwareKeyboard: 762 case AppletId::SoftwareKeyboard:
762 return std::make_shared<Applets::SoftwareKeyboard>(); 763 return std::make_shared<Applets::SoftwareKeyboard>();
763 default: 764 default:
764 UNREACHABLE_MSG("Unimplemented AppletId [{:08X}]!", static_cast<u32>(id)); 765 LOG_ERROR(Service_AM, "Unimplemented AppletId [{:08X}]! -- Falling back to stub!",
765 return nullptr; 766 static_cast<u32>(id));
767 return std::make_shared<Applets::StubApplet>();
766 } 768 }
767} 769}
768 770
diff --git a/src/core/hle/service/am/applets/stub_applet.cpp b/src/core/hle/service/am/applets/stub_applet.cpp
index c9bd3d973..ed166b87d 100644
--- a/src/core/hle/service/am/applets/stub_applet.cpp
+++ b/src/core/hle/service/am/applets/stub_applet.cpp
@@ -2,7 +2,12 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <string>
6
5#include "common/hex_util.h" 7#include "common/hex_util.h"
8#include "common/logging/log.h"
9#include "core/hle/result.h"
10#include "core/hle/service/am/am.h"
6#include "core/hle/service/am/applets/stub_applet.h" 11#include "core/hle/service/am/applets/stub_applet.h"
7 12
8namespace Service::AM::Applets { 13namespace Service::AM::Applets {
diff --git a/src/core/hle/service/am/applets/stub_applet.h b/src/core/hle/service/am/applets/stub_applet.h
index 41add5fe6..7d8dc968d 100644
--- a/src/core/hle/service/am/applets/stub_applet.h
+++ b/src/core/hle/service/am/applets/stub_applet.h
@@ -4,13 +4,6 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <array>
8#include <string>
9#include <vector>
10
11#include "common/common_funcs.h"
12#include "common/swap.h"
13#include "core/hle/service/am/am.h"
14#include "core/hle/service/am/applets/applets.h" 7#include "core/hle/service/am/applets/applets.h"
15 8
16namespace Service::AM::Applets { 9namespace Service::AM::Applets {