2015-02-27 02:13:08 +00:00
|
|
|
// Copyright 2015 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2015-05-06 07:06:12 +00:00
|
|
|
#include "common/common_paths.h"
|
2015-02-27 02:13:08 +00:00
|
|
|
#include "common/file_util.h"
|
2015-05-06 07:06:12 +00:00
|
|
|
#include "common/logging/log.h"
|
2015-05-26 04:30:20 +00:00
|
|
|
#include "core/hle/applets/applet.h"
|
2016-09-20 15:21:23 +00:00
|
|
|
#include "core/hle/kernel/event.h"
|
|
|
|
#include "core/hle/kernel/mutex.h"
|
|
|
|
#include "core/hle/kernel/process.h"
|
|
|
|
#include "core/hle/kernel/shared_memory.h"
|
2016-09-21 06:52:38 +00:00
|
|
|
#include "core/hle/service/apt/apt.h"
|
2015-02-27 02:13:08 +00:00
|
|
|
#include "core/hle/service/apt/apt_a.h"
|
|
|
|
#include "core/hle/service/apt/apt_s.h"
|
|
|
|
#include "core/hle/service/apt/apt_u.h"
|
2016-04-19 17:13:00 +00:00
|
|
|
#include "core/hle/service/apt/bcfnt/bcfnt.h"
|
2015-12-04 21:05:23 +00:00
|
|
|
#include "core/hle/service/fs/archive.h"
|
2016-04-20 10:12:05 +00:00
|
|
|
#include "core/hle/service/ptm/ptm.h"
|
2016-09-18 00:38:01 +00:00
|
|
|
#include "core/hle/service/service.h"
|
2017-01-01 12:58:24 +00:00
|
|
|
#include "core/hw/aes/ccm.h"
|
|
|
|
#include "core/hw/aes/key.h"
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
namespace Service {
|
|
|
|
namespace APT {
|
|
|
|
|
|
|
|
/// Handle to shared memory region designated to for shared system font
|
2015-04-28 02:01:48 +00:00
|
|
|
static Kernel::SharedPtr<Kernel::SharedMemory> shared_font_mem;
|
2016-04-18 02:12:37 +00:00
|
|
|
static bool shared_font_relocated = false;
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2015-04-28 02:01:48 +00:00
|
|
|
static Kernel::SharedPtr<Kernel::Mutex> lock;
|
|
|
|
static Kernel::SharedPtr<Kernel::Event> notification_event; ///< APT notification event
|
2016-09-18 00:38:01 +00:00
|
|
|
static Kernel::SharedPtr<Kernel::Event> parameter_event; ///< APT parameter event
|
2015-04-06 02:11:57 +00:00
|
|
|
|
2015-04-28 02:01:48 +00:00
|
|
|
static u32 cpu_percent; ///< CPU time available to the running application
|
2015-03-08 01:54:16 +00:00
|
|
|
|
2016-04-20 10:12:05 +00:00
|
|
|
// APT::CheckNew3DSApp will check this unknown_ns_state_field to determine processing mode
|
|
|
|
static u8 unknown_ns_state_field;
|
|
|
|
|
2016-07-14 10:26:43 +00:00
|
|
|
static ScreencapPostPermission screen_capture_post_permission;
|
|
|
|
|
2015-05-26 04:30:20 +00:00
|
|
|
/// Parameter data to be returned in the next call to Glance/ReceiveParameter
|
|
|
|
static MessageParameter next_parameter;
|
|
|
|
|
2015-05-27 20:21:06 +00:00
|
|
|
void SendParameter(const MessageParameter& parameter) {
|
2015-05-26 04:30:20 +00:00
|
|
|
next_parameter = parameter;
|
|
|
|
// Signal the event to let the application know that a new parameter is ready to be read
|
|
|
|
parameter_event->Signal();
|
|
|
|
}
|
|
|
|
|
2015-02-27 02:13:08 +00:00
|
|
|
void Initialize(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2015-03-08 01:54:16 +00:00
|
|
|
u32 app_id = cmd_buff[1];
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 flags = cmd_buff[2];
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2016-07-30 16:19:00 +00:00
|
|
|
cmd_buff[2] = IPC::CopyHandleDesc(2);
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[3] = Kernel::g_handle_table.Create(notification_event).MoveFrom();
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[4] = Kernel::g_handle_table.Create(parameter_event).MoveFrom();
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2015-04-06 02:11:57 +00:00
|
|
|
// TODO(bunnei): Check if these events are cleared every time Initialize is called.
|
2015-02-27 02:13:08 +00:00
|
|
|
notification_event->Clear();
|
2015-05-26 04:30:20 +00:00
|
|
|
parameter_event->Clear();
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
ASSERT_MSG((nullptr != lock), "Cannot initialize without lock");
|
|
|
|
lock->Release();
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2015-03-08 01:54:16 +00:00
|
|
|
|
2015-05-26 16:00:26 +00:00
|
|
|
LOG_DEBUG(Service_APT, "called app_id=0x%08X, flags=0x%08X", app_id, flags);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetSharedFont(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
2016-07-28 19:47:31 +00:00
|
|
|
if (!shared_font_mem) {
|
|
|
|
LOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds");
|
|
|
|
cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2);
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[1] = -1; // TODO: Find the right error code
|
2016-07-28 19:47:31 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
// The shared font has to be relocated to the new address before being passed to the
|
|
|
|
// application.
|
|
|
|
VAddr target_address =
|
|
|
|
Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address);
|
2016-04-19 17:13:00 +00:00
|
|
|
if (!shared_font_relocated) {
|
2016-08-27 08:04:26 +00:00
|
|
|
BCFNT::RelocateSharedFont(shared_font_mem, target_address);
|
2016-04-19 17:13:00 +00:00
|
|
|
shared_font_relocated = true;
|
|
|
|
}
|
2016-04-18 02:07:52 +00:00
|
|
|
cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2);
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-09-18 00:38:01 +00:00
|
|
|
// Since the SharedMemory interface doesn't provide the address at which the memory was
|
2016-09-19 01:01:46 +00:00
|
|
|
// allocated, the real APT service calculates this address by scanning the entire address space
|
|
|
|
// (using svcQueryMemory) and searches for an allocation of the same size as the Shared Font.
|
2016-04-18 02:12:37 +00:00
|
|
|
cmd_buff[2] = target_address;
|
2016-07-30 16:19:00 +00:00
|
|
|
cmd_buff[3] = IPC::CopyHandleDesc();
|
2016-04-18 02:07:52 +00:00
|
|
|
cmd_buff[4] = Kernel::g_handle_table.Create(shared_font_mem).MoveFrom();
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void NotifyToWait(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 app_id = cmd_buff[1];
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) app_id=%u", app_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GetLockHandle(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2015-07-23 23:52:57 +00:00
|
|
|
// Bits [0:2] are the applet type (System, Library, etc)
|
|
|
|
// Bit 5 tells the application that there's a pending APT parameter,
|
|
|
|
// this will cause the app to wait until parameter_event is signaled.
|
|
|
|
u32 applet_attributes = cmd_buff[1];
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
|
2015-07-23 23:52:57 +00:00
|
|
|
cmd_buff[2] = applet_attributes; // Applet Attributes, this value is passed to Enable.
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[3] = 0; // Least significant bit = power button state
|
2015-07-23 23:52:57 +00:00
|
|
|
cmd_buff[4] = IPC::CopyHandleDesc();
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[5] = Kernel::g_handle_table.Create(lock).MoveFrom();
|
2015-07-23 23:52:57 +00:00
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called handle=0x%08X applet_attributes=0x%08X", cmd_buff[5],
|
|
|
|
applet_attributes);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Enable(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2015-05-26 16:00:26 +00:00
|
|
|
u32 attributes = cmd_buff[1];
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-09-18 00:38:01 +00:00
|
|
|
parameter_event->Signal(); // Let the application know that it has been started
|
2015-05-26 16:00:26 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called attributes=0x%08X", attributes);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetAppletManInfo(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 unk = cmd_buff[1];
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
cmd_buff[2] = 0;
|
|
|
|
cmd_buff[3] = 0;
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[4] = static_cast<u32>(AppletId::HomeMenu); // Home menu AppID
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[5] = static_cast<u32>(AppletId::Application); // TODO(purpasmart96): Do this correctly
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called unk=0x%08X", unk);
|
|
|
|
}
|
|
|
|
|
|
|
|
void IsRegistered(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 app_id = cmd_buff[1];
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2015-07-23 23:52:57 +00:00
|
|
|
|
|
|
|
// TODO(Subv): An application is considered "registered" if it has already called APT::Enable
|
|
|
|
// handle this properly once we implement multiprocess support.
|
|
|
|
cmd_buff[2] = 0; // Set to not registered by default
|
|
|
|
|
|
|
|
if (app_id == static_cast<u32>(AppletId::AnyLibraryApplet)) {
|
|
|
|
cmd_buff[2] = HLE::Applets::IsLibraryAppletRunning() ? 1 : 0;
|
|
|
|
} else if (auto applet = HLE::Applets::Applet::Get(static_cast<AppletId>(app_id))) {
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[2] = 1; // Set to registered
|
2015-07-23 23:52:57 +00:00
|
|
|
}
|
2015-02-27 02:13:08 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
void InquireNotification(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 app_id = cmd_buff[1];
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[2] = static_cast<u32>(SignalType::None); // Signal type
|
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SendParameter(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 src_app_id = cmd_buff[1];
|
|
|
|
u32 dst_app_id = cmd_buff[2];
|
|
|
|
u32 signal_type = cmd_buff[3];
|
|
|
|
u32 buffer_size = cmd_buff[4];
|
|
|
|
u32 value = cmd_buff[5];
|
|
|
|
u32 handle = cmd_buff[6];
|
|
|
|
u32 size = cmd_buff[7];
|
|
|
|
u32 buffer = cmd_buff[8];
|
|
|
|
|
|
|
|
std::shared_ptr<HLE::Applets::Applet> dest_applet =
|
|
|
|
HLE::Applets::Applet::Get(static_cast<AppletId>(dst_app_id));
|
2015-05-26 04:30:20 +00:00
|
|
|
|
|
|
|
if (dest_applet == nullptr) {
|
|
|
|
LOG_ERROR(Service_APT, "Unknown applet id=0x%08X", dst_app_id);
|
2015-05-26 16:00:26 +00:00
|
|
|
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
|
2015-05-26 04:30:20 +00:00
|
|
|
return;
|
|
|
|
}
|
2015-05-25 18:34:09 +00:00
|
|
|
|
2015-05-26 04:30:20 +00:00
|
|
|
MessageParameter param;
|
|
|
|
param.destination_id = dst_app_id;
|
|
|
|
param.sender_id = src_app_id;
|
|
|
|
param.object = Kernel::g_handle_table.GetGeneric(handle);
|
|
|
|
param.signal = signal_type;
|
2016-04-16 10:18:49 +00:00
|
|
|
param.buffer.resize(buffer_size);
|
|
|
|
Memory::ReadBlock(buffer, param.buffer.data(), param.buffer.size());
|
2015-05-26 04:30:20 +00:00
|
|
|
|
|
|
|
cmd_buff[1] = dest_applet->ReceiveParameter(param).raw;
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(
|
|
|
|
Service_APT,
|
|
|
|
"(STUBBED) called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X,"
|
|
|
|
"buffer_size=0x%08X, value=0x%08X, handle=0x%08X, size=0x%08X, in_param_buffer_ptr=0x%08X",
|
|
|
|
src_app_id, dst_app_id, signal_type, buffer_size, value, handle, size, buffer);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ReceiveParameter(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 app_id = cmd_buff[1];
|
|
|
|
u32 buffer_size = cmd_buff[2];
|
2015-05-26 04:30:20 +00:00
|
|
|
VAddr buffer = cmd_buff[0x104 >> 2];
|
|
|
|
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[2] = next_parameter.sender_id;
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[3] = next_parameter.signal; // Signal type
|
2016-04-16 10:18:49 +00:00
|
|
|
cmd_buff[4] = next_parameter.buffer.size(); // Parameter buffer size
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[5] = 0x10;
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[6] = 0;
|
2015-05-26 04:30:20 +00:00
|
|
|
if (next_parameter.object != nullptr)
|
|
|
|
cmd_buff[6] = Kernel::g_handle_table.Create(next_parameter.object).MoveFrom();
|
2016-04-16 10:18:49 +00:00
|
|
|
cmd_buff[7] = (next_parameter.buffer.size() << 14) | 2;
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[8] = buffer;
|
|
|
|
|
2016-04-16 10:18:49 +00:00
|
|
|
Memory::WriteBlock(buffer, next_parameter.buffer.data(), next_parameter.buffer.size());
|
2015-05-26 04:30:20 +00:00
|
|
|
|
|
|
|
LOG_WARNING(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GlanceParameter(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 app_id = cmd_buff[1];
|
|
|
|
u32 buffer_size = cmd_buff[2];
|
2015-05-26 04:30:20 +00:00
|
|
|
VAddr buffer = cmd_buff[0x104 >> 2];
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[2] = next_parameter.sender_id;
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[3] = next_parameter.signal; // Signal type
|
2016-04-16 10:18:49 +00:00
|
|
|
cmd_buff[4] = next_parameter.buffer.size(); // Parameter buffer size
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[5] = 0x10;
|
2015-02-27 02:13:08 +00:00
|
|
|
cmd_buff[6] = 0;
|
2015-05-26 04:30:20 +00:00
|
|
|
if (next_parameter.object != nullptr)
|
|
|
|
cmd_buff[6] = Kernel::g_handle_table.Create(next_parameter.object).MoveFrom();
|
2016-04-16 10:18:49 +00:00
|
|
|
cmd_buff[7] = (next_parameter.buffer.size() << 14) | 2;
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[8] = buffer;
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
Memory::WriteBlock(buffer, next_parameter.buffer.data(),
|
|
|
|
std::min(static_cast<size_t>(buffer_size), next_parameter.buffer.size()));
|
2015-05-26 04:30:20 +00:00
|
|
|
|
|
|
|
LOG_WARNING(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CancelParameter(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 flag1 = cmd_buff[1];
|
|
|
|
u32 unk = cmd_buff[2];
|
|
|
|
u32 flag2 = cmd_buff[3];
|
2015-02-27 02:13:08 +00:00
|
|
|
u32 app_id = cmd_buff[4];
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2016-09-18 00:38:01 +00:00
|
|
|
cmd_buff[2] = 1; // Set to Success
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT,
|
|
|
|
"(STUBBED) called flag1=0x%08X, unk=0x%08X, flag2=0x%08X, app_id=0x%08X", flag1,
|
|
|
|
unk, flag2, app_id);
|
2015-03-08 01:54:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PrepareToStartApplication(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 title_info1 = cmd_buff[1];
|
|
|
|
u32 title_info2 = cmd_buff[2];
|
|
|
|
u32 title_info3 = cmd_buff[3];
|
|
|
|
u32 title_info4 = cmd_buff[4];
|
|
|
|
u32 flags = cmd_buff[5];
|
2015-03-08 01:54:16 +00:00
|
|
|
|
2016-04-20 10:12:05 +00:00
|
|
|
if (flags & 0x00000100) {
|
|
|
|
unknown_ns_state_field = 1;
|
|
|
|
}
|
|
|
|
|
2015-03-08 01:54:16 +00:00
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT,
|
|
|
|
"(STUBBED) called title_info1=0x%08X, title_info2=0x%08X, title_info3=0x%08X,"
|
|
|
|
"title_info4=0x%08X, flags=0x%08X",
|
|
|
|
title_info1, title_info2, title_info3, title_info4, flags);
|
2015-03-08 01:54:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void StartApplication(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 buffer1_size = cmd_buff[1];
|
|
|
|
u32 buffer2_size = cmd_buff[2];
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 flag = cmd_buff[3];
|
|
|
|
u32 size1 = cmd_buff[4];
|
|
|
|
u32 buffer1_ptr = cmd_buff[5];
|
|
|
|
u32 size2 = cmd_buff[6];
|
|
|
|
u32 buffer2_ptr = cmd_buff[7];
|
2015-03-08 01:54:16 +00:00
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT,
|
|
|
|
"(STUBBED) called buffer1_size=0x%08X, buffer2_size=0x%08X, flag=0x%08X,"
|
|
|
|
"size1=0x%08X, buffer1_ptr=0x%08X, size2=0x%08X, buffer2_ptr=0x%08X",
|
|
|
|
buffer1_size, buffer2_size, flag, size1, buffer1_ptr, size2, buffer2_ptr);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AppletUtility(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
// These are from 3dbrew - I'm not really sure what they're used for.
|
2015-05-26 16:00:26 +00:00
|
|
|
u32 command = cmd_buff[1];
|
2015-02-27 02:13:08 +00:00
|
|
|
u32 buffer1_size = cmd_buff[2];
|
|
|
|
u32 buffer2_size = cmd_buff[3];
|
|
|
|
u32 buffer1_addr = cmd_buff[5];
|
|
|
|
u32 buffer2_addr = cmd_buff[65];
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT,
|
|
|
|
"(STUBBED) called command=0x%08X, buffer1_size=0x%08X, buffer2_size=0x%08X, "
|
|
|
|
"buffer1_addr=0x%08X, buffer2_addr=0x%08X",
|
|
|
|
command, buffer1_size, buffer2_size, buffer1_addr, buffer2_addr);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetAppCpuTimeLimit(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 value = cmd_buff[1];
|
2015-03-08 01:54:16 +00:00
|
|
|
cpu_percent = cmd_buff[2];
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
if (value != 1) {
|
|
|
|
LOG_ERROR(Service_APT, "This value should be one, but is actually %u!", value);
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
|
|
|
|
2015-03-08 01:54:16 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called cpu_percent=%u, value=%u", cpu_percent, value);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetAppCpuTimeLimit(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 value = cmd_buff[1];
|
|
|
|
|
|
|
|
if (value != 1) {
|
|
|
|
LOG_ERROR(Service_APT, "This value should be one, but is actually %u!", value);
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
|
2015-03-08 01:54:16 +00:00
|
|
|
cmd_buff[2] = cpu_percent;
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2015-03-08 01:54:16 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called value=%u", value);
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
2015-05-26 04:30:20 +00:00
|
|
|
void PrepareToStartLibraryApplet(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2015-05-26 16:00:26 +00:00
|
|
|
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
2015-07-24 02:09:43 +00:00
|
|
|
auto applet = HLE::Applets::Applet::Get(applet_id);
|
|
|
|
if (applet) {
|
|
|
|
LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
} else {
|
|
|
|
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
|
|
|
|
}
|
|
|
|
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PreloadLibraryApplet(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
|
|
|
auto applet = HLE::Applets::Applet::Get(applet_id);
|
|
|
|
if (applet) {
|
|
|
|
LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
} else {
|
|
|
|
cmd_buff[1] = HLE::Applets::Applet::Create(applet_id).raw;
|
|
|
|
}
|
2015-05-26 16:00:26 +00:00
|
|
|
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
|
2015-05-26 04:30:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void StartLibraryApplet(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
2015-05-26 16:00:26 +00:00
|
|
|
AppletId applet_id = static_cast<AppletId>(cmd_buff[1]);
|
|
|
|
std::shared_ptr<HLE::Applets::Applet> applet = HLE::Applets::Applet::Get(applet_id);
|
2015-05-27 20:21:06 +00:00
|
|
|
|
2015-05-26 16:00:26 +00:00
|
|
|
LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
|
|
|
|
|
2015-05-26 04:30:20 +00:00
|
|
|
if (applet == nullptr) {
|
2015-05-26 16:00:26 +00:00
|
|
|
LOG_ERROR(Service_APT, "unknown applet id=%08X", applet_id);
|
2015-05-26 04:30:20 +00:00
|
|
|
cmd_buff[1] = -1; // TODO(Subv): Find the right error code
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-04-16 10:18:49 +00:00
|
|
|
size_t buffer_size = cmd_buff[2];
|
|
|
|
VAddr buffer_addr = cmd_buff[6];
|
|
|
|
|
2015-05-26 04:30:20 +00:00
|
|
|
AppletStartupParameter parameter;
|
|
|
|
parameter.object = Kernel::g_handle_table.GetGeneric(cmd_buff[4]);
|
2016-04-16 10:18:49 +00:00
|
|
|
parameter.buffer.resize(buffer_size);
|
|
|
|
Memory::ReadBlock(buffer_addr, parameter.buffer.data(), parameter.buffer.size());
|
2015-05-26 04:30:20 +00:00
|
|
|
|
|
|
|
cmd_buff[1] = applet->Start(parameter).raw;
|
|
|
|
}
|
|
|
|
|
2016-11-24 03:57:56 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2016-07-14 10:26:43 +00:00
|
|
|
void SetScreenCapPostPermission(Service::Interface* self) {
|
2016-04-20 10:12:05 +00:00
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
2016-07-14 10:26:43 +00:00
|
|
|
screen_capture_post_permission = static_cast<ScreencapPostPermission>(cmd_buff[1] & 0xF);
|
2016-04-20 10:12:05 +00:00
|
|
|
|
|
|
|
cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0);
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
|
|
|
|
screen_capture_post_permission);
|
2016-04-20 10:12:05 +00:00
|
|
|
}
|
|
|
|
|
2016-07-14 10:26:43 +00:00
|
|
|
void GetScreenCapPostPermission(Service::Interface* self) {
|
2016-04-20 10:12:05 +00:00
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
cmd_buff[0] = IPC::MakeHeader(0x56, 2, 0);
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
2016-07-14 10:26:43 +00:00
|
|
|
cmd_buff[2] = static_cast<u32>(screen_capture_post_permission);
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
|
|
|
|
screen_capture_post_permission);
|
2016-04-20 10:12:05 +00:00
|
|
|
}
|
|
|
|
|
2015-12-04 21:05:23 +00:00
|
|
|
void GetAppletInfo(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
auto app_id = static_cast<AppletId>(cmd_buff[1]);
|
|
|
|
|
|
|
|
if (auto applet = HLE::Applets::Applet::Get(app_id)) {
|
|
|
|
// TODO(Subv): Get the title id for the current applet and write it in the response[2-3]
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
cmd_buff[4] = static_cast<u32>(Service::FS::MediaType::NAND);
|
|
|
|
cmd_buff[5] = 1; // Registered
|
|
|
|
cmd_buff[6] = 1; // Loaded
|
|
|
|
cmd_buff[7] = 0; // Applet Attributes
|
|
|
|
} else {
|
|
|
|
cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
|
2016-09-18 00:38:01 +00:00
|
|
|
ErrorSummary::NotFound, ErrorLevel::Status)
|
|
|
|
.raw;
|
2015-12-04 21:05:23 +00:00
|
|
|
}
|
|
|
|
LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id);
|
|
|
|
}
|
|
|
|
|
2016-03-28 21:25:05 +00:00
|
|
|
void GetStartupArgument(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
u32 parameter_size = cmd_buff[1];
|
|
|
|
StartupArgumentType startup_argument_type = static_cast<StartupArgumentType>(cmd_buff[2]);
|
|
|
|
|
|
|
|
if (parameter_size >= 0x300) {
|
2016-09-18 00:38:01 +00:00
|
|
|
LOG_ERROR(
|
|
|
|
Service_APT,
|
|
|
|
"Parameter size is outside the valid range (capped to 0x300): parameter_size=0x%08x",
|
|
|
|
parameter_size);
|
2016-03-28 21:25:05 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-11-02 18:48:10 +00:00
|
|
|
u32 addr = cmd_buff[65];
|
|
|
|
if (addr && parameter_size) {
|
|
|
|
Memory::ZeroBlock(addr, parameter_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x",
|
|
|
|
startup_argument_type, parameter_size);
|
2016-03-28 21:25:05 +00:00
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
2016-11-02 18:48:10 +00:00
|
|
|
cmd_buff[2] = 0;
|
2016-03-28 21:25:05 +00:00
|
|
|
}
|
|
|
|
|
2017-01-01 12:58:24 +00:00
|
|
|
void Wrap(Service::Interface* self) {
|
|
|
|
IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x46, 4, 4);
|
|
|
|
const u32 output_size = rp.Pop<u32>();
|
|
|
|
const u32 input_size = rp.Pop<u32>();
|
|
|
|
const u32 nonce_offset = rp.Pop<u32>();
|
|
|
|
u32 nonce_size = rp.Pop<u32>();
|
|
|
|
size_t desc_size;
|
|
|
|
IPC::MappedBufferPermissions desc_permission;
|
|
|
|
const VAddr input = rp.PopMappedBuffer(&desc_size, &desc_permission);
|
|
|
|
ASSERT(desc_size == input_size && desc_permission == IPC::MappedBufferPermissions::R);
|
|
|
|
const VAddr output = rp.PopMappedBuffer(&desc_size, &desc_permission);
|
|
|
|
ASSERT(desc_size == output_size && desc_permission == IPC::MappedBufferPermissions::W);
|
|
|
|
|
|
|
|
// Note: real 3DS still returns SUCCESS when the sizes don't match. It seems that it doesn't
|
|
|
|
// check the buffer size and writes data with potential overflow.
|
|
|
|
ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE,
|
|
|
|
"input_size (%d) doesn't match to output_size (%d)", input_size, output_size);
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u",
|
|
|
|
output_size, input_size, nonce_offset, nonce_size);
|
|
|
|
|
|
|
|
// Note: This weird nonce size modification is verified against real 3DS
|
|
|
|
nonce_size = std::min<u32>(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE);
|
|
|
|
|
|
|
|
// Reads nonce and concatenates the rest of the input as plaintext
|
|
|
|
HW::AES::CCMNonce nonce{};
|
|
|
|
Memory::ReadBlock(input + nonce_offset, nonce.data(), nonce_size);
|
|
|
|
u32 pdata_size = input_size - nonce_size;
|
|
|
|
std::vector<u8> pdata(pdata_size);
|
|
|
|
Memory::ReadBlock(input, pdata.data(), nonce_offset);
|
|
|
|
Memory::ReadBlock(input + nonce_offset + nonce_size, pdata.data() + nonce_offset,
|
|
|
|
pdata_size - nonce_offset);
|
|
|
|
|
|
|
|
// Encrypts the plaintext using AES-CCM
|
|
|
|
auto cipher = HW::AES::EncryptSignCCM(pdata, nonce, HW::AES::KeySlotID::APTWrap);
|
|
|
|
|
|
|
|
// Puts the nonce to the beginning of the output, with ciphertext followed
|
|
|
|
Memory::WriteBlock(output, nonce.data(), nonce_size);
|
|
|
|
Memory::WriteBlock(output + nonce_size, cipher.data(), cipher.size());
|
|
|
|
|
|
|
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 4);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
|
|
|
|
// Unmap buffer
|
|
|
|
rb.PushMappedBuffer(input, input_size, IPC::MappedBufferPermissions::R);
|
|
|
|
rb.PushMappedBuffer(output, output_size, IPC::MappedBufferPermissions::W);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Unwrap(Service::Interface* self) {
|
|
|
|
IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x47, 4, 4);
|
|
|
|
const u32 output_size = rp.Pop<u32>();
|
|
|
|
const u32 input_size = rp.Pop<u32>();
|
|
|
|
const u32 nonce_offset = rp.Pop<u32>();
|
|
|
|
u32 nonce_size = rp.Pop<u32>();
|
|
|
|
size_t desc_size;
|
|
|
|
IPC::MappedBufferPermissions desc_permission;
|
|
|
|
const VAddr input = rp.PopMappedBuffer(&desc_size, &desc_permission);
|
|
|
|
ASSERT(desc_size == input_size && desc_permission == IPC::MappedBufferPermissions::R);
|
|
|
|
const VAddr output = rp.PopMappedBuffer(&desc_size, &desc_permission);
|
|
|
|
ASSERT(desc_size == output_size && desc_permission == IPC::MappedBufferPermissions::W);
|
|
|
|
|
|
|
|
// Note: real 3DS still returns SUCCESS when the sizes don't match. It seems that it doesn't
|
|
|
|
// check the buffer size and writes data with potential overflow.
|
|
|
|
ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE,
|
|
|
|
"input_size (%d) doesn't match to output_size (%d)", input_size, output_size);
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u",
|
|
|
|
output_size, input_size, nonce_offset, nonce_size);
|
|
|
|
|
|
|
|
// Note: This weird nonce size modification is verified against real 3DS
|
|
|
|
nonce_size = std::min<u32>(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE);
|
|
|
|
|
|
|
|
// Reads nonce and cipher text
|
|
|
|
HW::AES::CCMNonce nonce{};
|
|
|
|
Memory::ReadBlock(input, nonce.data(), nonce_size);
|
|
|
|
u32 cipher_size = input_size - nonce_size;
|
|
|
|
std::vector<u8> cipher(cipher_size);
|
|
|
|
Memory::ReadBlock(input + nonce_size, cipher.data(), cipher_size);
|
|
|
|
|
|
|
|
// Decrypts the ciphertext using AES-CCM
|
|
|
|
auto pdata = HW::AES::DecryptVerifyCCM(cipher, nonce, HW::AES::KeySlotID::APTWrap);
|
|
|
|
|
2017-03-18 09:45:19 +00:00
|
|
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 4);
|
2017-01-01 12:58:24 +00:00
|
|
|
if (!pdata.empty()) {
|
|
|
|
// Splits the plaintext and put the nonce in between
|
|
|
|
Memory::WriteBlock(output, pdata.data(), nonce_offset);
|
|
|
|
Memory::WriteBlock(output + nonce_offset, nonce.data(), nonce_size);
|
|
|
|
Memory::WriteBlock(output + nonce_offset + nonce_size, pdata.data() + nonce_offset,
|
|
|
|
pdata.size() - nonce_offset);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
} else {
|
|
|
|
LOG_ERROR(Service_APT, "Failed to decrypt data");
|
|
|
|
rb.Push(ResultCode(static_cast<ErrorDescription>(1), ErrorModule::PS,
|
|
|
|
ErrorSummary::WrongArgument, ErrorLevel::Status));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unmap buffer
|
|
|
|
rb.PushMappedBuffer(input, input_size, IPC::MappedBufferPermissions::R);
|
|
|
|
rb.PushMappedBuffer(output, output_size, IPC::MappedBufferPermissions::W);
|
|
|
|
}
|
|
|
|
|
2016-04-20 10:12:05 +00:00
|
|
|
void CheckNew3DSApp(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
if (unknown_ns_state_field) {
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
cmd_buff[2] = 0;
|
|
|
|
} else {
|
|
|
|
PTM::CheckNew3DS(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
cmd_buff[0] = IPC::MakeHeader(0x101, 2, 0);
|
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
|
|
|
|
void CheckNew3DS(Service::Interface* self) {
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
PTM::CheckNew3DS(self);
|
|
|
|
|
|
|
|
cmd_buff[0] = IPC::MakeHeader(0x102, 2, 0);
|
|
|
|
LOG_WARNING(Service_APT, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
|
2015-03-08 01:54:16 +00:00
|
|
|
void Init() {
|
2015-02-27 02:13:08 +00:00
|
|
|
AddService(new APT_A_Interface);
|
|
|
|
AddService(new APT_S_Interface);
|
|
|
|
AddService(new APT_U_Interface);
|
2015-05-25 18:34:09 +00:00
|
|
|
|
2015-05-26 16:00:26 +00:00
|
|
|
HLE::Applets::Init();
|
|
|
|
|
2015-02-27 02:13:08 +00:00
|
|
|
// Load the shared system font (if available).
|
|
|
|
// The expected format is a decrypted, uncompressed BCFNT file with the 0x80 byte header
|
|
|
|
// generated by the APT:U service. The best way to get is by dumping it from RAM. We've provided
|
|
|
|
// a homebrew app to do this: https://github.com/citra-emu/3dsutils. Put the resulting file
|
|
|
|
// "shared_font.bin" in the Citra "sysdata" directory.
|
|
|
|
|
|
|
|
std::string filepath = FileUtil::GetUserPath(D_SYSDATA_IDX) + SHARED_FONT;
|
|
|
|
|
|
|
|
FileUtil::CreateFullPath(filepath); // Create path if not already created
|
|
|
|
FileUtil::IOFile file(filepath, "rb");
|
|
|
|
|
|
|
|
if (file.IsOpen()) {
|
|
|
|
// Create shared font memory object
|
2015-05-10 22:47:07 +00:00
|
|
|
using Kernel::MemoryPermission;
|
2016-09-18 00:38:01 +00:00
|
|
|
shared_font_mem =
|
|
|
|
Kernel::SharedMemory::Create(nullptr, 0x332000, // 3272 KB
|
|
|
|
MemoryPermission::ReadWrite, MemoryPermission::Read, 0,
|
|
|
|
Kernel::MemoryRegion::SYSTEM, "APT:SharedFont");
|
2016-04-18 02:07:52 +00:00
|
|
|
// Read shared font data
|
|
|
|
file.ReadBytes(shared_font_mem->GetPointer(), file.GetSize());
|
2015-02-27 02:13:08 +00:00
|
|
|
} else {
|
|
|
|
LOG_WARNING(Service_APT, "Unable to load shared font: %s", filepath.c_str());
|
|
|
|
shared_font_mem = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
lock = Kernel::Mutex::Create(false, "APT_U:Lock");
|
2015-04-28 02:01:48 +00:00
|
|
|
|
2015-03-08 01:54:16 +00:00
|
|
|
cpu_percent = 0;
|
2016-04-20 10:12:05 +00:00
|
|
|
unknown_ns_state_field = 0;
|
2016-09-18 00:38:01 +00:00
|
|
|
screen_capture_post_permission =
|
|
|
|
ScreencapPostPermission::CleanThePermission; // TODO(JamePeng): verify the initial value
|
2015-03-08 01:54:16 +00:00
|
|
|
|
2015-02-27 02:13:08 +00:00
|
|
|
// TODO(bunnei): Check if these are created in Initialize or on APT process startup.
|
2016-03-13 02:47:41 +00:00
|
|
|
notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification");
|
|
|
|
parameter_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Start");
|
2015-05-26 04:30:20 +00:00
|
|
|
|
2016-11-19 18:07:03 +00:00
|
|
|
next_parameter.signal = static_cast<u32>(SignalType::Wakeup);
|
2015-05-26 04:30:20 +00:00
|
|
|
next_parameter.destination_id = 0x300;
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
2015-03-08 01:54:16 +00:00
|
|
|
void Shutdown() {
|
2015-04-28 02:01:48 +00:00
|
|
|
shared_font_mem = nullptr;
|
2016-04-18 02:12:37 +00:00
|
|
|
shared_font_relocated = false;
|
2015-04-28 02:01:48 +00:00
|
|
|
lock = nullptr;
|
|
|
|
notification_event = nullptr;
|
2015-05-26 04:30:20 +00:00
|
|
|
parameter_event = nullptr;
|
2015-07-17 05:24:13 +00:00
|
|
|
|
|
|
|
next_parameter.object = nullptr;
|
|
|
|
|
2015-05-26 16:00:26 +00:00
|
|
|
HLE::Applets::Shutdown();
|
2015-02-27 02:13:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace APT
|
|
|
|
} // namespace Service
|