HLE/APT: Initial HLE support for applets.

Currently only the SWKBD is emulated, and there's currently no way to ask the user for input, so it always returns "Subv" as the text.
This commit is contained in:
Subv
2015-05-25 23:30:20 -05:00
parent b0d72e3de1
commit 2a6ebadf66
9 changed files with 410 additions and 50 deletions

View File

@ -11,6 +11,23 @@
namespace Service {
namespace APT {
/// Holds information about the parameters used in Send/Glance/ReceiveParameter
struct MessageParameter {
u32 sender_id = 0;
u32 destination_id = 0;
u32 signal = 0;
u32 buffer_size = 0;
Kernel::SharedPtr<Kernel::Object> object = nullptr;
u8* data = nullptr;
};
/// Holds information about the parameters used in StartLibraryApplet
struct AppletStartupParameter {
u32 buffer_size = 0;
Kernel::SharedPtr<Kernel::Object> object = nullptr;
u8* data = nullptr;
};
/// Signals used by APT functions
enum class SignalType : u32 {
None = 0x0,
@ -23,7 +40,7 @@ enum class SignalType : u32 {
};
/// App Id's used by APT functions
enum class AppID : u32 {
enum class AppletId : u32 {
HomeMenu = 0x101,
AlternateMenu = 0x103,
Camera = 0x110,
@ -45,6 +62,9 @@ enum class AppID : u32 {
SoftwareKeyboard2 = 0x401,
};
/// Send a parameter to the currently-running application, which will read it via ReceiveParameter
void SendParameter(MessageParameter const& parameter);
/**
* APT::Initialize service function
* Service function that initializes the APT process for the running application
@ -249,6 +269,33 @@ void SetAppCpuTimeLimit(Service::Interface* self);
*/
void GetAppCpuTimeLimit(Service::Interface* self);
/**
* APT::PrepareToStartLibraryApplet service function
* Inputs:
* 0 : Command header [0x00180040]
* 1 : Id of the applet to start
* Outputs:
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
void PrepareToStartLibraryApplet(Service::Interface* self);
/**
* APT::StartLibraryApplet service function
* Inputs:
* 0 : Command header [0x001E0084]
* 1 : Id of the applet to start
* 2 : Buffer size
* 3 : Always 0?
* 4 : Handle passed to the applet
* 5 : (Size << 14) | 2
* 6 : Input buffer virtual address
* Outputs:
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
void StartLibraryApplet(Service::Interface* self);
/// Initialize the APT service
void Init();