Updated some module's FunctionTable from 3dbrez

This commit is contained in:
JamePeng 2016-02-09 01:21:40 +08:00
parent f1d1049c4f
commit 1d86878be4
10 changed files with 953 additions and 745 deletions

View file

@ -1,339 +1,349 @@
// Copyright 2015 Citra Emulator Project // Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#pragma once #pragma once
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
namespace Service { namespace Service {
class Interface; class Interface;
namespace APT { namespace APT {
/// Holds information about the parameters used in Send/Glance/ReceiveParameter /// Holds information about the parameters used in Send/Glance/ReceiveParameter
struct MessageParameter { struct MessageParameter {
u32 sender_id = 0; u32 sender_id = 0;
u32 destination_id = 0; u32 destination_id = 0;
u32 signal = 0; u32 signal = 0;
u32 buffer_size = 0; u32 buffer_size = 0;
Kernel::SharedPtr<Kernel::Object> object = nullptr; Kernel::SharedPtr<Kernel::Object> object = nullptr;
u8* data = nullptr; u8* data = nullptr;
}; };
/// Holds information about the parameters used in StartLibraryApplet /// Holds information about the parameters used in StartLibraryApplet
struct AppletStartupParameter { struct AppletStartupParameter {
u32 buffer_size = 0; u32 buffer_size = 0;
Kernel::SharedPtr<Kernel::Object> object = nullptr; Kernel::SharedPtr<Kernel::Object> object = nullptr;
u8* data = nullptr; u8* data = nullptr;
}; };
/// Signals used by APT functions /// Signals used by APT functions
enum class SignalType : u32 { enum class SignalType : u32 {
None = 0x0, None = 0x0,
AppJustStarted = 0x1, AppJustStarted = 0x1,
LibAppJustStarted = 0x2, LibAppJustStarted = 0x2,
LibAppFinished = 0x3, LibAppFinished = 0x3,
LibAppClosed = 0xA, LibAppClosed = 0xA,
ReturningToApp = 0xB, ReturningToApp = 0xB,
ExitingApp = 0xC, ExitingApp = 0xC,
}; };
/// App Id's used by APT functions /// App Id's used by APT functions
enum class AppletId : u32 { enum class AppletId : u32 {
HomeMenu = 0x101, HomeMenu = 0x101,
AlternateMenu = 0x103, AlternateMenu = 0x103,
Camera = 0x110, CameraApplet = 0x110,
FriendsList = 0x112, FriendsListApplet = 0x112,
GameNotes = 0x113, GameNotesApplet = 0x113,
InternetBrowser = 0x114, InternetBrowser = 0x114,
InstructionManual = 0x115, InstructionManual = 0x115,
Notifications = 0x116, Notifications = 0x116,
Miiverse = 0x117, MiiverseApplet = 0x117,
SoftwareKeyboard1 = 0x201, MiiversePostingApplet = 0x118,
Ed = 0x202, AmiiboSettings = 0x119,
PnoteApp = 0x204, SoftwareKeyboard1 = 0x201,
SnoteApp = 0x205, MiiSelectorEd1 = 0x202,
Error = 0x206, PhotoSelector1 = 0x204,
Mint = 0x207, SoundSelector1 = 0x205,
Extrapad = 0x208, ErrorDisplay1 = 0x206,
Memolib = 0x209, EShopMint1 = 0x207,
Application = 0x300, Extrapad1 = 0x208,
AnyLibraryApplet = 0x400, Notepad1 = 0x209,
SoftwareKeyboard2 = 0x401, Application = 0x300,
}; EShopTiger = 0x301,
AnyLibraryApplet = 0x400,
/// Send a parameter to the currently-running application, which will read it via ReceiveParameter SoftwareKeyboard2 = 0x401,
void SendParameter(const MessageParameter& parameter); MiiSelectorEd2 = 0x402,
PhotoSelector2 = 0x404,
/** SoundSelector2 = 0x405,
* APT::Initialize service function ErrorDisplay2 = 0x406,
* Service function that initializes the APT process for the running application EShopMint2 = 0x407,
* Outputs: Extrapad2 = 0x408,
* 1 : Result of the function, 0 on success, otherwise error code Notepad2 = 0x409
* 3 : Handle to the notification event };
* 4 : Handle to the pause event
*/ /// Send a parameter to the currently-running application, which will read it via ReceiveParameter
void Initialize(Service::Interface* self); void SendParameter(const MessageParameter& parameter);
/** /**
* APT::GetSharedFont service function * APT::Initialize service function
* Outputs: * Service function that initializes the APT process for the running application
* 1 : Result of function, 0 on success, otherwise error code * Outputs:
* 2 : Virtual address of where shared font will be loaded in memory * 1 : Result of the function, 0 on success, otherwise error code
* 4 : Handle to shared font memory * 3 : Handle to the notification event
*/ * 4 : Handle to the pause event
void GetSharedFont(Service::Interface* self); */
void Initialize(Service::Interface* self);
/**
* APT::NotifyToWait service function /**
* Inputs: * APT::GetSharedFont service function
* 1 : AppID * Outputs:
* Outputs: * 1 : Result of function, 0 on success, otherwise error code
* 1 : Result of function, 0 on success, otherwise error code * 2 : Virtual address of where shared font will be loaded in memory
*/ * 4 : Handle to shared font memory
void NotifyToWait(Service::Interface* self); */
void GetSharedFont(Service::Interface* self);
/**
* APT::GetLockHandle service function /**
* Inputs: * APT::NotifyToWait service function
* 1 : Applet attributes * Inputs:
* Outputs: * 1 : AppID
* 1 : Result of function, 0 on success, otherwise error code * Outputs:
* 2 : Applet attributes * 1 : Result of function, 0 on success, otherwise error code
* 3 : Power button state */
* 4 : IPC handle descriptor void NotifyToWait(Service::Interface* self);
* 5 : APT mutex handle
*/ /**
void GetLockHandle(Service::Interface* self); * APT::GetLockHandle service function
* Inputs:
/** * 1 : Applet attributes
* APT::Enable service function * Outputs:
* Inputs: * 1 : Result of function, 0 on success, otherwise error code
* 1 : Applet attributes * 2 : Applet attributes
* Outputs: * 3 : Power button state
* 1 : Result of function, 0 on success, otherwise error code * 4 : IPC handle descriptor
*/ * 5 : APT mutex handle
void Enable(Service::Interface* self); */
void GetLockHandle(Service::Interface* self);
/**
* APT::GetAppletManInfo service function. /**
* Inputs: * APT::Enable service function
* 1 : Unknown * Inputs:
* Outputs: * 1 : Applet attributes
* 1 : Result of function, 0 on success, otherwise error code * Outputs:
* 2 : Unknown u32 value * 1 : Result of function, 0 on success, otherwise error code
* 3 : Unknown u8 value */
* 4 : Home Menu AppId void Enable(Service::Interface* self);
* 5 : AppID of currently active app
*/ /**
void GetAppletManInfo(Service::Interface* self); * APT::GetAppletManInfo service function.
* Inputs:
/** * 1 : Unknown
* APT::IsRegistered service function. This returns whether the specified AppID is registered with NS yet. * Outputs:
* An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu uses this * 1 : Result of function, 0 on success, otherwise error code
* command to determine when the launched process is running and to determine when to stop using GSP etc, * 2 : Unknown u32 value
* while displaying the "Nintendo 3DS" loading screen. * 3 : Unknown u8 value
* Inputs: * 4 : Home Menu AppId
* 1 : AppID * 5 : AppID of currently active app
* Outputs: */
* 0 : Return header void GetAppletManInfo(Service::Interface* self);
* 1 : Result of function, 0 on success, otherwise error code
* 2 : Output, 0 = not registered, 1 = registered. /**
*/ * APT::IsRegistered service function. This returns whether the specified AppID is registered with NS yet.
void IsRegistered(Service::Interface* self); * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu uses this
* command to determine when the launched process is running and to determine when to stop using GSP etc,
void InquireNotification(Service::Interface* self); * while displaying the "Nintendo 3DS" loading screen.
* Inputs:
/** * 1 : AppID
* APT::SendParameter service function. This sets the parameter data state. * Outputs:
* Inputs: * 0 : Return header
* 1 : Source AppID * 1 : Result of function, 0 on success, otherwise error code
* 2 : Destination AppID * 2 : Output, 0 = not registered, 1 = registered.
* 3 : Signal type */
* 4 : Parameter buffer size, max size is 0x1000 (this can be zero) void IsRegistered(Service::Interface* self);
* 5 : Value
* 6 : Handle to the destination process, likely used for shared memory (this can be zero) void InquireNotification(Service::Interface* self);
* 7 : (Size<<14) | 2
* 8 : Input parameter buffer ptr /**
* Outputs: * APT::SendParameter service function. This sets the parameter data state.
* 0 : Return Header * Inputs:
* 1 : Result of function, 0 on success, otherwise error code * 1 : Source AppID
*/ * 2 : Destination AppID
void SendParameter(Service::Interface* self); * 3 : Signal type
* 4 : Parameter buffer size, max size is 0x1000 (this can be zero)
/** * 5 : Value
* APT::ReceiveParameter service function. This returns the current parameter data from NS state, * 6 : Handle to the destination process, likely used for shared memory (this can be zero)
* from the source process which set the parameters. Once finished, NS will clear a flag in the NS * 7 : (Size<<14) | 2
* state so that this command will return an error if this command is used again if parameters were * 8 : Input parameter buffer ptr
* not set again. This is called when the second Initialize event is triggered. It returns a signal * Outputs:
* type indicating why it was triggered. * 0 : Return Header
* Inputs: * 1 : Result of function, 0 on success, otherwise error code
* 1 : AppID */
* 2 : Parameter buffer size, max size is 0x1000 void SendParameter(Service::Interface* self);
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code /**
* 2 : AppID of the process which sent these parameters * APT::ReceiveParameter service function. This returns the current parameter data from NS state,
* 3 : Signal type * from the source process which set the parameters. Once finished, NS will clear a flag in the NS
* 4 : Actual parameter buffer size, this is <= to the the input size * state so that this command will return an error if this command is used again if parameters were
* 5 : Value * not set again. This is called when the second Initialize event is triggered. It returns a signal
* 6 : Handle from the source process which set the parameters, likely used for shared memory * type indicating why it was triggered.
* 7 : Size * Inputs:
* 8 : Output parameter buffer ptr * 1 : AppID
*/ * 2 : Parameter buffer size, max size is 0x1000
void ReceiveParameter(Service::Interface* self); * Outputs:
* 1 : Result of function, 0 on success, otherwise error code
/** * 2 : AppID of the process which sent these parameters
* APT::GlanceParameter service function. This is exactly the same as APT_U::ReceiveParameter * 3 : Signal type
* (except for the word value prior to the output handle), except this will not clear the flag * 4 : Actual parameter buffer size, this is <= to the the input size
* (except when responseword[3]==8 || responseword[3]==9) in NS state. * 5 : Value
* Inputs: * 6 : Handle from the source process which set the parameters, likely used for shared memory
* 1 : AppID * 7 : Size
* 2 : Parameter buffer size, max size is 0x1000 * 8 : Output parameter buffer ptr
* Outputs: */
* 1 : Result of function, 0 on success, otherwise error code void ReceiveParameter(Service::Interface* self);
* 2 : Unknown, for now assume AppID of the process which sent these parameters
* 3 : Unknown, for now assume Signal type /**
* 4 : Actual parameter buffer size, this is <= to the the input size * APT::GlanceParameter service function. This is exactly the same as APT_U::ReceiveParameter
* 5 : Value * (except for the word value prior to the output handle), except this will not clear the flag
* 6 : Handle from the source process which set the parameters, likely used for shared memory * (except when responseword[3]==8 || responseword[3]==9) in NS state.
* 7 : Size * Inputs:
* 8 : Output parameter buffer ptr * 1 : AppID
*/ * 2 : Parameter buffer size, max size is 0x1000
void GlanceParameter(Service::Interface* self); * Outputs:
* 1 : Result of function, 0 on success, otherwise error code
/** * 2 : Unknown, for now assume AppID of the process which sent these parameters
* APT::CancelParameter service function. When the parameter data is available, and when the above * 3 : Unknown, for now assume Signal type
* specified fields match the ones in NS state(for the ones where the checks are enabled), this * 4 : Actual parameter buffer size, this is <= to the the input size
* clears the flag which indicates that parameter data is available * 5 : Value
* (same flag cleared by APT:ReceiveParameter). * 6 : Handle from the source process which set the parameters, likely used for shared memory
* Inputs: * 7 : Size
* 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS state. * 8 : Output parameter buffer ptr
* 2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter. */
* 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS state. void GlanceParameter(Service::Interface* self);
* 4 : AppID
* Outputs: /**
* 0 : Return header * APT::CancelParameter service function. When the parameter data is available, and when the above
* 1 : Result of function, 0 on success, otherwise error code * specified fields match the ones in NS state(for the ones where the checks are enabled), this
* 2 : Status flag, 0 = failure due to no parameter data being available, or the above enabled * clears the flag which indicates that parameter data is available
* fields don't match the fields in NS state. 1 = success. * (same flag cleared by APT:ReceiveParameter).
*/ * Inputs:
void CancelParameter(Service::Interface* self); * 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS state.
* 2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter.
/** * 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS state.
* APT::PrepareToStartApplication service function. When the input title-info programID is zero, * 4 : AppID
* NS will load the actual program ID via AMNet:GetTitleIDList. After doing some checks with the * Outputs:
* programID, NS will then set a NS state flag to value 1, then set the programID for AppID * 0 : Return header
* 0x300(application) to the input program ID(or the one from GetTitleIDList). A media-type field * 1 : Result of function, 0 on success, otherwise error code
* in the NS state is also set to the input media-type value * 2 : Status flag, 0 = failure due to no parameter data being available, or the above enabled
* (other state fields are set at this point as well). With 8.0.0-18, NS will set an u8 NS state * fields don't match the fields in NS state. 1 = success.
* field to value 1 when input flags bit8 is set */
* Inputs: void CancelParameter(Service::Interface* self);
* 1-4 : 0x10-byte title-info struct
* 4 : Flags /**
* Outputs: * APT::PrepareToStartApplication service function. When the input title-info programID is zero,
* 0 : Return header * NS will load the actual program ID via AMNet:GetTitleIDList. After doing some checks with the
* 1 : Result of function, 0 on success, otherwise error code * programID, NS will then set a NS state flag to value 1, then set the programID for AppID
*/ * 0x300(application) to the input program ID(or the one from GetTitleIDList). A media-type field
void PrepareToStartApplication(Service::Interface* self); * in the NS state is also set to the input media-type value
* (other state fields are set at this point as well). With 8.0.0-18, NS will set an u8 NS state
/** * field to value 1 when input flags bit8 is set
* APT::StartApplication service function. Buf0 is copied to NS FIRMparams+0x0, then Buf1 is copied * Inputs:
* to the NS FIRMparams+0x480. Then the application is launched. * 1-4 : 0x10-byte title-info struct
* Inputs: * 4 : Flags
* 1 : Buffer 0 size, max size is 0x300 * Outputs:
* 2 : Buffer 1 size, max size is 0x20 (this can be zero) * 0 : Return header
* 3 : u8 flag * 1 : Result of function, 0 on success, otherwise error code
* 4 : (Size0<<14) | 2 */
* 5 : Buffer 0 pointer void PrepareToStartApplication(Service::Interface* self);
* 6 : (Size1<<14) | 0x802
* 7 : Buffer 1 pointer /**
* Outputs: * APT::StartApplication service function. Buf0 is copied to NS FIRMparams+0x0, then Buf1 is copied
* 0 : Return Header * to the NS FIRMparams+0x480. Then the application is launched.
* 1 : Result of function, 0 on success, otherwise error code * Inputs:
*/ * 1 : Buffer 0 size, max size is 0x300
void StartApplication(Service::Interface* self); * 2 : Buffer 1 size, max size is 0x20 (this can be zero)
* 3 : u8 flag
/** * 4 : (Size0<<14) | 2
* APT::AppletUtility service function * 5 : Buffer 0 pointer
* Inputs: * 6 : (Size1<<14) | 0x802
* 1 : Unknown, but clearly used for something * 7 : Buffer 1 pointer
* 2 : Buffer 1 size (purpose is unknown) * Outputs:
* 3 : Buffer 2 size (purpose is unknown) * 0 : Return Header
* 5 : Buffer 1 address (purpose is unknown) * 1 : Result of function, 0 on success, otherwise error code
* 65 : Buffer 2 address (purpose is unknown) */
* Outputs: void StartApplication(Service::Interface* self);
* 1 : Result of function, 0 on success, otherwise error code
*/ /**
void AppletUtility(Service::Interface* self); * APT::AppletUtility service function
* Inputs:
/** * 1 : Unknown, but clearly used for something
* APT::SetAppCpuTimeLimit service function * 2 : Buffer 1 size (purpose is unknown)
* Inputs: * 3 : Buffer 2 size (purpose is unknown)
* 1 : Value, must be one * 5 : Buffer 1 address (purpose is unknown)
* 2 : Percentage of CPU time from 5 to 80 * 65 : Buffer 2 address (purpose is unknown)
* Outputs: * Outputs:
* 1 : Result of function, 0 on success, otherwise error code * 1 : Result of function, 0 on success, otherwise error code
*/ */
void SetAppCpuTimeLimit(Service::Interface* self); void AppletUtility(Service::Interface* self);
/** /**
* APT::GetAppCpuTimeLimit service function * APT::SetAppCpuTimeLimit service function
* Inputs: * Inputs:
* 1 : Value, must be one * 1 : Value, must be one
* Outputs: * 2 : Percentage of CPU time from 5 to 80
* 0 : Return header * Outputs:
* 1 : Result of function, 0 on success, otherwise error code * 1 : Result of function, 0 on success, otherwise error code
* 2 : System core CPU time percentage */
*/ void SetAppCpuTimeLimit(Service::Interface* self);
void GetAppCpuTimeLimit(Service::Interface* self);
/**
/** * APT::GetAppCpuTimeLimit service function
* APT::PrepareToStartLibraryApplet service function * Inputs:
* Inputs: * 1 : Value, must be one
* 0 : Command header [0x00180040] * Outputs:
* 1 : Id of the applet to start * 0 : Return header
* Outputs: * 1 : Result of function, 0 on success, otherwise error code
* 0 : Return header * 2 : System core CPU time percentage
* 1 : Result of function, 0 on success, otherwise error code */
*/ void GetAppCpuTimeLimit(Service::Interface* self);
void PrepareToStartLibraryApplet(Service::Interface* self);
/**
/** * APT::PrepareToStartLibraryApplet service function
* APT::PreloadLibraryApplet service function * Inputs:
* Inputs: * 0 : Command header [0x00180040]
* 0 : Command header [0x00160040] * 1 : Id of the applet to start
* 1 : Id of the applet to start * Outputs:
* Outputs: * 0 : Return header
* 0 : Return header * 1 : Result of function, 0 on success, otherwise error code
* 1 : Result of function, 0 on success, otherwise error code */
*/ void PrepareToStartLibraryApplet(Service::Interface* self);
void PreloadLibraryApplet(Service::Interface* self);
/**
/** * APT::PreloadLibraryApplet service function
* APT::StartLibraryApplet service function * Inputs:
* Inputs: * 0 : Command header [0x00160040]
* 0 : Command header [0x001E0084] * 1 : Id of the applet to start
* 1 : Id of the applet to start * Outputs:
* 2 : Buffer size * 0 : Return header
* 3 : Always 0? * 1 : Result of function, 0 on success, otherwise error code
* 4 : Handle passed to the applet */
* 5 : (Size << 14) | 2 void PreloadLibraryApplet(Service::Interface* self);
* 6 : Input buffer virtual address
* Outputs: /**
* 0 : Return header * APT::StartLibraryApplet service function
* 1 : Result of function, 0 on success, otherwise error code * Inputs:
*/ * 0 : Command header [0x001E0084]
void StartLibraryApplet(Service::Interface* self); * 1 : Id of the applet to start
* 2 : Buffer size
/// Initialize the APT service * 3 : Always 0?
void Init(); * 4 : Handle passed to the applet
* 5 : (Size << 14) | 2
/// Shutdown the APT service * 6 : Input buffer virtual address
void Shutdown(); * Outputs:
* 0 : Return header
} // namespace APT * 1 : Result of function, 0 on success, otherwise error code
} // namespace Service */
void StartLibraryApplet(Service::Interface* self);
/// Initialize the APT service
void Init();
/// Shutdown the APT service
void Shutdown();
} // namespace APT
} // namespace Service

View file

@ -1,38 +1,107 @@
// Copyright 2014 Citra Emulator Project // Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt.h"
#include "core/hle/service/apt/apt_a.h" #include "core/hle/service/apt/apt_a.h"
namespace Service { namespace Service {
namespace APT { namespace APT {
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, GetLockHandle, "GetLockHandle?"}, { 0x00010040, GetLockHandle, "GetLockHandle"},
{0x00020080, Initialize, "Initialize?"}, { 0x00020080, Initialize, "Initialize"},
{0x00030040, Enable, "Enable?"}, { 0x00030040, Enable, "Enable"},
{0x00040040, nullptr, "Finalize?"}, { 0x00040040, nullptr, "Finalize"},
{0x00050040, nullptr, "GetAppletManInfo?"}, { 0x00050040, nullptr, "GetAppletManInfo"},
{0x00060040, nullptr, "GetAppletInfo?"}, { 0x00060040, nullptr, "GetAppletInfo"},
{0x00090040, IsRegistered, "IsRegistered"}, { 0x00070000, nullptr, "GetLastSignaledAppletId"},
{0x000C0104, SendParameter, "SendParameter"}, { 0x00080000, nullptr, "CountRegisteredApplet"},
{0x000D0080, ReceiveParameter, "ReceiveParameter"}, { 0x00090040, IsRegistered, "IsRegistered"},
{0x000E0080, GlanceParameter, "GlanceParameter"}, { 0x000A0040, nullptr, "GetAttribute"},
{0x000F0100, CancelParameter, "CancelParameter"}, { 0x000B0040, InquireNotification, "InquireNotification"},
{0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, { 0x000C0104, SendParameter, "SendParameter"},
{0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, { 0x000D0080, ReceiveParameter, "ReceiveParameter"},
{0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, { 0x000E0080, GlanceParameter, "GlanceParameter"},
{0x003B0040, nullptr, "CancelLibraryApplet?"}, { 0x000F0100, CancelParameter, "CancelParameter"},
{0x00430040, NotifyToWait, "NotifyToWait?"}, { 0x001000C2, nullptr, "DebugFunc"},
{0x00440000, GetSharedFont, "GetSharedFont?"}, { 0x001100C0, nullptr, "MapProgramIdForDebug"},
{0x004B00C2, AppletUtility, "AppletUtility?"}, { 0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"},
{0x00550040, nullptr, "WriteInputToNsState?"}, { 0x00130000, nullptr, "GetPreparationState"},
}; { 0x00140040, nullptr, "SetPreparationState"},
{ 0x00150140, nullptr, "PrepareToStartApplication"},
APT_A_Interface::APT_A_Interface() { { 0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"},
Register(FunctionTable); { 0x00170040, nullptr, "FinishPreloadingLibraryApplet"},
} { 0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet" },
{ 0x00190040, nullptr, "PrepareToStartSystemApplet" },
} // namespace APT { 0x001A0000, nullptr, "PrepareToStartNewestHomeMenu" },
} // namespace Service { 0x001B00C4, nullptr, "StartApplication" },
{ 0x001C0000, nullptr, "WakeupApplication" },
{ 0x001D0000, nullptr, "CancelApplication" },
{ 0x001E0084, nullptr, "StartLibraryApplet" },
{ 0x001F0084, StartLibraryApplet, "StartSystemApplet" },
{ 0x00200044, nullptr, "StartNewestHomeMenu" },
{ 0x00210000, nullptr, "OrderToCloseApplication" },
{ 0x00220040, nullptr, "PrepareToCloseApplication" },
{ 0x00230040, nullptr, "PrepareToJumpToApplication" },
{ 0x00240044, nullptr, "JumpToApplication" },
{ 0x002500C0, nullptr, "PrepareToCloseLibraryApplet" },
{ 0x00260000, nullptr, "PrepareToCloseSystemApplet" },
{ 0x00270044, nullptr, "CloseApplication" },
{ 0x00280044, nullptr, "CloseLibraryApplet" },
{ 0x00290044, nullptr, "CloseSystemApplet" },
{ 0x002A0000, nullptr, "OrderToCloseSystemApplet" },
{ 0x002B0000, nullptr, "PrepareToJumpToHomeMenu" },
{ 0x002C0044, nullptr, "JumpToHomeMenu" },
{ 0x002D0000, nullptr, "PrepareToLeaveHomeMenu" },
{ 0x002E0044, nullptr, "LeaveHomeMenu" },
{ 0x002F0040, nullptr, "PrepareToLeaveResidentApplet" },
{ 0x00300044, nullptr, "LeaveResidentApplet" },
{ 0x00310100, nullptr, "PrepareToDoApplicationJump" },
{ 0x00320084, nullptr, "DoApplicationJump" },
{ 0x00330000, nullptr, "GetProgramIdOnApplicationJump" },
{ 0x00340084, nullptr, "SendDeliverArg" },
{ 0x00350080, nullptr, "ReceiveDeliverArg" },
{ 0x00360040, nullptr, "LoadSysMenuArg" },
{ 0x00370042, nullptr, "StoreSysMenuArg" },
{ 0x00380040, nullptr, "PreloadResidentApplet" },
{ 0x00390040, nullptr, "PrepareToStartResidentApplet" },
{ 0x003A0044, nullptr, "StartResidentApplet" },
{ 0x003B0040, nullptr, "CancelLibraryApplet" },
{ 0x003C0042, nullptr, "SendDspSleep" },
{ 0x003D0042, nullptr, "SendDspWakeUp" },
{ 0x003E0080, nullptr, "ReplySleepQuery" },
{ 0x003F0040, nullptr, "ReplySleepNotificationComplete" },
{ 0x00400042, nullptr, "SendCaptureBufferInfo" },
{ 0x00410040, nullptr, "ReceiveCaptureBufferInfo" },
{ 0x00420080, nullptr, "SleepSystem" },
{ 0x00430040, NotifyToWait, "NotifyToWait" },
{ 0x00440000, GetSharedFont, "GetSharedFont" },
{ 0x00450040, nullptr, "GetWirelessRebootInfo" },
{ 0x00460104, nullptr, "Wrap" },
{ 0x00470104, nullptr, "Unwrap" },
{ 0x00480100, nullptr, "GetProgramInfo" },
{ 0x00490180, nullptr, "Reboot" },
{ 0x004A0040, nullptr, "GetCaptureInfo" },
{ 0x004B00C2, AppletUtility, "AppletUtility" },
{ 0x004C0000, nullptr, "SetFatalErrDispMode" },
{ 0x004D0080, nullptr, "GetAppletProgramInfo" },
{ 0x004E0000, nullptr, "HardwareResetAsync" },
{ 0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit" },
{ 0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit" },
{ 0x00510080, nullptr, "GetStartupArgument" },
{ 0x00520104, nullptr, "Wrap1" },
{ 0x00530104, nullptr, "Unwrap1" },
{ 0x00580002, nullptr, "GetProgramID" },
{ 0x01010000, nullptr, "CheckNew3DSApp" },
{ 0x01020000, nullptr, "CheckNew3DS" },
{ 0x01040000, nullptr, "IsStandardMemoryLayout"},
{ 0x01050100, nullptr, "IsTitleAllowed"}
};
APT_A_Interface::APT_A_Interface() {
Register(FunctionTable);
}
} // namespace APT
} // namespace Service

View file

@ -1,105 +1,107 @@
// Copyright 2015 Citra Emulator Project // Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt.h"
#include "core/hle/service/apt/apt_s.h" #include "core/hle/service/apt/apt_s.h"
namespace Service { namespace Service {
namespace APT { namespace APT {
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, GetLockHandle, "GetLockHandle"}, {0x00010040, GetLockHandle, "GetLockHandle"},
{0x00020080, Initialize, "Initialize"}, {0x00020080, Initialize, "Initialize"},
{0x00030040, Enable, "Enable"}, {0x00030040, Enable, "Enable"},
{0x00040040, nullptr, "Finalize"}, {0x00040040, nullptr, "Finalize"},
{0x00050040, nullptr, "GetAppletManInfo"}, {0x00050040, nullptr, "GetAppletManInfo"},
{0x00060040, nullptr, "GetAppletInfo"}, {0x00060040, nullptr, "GetAppletInfo"},
{0x00070000, nullptr, "GetLastSignaledAppletId"}, {0x00070000, nullptr, "GetLastSignaledAppletId"},
{0x00080000, nullptr, "CountRegisteredApplet"}, {0x00080000, nullptr, "CountRegisteredApplet"},
{0x00090040, nullptr, "IsRegistered"}, {0x00090040, nullptr, "IsRegistered"},
{0x000A0040, nullptr, "GetAttribute"}, {0x000A0040, nullptr, "GetAttribute"},
{0x000B0040, InquireNotification, "InquireNotification"}, {0x000B0040, InquireNotification, "InquireNotification"},
{0x000C0104, nullptr, "SendParameter"}, {0x000C0104, nullptr, "SendParameter"},
{0x000D0080, ReceiveParameter, "ReceiveParameter"}, {0x000D0080, ReceiveParameter, "ReceiveParameter"},
{0x000E0080, GlanceParameter, "GlanceParameter"}, {0x000E0080, GlanceParameter, "GlanceParameter"},
{0x000F0100, nullptr, "CancelParameter"}, {0x000F0100, nullptr, "CancelParameter"},
{0x001000C2, nullptr, "DebugFunc"}, {0x001000C2, nullptr, "DebugFunc"},
{0x001100C0, nullptr, "MapProgramIdForDebug"}, {0x001100C0, nullptr, "MapProgramIdForDebug"},
{0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"},
{0x00130000, nullptr, "GetPreparationState"}, {0x00130000, nullptr, "GetPreparationState"},
{0x00140040, nullptr, "SetPreparationState"}, {0x00140040, nullptr, "SetPreparationState"},
{0x00150140, nullptr, "PrepareToStartApplication"}, {0x00150140, nullptr, "PrepareToStartApplication"},
{0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"},
{0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, {0x00170040, nullptr, "FinishPreloadingLibraryApplet"},
{0x00180040, PrepareToStartLibraryApplet,"PrepareToStartLibraryApplet"}, {0x00180040, PrepareToStartLibraryApplet,"PrepareToStartLibraryApplet"},
{0x00190040, nullptr, "PrepareToStartSystemApplet"}, {0x00190040, nullptr, "PrepareToStartSystemApplet"},
{0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"},
{0x001B00C4, nullptr, "StartApplication"}, {0x001B00C4, nullptr, "StartApplication"},
{0x001C0000, nullptr, "WakeupApplication"}, {0x001C0000, nullptr, "WakeupApplication"},
{0x001D0000, nullptr, "CancelApplication"}, {0x001D0000, nullptr, "CancelApplication"},
{0x001E0084, nullptr, "StartLibraryApplet"}, {0x001E0084, nullptr, "StartLibraryApplet"},
{0x001F0084, nullptr, "StartSystemApplet"}, {0x001F0084, StartLibraryApplet, "StartSystemApplet"},
{0x00200044, nullptr, "StartNewestHomeMenu"}, {0x00200044, nullptr, "StartNewestHomeMenu"},
{0x00210000, nullptr, "OrderToCloseApplication"}, {0x00210000, nullptr, "OrderToCloseApplication"},
{0x00220040, nullptr, "PrepareToCloseApplication"}, {0x00220040, nullptr, "PrepareToCloseApplication"},
{0x00230040, nullptr, "PrepareToJumpToApplication"}, {0x00230040, nullptr, "PrepareToJumpToApplication"},
{0x00240044, nullptr, "JumpToApplication"}, {0x00240044, nullptr, "JumpToApplication"},
{0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"},
{0x00260000, nullptr, "PrepareToCloseSystemApplet"}, {0x00260000, nullptr, "PrepareToCloseSystemApplet"},
{0x00270044, nullptr, "CloseApplication"}, {0x00270044, nullptr, "CloseApplication"},
{0x00280044, nullptr, "CloseLibraryApplet"}, {0x00280044, nullptr, "CloseLibraryApplet"},
{0x00290044, nullptr, "CloseSystemApplet"}, {0x00290044, nullptr, "CloseSystemApplet"},
{0x002A0000, nullptr, "OrderToCloseSystemApplet"}, {0x002A0000, nullptr, "OrderToCloseSystemApplet"},
{0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"},
{0x002C0044, nullptr, "JumpToHomeMenu"}, {0x002C0044, nullptr, "JumpToHomeMenu"},
{0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"},
{0x002E0044, nullptr, "LeaveHomeMenu"}, {0x002E0044, nullptr, "LeaveHomeMenu"},
{0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"},
{0x00300044, nullptr, "LeaveResidentApplet"}, {0x00300044, nullptr, "LeaveResidentApplet"},
{0x00310100, nullptr, "PrepareToDoApplicationJump"}, {0x00310100, nullptr, "PrepareToDoApplicationJump"},
{0x00320084, nullptr, "DoApplicationJump"}, {0x00320084, nullptr, "DoApplicationJump"},
{0x00330000, nullptr, "GetProgramIdOnApplicationJump"}, {0x00330000, nullptr, "GetProgramIdOnApplicationJump"},
{0x00340084, nullptr, "SendDeliverArg"}, {0x00340084, nullptr, "SendDeliverArg"},
{0x00350080, nullptr, "ReceiveDeliverArg"}, {0x00350080, nullptr, "ReceiveDeliverArg"},
{0x00360040, nullptr, "LoadSysMenuArg"}, {0x00360040, nullptr, "LoadSysMenuArg"},
{0x00370042, nullptr, "StoreSysMenuArg"}, {0x00370042, nullptr, "StoreSysMenuArg"},
{0x00380040, nullptr, "PreloadResidentApplet"}, {0x00380040, nullptr, "PreloadResidentApplet"},
{0x00390040, nullptr, "PrepareToStartResidentApplet"}, {0x00390040, nullptr, "PrepareToStartResidentApplet"},
{0x003A0044, nullptr, "StartResidentApplet"}, {0x003A0044, nullptr, "StartResidentApplet"},
{0x003B0040, nullptr, "CancelLibraryApplet"}, {0x003B0040, nullptr, "CancelLibraryApplet"},
{0x003C0042, nullptr, "SendDspSleep"}, {0x003C0042, nullptr, "SendDspSleep"},
{0x003D0042, nullptr, "SendDspWakeUp"}, {0x003D0042, nullptr, "SendDspWakeUp"},
{0x003E0080, nullptr, "ReplySleepQuery"}, {0x003E0080, nullptr, "ReplySleepQuery"},
{0x003F0040, nullptr, "ReplySleepNotificationComplete"}, {0x003F0040, nullptr, "ReplySleepNotificationComplete"},
{0x00400042, nullptr, "SendCaptureBufferInfo"}, {0x00400042, nullptr, "SendCaptureBufferInfo"},
{0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, {0x00410040, nullptr, "ReceiveCaptureBufferInfo"},
{0x00420080, nullptr, "SleepSystem"}, {0x00420080, nullptr, "SleepSystem"},
{0x00430040, NotifyToWait, "NotifyToWait"}, {0x00430040, NotifyToWait, "NotifyToWait"},
{0x00440000, GetSharedFont, "GetSharedFont"}, {0x00440000, GetSharedFont, "GetSharedFont"},
{0x00450040, nullptr, "GetWirelessRebootInfo"}, {0x00450040, nullptr, "GetWirelessRebootInfo"},
{0x00460104, nullptr, "Wrap"}, {0x00460104, nullptr, "Wrap"},
{0x00470104, nullptr, "Unwrap"}, {0x00470104, nullptr, "Unwrap"},
{0x00480100, nullptr, "GetProgramInfo"}, {0x00480100, nullptr, "GetProgramInfo"},
{0x00490180, nullptr, "Reboot"}, {0x00490180, nullptr, "Reboot"},
{0x004A0040, nullptr, "GetCaptureInfo"}, {0x004A0040, nullptr, "GetCaptureInfo"},
{0x004B00C2, AppletUtility, "AppletUtility"}, {0x004B00C2, AppletUtility, "AppletUtility"},
{0x004C0000, nullptr, "SetFatalErrDispMode"}, {0x004C0000, nullptr, "SetFatalErrDispMode"},
{0x004D0080, nullptr, "GetAppletProgramInfo"}, {0x004D0080, nullptr, "GetAppletProgramInfo"},
{0x004E0000, nullptr, "HardwareResetAsync"}, {0x004E0000, nullptr, "HardwareResetAsync"},
{0x004F0080, nullptr, "SetApplicationCpuTimeLimit"}, {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit" },
{0x00500040, nullptr, "GetApplicationCpuTimeLimit"}, {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit" },
{0x00510080, nullptr, "GetStartupArgument"}, {0x00510080, nullptr, "GetStartupArgument"},
{0x00520104, nullptr, "Wrap1"}, {0x00520104, nullptr, "Wrap1"},
{0x00530104, nullptr, "Unwrap1"}, {0x00530104, nullptr, "Unwrap1"},
{0x00580002, nullptr, "GetProgramID"}, {0x00580002, nullptr, "GetProgramID"},
{0x01010000, nullptr, "CheckNew3DSApp"}, {0x01010000, nullptr, "CheckNew3DSApp"},
{0x01020000, nullptr, "CheckNew3DS"} {0x01020000, nullptr, "CheckNew3DS"},
}; {0x01040000, nullptr, "IsStandardMemoryLayout" },
{0x01050100, nullptr, "IsTitleAllowed" }
APT_S_Interface::APT_S_Interface() { };
Register(FunctionTable);
} APT_S_Interface::APT_S_Interface() {
Register(FunctionTable);
} // namespace APT }
} // namespace Service
} // namespace APT
} // namespace Service

View file

@ -1,105 +1,107 @@
// Copyright 2014 Citra Emulator Project // Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt.h"
#include "core/hle/service/apt/apt_u.h" #include "core/hle/service/apt/apt_u.h"
namespace Service { namespace Service {
namespace APT { namespace APT {
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, GetLockHandle, "GetLockHandle"}, {0x00010040, GetLockHandle, "GetLockHandle"},
{0x00020080, Initialize, "Initialize"}, {0x00020080, Initialize, "Initialize"},
{0x00030040, Enable, "Enable"}, {0x00030040, Enable, "Enable"},
{0x00040040, nullptr, "Finalize"}, {0x00040040, nullptr, "Finalize"},
{0x00050040, GetAppletManInfo, "GetAppletManInfo"}, {0x00050040, GetAppletManInfo, "GetAppletManInfo"},
{0x00060040, nullptr, "GetAppletInfo"}, {0x00060040, nullptr, "GetAppletInfo"},
{0x00070000, nullptr, "GetLastSignaledAppletId"}, {0x00070000, nullptr, "GetLastSignaledAppletId"},
{0x00080000, nullptr, "CountRegisteredApplet"}, {0x00080000, nullptr, "CountRegisteredApplet"},
{0x00090040, IsRegistered, "IsRegistered"}, {0x00090040, IsRegistered, "IsRegistered"},
{0x000A0040, nullptr, "GetAttribute"}, {0x000A0040, nullptr, "GetAttribute"},
{0x000B0040, InquireNotification, "InquireNotification"}, {0x000B0040, InquireNotification, "InquireNotification"},
{0x000C0104, SendParameter, "SendParameter"}, {0x000C0104, SendParameter, "SendParameter"},
{0x000D0080, ReceiveParameter, "ReceiveParameter"}, {0x000D0080, ReceiveParameter, "ReceiveParameter"},
{0x000E0080, GlanceParameter, "GlanceParameter"}, {0x000E0080, GlanceParameter, "GlanceParameter"},
{0x000F0100, CancelParameter, "CancelParameter"}, {0x000F0100, CancelParameter, "CancelParameter"},
{0x001000C2, nullptr, "DebugFunc"}, {0x001000C2, nullptr, "DebugFunc"},
{0x001100C0, nullptr, "MapProgramIdForDebug"}, {0x001100C0, nullptr, "MapProgramIdForDebug"},
{0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"},
{0x00130000, nullptr, "GetPreparationState"}, {0x00130000, nullptr, "GetPreparationState"},
{0x00140040, nullptr, "SetPreparationState"}, {0x00140040, nullptr, "SetPreparationState"},
{0x00150140, nullptr, "PrepareToStartApplication"}, {0x00150140, nullptr, "PrepareToStartApplication"},
{0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"},
{0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, {0x00170040, nullptr, "FinishPreloadingLibraryApplet"},
{0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"},
{0x00190040, nullptr, "PrepareToStartSystemApplet"}, {0x00190040, nullptr, "PrepareToStartSystemApplet"},
{0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"},
{0x001B00C4, nullptr, "StartApplication"}, {0x001B00C4, nullptr, "StartApplication"},
{0x001C0000, nullptr, "WakeupApplication"}, {0x001C0000, nullptr, "WakeupApplication"},
{0x001D0000, nullptr, "CancelApplication"}, {0x001D0000, nullptr, "CancelApplication"},
{0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, {0x001E0084, StartLibraryApplet, "StartLibraryApplet"},
{0x001F0084, nullptr, "StartSystemApplet"}, {0x001F0084, nullptr, "StartSystemApplet"},
{0x00200044, nullptr, "StartNewestHomeMenu"}, {0x00200044, nullptr, "StartNewestHomeMenu"},
{0x00210000, nullptr, "OrderToCloseApplication"}, {0x00210000, nullptr, "OrderToCloseApplication"},
{0x00220040, nullptr, "PrepareToCloseApplication"}, {0x00220040, nullptr, "PrepareToCloseApplication"},
{0x00230040, nullptr, "PrepareToJumpToApplication"}, {0x00230040, nullptr, "PrepareToJumpToApplication"},
{0x00240044, nullptr, "JumpToApplication"}, {0x00240044, nullptr, "JumpToApplication"},
{0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"},
{0x00260000, nullptr, "PrepareToCloseSystemApplet"}, {0x00260000, nullptr, "PrepareToCloseSystemApplet"},
{0x00270044, nullptr, "CloseApplication"}, {0x00270044, nullptr, "CloseApplication"},
{0x00280044, nullptr, "CloseLibraryApplet"}, {0x00280044, nullptr, "CloseLibraryApplet"},
{0x00290044, nullptr, "CloseSystemApplet"}, {0x00290044, nullptr, "CloseSystemApplet"},
{0x002A0000, nullptr, "OrderToCloseSystemApplet"}, {0x002A0000, nullptr, "OrderToCloseSystemApplet"},
{0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"},
{0x002C0044, nullptr, "JumpToHomeMenu"}, {0x002C0044, nullptr, "JumpToHomeMenu"},
{0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"},
{0x002E0044, nullptr, "LeaveHomeMenu"}, {0x002E0044, nullptr, "LeaveHomeMenu"},
{0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"},
{0x00300044, nullptr, "LeaveResidentApplet"}, {0x00300044, nullptr, "LeaveResidentApplet"},
{0x00310100, nullptr, "PrepareToDoApplicationJump"}, {0x00310100, nullptr, "PrepareToDoApplicationJump"},
{0x00320084, nullptr, "DoApplicationJump"}, {0x00320084, nullptr, "DoApplicationJump"},
{0x00330000, nullptr, "GetProgramIdOnApplicationJump"}, {0x00330000, nullptr, "GetProgramIdOnApplicationJump"},
{0x00340084, nullptr, "SendDeliverArg"}, {0x00340084, nullptr, "SendDeliverArg"},
{0x00350080, nullptr, "ReceiveDeliverArg"}, {0x00350080, nullptr, "ReceiveDeliverArg"},
{0x00360040, nullptr, "LoadSysMenuArg"}, {0x00360040, nullptr, "LoadSysMenuArg"},
{0x00370042, nullptr, "StoreSysMenuArg"}, {0x00370042, nullptr, "StoreSysMenuArg"},
{0x00380040, nullptr, "PreloadResidentApplet"}, {0x00380040, nullptr, "PreloadResidentApplet"},
{0x00390040, nullptr, "PrepareToStartResidentApplet"}, {0x00390040, nullptr, "PrepareToStartResidentApplet"},
{0x003A0044, nullptr, "StartResidentApplet"}, {0x003A0044, nullptr, "StartResidentApplet"},
{0x003B0040, nullptr, "CancelLibraryApplet"}, {0x003B0040, nullptr, "CancelLibraryApplet"},
{0x003C0042, nullptr, "SendDspSleep"}, {0x003C0042, nullptr, "SendDspSleep"},
{0x003D0042, nullptr, "SendDspWakeUp"}, {0x003D0042, nullptr, "SendDspWakeUp"},
{0x003E0080, nullptr, "ReplySleepQuery"}, {0x003E0080, nullptr, "ReplySleepQuery"},
{0x003F0040, nullptr, "ReplySleepNotificationComplete"}, {0x003F0040, nullptr, "ReplySleepNotificationComplete"},
{0x00400042, nullptr, "SendCaptureBufferInfo"}, {0x00400042, nullptr, "SendCaptureBufferInfo"},
{0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, {0x00410040, nullptr, "ReceiveCaptureBufferInfo"},
{0x00420080, nullptr, "SleepSystem"}, {0x00420080, nullptr, "SleepSystem"},
{0x00430040, NotifyToWait, "NotifyToWait"}, {0x00430040, NotifyToWait, "NotifyToWait"},
{0x00440000, GetSharedFont, "GetSharedFont"}, {0x00440000, GetSharedFont, "GetSharedFont"},
{0x00450040, nullptr, "GetWirelessRebootInfo"}, {0x00450040, nullptr, "GetWirelessRebootInfo"},
{0x00460104, nullptr, "Wrap"}, {0x00460104, nullptr, "Wrap"},
{0x00470104, nullptr, "Unwrap"}, {0x00470104, nullptr, "Unwrap"},
{0x00480100, nullptr, "GetProgramInfo"}, {0x00480100, nullptr, "GetProgramInfo"},
{0x00490180, nullptr, "Reboot"}, {0x00490180, nullptr, "Reboot"},
{0x004A0040, nullptr, "GetCaptureInfo"}, {0x004A0040, nullptr, "GetCaptureInfo"},
{0x004B00C2, AppletUtility, "AppletUtility"}, {0x004B00C2, AppletUtility, "AppletUtility"},
{0x004C0000, nullptr, "SetFatalErrDispMode"}, {0x004C0000, nullptr, "SetFatalErrDispMode"},
{0x004D0080, nullptr, "GetAppletProgramInfo"}, {0x004D0080, nullptr, "GetAppletProgramInfo"},
{0x004E0000, nullptr, "HardwareResetAsync"}, {0x004E0000, nullptr, "HardwareResetAsync"},
{0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"},
{0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"},
{0x00510080, nullptr, "GetStartupArgument"}, {0x00510080, nullptr, "GetStartupArgument"},
{0x00520104, nullptr, "Wrap1"}, {0x00520104, nullptr, "Wrap1"},
{0x00530104, nullptr, "Unwrap1"}, {0x00530104, nullptr, "Unwrap1"},
{0x00580002, nullptr, "GetProgramID"}, {0x00580002, nullptr, "GetProgramID"},
{0x01010000, nullptr, "CheckNew3DSApp"}, {0x01010000, nullptr, "CheckNew3DSApp"},
{0x01020000, nullptr, "CheckNew3DS"} {0x01020000, nullptr, "CheckNew3DS"},
}; {0x01040000, nullptr, "IsStandardMemoryLayout" },
{0x01050100, nullptr, "IsTitleAllowed" }
APT_U_Interface::APT_U_Interface() { };
Register(FunctionTable);
} APT_U_Interface::APT_U_Interface() {
Register(FunctionTable);
} // namespace APT }
} // namespace Service
} // namespace APT
} // namespace Service

View file

@ -1,38 +1,54 @@
// Copyright 2014 Citra Emulator Project // Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/mic_u.h" #include "core/hle/service/mic_u.h"
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace MIC_U // Namespace MIC_U
namespace MIC_U { namespace MIC_U {
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010042, nullptr, "MapSharedMem"}, {0x00010042, nullptr, "MapSharedMem"},
{0x00020000, nullptr, "UnmapSharedMem"}, {0x00020000, nullptr, "UnmapSharedMem"},
{0x00030140, nullptr, "Initialize"}, {0x00030140, nullptr, "Initialize"},
{0x00040040, nullptr, "AdjustSampling"}, {0x00040040, nullptr, "AdjustSampling"},
{0x00050000, nullptr, "StopSampling"}, {0x00050000, nullptr, "StopSampling"},
{0x00060000, nullptr, "IsSampling"}, {0x00060000, nullptr, "IsSampling"},
{0x00070000, nullptr, "GetEventHandle"}, {0x00070000, nullptr, "GetEventHandle"},
{0x00080040, nullptr, "SetGain"}, {0x00080040, nullptr, "SetGain"},
{0x00090000, nullptr, "GetGain"}, {0x00090000, nullptr, "GetGain"},
{0x000A0040, nullptr, "SetPower"}, {0x000A0040, nullptr, "SetPower"},
{0x000B0000, nullptr, "GetPower"}, {0x000B0000, nullptr, "GetPower"},
{0x000C0042, nullptr, "size"}, {0x000C0042, nullptr, "size"},
{0x000D0040, nullptr, "SetClamp"}, {0x000D0040, nullptr, "SetClamp"},
{0x000E0000, nullptr, "GetClamp"}, {0x000E0000, nullptr, "GetClamp"},
{0x000F0040, nullptr, "SetAllowShellClosed"}, {0x000F0040, nullptr, "SetAllowShellClosed"},
{0x00100040, nullptr, "unknown_input2"}, {0x00100040, nullptr, "unknown_input2"},
}; };
//////////////////////////////////////////////////////////////////////////////////////////////////// enum Encoding
// Interface class {
ENCODING_PCM8=0,
Interface::Interface() { ENCODING_PCM16,
Register(FunctionTable); ENCODING_PCM8_SIGNED,
} ENCODING_PCM16_SIGNED
};
} // namespace
enum SampleRate
{
SAMPLE_RATE_32730=0,
SAMPLE_RATE_16360,
SAMPLE_RATE_10910,
SAMPLE_RATE_8180
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::Interface() {
Register(FunctionTable);
}
} // namespace

View file

@ -1,45 +1,95 @@
// Copyright 2014 Citra Emulator Project // Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/ndm_u.h" #include "core/hle/service/ndm_u.h"
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace NDM_U // Namespace NDM_U
namespace NDM_U { namespace NDM_U {
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010042, nullptr, "EnterExclusiveState"}, {0x00010042, nullptr, "EnterExclusiveState"},
{0x00020002, nullptr, "LeaveExclusiveState"}, {0x00020002, nullptr, "LeaveExclusiveState"},
{0x00030000, nullptr, "QueryExclusiveMode"}, {0x00030000, nullptr, "QueryExclusiveMode"},
{0x00040002, nullptr, "LockState"}, {0x00040002, nullptr, "LockState"},
{0x00050002, nullptr, "UnlockState"}, {0x00050002, nullptr, "UnlockState"},
{0x00060040, nullptr, "SuspendDaemons"}, {0x00060040, nullptr, "SuspendDaemons"},
{0x00070040, nullptr, "ResumeDaemons"}, {0x00070040, nullptr, "ResumeDaemons"},
{0x00080040, nullptr, "DisableWifiUsage"}, {0x00080040, nullptr, "DisableWifiUsage"},
{0x00090000, nullptr, "EnableWifiUsage"}, {0x00090000, nullptr, "EnableWifiUsage"},
{0x000A0000, nullptr, "GetCurrentState"}, {0x000A0000, nullptr, "GetCurrentState"},
{0x000B0000, nullptr, "GetTargetState"}, {0x000B0000, nullptr, "GetTargetState"},
{0x000C0000, nullptr, "<Stubbed>"}, {0x000C0000, nullptr, "<Stubbed>"},
{0x000D0040, nullptr, "QueryStatus"}, {0x000D0040, nullptr, "QueryStatus"},
{0x000E0040, nullptr, "GetDaemonDisableCount"}, {0x000E0040, nullptr, "GetDaemonDisableCount"},
{0x000F0000, nullptr, "GetSchedulerDisableCount"}, {0x000F0000, nullptr, "GetSchedulerDisableCount"},
{0x00100040, nullptr, "SetScanInterval"}, {0x00100040, nullptr, "SetScanInterval"},
{0x00110000, nullptr, "GetScanInterval"}, {0x00110000, nullptr, "GetScanInterval"},
{0x00120040, nullptr, "SetRetryInterval"}, {0x00120040, nullptr, "SetRetryInterval"},
{0x00130000, nullptr, "GetRetryInterval"}, {0x00130000, nullptr, "GetRetryInterval"},
{0x00140040, nullptr, "OverrideDefaultDaemons"}, {0x00140040, nullptr, "OverrideDefaultDaemons"},
{0x00150000, nullptr, "ResetDefaultDaemons"}, {0x00150000, nullptr, "ResetDefaultDaemons"},
{0x00160000, nullptr, "GetDefaultDaemons"}, {0x00160000, nullptr, "GetDefaultDaemons"},
{0x00170000, nullptr, "ClearHalfAwakeMacFilter"}, {0x00170000, nullptr, "ClearHalfAwakeMacFilter"},
}; };
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class enum ExclusiveState
{
Interface::Interface() { EXCLUSIVE_STATE_NONE=0,
Register(FunctionTable); EXCLUSIVE_STATE_INFRASTRUCTURE,
} EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS,
EXCLUSIVE_STATE_STREETPASS,
} // namespace EXCLUSIVE_STATE_STREETPASS_DATA
};
enum Daemon
{
DAEMON_CEC=0,
DAEMON_BOSS,
DAEMON_NIM,
DAEMON_FRIENDS
};
enum DaemonMask
{
DAEMON_MASK_CEC = (1 << DAEMON_CEC),
DAEMON_MASK_BOSS = (1 << DAEMON_BOSS),
DAEMON_MASK_NIM = (1 << DAEMON_NIM),
DAEMON_MASK_FRIENDS = (1 << DAEMON_FRIENDS)
};
enum DaemonStatus
{
DAEMON_STATUS_BUSY=0,
DAEMON_STATUS_IDLE,
DAEMON_STATUS_SUSPENDING,
DAEMON_STATUS_SUSPENDED
};
enum State
{
STATE_INITIAL=0,
STATE_SUSPENDED,
STATE_INFRASTRUCTURE_CONNECTING,
STATE_INFRASTRUCTURE_CONNECTED,
STATE_INFRASTRUCTURE_WORKING,
STATE_INFRASTRUCTURE_SUSPENDING,
STATE_INFRASTRUCTURE_FORCE_SUSPENDING,
STATE_INFRASTRUCTURE_DISCONNECTING,
STATE_INFRASTRUCTURE_FORCE_DISCONNECTING,
STATE_CEC_WORKING,
STATE_CEC_FORCE_SUSPENDING,
STATE_CEC_SUSPENDING
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::Interface() {
Register(FunctionTable);
}
} // namespace

View file

@ -0,0 +1,25 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/service/pm_dbg.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace PM_APP
namespace PM_DBG {
const Interface::FunctionInfo FunctionTable[] = {
{0x00010140,nullptr, "LaunchAppDebug"},
{0x00020140,nullptr, "LaunchApp"},
{0x00030000,nullptr, "RunQueuedProcess"}
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::Interface() {
Register(FunctionTable);
}
} // namespace

View file

@ -0,0 +1,23 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace PM_DBG
namespace PM_DBG {
class Interface : public Service::Interface {
public:
Interface();
std::string GetPortName() const override {
return "pm:dbg";
}
};
} // namespace

View file

@ -1,75 +1,80 @@
// Copyright 2014 Citra Emulator Project // Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/hle/service/srv.h" #include "core/hle/service/srv.h"
#include "core/hle/kernel/event.h" #include "core/hle/kernel/event.h"
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace SRV // Namespace SRV
namespace SRV { namespace SRV {
static Kernel::SharedPtr<Kernel::Event> event_handle; static Kernel::SharedPtr<Kernel::Event> event_handle;
static void Initialize(Service::Interface* self) { static void Initialize(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = 0; // No error cmd_buff[1] = 0; // No error
} }
static void GetProcSemaphore(Service::Interface* self) { static void EnableNotification(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
// TODO(bunnei): Change to a semaphore once these have been implemented // TODO(bunnei): Change to a semaphore once these have been implemented
event_handle = Kernel::Event::Create(RESETTYPE_ONESHOT, "SRV:Event"); event_handle = Kernel::Event::Create(RESETTYPE_ONESHOT, "SRV:Event");
event_handle->Clear(); event_handle->Clear();
cmd_buff[1] = 0; // No error cmd_buff[1] = 0; // No error
cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom(); cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom();
} }
static void GetServiceHandle(Service::Interface* self) { static void GetServiceHandle(Service::Interface* self) {
ResultCode res = RESULT_SUCCESS; ResultCode res = RESULT_SUCCESS;
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize);
auto it = Service::g_srv_services.find(port_name); auto it = Service::g_srv_services.find(port_name);
if (it != Service::g_srv_services.end()) { if (it != Service::g_srv_services.end()) {
cmd_buff[3] = Kernel::g_handle_table.Create(it->second).MoveFrom(); cmd_buff[3] = Kernel::g_handle_table.Create(it->second).MoveFrom();
LOG_TRACE(Service_SRV, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]); LOG_TRACE(Service_SRV, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]);
} else { } else {
LOG_ERROR(Service_SRV, "(UNIMPLEMENTED) called port=%s", port_name.c_str()); LOG_ERROR(Service_SRV, "(UNIMPLEMENTED) called port=%s", port_name.c_str());
res = UnimplementedFunction(ErrorModule::SRV); res = UnimplementedFunction(ErrorModule::SRV);
} }
cmd_buff[1] = res.raw; cmd_buff[1] = res.raw;
} }
const Interface::FunctionInfo FunctionTable[] = { const Interface::FunctionInfo FunctionTable[] = {
{0x00010002, Initialize, "Initialize"}, {0x00010002, Initialize, "Initialize"},
{0x00020000, GetProcSemaphore, "GetProcSemaphore"}, {0x00020000, EnableNotification, "EnableNotification"},
{0x00030100, nullptr, "RegisterService"}, {0x00030100, nullptr, "RegisterService"},
{0x000400C0, nullptr, "UnregisterService"}, {0x000400C0, nullptr, "UnregisterService"},
{0x00050100, GetServiceHandle, "GetServiceHandle"}, {0x00050100, GetServiceHandle, "GetServiceHandle"},
{0x000600C2, nullptr, "RegisterHandle"}, {0x000600C2, nullptr, "RegisterHandle"},
{0x00090040, nullptr, "Subscribe"}, {0x000700C0, nullptr, "UnregisterPort"},
{0x000B0000, nullptr, "ReceiveNotification"}, {0x00080100, nullptr, "GetPort"},
{0x000C0080, nullptr, "PublishToSubscriber"}, {0x00090040, nullptr, "Subscribe"},
}; {0x000A0040, nullptr, "Unsubscribe"},
{0x000B0000, nullptr, "ReceiveNotification"},
//////////////////////////////////////////////////////////////////////////////////////////////////// {0x000C0080, nullptr, "PublishToSubscriber"},
// Interface class {0x000D0040, nullptr, "PublishAndGetSubscriber"},
{0x000E00C0, nullptr, "IsServiceRegistered"}
Interface::Interface() { };
Register(FunctionTable);
} ////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::~Interface() {
event_handle = nullptr; Interface::Interface() {
} Register(FunctionTable);
}
} // namespace
Interface::~Interface() {
event_handle = nullptr;
}
} // namespace

View file

@ -20,6 +20,12 @@ struct PageInfo {
u32 flags; u32 flags;
}; };
enum PageFlags
{
LOCKED=0,
CHANGED
};
enum ResetType { enum ResetType {
RESETTYPE_ONESHOT, RESETTYPE_ONESHOT,
RESETTYPE_STICKY, RESETTYPE_STICKY,