diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-10 02:14:01 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-18 16:53:47 +0100 |
commit | 48fcb43585132e52acaf9d859dd5d39fb308cb14 (patch) | |
tree | 1361d77d3a5ef1015a0442b483990062c64243b9 /src | |
parent | qt/applets: Provide Qt frontend implementation of software keyboard (diff) | |
download | yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.tar yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.tar.gz yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.tar.bz2 yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.tar.lz yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.tar.xz yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.tar.zst yuzu-48fcb43585132e52acaf9d859dd5d39fb308cb14.zip |
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 ILibraryAppletCreator::~ILibraryAppletCreator() = default; +static std::shared_ptr<Applets::Applet> GetAppletFromId(AppletId id) { + switch (id) { + case AppletId::SoftwareKeyboard: + return std::make_shared<Applets::SoftwareKeyboard>(); + default: + UNREACHABLE_MSG("Unimplemented AppletId [{:08X}]!", static_cast<u32>(id)); + return nullptr; + } +} + void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto applet_id = rp.PopRaw<AppletId>(); + const auto applet_mode = rp.PopRaw<u32>(); + + LOG_DEBUG(Service_AM, "called with applet_id={:08X}, applet_mode={:08X}", + static_cast<u32>(applet_id), applet_mode); + + const auto applet = GetAppletFromId(applet_id); + + if (applet == nullptr) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultCode(-1)); + return; + } + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<AM::ILibraryAppletAccessor>(); + rb.PushIpcInterface<AM::ILibraryAppletAccessor>(applet); LOG_DEBUG(Service_AM, "called"); } |