diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4b7aacbac..53580d673 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -725,11 +725,36 @@ ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryApple | |||
| 725 | 725 | ||
| 726 | ILibraryAppletCreator::~ILibraryAppletCreator() = default; | 726 | ILibraryAppletCreator::~ILibraryAppletCreator() = default; |
| 727 | 727 | ||
| 728 | static std::shared_ptr<Applets::Applet> GetAppletFromId(AppletId id) { | ||
| 729 | switch (id) { | ||
| 730 | case AppletId::SoftwareKeyboard: | ||
| 731 | return std::make_shared<Applets::SoftwareKeyboard>(); | ||
| 732 | default: | ||
| 733 | UNREACHABLE_MSG("Unimplemented AppletId [{:08X}]!", static_cast<u32>(id)); | ||
| 734 | return nullptr; | ||
| 735 | } | ||
| 736 | } | ||
| 737 | |||
| 728 | void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) { | 738 | void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) { |
| 739 | IPC::RequestParser rp{ctx}; | ||
| 740 | const auto applet_id = rp.PopRaw<AppletId>(); | ||
| 741 | const auto applet_mode = rp.PopRaw<u32>(); | ||
| 742 | |||
| 743 | LOG_DEBUG(Service_AM, "called with applet_id={:08X}, applet_mode={:08X}", | ||
| 744 | static_cast<u32>(applet_id), applet_mode); | ||
| 745 | |||
| 746 | const auto applet = GetAppletFromId(applet_id); | ||
| 747 | |||
| 748 | if (applet == nullptr) { | ||
| 749 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 750 | rb.Push(ResultCode(-1)); | ||
| 751 | return; | ||
| 752 | } | ||
| 753 | |||
| 729 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 754 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 730 | 755 | ||
| 731 | rb.Push(RESULT_SUCCESS); | 756 | rb.Push(RESULT_SUCCESS); |
| 732 | rb.PushIpcInterface<AM::ILibraryAppletAccessor>(); | 757 | rb.PushIpcInterface<AM::ILibraryAppletAccessor>(applet); |
| 733 | 758 | ||
| 734 | LOG_DEBUG(Service_AM, "called"); | 759 | LOG_DEBUG(Service_AM, "called"); |
| 735 | } | 760 | } |