diff options
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/stub_applet.cpp | 70 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/stub_applet.h | 24 |
4 files changed, 102 insertions, 4 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3d2e0767a..e1f21a764 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -158,6 +158,8 @@ add_library(core STATIC | |||
| 158 | hle/service/am/applets/applets.h | 158 | hle/service/am/applets/applets.h |
| 159 | hle/service/am/applets/software_keyboard.cpp | 159 | hle/service/am/applets/software_keyboard.cpp |
| 160 | hle/service/am/applets/software_keyboard.h | 160 | hle/service/am/applets/software_keyboard.h |
| 161 | hle/service/am/applets/stub_applet.cpp | ||
| 162 | hle/service/am/applets/stub_applet.h | ||
| 161 | hle/service/am/idle.cpp | 163 | hle/service/am/idle.cpp |
| 162 | hle/service/am/idle.h | 164 | hle/service/am/idle.h |
| 163 | hle/service/am/omm.cpp | 165 | hle/service/am/omm.cpp |
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 new file mode 100644 index 000000000..ed166b87d --- /dev/null +++ b/src/core/hle/service/am/applets/stub_applet.cpp | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <string> | ||
| 6 | |||
| 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" | ||
| 11 | #include "core/hle/service/am/applets/stub_applet.h" | ||
| 12 | |||
| 13 | namespace Service::AM::Applets { | ||
| 14 | |||
| 15 | static void LogCurrentStorage(AppletDataBroker& broker, std::string prefix) { | ||
| 16 | std::unique_ptr<IStorage> storage = broker.PopNormalDataToApplet(); | ||
| 17 | for (; storage != nullptr; storage = broker.PopNormalDataToApplet()) { | ||
| 18 | const auto data = storage->GetData(); | ||
| 19 | LOG_INFO(Service_AM, | ||
| 20 | "called (STUBBED), during {} recieved normal data with size={:08X}, data={}", | ||
| 21 | prefix, data.size(), Common::HexVectorToString(data)); | ||
| 22 | } | ||
| 23 | |||
| 24 | storage = broker.PopInteractiveDataToApplet(); | ||
| 25 | for (; storage != nullptr; storage = broker.PopInteractiveDataToApplet()) { | ||
| 26 | const auto data = storage->GetData(); | ||
| 27 | LOG_INFO(Service_AM, | ||
| 28 | "called (STUBBED), during {} recieved interactive data with size={:08X}, data={}", | ||
| 29 | prefix, data.size(), Common::HexVectorToString(data)); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | StubApplet::StubApplet() = default; | ||
| 34 | |||
| 35 | StubApplet::~StubApplet() = default; | ||
| 36 | |||
| 37 | void StubApplet::Initialize() { | ||
| 38 | LOG_WARNING(Service_AM, "called (STUBBED)"); | ||
| 39 | Applet::Initialize(); | ||
| 40 | LogCurrentStorage(broker, "Initialize"); | ||
| 41 | } | ||
| 42 | |||
| 43 | bool StubApplet::TransactionComplete() const { | ||
| 44 | LOG_WARNING(Service_AM, "called (STUBBED)"); | ||
| 45 | return true; | ||
| 46 | } | ||
| 47 | |||
| 48 | ResultCode StubApplet::GetStatus() const { | ||
| 49 | LOG_WARNING(Service_AM, "called (STUBBED)"); | ||
| 50 | return RESULT_SUCCESS; | ||
| 51 | } | ||
| 52 | |||
| 53 | void StubApplet::ExecuteInteractive() { | ||
| 54 | LOG_WARNING(Service_AM, "called (STUBBED)"); | ||
| 55 | LogCurrentStorage(broker, "ExecuteInteractive"); | ||
| 56 | |||
| 57 | broker.PushNormalDataFromApplet(IStorage{std::vector<u8>(0x1000)}); | ||
| 58 | broker.PushInteractiveDataFromApplet(IStorage{std::vector<u8>(0x1000)}); | ||
| 59 | broker.SignalStateChanged(); | ||
| 60 | } | ||
| 61 | |||
| 62 | void StubApplet::Execute() { | ||
| 63 | LOG_WARNING(Service_AM, "called (STUBBED)"); | ||
| 64 | LogCurrentStorage(broker, "Execute"); | ||
| 65 | |||
| 66 | broker.PushNormalDataFromApplet(IStorage{std::vector<u8>(0x1000)}); | ||
| 67 | broker.PushInteractiveDataFromApplet(IStorage{std::vector<u8>(0x1000)}); | ||
| 68 | broker.SignalStateChanged(); | ||
| 69 | } | ||
| 70 | } // namespace 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 new file mode 100644 index 000000000..7d8dc968d --- /dev/null +++ b/src/core/hle/service/am/applets/stub_applet.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/am/applets/applets.h" | ||
| 8 | |||
| 9 | namespace Service::AM::Applets { | ||
| 10 | |||
| 11 | class StubApplet final : public Applet { | ||
| 12 | public: | ||
| 13 | StubApplet(); | ||
| 14 | ~StubApplet() override; | ||
| 15 | |||
| 16 | void Initialize() override; | ||
| 17 | |||
| 18 | bool TransactionComplete() const override; | ||
| 19 | ResultCode GetStatus() const override; | ||
| 20 | void ExecuteInteractive() override; | ||
| 21 | void Execute() override; | ||
| 22 | }; | ||
| 23 | |||
| 24 | } // namespace Service::AM::Applets | ||