diff options
Diffstat (limited to 'src/core/hle/service/apt')
-rw-r--r-- | src/core/hle/service/apt/apt.cpp | 11 | ||||
-rw-r--r-- | src/core/hle/service/apt/apt.h | 34 | ||||
-rw-r--r-- | src/core/hle/service/apt/apt_a.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/apt/apt_u.cpp | 2 |
4 files changed, 40 insertions, 9 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index c4bd65986..31e5e07b2 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -396,6 +396,15 @@ void StartLibraryApplet(Service::Interface* self) { cmd_buff[1] = applet->Start(parameter).raw; } +void CancelLibraryApplet(Service::Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + u32 exiting = cmd_buff[1] & 0xFF; + + cmd_buff[1] = 1; // TODO: Find the return code meaning + + LOG_WARNING(Service_APT, "(STUBBED) called exiting=%u", exiting); +} + void SetScreenCapPostPermission(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); @@ -523,7 +532,7 @@ void Init() { notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); parameter_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Start"); - next_parameter.signal = static_cast<u32>(SignalType::AppJustStarted); + next_parameter.signal = static_cast<u32>(SignalType::Wakeup); next_parameter.destination_id = 0x300; } diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index a118cda1f..44dbd8757 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -46,12 +46,23 @@ static_assert(sizeof(CaptureBufferInfo) == 0x20, "CaptureBufferInfo struct has i /// Signals used by APT functions enum class SignalType : u32 { None = 0x0, - AppJustStarted = 0x1, - LibAppJustStarted = 0x2, - LibAppFinished = 0x3, - LibAppClosed = 0xA, - ReturningToApp = 0xB, - ExitingApp = 0xC, + Wakeup = 0x1, + Request = 0x2, + Response = 0x3, + Exit = 0x4, + Message = 0x5, + HomeButtonSingle = 0x6, + HomeButtonDouble = 0x7, + DspSleep = 0x8, + DspWakeup = 0x9, + WakeupByExit = 0xA, + WakeupByPause = 0xB, + WakeupByCancel = 0xC, + WakeupByCancelAll = 0xD, + WakeupByPowerButtonClick = 0xE, + WakeupToJumpHome = 0xF, + RequestForSysApplet = 0x10, + WakeupToLaunchApplication = 0x11, }; /// App Id's used by APT functions @@ -381,6 +392,17 @@ void PreloadLibraryApplet(Service::Interface* self); void StartLibraryApplet(Service::Interface* self); /** + * APT::CancelLibraryApplet service function + * Inputs: + * 0 : Command header [0x003B0040] + * 1 : u8, Application exiting (0 = not exiting, 1 = exiting) + * Outputs: + * 0 : Header code + * 1 : Result code + */ +void CancelLibraryApplet(Service::Interface* self); + +/** * APT::GetStartupArgument service function * Inputs: * 1 : Parameter Size (capped to 0x300) diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index f27ad91b7..a7a0c8a41 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp @@ -25,7 +25,7 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, - {0x003B0040, nullptr, "CancelLibraryApplet?"}, + {0x003B0040, CancelLibraryApplet, "CancelLibraryApplet"}, {0x003E0080, nullptr, "ReplySleepQuery"}, {0x00430040, NotifyToWait, "NotifyToWait?"}, {0x00440000, GetSharedFont, "GetSharedFont?"}, diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index d6ad42e21..a731c39f6 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -67,7 +67,7 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00380040, nullptr, "PreloadResidentApplet"}, {0x00390040, nullptr, "PrepareToStartResidentApplet"}, {0x003A0044, nullptr, "StartResidentApplet"}, - {0x003B0040, nullptr, "CancelLibraryApplet"}, + {0x003B0040, CancelLibraryApplet, "CancelLibraryApplet"}, {0x003C0042, nullptr, "SendDspSleep"}, {0x003D0042, nullptr, "SendDspWakeUp"}, {0x003E0080, nullptr, "ReplySleepQuery"}, |