diff options
author | Subv <subv2112@gmail.com> | 2015-07-23 21:09:43 -0500 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-07-23 21:32:30 -0500 |
commit | 599744921de3160a1f91b78bc5fa5394c9e09730 (patch) | |
tree | 9c2a31867b1bb0190798bac41823d17c27128583 /src/core/hle/service/apt/apt.cpp | |
parent | ce31184557361f3905e81e2ab948de976c51c7e4 (diff) |
Service/APT: Fixed a regression, PreloadLibraryApplet should also start an applet when called.
Diffstat (limited to 'src/core/hle/service/apt/apt.cpp')
-rw-r--r-- | src/core/hle/service/apt/apt.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 1988be52..35402341 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -334,7 +334,26 @@ void GetAppCpuTimeLimit(Service::Interface* self) { void PrepareToStartLibraryApplet(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); AppletId applet_id = static_cast<AppletId>(cmd_buff[1]); - cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw; + auto applet = HLE::Applets::Applet::Get(applet_id); + if (applet) { + LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id); + cmd_buff[1] = RESULT_SUCCESS.raw; + } else { + cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw; + } + LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); +} + +void PreloadLibraryApplet(Service::Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + AppletId applet_id = static_cast<AppletId>(cmd_buff[1]); + auto applet = HLE::Applets::Applet::Get(applet_id); + if (applet) { + LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id); + cmd_buff[1] = RESULT_SUCCESS.raw; + } else { + cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw; + } LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id); } |