summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/apt_u.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/core/hle/service/apt_u.cpp b/src/core/hle/service/apt_u.cpp
index a38621088..007c6efef 100644
--- a/src/core/hle/service/apt_u.cpp
+++ b/src/core/hle/service/apt_u.cpp
@@ -25,10 +25,12 @@ namespace APT_U {
25// correctly mapping it in Citra, however we still do not understand how the mapping is determined. 25// correctly mapping it in Citra, however we still do not understand how the mapping is determined.
26static const VAddr SHARED_FONT_VADDR = 0x18000000; 26static const VAddr SHARED_FONT_VADDR = 0x18000000;
27 27
28// Handle to shared memory region designated to for shared system font 28/// Handle to shared memory region designated to for shared system font
29static Handle shared_font_mem = 0; 29static Handle shared_font_mem = 0;
30 30
31static Handle lock_handle = 0; 31static Handle lock_handle = 0;
32static Handle notification_event_handle = 0; ///< APT notification event handle
33static Handle pause_event_handle = 0; ///< APT pause event handle
32static std::vector<u8> shared_font; 34static std::vector<u8> shared_font;
33 35
34/// Signals used by APT functions 36/// Signals used by APT functions
@@ -42,11 +44,14 @@ enum class SignalType : u32 {
42void Initialize(Service::Interface* self) { 44void Initialize(Service::Interface* self) {
43 u32* cmd_buff = Kernel::GetCommandBuffer(); 45 u32* cmd_buff = Kernel::GetCommandBuffer();
44 46
45 cmd_buff[3] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Menu"); // APT menu event handle 47 notification_event_handle = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Notification");
46 cmd_buff[4] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Pause"); // APT pause event handle 48 pause_event_handle = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Pause");
47 49
48 Kernel::SetEventLocked(cmd_buff[3], true); 50 cmd_buff[3] = notification_event_handle;
49 Kernel::SetEventLocked(cmd_buff[4], false); // Fire start event 51 cmd_buff[4] = pause_event_handle;
52
53 Kernel::SetEventLocked(notification_event_handle, true);
54 Kernel::SetEventLocked(pause_event_handle, false); // Fire start event
50 55
51 _assert_msg_(KERNEL, (0 != lock_handle), "Cannot initialize without lock"); 56 _assert_msg_(KERNEL, (0 != lock_handle), "Cannot initialize without lock");
52 Kernel::ReleaseMutex(lock_handle); 57 Kernel::ReleaseMutex(lock_handle);
@@ -54,6 +59,15 @@ void Initialize(Service::Interface* self) {
54 cmd_buff[1] = 0; // No error 59 cmd_buff[1] = 0; // No error
55} 60}
56 61
62void NotifyToWait(Service::Interface* self) {
63 u32* cmd_buff = Kernel::GetCommandBuffer();
64 u32 app_id = cmd_buff[1];
65 // TODO(Subv): Verify this, it seems to get SWKBD and Home Menu further.
66 Kernel::SignalEvent(pause_event_handle);
67 LOG_WARNING(Service_APT, "(STUBBED) app_id=%u", app_id);
68 cmd_buff[0] = 0;
69}
70
57void GetLockHandle(Service::Interface* self) { 71void GetLockHandle(Service::Interface* self) {
58 u32* cmd_buff = Kernel::GetCommandBuffer(); 72 u32* cmd_buff = Kernel::GetCommandBuffer();
59 u32 flags = cmd_buff[1]; // TODO(bunnei): Figure out the purpose of the flag field 73 u32 flags = cmd_buff[1]; // TODO(bunnei): Figure out the purpose of the flag field
@@ -84,7 +98,7 @@ void Enable(Service::Interface* self) {
84 98
85void InquireNotification(Service::Interface* self) { 99void InquireNotification(Service::Interface* self) {
86 u32* cmd_buff = Kernel::GetCommandBuffer(); 100 u32* cmd_buff = Kernel::GetCommandBuffer();
87 u32 app_id = cmd_buff[2]; 101 u32 app_id = cmd_buff[1];
88 cmd_buff[1] = 0; // No error 102 cmd_buff[1] = 0; // No error
89 cmd_buff[2] = static_cast<u32>(SignalType::None); // Signal type 103 cmd_buff[2] = static_cast<u32>(SignalType::None); // Signal type
90 LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id); 104 LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id);
@@ -277,7 +291,7 @@ const Interface::FunctionInfo FunctionTable[] = {
277 {0x00400042, nullptr, "SendCaptureBufferInfo"}, 291 {0x00400042, nullptr, "SendCaptureBufferInfo"},
278 {0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, 292 {0x00410040, nullptr, "ReceiveCaptureBufferInfo"},
279 {0x00420080, nullptr, "SleepSystem"}, 293 {0x00420080, nullptr, "SleepSystem"},
280 {0x00430040, nullptr, "NotifyToWait"}, 294 {0x00430040, NotifyToWait, "NotifyToWait"},
281 {0x00440000, GetSharedFont, "GetSharedFont"}, 295 {0x00440000, GetSharedFont, "GetSharedFont"},
282 {0x00450040, nullptr, "GetWirelessRebootInfo"}, 296 {0x00450040, nullptr, "GetWirelessRebootInfo"},
283 {0x00460104, nullptr, "Wrap"}, 297 {0x00460104, nullptr, "Wrap"},