summaryrefslogtreecommitdiff
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar Subv2015-12-04 16:05:23 -0500
committerGravatar Subv2016-03-12 10:59:37 -0500
commit0f8be2d2cc54feda0a52ec8f9633fd022879816a (patch)
tree18a0fa35a23a773be265cb8ff2f6c8df1e8ce9b1 /src/core/hle/service
parentMerge pull request #1261 from yuriks/tev-buffer-delay (diff)
downloadyuzu-0f8be2d2cc54feda0a52ec8f9633fd022879816a.tar.gz
yuzu-0f8be2d2cc54feda0a52ec8f9633fd022879816a.tar.xz
yuzu-0f8be2d2cc54feda0a52ec8f9633fd022879816a.zip
HLE/Applets: Implemented a dummy Mii Selector applet.
This prevents some games (like Super Mario 3D Land) from freezing when trying to launch it, however, it's not complete and won't let you go past Mii selection as the parameter structure hasn't been reverse engineered yet.
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/apt/apt.cpp19
-rw-r--r--src/core/hle/service/apt/apt.h17
-rw-r--r--src/core/hle/service/apt/apt_u.cpp2
3 files changed, 36 insertions, 2 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index ba66569b4..feb579778 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -12,6 +12,7 @@
12#include "core/hle/service/apt/apt_a.h" 12#include "core/hle/service/apt/apt_a.h"
13#include "core/hle/service/apt/apt_s.h" 13#include "core/hle/service/apt/apt_s.h"
14#include "core/hle/service/apt/apt_u.h" 14#include "core/hle/service/apt/apt_u.h"
15#include "core/hle/service/fs/archive.h"
15 16
16#include "core/hle/hle.h" 17#include "core/hle/hle.h"
17#include "core/hle/kernel/event.h" 18#include "core/hle/kernel/event.h"
@@ -380,6 +381,24 @@ void StartLibraryApplet(Service::Interface* self) {
380 cmd_buff[1] = applet->Start(parameter).raw; 381 cmd_buff[1] = applet->Start(parameter).raw;
381} 382}
382 383
384void GetAppletInfo(Service::Interface* self) {
385 u32* cmd_buff = Kernel::GetCommandBuffer();
386 auto app_id = static_cast<AppletId>(cmd_buff[1]);
387
388 if (auto applet = HLE::Applets::Applet::Get(app_id)) {
389 // TODO(Subv): Get the title id for the current applet and write it in the response[2-3]
390 cmd_buff[1] = RESULT_SUCCESS.raw;
391 cmd_buff[4] = static_cast<u32>(Service::FS::MediaType::NAND);
392 cmd_buff[5] = 1; // Registered
393 cmd_buff[6] = 1; // Loaded
394 cmd_buff[7] = 0; // Applet Attributes
395 } else {
396 cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
397 ErrorSummary::NotFound, ErrorLevel::Status).raw;
398 }
399 LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id);
400}
401
383void Init() { 402void Init() {
384 AddService(new APT_A_Interface); 403 AddService(new APT_A_Interface);
385 AddService(new APT_S_Interface); 404 AddService(new APT_S_Interface);
diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h
index 4a72b6b5c..47a97c1a1 100644
--- a/src/core/hle/service/apt/apt.h
+++ b/src/core/hle/service/apt/apt.h
@@ -54,7 +54,7 @@ enum class AppletId : u32 {
54 Notifications = 0x116, 54 Notifications = 0x116,
55 Miiverse = 0x117, 55 Miiverse = 0x117,
56 SoftwareKeyboard1 = 0x201, 56 SoftwareKeyboard1 = 0x201,
57 Ed = 0x202, 57 Ed1 = 0x202,
58 PnoteApp = 0x204, 58 PnoteApp = 0x204,
59 SnoteApp = 0x205, 59 SnoteApp = 0x205,
60 Error = 0x206, 60 Error = 0x206,
@@ -64,6 +64,7 @@ enum class AppletId : u32 {
64 Application = 0x300, 64 Application = 0x300,
65 AnyLibraryApplet = 0x400, 65 AnyLibraryApplet = 0x400,
66 SoftwareKeyboard2 = 0x401, 66 SoftwareKeyboard2 = 0x401,
67 Ed2 = 0x402,
67}; 68};
68 69
69/// Send a parameter to the currently-running application, which will read it via ReceiveParameter 70/// Send a parameter to the currently-running application, which will read it via ReceiveParameter
@@ -133,6 +134,20 @@ void Enable(Service::Interface* self);
133void GetAppletManInfo(Service::Interface* self); 134void GetAppletManInfo(Service::Interface* self);
134 135
135/** 136/**
137 * APT::GetAppletInfo service function.
138 * Inputs:
139 * 1 : AppId
140 * Outputs:
141 * 1 : Result of function, 0 on success, otherwise error code
142 * 2-3 : Title ID
143 * 4 : Media Type
144 * 5 : Registered
145 * 6 : Loaded
146 * 7 : Attributes
147 */
148void GetAppletInfo(Service::Interface* self);
149
150/**
136 * APT::IsRegistered service function. This returns whether the specified AppID is registered with NS yet. 151 * APT::IsRegistered service function. This returns whether the specified AppID is registered with NS yet.
137 * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu uses this 152 * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu uses this
138 * command to determine when the launched process is running and to determine when to stop using GSP etc, 153 * command to determine when the launched process is running and to determine when to stop using GSP etc,
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp
index 146bfd595..2e9d1f4b4 100644
--- a/src/core/hle/service/apt/apt_u.cpp
+++ b/src/core/hle/service/apt/apt_u.cpp
@@ -17,7 +17,7 @@ const Interface::FunctionInfo FunctionTable[] = {
17 {0x00030040, Enable, "Enable"}, 17 {0x00030040, Enable, "Enable"},
18 {0x00040040, nullptr, "Finalize"}, 18 {0x00040040, nullptr, "Finalize"},
19 {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, 19 {0x00050040, GetAppletManInfo, "GetAppletManInfo"},
20 {0x00060040, nullptr, "GetAppletInfo"}, 20 {0x00060040, GetAppletInfo, "GetAppletInfo"},
21 {0x00070000, nullptr, "GetLastSignaledAppletId"}, 21 {0x00070000, nullptr, "GetLastSignaledAppletId"},
22 {0x00080000, nullptr, "CountRegisteredApplet"}, 22 {0x00080000, nullptr, "CountRegisteredApplet"},
23 {0x00090040, IsRegistered, "IsRegistered"}, 23 {0x00090040, IsRegistered, "IsRegistered"},