early-access version 4070
This commit is contained in:
@@ -716,22 +716,23 @@ add_library(core STATIC
|
||||
hle/service/server_manager.h
|
||||
hle/service/service.cpp
|
||||
hle/service/service.h
|
||||
hle/service/set/appln_settings.cpp
|
||||
hle/service/set/appln_settings.h
|
||||
hle/service/set/device_settings.cpp
|
||||
hle/service/set/device_settings.h
|
||||
hle/service/set/setting_formats/appln_settings.cpp
|
||||
hle/service/set/setting_formats/appln_settings.h
|
||||
hle/service/set/setting_formats/device_settings.cpp
|
||||
hle/service/set/setting_formats/device_settings.h
|
||||
hle/service/set/setting_formats/system_settings.cpp
|
||||
hle/service/set/setting_formats/system_settings.h
|
||||
hle/service/set/setting_formats/private_settings.cpp
|
||||
hle/service/set/setting_formats/private_settings.h
|
||||
hle/service/set/factory_settings_server.cpp
|
||||
hle/service/set/factory_settings_server.h
|
||||
hle/service/set/firmware_debug_settings_server.cpp
|
||||
hle/service/set/firmware_debug_settings_server.h
|
||||
hle/service/set/private_settings.cpp
|
||||
hle/service/set/private_settings.h
|
||||
hle/service/set/settings.cpp
|
||||
hle/service/set/settings.h
|
||||
hle/service/set/settings_server.cpp
|
||||
hle/service/set/settings_server.h
|
||||
hle/service/set/system_settings.cpp
|
||||
hle/service/set/system_settings.h
|
||||
hle/service/set/settings_types.h
|
||||
hle/service/set/system_settings_server.cpp
|
||||
hle/service/set/system_settings_server.h
|
||||
hle/service/sm/sm.cpp
|
||||
|
@@ -20,12 +20,13 @@ void LoopProcess(Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
std::shared_ptr<ResourceManager> resource_manager = std::make_shared<ResourceManager>(system);
|
||||
std::shared_ptr<HidFirmwareSettings> firmware_settings =
|
||||
std::make_shared<HidFirmwareSettings>();
|
||||
std::make_shared<HidFirmwareSettings>(system);
|
||||
|
||||
// TODO: Remove this hack when am is emulated properly.
|
||||
resource_manager->Initialize();
|
||||
resource_manager->RegisterAppletResourceUserId(system.ApplicationProcess()->GetProcessId(),
|
||||
true);
|
||||
resource_manager->SetAruidValidForVibration(system.ApplicationProcess()->GetProcessId(), true);
|
||||
|
||||
server_manager->RegisterNamedService(
|
||||
"hid", std::make_shared<IHidServer>(system, resource_manager, firmware_settings));
|
||||
|
@@ -22,12 +22,16 @@
|
||||
#include "hid_core/resources/mouse/mouse.h"
|
||||
#include "hid_core/resources/npad/npad.h"
|
||||
#include "hid_core/resources/npad/npad_types.h"
|
||||
#include "hid_core/resources/npad/npad_vibration.h"
|
||||
#include "hid_core/resources/palma/palma.h"
|
||||
#include "hid_core/resources/six_axis/console_six_axis.h"
|
||||
#include "hid_core/resources/six_axis/seven_six_axis.h"
|
||||
#include "hid_core/resources/six_axis/six_axis.h"
|
||||
#include "hid_core/resources/touch_screen/gesture.h"
|
||||
#include "hid_core/resources/touch_screen/touch_screen.h"
|
||||
#include "hid_core/resources/vibration/gc_vibration_device.h"
|
||||
#include "hid_core/resources/vibration/n64_vibration_device.h"
|
||||
#include "hid_core/resources/vibration/vibration_device.h"
|
||||
|
||||
namespace Service::HID {
|
||||
|
||||
@@ -38,7 +42,7 @@ public:
|
||||
: ServiceFramework{system_, "IActiveVibrationDeviceList"}, resource_manager(resource) {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IActiveVibrationDeviceList::InitializeVibrationDevice, "InitializeVibrationDevice"},
|
||||
{0, &IActiveVibrationDeviceList::ActivateVibrationDevice, "ActivateVibrationDevice"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -46,22 +50,49 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void InitializeVibrationDevice(HLERequestContext& ctx) {
|
||||
void ActivateVibrationDevice(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto vibration_device_handle{rp.PopRaw<Core::HID::VibrationDeviceHandle>()};
|
||||
|
||||
if (resource_manager != nullptr && resource_manager->GetNpad()) {
|
||||
resource_manager->GetNpad()->InitializeVibrationDevice(vibration_device_handle);
|
||||
}
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, npad_type={}, npad_id={}, device_index={}",
|
||||
vibration_device_handle.npad_type, vibration_device_handle.npad_id,
|
||||
vibration_device_handle.device_index);
|
||||
|
||||
const auto result = ActivateVibrationDeviceImpl(vibration_device_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
Result ActivateVibrationDeviceImpl(const Core::HID::VibrationDeviceHandle& handle) {
|
||||
std::scoped_lock lock{mutex};
|
||||
|
||||
const Result is_valid = IsVibrationHandleValid(handle);
|
||||
if (is_valid.IsError()) {
|
||||
return is_valid;
|
||||
}
|
||||
|
||||
for (std::size_t i = 0; i < list_size; i++) {
|
||||
if (handle.device_index == vibration_device_list[i].device_index &&
|
||||
handle.npad_id == vibration_device_list[i].npad_id &&
|
||||
handle.npad_type == vibration_device_list[i].npad_type) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
}
|
||||
if (list_size == vibration_device_list.size()) {
|
||||
return ResultVibrationDeviceIndexOutOfRange;
|
||||
}
|
||||
const Result result = resource_manager->GetVibrationDevice(handle)->Activate();
|
||||
if (result.IsError()) {
|
||||
return result;
|
||||
}
|
||||
vibration_device_list[list_size++] = handle;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
mutable std::mutex mutex;
|
||||
std::size_t list_size{};
|
||||
std::array<Core::HID::VibrationDeviceHandle, 0x100> vibration_device_list{};
|
||||
std::shared_ptr<ResourceManager> resource_manager;
|
||||
};
|
||||
|
||||
@@ -153,7 +184,7 @@ IHidServer::IHidServer(Core::System& system_, std::shared_ptr<ResourceManager> r
|
||||
{209, &IHidServer::BeginPermitVibrationSession, "BeginPermitVibrationSession"},
|
||||
{210, &IHidServer::EndPermitVibrationSession, "EndPermitVibrationSession"},
|
||||
{211, &IHidServer::IsVibrationDeviceMounted, "IsVibrationDeviceMounted"},
|
||||
{212, nullptr, "SendVibrationValueInBool"},
|
||||
{212, &IHidServer::SendVibrationValueInBool, "SendVibrationValueInBool"},
|
||||
{300, &IHidServer::ActivateConsoleSixAxisSensor, "ActivateConsoleSixAxisSensor"},
|
||||
{301, &IHidServer::StartConsoleSixAxisSensor, "StartConsoleSixAxisSensor"},
|
||||
{302, &IHidServer::StopConsoleSixAxisSensor, "StopConsoleSixAxisSensor"},
|
||||
@@ -1492,59 +1523,13 @@ void IHidServer::ClearNpadCaptureButtonAssignment(HLERequestContext& ctx) {
|
||||
void IHidServer::GetVibrationDeviceInfo(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto vibration_device_handle{rp.PopRaw<Core::HID::VibrationDeviceHandle>()};
|
||||
const auto controller = GetResourceManager()->GetNpad();
|
||||
|
||||
Core::HID::VibrationDeviceInfo vibration_device_info;
|
||||
bool check_device_index = false;
|
||||
|
||||
switch (vibration_device_handle.npad_type) {
|
||||
case Core::HID::NpadStyleIndex::Fullkey:
|
||||
case Core::HID::NpadStyleIndex::Handheld:
|
||||
case Core::HID::NpadStyleIndex::JoyconDual:
|
||||
case Core::HID::NpadStyleIndex::JoyconLeft:
|
||||
case Core::HID::NpadStyleIndex::JoyconRight:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::LinearResonantActuator;
|
||||
check_device_index = true;
|
||||
break;
|
||||
case Core::HID::NpadStyleIndex::GameCube:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::GcErm;
|
||||
break;
|
||||
case Core::HID::NpadStyleIndex::N64:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::N64;
|
||||
break;
|
||||
default:
|
||||
vibration_device_info.type = Core::HID::VibrationDeviceType::Unknown;
|
||||
break;
|
||||
}
|
||||
|
||||
vibration_device_info.position = Core::HID::VibrationDevicePosition::None;
|
||||
if (check_device_index) {
|
||||
switch (vibration_device_handle.device_index) {
|
||||
case Core::HID::DeviceIndex::Left:
|
||||
vibration_device_info.position = Core::HID::VibrationDevicePosition::Left;
|
||||
break;
|
||||
case Core::HID::DeviceIndex::Right:
|
||||
vibration_device_info.position = Core::HID::VibrationDevicePosition::Right;
|
||||
break;
|
||||
case Core::HID::DeviceIndex::None:
|
||||
default:
|
||||
ASSERT_MSG(false, "DeviceIndex should never be None!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, vibration_device_type={}, vibration_device_position={}",
|
||||
vibration_device_info.type, vibration_device_info.position);
|
||||
|
||||
const auto result = IsVibrationHandleValid(vibration_device_handle);
|
||||
if (result.IsError()) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
return;
|
||||
}
|
||||
Core::HID::VibrationDeviceInfo vibration_device_info{};
|
||||
const auto result = GetResourceManager()->GetVibrationDeviceInfo(vibration_device_info,
|
||||
vibration_device_handle);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
rb.PushRaw(vibration_device_info);
|
||||
}
|
||||
|
||||
@@ -1560,16 +1545,16 @@ void IHidServer::SendVibrationValue(HLERequestContext& ctx) {
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
GetResourceManager()->GetNpad()->VibrateController(parameters.applet_resource_user_id,
|
||||
parameters.vibration_device_handle,
|
||||
parameters.vibration_value);
|
||||
|
||||
LOG_DEBUG(Service_HID,
|
||||
"called, npad_type={}, npad_id={}, device_index={}, applet_resource_user_id={}",
|
||||
parameters.vibration_device_handle.npad_type,
|
||||
parameters.vibration_device_handle.npad_id,
|
||||
parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
|
||||
|
||||
GetResourceManager()->SendVibrationValue(parameters.applet_resource_user_id,
|
||||
parameters.vibration_device_handle,
|
||||
parameters.vibration_value);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
@@ -1591,10 +1576,28 @@ void IHidServer::GetActualVibrationValue(HLERequestContext& ctx) {
|
||||
parameters.vibration_device_handle.npad_id,
|
||||
parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
|
||||
|
||||
bool has_active_aruid{};
|
||||
NpadVibrationDevice* device{nullptr};
|
||||
Core::HID::VibrationValue vibration_value{};
|
||||
Result result = GetResourceManager()->IsVibrationAruidActive(parameters.applet_resource_user_id,
|
||||
has_active_aruid);
|
||||
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
result = IsVibrationHandleValid(parameters.vibration_device_handle);
|
||||
}
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
device = GetResourceManager()->GetNSVibrationDevice(parameters.vibration_device_handle);
|
||||
}
|
||||
if (device != nullptr) {
|
||||
result = device->GetActualVibrationValue(vibration_value);
|
||||
}
|
||||
if (result.IsError()) {
|
||||
vibration_value = Core::HID::DEFAULT_VIBRATION_VALUE;
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(GetResourceManager()->GetNpad()->GetLastVibration(
|
||||
parameters.applet_resource_user_id, parameters.vibration_device_handle));
|
||||
rb.PushRaw(vibration_value);
|
||||
}
|
||||
|
||||
void IHidServer::CreateActiveVibrationDeviceList(HLERequestContext& ctx) {
|
||||
@@ -1609,25 +1612,27 @@ void IHidServer::PermitVibration(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto can_vibrate{rp.Pop<bool>()};
|
||||
|
||||
// nnSDK saves this value as a float. Since it can only be 1.0f or 0.0f we simplify this value
|
||||
// by converting it to a bool
|
||||
Settings::values.vibration_enabled.SetValue(can_vibrate);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, can_vibrate={}", can_vibrate);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->SetVibrationMasterVolume(
|
||||
can_vibrate ? 1.0f : 0.0f);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::IsVibrationPermitted(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_HID, "called");
|
||||
|
||||
// nnSDK checks if a float is greater than zero. We return the bool we stored earlier
|
||||
const auto is_enabled = Settings::values.vibration_enabled.GetValue();
|
||||
f32 master_volume{};
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->GetVibrationMasterVolume(
|
||||
master_volume);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(is_enabled);
|
||||
rb.Push(result);
|
||||
rb.Push(master_volume > 0.0f);
|
||||
}
|
||||
|
||||
void IHidServer::SendVibrationValues(HLERequestContext& ctx) {
|
||||
@@ -1645,13 +1650,22 @@ void IHidServer::SendVibrationValues(HLERequestContext& ctx) {
|
||||
auto vibration_values = std::span(
|
||||
reinterpret_cast<const Core::HID::VibrationValue*>(vibration_data.data()), vibration_count);
|
||||
|
||||
GetResourceManager()->GetNpad()->VibrateControllers(applet_resource_user_id,
|
||||
vibration_device_handles, vibration_values);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
Result result = ResultSuccess;
|
||||
if (handle_count != vibration_count) {
|
||||
result = ResultVibrationArraySizeMismatch;
|
||||
}
|
||||
|
||||
for (std::size_t i = 0; i < handle_count; i++) {
|
||||
if (result.IsSuccess()) {
|
||||
result = GetResourceManager()->SendVibrationValue(
|
||||
applet_resource_user_id, vibration_device_handles[i], vibration_values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::SendVibrationGcErmCommand(HLERequestContext& ctx) {
|
||||
@@ -1666,43 +1680,6 @@ void IHidServer::SendVibrationGcErmCommand(HLERequestContext& ctx) {
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
/**
|
||||
* Note: This uses yuzu-specific behavior such that the StopHard command produces
|
||||
* vibrations where freq_low == 0.0f and freq_high == 0.0f, as defined below,
|
||||
* in order to differentiate between Stop and StopHard commands.
|
||||
* This is done to reuse the controller vibration functions made for regular controllers.
|
||||
*/
|
||||
const auto vibration_value = [parameters] {
|
||||
switch (parameters.gc_erm_command) {
|
||||
case Core::HID::VibrationGcErmCommand::Stop:
|
||||
return Core::HID::VibrationValue{
|
||||
.low_amplitude = 0.0f,
|
||||
.low_frequency = 160.0f,
|
||||
.high_amplitude = 0.0f,
|
||||
.high_frequency = 320.0f,
|
||||
};
|
||||
case Core::HID::VibrationGcErmCommand::Start:
|
||||
return Core::HID::VibrationValue{
|
||||
.low_amplitude = 1.0f,
|
||||
.low_frequency = 160.0f,
|
||||
.high_amplitude = 1.0f,
|
||||
.high_frequency = 320.0f,
|
||||
};
|
||||
case Core::HID::VibrationGcErmCommand::StopHard:
|
||||
return Core::HID::VibrationValue{
|
||||
.low_amplitude = 0.0f,
|
||||
.low_frequency = 0.0f,
|
||||
.high_amplitude = 0.0f,
|
||||
.high_frequency = 0.0f,
|
||||
};
|
||||
default:
|
||||
return Core::HID::DEFAULT_VIBRATION_VALUE;
|
||||
}
|
||||
}();
|
||||
|
||||
GetResourceManager()->GetNpad()->VibrateController(
|
||||
parameters.applet_resource_user_id, parameters.vibration_device_handle, vibration_value);
|
||||
|
||||
LOG_DEBUG(Service_HID,
|
||||
"called, npad_type={}, npad_id={}, device_index={}, applet_resource_user_id={}, "
|
||||
"gc_erm_command={}",
|
||||
@@ -1711,8 +1688,23 @@ void IHidServer::SendVibrationGcErmCommand(HLERequestContext& ctx) {
|
||||
parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id,
|
||||
parameters.gc_erm_command);
|
||||
|
||||
bool has_active_aruid{};
|
||||
NpadGcVibrationDevice* gc_device{nullptr};
|
||||
Result result = GetResourceManager()->IsVibrationAruidActive(parameters.applet_resource_user_id,
|
||||
has_active_aruid);
|
||||
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
result = IsVibrationHandleValid(parameters.vibration_device_handle);
|
||||
}
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
gc_device = GetResourceManager()->GetGcVibrationDevice(parameters.vibration_device_handle);
|
||||
}
|
||||
if (gc_device != nullptr) {
|
||||
result = gc_device->SendVibrationGcErmCommand(parameters.gc_erm_command);
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::GetActualVibrationGcErmCommand(HLERequestContext& ctx) {
|
||||
@@ -1725,33 +1717,31 @@ void IHidServer::GetActualVibrationGcErmCommand(HLERequestContext& ctx) {
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
const auto last_vibration = GetResourceManager()->GetNpad()->GetLastVibration(
|
||||
parameters.applet_resource_user_id, parameters.vibration_device_handle);
|
||||
|
||||
const auto gc_erm_command = [last_vibration] {
|
||||
if (last_vibration.low_amplitude != 0.0f || last_vibration.high_amplitude != 0.0f) {
|
||||
return Core::HID::VibrationGcErmCommand::Start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: This uses yuzu-specific behavior such that the StopHard command produces
|
||||
* vibrations where freq_low == 0.0f and freq_high == 0.0f, as defined in the HID function
|
||||
* SendVibrationGcErmCommand, in order to differentiate between Stop and StopHard commands.
|
||||
* This is done to reuse the controller vibration functions made for regular controllers.
|
||||
*/
|
||||
if (last_vibration.low_frequency == 0.0f && last_vibration.high_frequency == 0.0f) {
|
||||
return Core::HID::VibrationGcErmCommand::StopHard;
|
||||
}
|
||||
|
||||
return Core::HID::VibrationGcErmCommand::Stop;
|
||||
}();
|
||||
|
||||
LOG_DEBUG(Service_HID,
|
||||
"called, npad_type={}, npad_id={}, device_index={}, applet_resource_user_id={}",
|
||||
parameters.vibration_device_handle.npad_type,
|
||||
parameters.vibration_device_handle.npad_id,
|
||||
parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
|
||||
|
||||
bool has_active_aruid{};
|
||||
NpadGcVibrationDevice* gc_device{nullptr};
|
||||
Core::HID::VibrationGcErmCommand gc_erm_command{};
|
||||
Result result = GetResourceManager()->IsVibrationAruidActive(parameters.applet_resource_user_id,
|
||||
has_active_aruid);
|
||||
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
result = IsVibrationHandleValid(parameters.vibration_device_handle);
|
||||
}
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
gc_device = GetResourceManager()->GetGcVibrationDevice(parameters.vibration_device_handle);
|
||||
}
|
||||
if (gc_device != nullptr) {
|
||||
result = gc_device->GetActualVibrationGcErmCommand(gc_erm_command);
|
||||
}
|
||||
if (result.IsError()) {
|
||||
gc_erm_command = Core::HID::VibrationGcErmCommand::Stop;
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(gc_erm_command);
|
||||
@@ -1761,21 +1751,24 @@ void IHidServer::BeginPermitVibrationSession(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
GetResourceManager()->GetNpad()->SetPermitVibrationSession(true);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->BeginPermitVibrationSession(
|
||||
applet_resource_user_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::EndPermitVibrationSession(HLERequestContext& ctx) {
|
||||
GetResourceManager()->GetNpad()->SetPermitVibrationSession(false);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called");
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->EndPermitVibrationSession();
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::IsVibrationDeviceMounted(HLERequestContext& ctx) {
|
||||
@@ -1795,10 +1788,61 @@ void IHidServer::IsVibrationDeviceMounted(HLERequestContext& ctx) {
|
||||
parameters.vibration_device_handle.npad_id,
|
||||
parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
|
||||
|
||||
bool is_mounted{};
|
||||
NpadVibrationBase* device{nullptr};
|
||||
Result result = IsVibrationHandleValid(parameters.vibration_device_handle);
|
||||
|
||||
if (result.IsSuccess()) {
|
||||
device = GetResourceManager()->GetVibrationDevice(parameters.vibration_device_handle);
|
||||
}
|
||||
|
||||
if (device != nullptr) {
|
||||
is_mounted = device->IsVibrationMounted();
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(GetResourceManager()->GetNpad()->IsVibrationDeviceMounted(
|
||||
parameters.applet_resource_user_id, parameters.vibration_device_handle));
|
||||
rb.Push(result);
|
||||
rb.Push(is_mounted);
|
||||
}
|
||||
|
||||
void IHidServer::SendVibrationValueInBool(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
Core::HID::VibrationDeviceHandle vibration_device_handle;
|
||||
INSERT_PADDING_WORDS_NOINIT(1);
|
||||
u64 applet_resource_user_id;
|
||||
bool is_vibrating;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x18, "Parameters has incorrect size.");
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_DEBUG(Service_HID,
|
||||
"called, npad_type={}, npad_id={}, device_index={}, applet_resource_user_id={}, "
|
||||
"is_vibrating={}",
|
||||
parameters.vibration_device_handle.npad_type,
|
||||
parameters.vibration_device_handle.npad_id,
|
||||
parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id,
|
||||
parameters.is_vibrating);
|
||||
|
||||
bool has_active_aruid{};
|
||||
NpadN64VibrationDevice* n64_device{nullptr};
|
||||
Result result = GetResourceManager()->IsVibrationAruidActive(parameters.applet_resource_user_id,
|
||||
has_active_aruid);
|
||||
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
result = IsVibrationHandleValid(parameters.vibration_device_handle);
|
||||
}
|
||||
if (result.IsSuccess() && has_active_aruid) {
|
||||
n64_device =
|
||||
GetResourceManager()->GetN64VibrationDevice(parameters.vibration_device_handle);
|
||||
}
|
||||
if (n64_device != nullptr) {
|
||||
result = n64_device->SendValueInBool(parameters.is_vibrating);
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidServer::ActivateConsoleSixAxisSensor(HLERequestContext& ctx) {
|
||||
|
@@ -97,6 +97,7 @@ private:
|
||||
void BeginPermitVibrationSession(HLERequestContext& ctx);
|
||||
void EndPermitVibrationSession(HLERequestContext& ctx);
|
||||
void IsVibrationDeviceMounted(HLERequestContext& ctx);
|
||||
void SendVibrationValueInBool(HLERequestContext& ctx);
|
||||
void ActivateConsoleSixAxisSensor(HLERequestContext& ctx);
|
||||
void StartConsoleSixAxisSensor(HLERequestContext& ctx);
|
||||
void StopConsoleSixAxisSensor(HLERequestContext& ctx);
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "hid_core/resource_manager.h"
|
||||
#include "hid_core/resources/npad/npad.h"
|
||||
#include "hid_core/resources/npad/npad_types.h"
|
||||
#include "hid_core/resources/npad/npad_vibration.h"
|
||||
#include "hid_core/resources/palma/palma.h"
|
||||
#include "hid_core/resources/touch_screen/touch_screen.h"
|
||||
|
||||
@@ -67,14 +68,14 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
|
||||
{501, &IHidSystemServer::RegisterAppletResourceUserId, "RegisterAppletResourceUserId"},
|
||||
{502, &IHidSystemServer::UnregisterAppletResourceUserId, "UnregisterAppletResourceUserId"},
|
||||
{503, &IHidSystemServer::EnableAppletToGetInput, "EnableAppletToGetInput"},
|
||||
{504, nullptr, "SetAruidValidForVibration"},
|
||||
{504, &IHidSystemServer::SetAruidValidForVibration, "SetAruidValidForVibration"},
|
||||
{505, &IHidSystemServer::EnableAppletToGetSixAxisSensor, "EnableAppletToGetSixAxisSensor"},
|
||||
{506, &IHidSystemServer::EnableAppletToGetPadInput, "EnableAppletToGetPadInput"},
|
||||
{507, &IHidSystemServer::EnableAppletToGetTouchScreen, "EnableAppletToGetTouchScreen"},
|
||||
{510, nullptr, "SetVibrationMasterVolume"},
|
||||
{511, nullptr, "GetVibrationMasterVolume"},
|
||||
{512, nullptr, "BeginPermitVibrationSession"},
|
||||
{513, nullptr, "EndPermitVibrationSession"},
|
||||
{510, &IHidSystemServer::SetVibrationMasterVolume, "SetVibrationMasterVolume"},
|
||||
{511, &IHidSystemServer::GetVibrationMasterVolume, "GetVibrationMasterVolume"},
|
||||
{512, &IHidSystemServer::BeginPermitVibrationSession, "BeginPermitVibrationSession"},
|
||||
{513, &IHidSystemServer::EndPermitVibrationSession, "EndPermitVibrationSession"},
|
||||
{514, nullptr, "Unknown514"},
|
||||
{520, nullptr, "EnableHandheldHids"},
|
||||
{521, nullptr, "DisableHandheldHids"},
|
||||
@@ -156,7 +157,7 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
|
||||
{1152, nullptr, "SetTouchScreenDefaultConfiguration"},
|
||||
{1153, &IHidSystemServer::GetTouchScreenDefaultConfiguration, "GetTouchScreenDefaultConfiguration"},
|
||||
{1154, nullptr, "IsFirmwareAvailableForNotification"},
|
||||
{1155, nullptr, "SetForceHandheldStyleVibration"},
|
||||
{1155, &IHidSystemServer::SetForceHandheldStyleVibration, "SetForceHandheldStyleVibration"},
|
||||
{1156, nullptr, "SendConnectionTriggerWithoutTimeoutEvent"},
|
||||
{1157, nullptr, "CancelConnectionTrigger"},
|
||||
{1200, nullptr, "IsButtonConfigSupported"},
|
||||
@@ -538,6 +539,27 @@ void IHidSystemServer::EnableAppletToGetInput(HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidSystemServer::SetAruidValidForVibration(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
bool is_enabled;
|
||||
INSERT_PADDING_WORDS_NOINIT(1);
|
||||
u64 applet_resource_user_id;
|
||||
};
|
||||
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
|
||||
|
||||
const auto parameters{rp.PopRaw<Parameters>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, is_enabled={}, applet_resource_user_id={}",
|
||||
parameters.is_enabled, parameters.applet_resource_user_id);
|
||||
|
||||
GetResourceManager()->SetAruidValidForVibration(parameters.applet_resource_user_id,
|
||||
parameters.is_enabled);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidSystemServer::EnableAppletToGetSixAxisSensor(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
struct Parameters {
|
||||
@@ -601,6 +623,57 @@ void IHidSystemServer::EnableAppletToGetTouchScreen(HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidSystemServer::SetVibrationMasterVolume(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto master_volume{rp.Pop<f32>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, volume={}", master_volume);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->SetVibrationMasterVolume(
|
||||
master_volume);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidSystemServer::GetVibrationMasterVolume(HLERequestContext& ctx) {
|
||||
f32 master_volume{};
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->GetVibrationMasterVolume(
|
||||
master_volume);
|
||||
|
||||
LOG_INFO(Service_HID, "called, volume={}", master_volume);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(result);
|
||||
rb.Push(master_volume);
|
||||
}
|
||||
|
||||
void IHidSystemServer::BeginPermitVibrationSession(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->BeginPermitVibrationSession(
|
||||
applet_resource_user_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidSystemServer::EndPermitVibrationSession(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_HID, "called");
|
||||
|
||||
const auto result =
|
||||
GetResourceManager()->GetNpad()->GetVibrationHandler()->EndPermitVibrationSession();
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void IHidSystemServer::IsJoyConAttachedOnAllRail(HLERequestContext& ctx) {
|
||||
const bool is_attached = true;
|
||||
|
||||
@@ -749,6 +822,19 @@ void IHidSystemServer::GetTouchScreenDefaultConfiguration(HLERequestContext& ctx
|
||||
rb.PushRaw(touchscreen_config);
|
||||
}
|
||||
|
||||
void IHidSystemServer::SetForceHandheldStyleVibration(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto is_forced{rp.Pop<bool>()};
|
||||
|
||||
LOG_INFO(Service_HID, "called, is_forced={}", is_forced);
|
||||
|
||||
GetResourceManager()->SetForceHandheldStyleVibration(is_forced);
|
||||
GetResourceManager()->GetNpad()->UpdateHandheldAbstractState();
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHidSystemServer::IsUsingCustomButtonConfig(HLERequestContext& ctx) {
|
||||
const bool is_enabled = false;
|
||||
|
||||
|
@@ -42,9 +42,14 @@ private:
|
||||
void RegisterAppletResourceUserId(HLERequestContext& ctx);
|
||||
void UnregisterAppletResourceUserId(HLERequestContext& ctx);
|
||||
void EnableAppletToGetInput(HLERequestContext& ctx);
|
||||
void SetAruidValidForVibration(HLERequestContext& ctx);
|
||||
void EnableAppletToGetSixAxisSensor(HLERequestContext& ctx);
|
||||
void EnableAppletToGetPadInput(HLERequestContext& ctx);
|
||||
void EnableAppletToGetTouchScreen(HLERequestContext& ctx);
|
||||
void SetVibrationMasterVolume(HLERequestContext& ctx);
|
||||
void GetVibrationMasterVolume(HLERequestContext& ctx);
|
||||
void BeginPermitVibrationSession(HLERequestContext& ctx);
|
||||
void EndPermitVibrationSession(HLERequestContext& ctx);
|
||||
void IsJoyConAttachedOnAllRail(HLERequestContext& ctx);
|
||||
void AcquireConnectionTriggerTimeoutEvent(HLERequestContext& ctx);
|
||||
void AcquireDeviceRegisteredEventForControllerSupport(HLERequestContext& ctx);
|
||||
@@ -61,6 +66,7 @@ private:
|
||||
void FinalizeUsbFirmwareUpdate(HLERequestContext& ctx);
|
||||
void InitializeUsbFirmwareUpdateWithoutMemory(HLERequestContext& ctx);
|
||||
void GetTouchScreenDefaultConfiguration(HLERequestContext& ctx);
|
||||
void SetForceHandheldStyleVibration(HLERequestContext& ctx);
|
||||
void IsUsingCustomButtonConfig(HLERequestContext& ctx);
|
||||
|
||||
std::shared_ptr<ResourceManager> GetResourceManager();
|
||||
|
@@ -441,7 +441,10 @@ Result NfcDevice::Mount(NFP::ModelType model_type, NFP::MountTarget mount_target
|
||||
device_state = DeviceState::TagMounted;
|
||||
mount_target = mount_target_;
|
||||
|
||||
if (!is_corrupted && mount_target != NFP::MountTarget::Rom) {
|
||||
const bool create_backup =
|
||||
mount_target == NFP::MountTarget::All || mount_target == NFP::MountTarget::Ram ||
|
||||
(mount_target == NFP::MountTarget::Rom && HasBackup(encrypted_tag_data.uuid).IsError());
|
||||
if (!is_corrupted && create_backup) {
|
||||
std::vector<u8> data(sizeof(NFP::EncryptedNTAG215File));
|
||||
memcpy(data.data(), &encrypted_tag_data, sizeof(encrypted_tag_data));
|
||||
WriteBackupData(encrypted_tag_data.uuid, data);
|
||||
|
16
src/core/hle/service/set/setting_formats/appln_settings.cpp
Executable file
16
src/core/hle/service/set/setting_formats/appln_settings.cpp
Executable file
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/set/setting_formats/appln_settings.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
ApplnSettings DefaultApplnSettings() {
|
||||
ApplnSettings settings{};
|
||||
|
||||
settings.mii_author_id = Common::UUID::MakeDefault();
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
} // namespace Service::Set
|
35
src/core/hle/service/set/setting_formats/appln_settings.h
Executable file
35
src/core/hle/service/set/setting_formats/appln_settings.h
Executable file
@@ -0,0 +1,35 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/service/set/settings_types.h"
|
||||
|
||||
namespace Service::Set {
|
||||
struct ApplnSettings {
|
||||
INSERT_PADDING_BYTES(0x10); // Reserved
|
||||
|
||||
// nn::util::Uuid MiiAuthorId, copied from system settings 0x94B0
|
||||
Common::UUID mii_author_id;
|
||||
INSERT_PADDING_BYTES(0x30); // Reserved
|
||||
|
||||
// nn::settings::system::ServiceDiscoveryControlSettings
|
||||
u32 service_discovery_control_settings;
|
||||
INSERT_PADDING_BYTES(0x20); // Reserved
|
||||
|
||||
bool in_repair_process_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
};
|
||||
static_assert(offsetof(ApplnSettings, mii_author_id) == 0x10);
|
||||
static_assert(offsetof(ApplnSettings, service_discovery_control_settings) == 0x50);
|
||||
static_assert(offsetof(ApplnSettings, in_repair_process_enable_flag) == 0x74);
|
||||
static_assert(sizeof(ApplnSettings) == 0x78, "ApplnSettings has the wrong size!");
|
||||
|
||||
ApplnSettings DefaultApplnSettings();
|
||||
|
||||
} // namespace Service::Set
|
12
src/core/hle/service/set/setting_formats/device_settings.cpp
Executable file
12
src/core/hle/service/set/setting_formats/device_settings.cpp
Executable file
@@ -0,0 +1,12 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/set/setting_formats/device_settings.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
DeviceSettings DefaultDeviceSettings() {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace Service::Set
|
54
src/core/hle/service/set/setting_formats/device_settings.h
Executable file
54
src/core/hle/service/set/setting_formats/device_settings.h
Executable file
@@ -0,0 +1,54 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/vector_math.h"
|
||||
#include "core/hle/service/set/settings_types.h"
|
||||
|
||||
namespace Service::Set {
|
||||
struct DeviceSettings {
|
||||
INSERT_PADDING_BYTES(0x10); // Reserved
|
||||
|
||||
// nn::settings::BatteryLot
|
||||
std::array<u8, 0x18> ptm_battery_lot;
|
||||
// nn::settings::system::PtmFuelGaugeParameter
|
||||
std::array<u8, 0x18> ptm_fuel_gauge_parameter;
|
||||
u8 ptm_battery_version;
|
||||
// nn::settings::system::PtmCycleCountReliability
|
||||
u32 ptm_cycle_count_reliability;
|
||||
INSERT_PADDING_BYTES(0x48); // Reserved
|
||||
|
||||
// nn::settings::system::AnalogStickUserCalibration L
|
||||
std::array<u8, 0x10> analog_user_stick_calibration_l;
|
||||
// nn::settings::system::AnalogStickUserCalibration R
|
||||
std::array<u8, 0x10> analog_user_stick_calibration_r;
|
||||
INSERT_PADDING_BYTES(0x20); // Reserved
|
||||
|
||||
// nn::settings::system::ConsoleSixAxisSensorAccelerationBias
|
||||
Common::Vec3<f32> console_six_axis_sensor_acceleration_bias;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias
|
||||
Common::Vec3<f32> console_six_axis_sensor_angular_velocity_bias;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAccelerationGain
|
||||
std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain
|
||||
std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias
|
||||
Common::Vec3<f32> console_six_axis_sensor_angular_velocity_time_bias;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularAcceleration
|
||||
std::array<u8, 0x24> console_six_axis_sensor_angular_acceleration;
|
||||
};
|
||||
static_assert(offsetof(DeviceSettings, ptm_battery_lot) == 0x10);
|
||||
static_assert(offsetof(DeviceSettings, ptm_cycle_count_reliability) == 0x44);
|
||||
static_assert(offsetof(DeviceSettings, analog_user_stick_calibration_l) == 0x90);
|
||||
static_assert(offsetof(DeviceSettings, console_six_axis_sensor_acceleration_bias) == 0xD0);
|
||||
static_assert(offsetof(DeviceSettings, console_six_axis_sensor_angular_acceleration) == 0x13C);
|
||||
static_assert(sizeof(DeviceSettings) == 0x160, "DeviceSettings has the wrong size!");
|
||||
|
||||
DeviceSettings DefaultDeviceSettings();
|
||||
|
||||
} // namespace Service::Set
|
12
src/core/hle/service/set/setting_formats/private_settings.cpp
Executable file
12
src/core/hle/service/set/setting_formats/private_settings.cpp
Executable file
@@ -0,0 +1,12 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/set/setting_formats/private_settings.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
PrivateSettings DefaultPrivateSettings() {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace Service::Set
|
39
src/core/hle/service/set/setting_formats/private_settings.h
Executable file
39
src/core/hle/service/set/setting_formats/private_settings.h
Executable file
@@ -0,0 +1,39 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/service/set/settings_types.h"
|
||||
#include "core/hle/service/time/clock_types.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
struct PrivateSettings {
|
||||
INSERT_PADDING_BYTES(0x10); // Reserved
|
||||
|
||||
InitialLaunchSettings initial_launch_settings;
|
||||
INSERT_PADDING_BYTES(0x20); // Reserved
|
||||
|
||||
Common::UUID external_clock_source_id;
|
||||
s64 shutdown_rtc_value;
|
||||
s64 external_steady_clock_internal_offset;
|
||||
INSERT_PADDING_BYTES(0x60); // Reserved
|
||||
|
||||
// nn::settings::system::PlatformRegion
|
||||
s32 platform_region;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
};
|
||||
static_assert(offsetof(PrivateSettings, initial_launch_settings) == 0x10);
|
||||
static_assert(offsetof(PrivateSettings, external_clock_source_id) == 0x50);
|
||||
static_assert(offsetof(PrivateSettings, shutdown_rtc_value) == 0x60);
|
||||
static_assert(offsetof(PrivateSettings, external_steady_clock_internal_offset) == 0x68);
|
||||
static_assert(offsetof(PrivateSettings, platform_region) == 0xD0);
|
||||
static_assert(sizeof(PrivateSettings) == 0xD8, "PrivateSettings has the wrong size!");
|
||||
|
||||
PrivateSettings DefaultPrivateSettings();
|
||||
|
||||
} // namespace Service::Set
|
57
src/core/hle/service/set/setting_formats/system_settings.cpp
Executable file
57
src/core/hle/service/set/setting_formats/system_settings.cpp
Executable file
@@ -0,0 +1,57 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/set/setting_formats/system_settings.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
SystemSettings DefaultSystemSettings() {
|
||||
SystemSettings settings{};
|
||||
|
||||
settings.version = 0x140000;
|
||||
settings.flags = 7;
|
||||
|
||||
settings.mii_author_id = Common::UUID::MakeDefault();
|
||||
|
||||
settings.color_set_id = ColorSet::BasicWhite;
|
||||
|
||||
settings.notification_settings = {
|
||||
.flags{0x300},
|
||||
.volume = NotificationVolume::High,
|
||||
.start_time = {.hour = 9, .minute = 0},
|
||||
.stop_time = {.hour = 21, .minute = 0},
|
||||
};
|
||||
|
||||
settings.tv_settings = {
|
||||
.flags = {0xC},
|
||||
.tv_resolution = TvResolution::Auto,
|
||||
.hdmi_content_type = HdmiContentType::Game,
|
||||
.rgb_range = RgbRange::Auto,
|
||||
.cmu_mode = CmuMode::None,
|
||||
.tv_underscan = {},
|
||||
.tv_gama = 1.0f,
|
||||
.contrast_ratio = 0.5f,
|
||||
};
|
||||
|
||||
settings.initial_launch_settings_packed = {
|
||||
.flags = {0x10001},
|
||||
.timestamp = {},
|
||||
};
|
||||
|
||||
settings.sleep_settings = {
|
||||
.flags = {0x3},
|
||||
.handheld_sleep_plan = HandheldSleepPlan::Sleep10Min,
|
||||
.console_sleep_plan = ConsoleSleepPlan::Sleep1Hour,
|
||||
};
|
||||
|
||||
settings.device_time_zone_location_name = {"UTC"};
|
||||
settings.user_system_clock_automatic_correction_enabled = false;
|
||||
|
||||
settings.primary_album_storage = PrimaryAlbumStorage::SdCard;
|
||||
settings.battery_percentage_flag = true;
|
||||
settings.chinese_traditional_input_method = ChineseTraditionalInputMethod::Unknown0;
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
} // namespace Service::Set
|
389
src/core/hle/service/set/setting_formats/system_settings.h
Executable file
389
src/core/hle/service/set/setting_formats/system_settings.h
Executable file
@@ -0,0 +1,389 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "common/bit_field.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/uuid.h"
|
||||
#include "common/vector_math.h"
|
||||
#include "core/hle/service/set/setting_formats/private_settings.h"
|
||||
#include "core/hle/service/set/settings_types.h"
|
||||
#include "core/hle/service/time/clock_types.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
struct SystemSettings {
|
||||
// 0/unwritten (1.0.0), 0x20000 (2.0.0), 0x30000 (3.0.0-3.0.1), 0x40001 (4.0.0-4.1.0), 0x50000
|
||||
// (5.0.0-5.1.0), 0x60000 (6.0.0-6.2.0), 0x70000 (7.0.0), 0x80000 (8.0.0-8.1.1), 0x90000
|
||||
// (9.0.0-10.0.4), 0x100100 (10.1.0+), 0x120000 (12.0.0-12.1.0), 0x130000 (13.0.0-13.2.1),
|
||||
// 0x140000 (14.0.0+)
|
||||
u32 version;
|
||||
// 0/unwritten (1.0.0), 1 (6.0.0-8.1.0), 2 (8.1.1), 7 (9.0.0+).
|
||||
// if (flags & 2), defaults are written for AnalogStickUserCalibration
|
||||
u32 flags;
|
||||
INSERT_PADDING_BYTES(0x8); // Reserved
|
||||
|
||||
LanguageCode language_code;
|
||||
INSERT_PADDING_BYTES(0x38); // Reserved
|
||||
|
||||
// nn::settings::system::NetworkSettings
|
||||
u32 network_setting_count;
|
||||
bool wireless_lan_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x8); // Reserved
|
||||
|
||||
// nn::settings::system::NetworkSettings
|
||||
std::array<std::array<u8, 0x400>, 32> network_settings_1B0;
|
||||
|
||||
// nn::settings::system::BluetoothDevicesSettings
|
||||
std::array<u8, 0x4> bluetooth_device_settings_count;
|
||||
bool bluetooth_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
bool bluetooth_afh_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
bool bluetooth_boost_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
std::array<std::array<u8, 0x200>, 10> bluetooth_device_settings_first_10;
|
||||
|
||||
s32 ldn_channel;
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
// nn::util::Uuid MiiAuthorId
|
||||
Common::UUID mii_author_id;
|
||||
|
||||
INSERT_PADDING_BYTES(0x30); // Reserved
|
||||
|
||||
// nn::settings::system::NxControllerSettings
|
||||
u32 nx_controller_settings_count;
|
||||
|
||||
INSERT_PADDING_BYTES(0xC); // Reserved
|
||||
|
||||
// nn::settings::system::NxControllerSettings,
|
||||
// nn::settings::system::NxControllerLegacySettings on 13.0.0+
|
||||
std::array<std::array<u8, 0x40>, 10> nx_controller_legacy_settings;
|
||||
INSERT_PADDING_BYTES(0x170); // Reserved
|
||||
|
||||
bool external_rtc_reset_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
s32 push_notification_activity_mode_on_sleep;
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
ErrorReportSharePermission error_report_share_permission;
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
KeyboardLayout keyboard_layout;
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
bool web_inspector_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
|
||||
// nn::settings::system::AllowedSslHost
|
||||
u32 allowed_ssl_host_count;
|
||||
|
||||
bool memory_usage_rate_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x34); // Reserved
|
||||
|
||||
// nn::settings::system::HostFsMountPoint
|
||||
std::array<u8, 0x100> host_fs_mount_point;
|
||||
|
||||
// nn::settings::system::AllowedSslHost
|
||||
std::array<std::array<u8, 0x100>, 8> allowed_ssl_hosts;
|
||||
INSERT_PADDING_BYTES(0x6C0); // Reserved
|
||||
|
||||
// nn::settings::system::BlePairingSettings
|
||||
u32 ble_pairing_settings_count;
|
||||
INSERT_PADDING_BYTES(0xC); // Reserved
|
||||
std::array<std::array<u8, 0x80>, 10> ble_pairing_settings;
|
||||
|
||||
// nn::settings::system::AccountOnlineStorageSettings
|
||||
u32 account_online_storage_settings_count;
|
||||
INSERT_PADDING_BYTES(0xC); // Reserved
|
||||
std::array<std::array<u8, 0x40>, 8> account_online_storage_settings;
|
||||
|
||||
bool pctl_ready_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
// nn::settings::system::ThemeId
|
||||
std::array<u8, 0x80> theme_id_type0;
|
||||
std::array<u8, 0x80> theme_id_type1;
|
||||
INSERT_PADDING_BYTES(0x100); // Reserved
|
||||
|
||||
ChineseTraditionalInputMethod chinese_traditional_input_method;
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
bool zoom_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
// nn::settings::system::ButtonConfigRegisteredSettings
|
||||
u32 button_config_registered_settings_count;
|
||||
INSERT_PADDING_BYTES(0xC); // Reserved
|
||||
|
||||
// nn::settings::system::ButtonConfigSettings
|
||||
u32 button_config_settings_count;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
std::array<std::array<u8, 0x5A8>, 5> button_config_settings;
|
||||
INSERT_PADDING_BYTES(0x13B0); // Reserved
|
||||
u32 button_config_settings_embedded_count;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
std::array<std::array<u8, 0x5A8>, 5> button_config_settings_embedded;
|
||||
INSERT_PADDING_BYTES(0x13B0); // Reserved
|
||||
u32 button_config_settings_left_count;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
std::array<std::array<u8, 0x5A8>, 5> button_config_settings_left;
|
||||
INSERT_PADDING_BYTES(0x13B0); // Reserved
|
||||
u32 button_config_settings_right_count;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
std::array<std::array<u8, 0x5A8>, 5> button_config_settings_right;
|
||||
INSERT_PADDING_BYTES(0x73B0); // Reserved
|
||||
// nn::settings::system::ButtonConfigRegisteredSettings
|
||||
std::array<u8, 0x5C8> button_config_registered_settings_embedded;
|
||||
std::array<std::array<u8, 0x5C8>, 10> button_config_registered_settings;
|
||||
INSERT_PADDING_BYTES(0x7FF8); // Reserved
|
||||
|
||||
// nn::settings::system::ConsoleSixAxisSensorAccelerationBias
|
||||
Common::Vec3<f32> console_six_axis_sensor_acceleration_bias;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias
|
||||
Common::Vec3<f32> console_six_axis_sensor_angular_velocity_bias;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAccelerationGain
|
||||
std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain
|
||||
std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias
|
||||
Common::Vec3<f32> console_six_axis_sensor_angular_velocity_time_bias;
|
||||
// nn::settings::system::ConsoleSixAxisSensorAngularAcceleration
|
||||
std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_acceleration;
|
||||
INSERT_PADDING_BYTES(0x70); // Reserved
|
||||
|
||||
bool lock_screen_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
|
||||
ColorSet color_set_id;
|
||||
|
||||
QuestFlag quest_flag;
|
||||
|
||||
SystemRegionCode region_code;
|
||||
|
||||
// Different to nn::settings::system::InitialLaunchSettings?
|
||||
InitialLaunchSettingsPacked initial_launch_settings_packed;
|
||||
|
||||
bool battery_percentage_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
|
||||
// BitFlagSet<32, nn::settings::system::AppletLaunchFlag>
|
||||
u32 applet_launch_flag;
|
||||
|
||||
// nn::settings::system::ThemeSettings
|
||||
std::array<u8, 0x8> theme_settings;
|
||||
// nn::fssystem::ArchiveMacKey
|
||||
std::array<u8, 0x10> theme_key;
|
||||
|
||||
bool field_testing_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
|
||||
s32 panel_crc_mode;
|
||||
INSERT_PADDING_BYTES(0x28); // Reserved
|
||||
|
||||
// nn::settings::system::BacklightSettings
|
||||
std::array<u8, 0x2C> backlight_settings_mixed_up;
|
||||
INSERT_PADDING_BYTES(0x64); // Reserved
|
||||
|
||||
Service::Time::Clock::SystemClockContext user_system_clock_context;
|
||||
Service::Time::Clock::SystemClockContext network_system_clock_context;
|
||||
bool user_system_clock_automatic_correction_enabled;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
Service::Time::Clock::SteadyClockTimePoint
|
||||
user_system_clock_automatic_correction_updated_time_point;
|
||||
INSERT_PADDING_BYTES(0x10); // Reserved
|
||||
|
||||
AccountSettings account_settings;
|
||||
INSERT_PADDING_BYTES(0xFC); // Reserved
|
||||
|
||||
// nn::settings::system::AudioVolume
|
||||
std::array<u8, 0x8> audio_volume_type0;
|
||||
std::array<u8, 0x8> audio_volume_type1;
|
||||
// nn::settings::system::AudioOutputMode
|
||||
s32 audio_output_mode_type0;
|
||||
s32 audio_output_mode_type1;
|
||||
s32 audio_output_mode_type2;
|
||||
bool force_mute_on_headphone_removed;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
s32 headphone_volume_warning_count;
|
||||
bool heaphone_volume_update_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
// nn::settings::system::AudioVolume
|
||||
std::array<u8, 0x8> audio_volume_type2;
|
||||
// nn::settings::system::AudioOutputMode
|
||||
s32 audio_output_mode_type3;
|
||||
s32 audio_output_mode_type4;
|
||||
bool hearing_protection_safeguard_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
s64 hearing_protection_safeguard_remaining_time;
|
||||
INSERT_PADDING_BYTES(0x38); // Reserved
|
||||
|
||||
bool console_information_upload_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
bool automatic_application_download_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
|
||||
NotificationSettings notification_settings;
|
||||
INSERT_PADDING_BYTES(0x60); // Reserved
|
||||
|
||||
// nn::settings::system::AccountNotificationSettings
|
||||
u32 account_notification_settings_count;
|
||||
INSERT_PADDING_BYTES(0xC); // Reserved
|
||||
std::array<AccountNotificationSettings, 8> account_notification_settings;
|
||||
INSERT_PADDING_BYTES(0x140); // Reserved
|
||||
|
||||
f32 vibration_master_volume;
|
||||
|
||||
bool usb_full_key_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
|
||||
// nn::settings::system::AnalogStickUserCalibration
|
||||
std::array<u8, 0x10> analog_stick_user_calibration_left;
|
||||
std::array<u8, 0x10> analog_stick_user_calibration_right;
|
||||
|
||||
// nn::settings::system::TouchScreenMode
|
||||
s32 touch_screen_mode;
|
||||
INSERT_PADDING_BYTES(0x14); // Reserved
|
||||
|
||||
TvSettings tv_settings;
|
||||
|
||||
// nn::settings::system::Edid
|
||||
std::array<u8, 0x100> edid;
|
||||
INSERT_PADDING_BYTES(0x2E0); // Reserved
|
||||
|
||||
// nn::settings::system::DataDeletionSettings
|
||||
std::array<u8, 0x8> data_deletion_settings;
|
||||
INSERT_PADDING_BYTES(0x38); // Reserved
|
||||
|
||||
// nn::ncm::ProgramId
|
||||
std::array<u8, 0x8> initial_system_applet_program_id;
|
||||
std::array<u8, 0x8> overlay_disp_program_id;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
|
||||
bool requires_run_repair_time_reviser;
|
||||
INSERT_PADDING_BYTES(0x6B); // Reserved
|
||||
|
||||
Service::Time::TimeZone::LocationName device_time_zone_location_name;
|
||||
INSERT_PADDING_BYTES(0x4); // Reserved
|
||||
Service::Time::Clock::SteadyClockTimePoint device_time_zone_location_updated_time;
|
||||
INSERT_PADDING_BYTES(0xC0); // Reserved
|
||||
|
||||
// nn::settings::system::PrimaryAlbumStorage
|
||||
PrimaryAlbumStorage primary_album_storage;
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
bool usb_30_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
bool usb_30_host_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
bool usb_30_device_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x34); // Reserved
|
||||
|
||||
bool nfc_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x3C); // Reserved
|
||||
|
||||
// nn::settings::system::SleepSettings
|
||||
SleepSettings sleep_settings;
|
||||
INSERT_PADDING_BYTES(0x34); // Reserved
|
||||
|
||||
// nn::settings::system::EulaVersion
|
||||
u32 eula_version_count;
|
||||
INSERT_PADDING_BYTES(0xC); // Reserved
|
||||
std::array<EulaVersion, 32> eula_versions;
|
||||
INSERT_PADDING_BYTES(0x200); // Reserved
|
||||
|
||||
// nn::settings::system::DeviceNickName
|
||||
std::array<u8, 0x80> device_nick_name;
|
||||
INSERT_PADDING_BYTES(0x80); // Reserved
|
||||
|
||||
bool auto_update_enable_flag;
|
||||
INSERT_PADDING_BYTES(0x3);
|
||||
INSERT_PADDING_BYTES(0x4C); // Reserved
|
||||
|
||||
// nn::settings::system::BluetoothDevicesSettings
|
||||
std::array<std::array<u8, 0x200>, 14> bluetooth_device_settings_last_14;
|
||||
INSERT_PADDING_BYTES(0x2000); // Reserved
|
||||
|
||||
// nn::settings::system::NxControllerSettings
|
||||
std::array<std::array<u8, 0x800>, 10> nx_controller_settings_data_from_offset_30;
|
||||
};
|
||||
|
||||
static_assert(offsetof(SystemSettings, language_code) == 0x10);
|
||||
static_assert(offsetof(SystemSettings, network_setting_count) == 0x50);
|
||||
static_assert(offsetof(SystemSettings, network_settings_1B0) == 0x60);
|
||||
static_assert(offsetof(SystemSettings, bluetooth_device_settings_count) == 0x8060);
|
||||
static_assert(offsetof(SystemSettings, bluetooth_enable_flag) == 0x8064);
|
||||
static_assert(offsetof(SystemSettings, bluetooth_device_settings_first_10) == 0x8070);
|
||||
static_assert(offsetof(SystemSettings, ldn_channel) == 0x9470);
|
||||
static_assert(offsetof(SystemSettings, mii_author_id) == 0x94B0);
|
||||
static_assert(offsetof(SystemSettings, nx_controller_settings_count) == 0x94F0);
|
||||
static_assert(offsetof(SystemSettings, nx_controller_legacy_settings) == 0x9500);
|
||||
static_assert(offsetof(SystemSettings, external_rtc_reset_flag) == 0x98F0);
|
||||
static_assert(offsetof(SystemSettings, push_notification_activity_mode_on_sleep) == 0x9930);
|
||||
static_assert(offsetof(SystemSettings, allowed_ssl_host_count) == 0x99F4);
|
||||
static_assert(offsetof(SystemSettings, host_fs_mount_point) == 0x9A30);
|
||||
static_assert(offsetof(SystemSettings, allowed_ssl_hosts) == 0x9B30);
|
||||
static_assert(offsetof(SystemSettings, ble_pairing_settings_count) == 0xA9F0);
|
||||
static_assert(offsetof(SystemSettings, ble_pairing_settings) == 0xAA00);
|
||||
static_assert(offsetof(SystemSettings, account_online_storage_settings_count) == 0xAF00);
|
||||
static_assert(offsetof(SystemSettings, account_online_storage_settings) == 0xAF10);
|
||||
static_assert(offsetof(SystemSettings, pctl_ready_flag) == 0xB110);
|
||||
static_assert(offsetof(SystemSettings, theme_id_type0) == 0xB150);
|
||||
static_assert(offsetof(SystemSettings, chinese_traditional_input_method) == 0xB350);
|
||||
static_assert(offsetof(SystemSettings, button_config_registered_settings_count) == 0xB3D0);
|
||||
static_assert(offsetof(SystemSettings, button_config_settings_count) == 0xB3E0);
|
||||
static_assert(offsetof(SystemSettings, button_config_settings) == 0xB3E8);
|
||||
static_assert(offsetof(SystemSettings, button_config_registered_settings_embedded) == 0x1D3E0);
|
||||
static_assert(offsetof(SystemSettings, console_six_axis_sensor_acceleration_bias) == 0x29370);
|
||||
static_assert(offsetof(SystemSettings, lock_screen_flag) == 0x29470);
|
||||
static_assert(offsetof(SystemSettings, battery_percentage_flag) == 0x294A0);
|
||||
static_assert(offsetof(SystemSettings, field_testing_flag) == 0x294C0);
|
||||
static_assert(offsetof(SystemSettings, backlight_settings_mixed_up) == 0x294F0);
|
||||
static_assert(offsetof(SystemSettings, user_system_clock_context) == 0x29580);
|
||||
static_assert(offsetof(SystemSettings, network_system_clock_context) == 0x295A0);
|
||||
static_assert(offsetof(SystemSettings, user_system_clock_automatic_correction_enabled) == 0x295C0);
|
||||
static_assert(offsetof(SystemSettings, user_system_clock_automatic_correction_updated_time_point) ==
|
||||
0x295C8);
|
||||
static_assert(offsetof(SystemSettings, account_settings) == 0x295F0);
|
||||
static_assert(offsetof(SystemSettings, audio_volume_type0) == 0x296F0);
|
||||
static_assert(offsetof(SystemSettings, hearing_protection_safeguard_remaining_time) == 0x29730);
|
||||
static_assert(offsetof(SystemSettings, automatic_application_download_flag) == 0x297B0);
|
||||
static_assert(offsetof(SystemSettings, notification_settings) == 0x297B8);
|
||||
static_assert(offsetof(SystemSettings, account_notification_settings) == 0x29840);
|
||||
static_assert(offsetof(SystemSettings, vibration_master_volume) == 0x29A40);
|
||||
static_assert(offsetof(SystemSettings, analog_stick_user_calibration_left) == 0x29A48);
|
||||
static_assert(offsetof(SystemSettings, touch_screen_mode) == 0x29A68);
|
||||
static_assert(offsetof(SystemSettings, edid) == 0x29AA0);
|
||||
static_assert(offsetof(SystemSettings, data_deletion_settings) == 0x29E80);
|
||||
static_assert(offsetof(SystemSettings, requires_run_repair_time_reviser) == 0x29ED4);
|
||||
static_assert(offsetof(SystemSettings, device_time_zone_location_name) == 0x29F40);
|
||||
static_assert(offsetof(SystemSettings, nfc_enable_flag) == 0x2A0C0);
|
||||
static_assert(offsetof(SystemSettings, eula_version_count) == 0x2A140);
|
||||
static_assert(offsetof(SystemSettings, device_nick_name) == 0x2A950);
|
||||
static_assert(offsetof(SystemSettings, bluetooth_device_settings_last_14) == 0x2AAA0);
|
||||
static_assert(offsetof(SystemSettings, nx_controller_settings_data_from_offset_30) == 0x2E6A0);
|
||||
|
||||
static_assert(sizeof(SystemSettings) == 0x336A0, "SystemSettings has the wrong size!");
|
||||
|
||||
SystemSettings DefaultSystemSettings();
|
||||
|
||||
} // namespace Service::Set
|
@@ -4,72 +4,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/set/system_settings.h"
|
||||
#include "core/hle/service/set/settings_types.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::Set {
|
||||
enum class KeyboardLayout : u64 {
|
||||
Japanese = 0,
|
||||
EnglishUs = 1,
|
||||
EnglishUsInternational = 2,
|
||||
EnglishUk = 3,
|
||||
French = 4,
|
||||
FrenchCa = 5,
|
||||
Spanish = 6,
|
||||
SpanishLatin = 7,
|
||||
German = 8,
|
||||
Italian = 9,
|
||||
Portuguese = 10,
|
||||
Russian = 11,
|
||||
Korean = 12,
|
||||
ChineseSimplified = 13,
|
||||
ChineseTraditional = 14,
|
||||
};
|
||||
|
||||
constexpr std::array<LanguageCode, 18> available_language_codes = {{
|
||||
LanguageCode::JA,
|
||||
LanguageCode::EN_US,
|
||||
LanguageCode::FR,
|
||||
LanguageCode::DE,
|
||||
LanguageCode::IT,
|
||||
LanguageCode::ES,
|
||||
LanguageCode::ZH_CN,
|
||||
LanguageCode::KO,
|
||||
LanguageCode::NL,
|
||||
LanguageCode::PT,
|
||||
LanguageCode::RU,
|
||||
LanguageCode::ZH_TW,
|
||||
LanguageCode::EN_GB,
|
||||
LanguageCode::FR_CA,
|
||||
LanguageCode::ES_419,
|
||||
LanguageCode::ZH_HANS,
|
||||
LanguageCode::ZH_HANT,
|
||||
LanguageCode::PT_BR,
|
||||
}};
|
||||
|
||||
static constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{
|
||||
{LanguageCode::JA, KeyboardLayout::Japanese},
|
||||
{LanguageCode::EN_US, KeyboardLayout::EnglishUs},
|
||||
{LanguageCode::FR, KeyboardLayout::French},
|
||||
{LanguageCode::DE, KeyboardLayout::German},
|
||||
{LanguageCode::IT, KeyboardLayout::Italian},
|
||||
{LanguageCode::ES, KeyboardLayout::Spanish},
|
||||
{LanguageCode::ZH_CN, KeyboardLayout::ChineseSimplified},
|
||||
{LanguageCode::KO, KeyboardLayout::Korean},
|
||||
{LanguageCode::NL, KeyboardLayout::EnglishUsInternational},
|
||||
{LanguageCode::PT, KeyboardLayout::Portuguese},
|
||||
{LanguageCode::RU, KeyboardLayout::Russian},
|
||||
{LanguageCode::ZH_TW, KeyboardLayout::ChineseTraditional},
|
||||
{LanguageCode::EN_GB, KeyboardLayout::EnglishUk},
|
||||
{LanguageCode::FR_CA, KeyboardLayout::FrenchCa},
|
||||
{LanguageCode::ES_419, KeyboardLayout::SpanishLatin},
|
||||
{LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified},
|
||||
{LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional},
|
||||
{LanguageCode::PT_BR, KeyboardLayout::Portuguese},
|
||||
}};
|
||||
|
||||
LanguageCode GetLanguageCodeFromIndex(std::size_t idx);
|
||||
|
||||
|
451
src/core/hle/service/set/settings_types.h
Executable file
451
src/core/hle/service/set/settings_types.h
Executable file
@@ -0,0 +1,451 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "common/bit_field.h"
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/service/time/clock_types.h"
|
||||
|
||||
namespace Service::Set {
|
||||
|
||||
/// This is nn::settings::system::AudioOutputMode
|
||||
enum class AudioOutputMode : u32 {
|
||||
ch_1,
|
||||
ch_2,
|
||||
ch_5_1,
|
||||
ch_7_1,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::AudioOutputModeTarget
|
||||
enum class AudioOutputModeTarget : u32 {
|
||||
Hdmi,
|
||||
Speaker,
|
||||
Headphone,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::AudioVolumeTarget
|
||||
enum class AudioVolumeTarget : u32 {
|
||||
Speaker,
|
||||
Headphone,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::ClockSourceId
|
||||
enum class ClockSourceId : u32 {
|
||||
NetworkSystemClock,
|
||||
SteadyClock,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::CmuMode
|
||||
enum class CmuMode : u32 {
|
||||
None,
|
||||
ColorInvert,
|
||||
HighContrast,
|
||||
GrayScale,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::ChineseTraditionalInputMethod
|
||||
enum class ChineseTraditionalInputMethod : u32 {
|
||||
Unknown0 = 0,
|
||||
Unknown1 = 1,
|
||||
Unknown2 = 2,
|
||||
};
|
||||
|
||||
/// Indicates the current theme set by the system settings
|
||||
enum class ColorSet : u32 {
|
||||
BasicWhite = 0,
|
||||
BasicBlack = 1,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::ConsoleSleepPlan
|
||||
enum class ConsoleSleepPlan : u32 {
|
||||
Sleep1Hour,
|
||||
Sleep2Hour,
|
||||
Sleep3Hour,
|
||||
Sleep6Hour,
|
||||
Sleep12Hour,
|
||||
Never,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::ErrorReportSharePermission
|
||||
enum class ErrorReportSharePermission : u32 {
|
||||
NotConfirmed,
|
||||
Granted,
|
||||
Denied,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::EulaVersionClockType
|
||||
enum class EulaVersionClockType : u32 {
|
||||
NetworkSystemClock,
|
||||
SteadyClock,
|
||||
};
|
||||
|
||||
/// This is nn::settings::factory::RegionCode
|
||||
enum class FactoryRegionCode : u32 {
|
||||
Japan,
|
||||
Usa,
|
||||
Europe,
|
||||
Australia,
|
||||
China,
|
||||
Korea,
|
||||
Taiwan,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::FriendPresenceOverlayPermission
|
||||
enum class FriendPresenceOverlayPermission : u8 {
|
||||
NotConfirmed,
|
||||
NoDisplay,
|
||||
FavoriteFriends,
|
||||
Friends,
|
||||
};
|
||||
|
||||
enum class GetFirmwareVersionType {
|
||||
Version1,
|
||||
Version2,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::HandheldSleepPlan
|
||||
enum class HandheldSleepPlan : u32 {
|
||||
Sleep1Min,
|
||||
Sleep3Min,
|
||||
Sleep5Min,
|
||||
Sleep10Min,
|
||||
Sleep30Min,
|
||||
Never,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::HdmiContentType
|
||||
enum class HdmiContentType : u32 {
|
||||
None,
|
||||
Graphics,
|
||||
Cinema,
|
||||
Photo,
|
||||
Game,
|
||||
};
|
||||
|
||||
enum class KeyboardLayout : u32 {
|
||||
Japanese = 0,
|
||||
EnglishUs = 1,
|
||||
EnglishUsInternational = 2,
|
||||
EnglishUk = 3,
|
||||
French = 4,
|
||||
FrenchCa = 5,
|
||||
Spanish = 6,
|
||||
SpanishLatin = 7,
|
||||
German = 8,
|
||||
Italian = 9,
|
||||
Portuguese = 10,
|
||||
Russian = 11,
|
||||
Korean = 12,
|
||||
ChineseSimplified = 13,
|
||||
ChineseTraditional = 14,
|
||||
};
|
||||
|
||||
/// This is "nn::settings::LanguageCode", which is a NUL-terminated string stored in a u64.
|
||||
enum class LanguageCode : u64 {
|
||||
JA = 0x000000000000616A,
|
||||
EN_US = 0x00000053552D6E65,
|
||||
FR = 0x0000000000007266,
|
||||
DE = 0x0000000000006564,
|
||||
IT = 0x0000000000007469,
|
||||
ES = 0x0000000000007365,
|
||||
ZH_CN = 0x0000004E432D687A,
|
||||
KO = 0x0000000000006F6B,
|
||||
NL = 0x0000000000006C6E,
|
||||
PT = 0x0000000000007470,
|
||||
RU = 0x0000000000007572,
|
||||
ZH_TW = 0x00000057542D687A,
|
||||
EN_GB = 0x00000042472D6E65,
|
||||
FR_CA = 0x00000041432D7266,
|
||||
ES_419 = 0x00003931342D7365,
|
||||
ZH_HANS = 0x00736E61482D687A,
|
||||
ZH_HANT = 0x00746E61482D687A,
|
||||
PT_BR = 0x00000052422D7470,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::NotificationVolume
|
||||
enum class NotificationVolume : u32 {
|
||||
Mute,
|
||||
Low,
|
||||
High,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::PrimaryAlbumStorage
|
||||
enum class PrimaryAlbumStorage : u32 {
|
||||
Nand,
|
||||
SdCard,
|
||||
};
|
||||
|
||||
/// Indicates the current console is a retail or kiosk unit
|
||||
enum class QuestFlag : u8 {
|
||||
Retail = 0,
|
||||
Kiosk = 1,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::RgbRange
|
||||
enum class RgbRange : u32 {
|
||||
Auto,
|
||||
Full,
|
||||
Limited,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::RegionCode
|
||||
enum class SystemRegionCode : u32 {
|
||||
Japan,
|
||||
Usa,
|
||||
Europe,
|
||||
Australia,
|
||||
HongKongTaiwanKorea,
|
||||
China,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::TouchScreenMode
|
||||
enum class TouchScreenMode : u32 {
|
||||
Stylus,
|
||||
Standard,
|
||||
};
|
||||
|
||||
/// This is nn::settings::system::TvResolution
|
||||
enum class TvResolution : u32 {
|
||||
Auto,
|
||||
Resolution1080p,
|
||||
Resolution720p,
|
||||
Resolution480p,
|
||||
};
|
||||
|
||||
constexpr std::array<LanguageCode, 18> available_language_codes = {{
|
||||
LanguageCode::JA,
|
||||
LanguageCode::EN_US,
|
||||
LanguageCode::FR,
|
||||
LanguageCode::DE,
|
||||
LanguageCode::IT,
|
||||
LanguageCode::ES,
|
||||
LanguageCode::ZH_CN,
|
||||
LanguageCode::KO,
|
||||
LanguageCode::NL,
|
||||
LanguageCode::PT,
|
||||
LanguageCode::RU,
|
||||
LanguageCode::ZH_TW,
|
||||
LanguageCode::EN_GB,
|
||||
LanguageCode::FR_CA,
|
||||
LanguageCode::ES_419,
|
||||
LanguageCode::ZH_HANS,
|
||||
LanguageCode::ZH_HANT,
|
||||
LanguageCode::PT_BR,
|
||||
}};
|
||||
|
||||
static constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{
|
||||
{LanguageCode::JA, KeyboardLayout::Japanese},
|
||||
{LanguageCode::EN_US, KeyboardLayout::EnglishUs},
|
||||
{LanguageCode::FR, KeyboardLayout::French},
|
||||
{LanguageCode::DE, KeyboardLayout::German},
|
||||
{LanguageCode::IT, KeyboardLayout::Italian},
|
||||
{LanguageCode::ES, KeyboardLayout::Spanish},
|
||||
{LanguageCode::ZH_CN, KeyboardLayout::ChineseSimplified},
|
||||
{LanguageCode::KO, KeyboardLayout::Korean},
|
||||
{LanguageCode::NL, KeyboardLayout::EnglishUsInternational},
|
||||
{LanguageCode::PT, KeyboardLayout::Portuguese},
|
||||
{LanguageCode::RU, KeyboardLayout::Russian},
|
||||
{LanguageCode::ZH_TW, KeyboardLayout::ChineseTraditional},
|
||||
{LanguageCode::EN_GB, KeyboardLayout::EnglishUk},
|
||||
{LanguageCode::FR_CA, KeyboardLayout::FrenchCa},
|
||||
{LanguageCode::ES_419, KeyboardLayout::SpanishLatin},
|
||||
{LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified},
|
||||
{LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional},
|
||||
{LanguageCode::PT_BR, KeyboardLayout::Portuguese},
|
||||
}};
|
||||
|
||||
/// This is nn::settings::system::AccountNotificationFlag
|
||||
struct AccountNotificationFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> FriendOnlineFlag;
|
||||
BitField<1, 1, u32> FriendRequestFlag;
|
||||
BitField<8, 1, u32> CoralInvitationFlag;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(AccountNotificationFlag) == 4, "AccountNotificationFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::AccountSettings
|
||||
struct AccountSettings {
|
||||
u32 flags;
|
||||
};
|
||||
static_assert(sizeof(AccountSettings) == 4, "AccountSettings is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::DataDeletionFlag
|
||||
struct DataDeletionFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> AutomaticDeletionFlag;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(DataDeletionFlag) == 4, "DataDeletionFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::InitialLaunchFlag
|
||||
struct InitialLaunchFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> InitialLaunchCompletionFlag;
|
||||
BitField<8, 1, u32> InitialLaunchUserAdditionFlag;
|
||||
BitField<16, 1, u32> InitialLaunchTimestampFlag;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(InitialLaunchFlag) == 4, "InitialLaunchFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::SleepFlag
|
||||
struct SleepFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> SleepsWhilePlayingMedia;
|
||||
BitField<1, 1, u32> WakesAtPowerStateChange;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(SleepFlag) == 4, "TvFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::NotificationFlag
|
||||
struct NotificationFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> RingtoneFlag;
|
||||
BitField<1, 1, u32> DownloadCompletionFlag;
|
||||
BitField<8, 1, u32> EnablesNews;
|
||||
BitField<9, 1, u32> IncomingLampFlag;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(NotificationFlag) == 4, "NotificationFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::TvFlag
|
||||
struct TvFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> Allows4k;
|
||||
BitField<1, 1, u32> Allows3d;
|
||||
BitField<2, 1, u32> AllowsCec;
|
||||
BitField<3, 1, u32> PreventsScreenBurnIn;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(TvFlag) == 4, "TvFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::UserSelectorFlag
|
||||
struct UserSelectorFlag {
|
||||
union {
|
||||
u32 raw{};
|
||||
|
||||
BitField<0, 1, u32> SkipIfSingleUser;
|
||||
BitField<31, 1, u32> Unknown;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(UserSelectorFlag) == 4, "UserSelectorFlag is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::AccountNotificationSettings
|
||||
struct AccountNotificationSettings {
|
||||
Common::UUID uid;
|
||||
AccountNotificationFlag flags;
|
||||
FriendPresenceOverlayPermission friend_presence_permission;
|
||||
FriendPresenceOverlayPermission friend_invitation_permission;
|
||||
INSERT_PADDING_BYTES(0x2);
|
||||
};
|
||||
static_assert(sizeof(AccountNotificationSettings) == 0x18,
|
||||
"AccountNotificationSettings is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::EulaVersion
|
||||
struct EulaVersion {
|
||||
u32 version;
|
||||
SystemRegionCode region_code;
|
||||
EulaVersionClockType clock_type;
|
||||
INSERT_PADDING_BYTES(0x4);
|
||||
s64 posix_time;
|
||||
Time::Clock::SteadyClockTimePoint timestamp;
|
||||
};
|
||||
static_assert(sizeof(EulaVersion) == 0x30, "EulaVersion is incorrect size");
|
||||
|
||||
struct FirmwareVersionFormat {
|
||||
u8 major;
|
||||
u8 minor;
|
||||
u8 micro;
|
||||
INSERT_PADDING_BYTES(1);
|
||||
u8 revision_major;
|
||||
u8 revision_minor;
|
||||
INSERT_PADDING_BYTES(2);
|
||||
std::array<char, 0x20> platform;
|
||||
std::array<u8, 0x40> version_hash;
|
||||
std::array<char, 0x18> display_version;
|
||||
std::array<char, 0x80> display_title;
|
||||
};
|
||||
static_assert(sizeof(FirmwareVersionFormat) == 0x100, "FirmwareVersionFormat is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::HomeMenuScheme
|
||||
struct HomeMenuScheme {
|
||||
u32 main;
|
||||
u32 back;
|
||||
u32 sub;
|
||||
u32 bezel;
|
||||
u32 extra;
|
||||
};
|
||||
static_assert(sizeof(HomeMenuScheme) == 0x14, "HomeMenuScheme is incorrect size");
|
||||
|
||||
/// This is nn::settings::system::InitialLaunchSettings
|
||||
struct InitialLaunchSettings {
|
||||
InitialLaunchFlag flags;
|
||||
INSERT_PADDING_BYTES(0x4);
|
||||
Service::Time::Clock::SteadyClockTimePoint timestamp;
|
||||
};
|
||||
static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size");
|
||||
|
||||
#pragma pack(push, 4)
|
||||
struct InitialLaunchSettingsPacked {
|
||||
InitialLaunchFlag flags;
|
||||
Service::Time::Clock::SteadyClockTimePoint timestamp;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
static_assert(sizeof(InitialLaunchSettingsPacked) == 0x1C,
|
||||
"InitialLaunchSettingsPacked is incorrect size");
|
||||
|
||||
/// This is nn::settings::system::NotificationTime
|
||||
struct NotificationTime {
|
||||
u32 hour;
|
||||
u32 minute;
|
||||
};
|
||||
static_assert(sizeof(NotificationTime) == 0x8, "NotificationTime is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::NotificationSettings
|
||||
struct NotificationSettings {
|
||||
NotificationFlag flags;
|
||||
NotificationVolume volume;
|
||||
NotificationTime start_time;
|
||||
NotificationTime stop_time;
|
||||
};
|
||||
static_assert(sizeof(NotificationSettings) == 0x18, "NotificationSettings is an invalid size");
|
||||
|
||||
/// This is nn::settings::system::SleepSettings
|
||||
struct SleepSettings {
|
||||
SleepFlag flags;
|
||||
HandheldSleepPlan handheld_sleep_plan;
|
||||
ConsoleSleepPlan console_sleep_plan;
|
||||
};
|
||||
static_assert(sizeof(SleepSettings) == 0xc, "SleepSettings is incorrect size");
|
||||
|
||||
/// This is nn::settings::system::TvSettings
|
||||
struct TvSettings {
|
||||
TvFlag flags;
|
||||
TvResolution tv_resolution;
|
||||
HdmiContentType hdmi_content_type;
|
||||
RgbRange rgb_range;
|
||||
CmuMode cmu_mode;
|
||||
u32 tv_underscan;
|
||||
f32 tv_gama;
|
||||
f32 contrast_ratio;
|
||||
};
|
||||
static_assert(sizeof(TvSettings) == 0x20, "TvSettings is an invalid size");
|
||||
|
||||
} // namespace Service::Set
|
@@ -97,8 +97,8 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
|
||||
{3, &ISystemSettingsServer::GetFirmwareVersion, "GetFirmwareVersion"},
|
||||
{4, &ISystemSettingsServer::GetFirmwareVersion2, "GetFirmwareVersion2"},
|
||||
{5, nullptr, "GetFirmwareVersionDigest"},
|
||||
{7, nullptr, "GetLockScreenFlag"},
|
||||
{8, nullptr, "SetLockScreenFlag"},
|
||||
{7, &ISystemSettingsServer::GetLockScreenFlag, "GetLockScreenFlag"},
|
||||
{8, &ISystemSettingsServer::SetLockScreenFlag, "SetLockScreenFlag"},
|
||||
{9, nullptr, "GetBacklightSettings"},
|
||||
{10, nullptr, "SetBacklightSettings"},
|
||||
{11, nullptr, "SetBluetoothDevicesSettings"},
|
||||
@@ -157,12 +157,12 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
|
||||
{66, nullptr, "SetUsb30EnableFlag"},
|
||||
{67, nullptr, "GetBatteryLot"},
|
||||
{68, nullptr, "GetSerialNumber"},
|
||||
{69, nullptr, "GetNfcEnableFlag"},
|
||||
{70, nullptr, "SetNfcEnableFlag"},
|
||||
{69, &ISystemSettingsServer::GetNfcEnableFlag, "GetNfcEnableFlag"},
|
||||
{70, &ISystemSettingsServer::SetNfcEnableFlag, "SetNfcEnableFlag"},
|
||||
{71, &ISystemSettingsServer::GetSleepSettings, "GetSleepSettings"},
|
||||
{72, &ISystemSettingsServer::SetSleepSettings, "SetSleepSettings"},
|
||||
{73, nullptr, "GetWirelessLanEnableFlag"},
|
||||
{74, nullptr, "SetWirelessLanEnableFlag"},
|
||||
{73, &ISystemSettingsServer::GetWirelessLanEnableFlag, "GetWirelessLanEnableFlag"},
|
||||
{74, &ISystemSettingsServer::SetWirelessLanEnableFlag, "SetWirelessLanEnableFlag"},
|
||||
{75, &ISystemSettingsServer::GetInitialLaunchSettings, "GetInitialLaunchSettings"},
|
||||
{76, &ISystemSettingsServer::SetInitialLaunchSettings, "SetInitialLaunchSettings"},
|
||||
{77, &ISystemSettingsServer::GetDeviceNickName, "GetDeviceNickName"},
|
||||
@@ -176,8 +176,8 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
|
||||
{85, nullptr, "SetPtmBatteryLot"},
|
||||
{86, nullptr, "GetPtmFuelGaugeParameter"},
|
||||
{87, nullptr, "SetPtmFuelGaugeParameter"},
|
||||
{88, nullptr, "GetBluetoothEnableFlag"},
|
||||
{89, nullptr, "SetBluetoothEnableFlag"},
|
||||
{88, &ISystemSettingsServer::GetBluetoothEnableFlag, "GetBluetoothEnableFlag"},
|
||||
{89, &ISystemSettingsServer::SetBluetoothEnableFlag, "SetBluetoothEnableFlag"},
|
||||
{90, &ISystemSettingsServer::GetMiiAuthorId, "GetMiiAuthorId"},
|
||||
{91, nullptr, "SetShutdownRtcValue"},
|
||||
{92, nullptr, "GetShutdownRtcValue"},
|
||||
@@ -510,6 +510,25 @@ void ISystemSettingsServer::SetUserSystemClockContext(HLERequestContext& ctx) {
|
||||
rb.Push(res);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetLockScreenFlag(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called, lock_screen_flag={}", m_system_settings.lock_screen_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(m_system_settings.lock_screen_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetLockScreenFlag(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
m_system_settings.lock_screen_flag = rp.Pop<bool>();
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET, "called, lock_screen_flag={}", m_system_settings.lock_screen_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetAccountSettings(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
@@ -531,7 +550,7 @@ void ISystemSettingsServer::SetAccountSettings(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetEulaVersions(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called, elements={}", m_system_settings.eula_version_count);
|
||||
|
||||
ctx.WriteBuffer(m_system_settings.eula_versions);
|
||||
|
||||
@@ -557,7 +576,7 @@ void ISystemSettingsServer::SetEulaVersions(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetColorSetId(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_SET, "called");
|
||||
LOG_DEBUG(Service_SET, "called, color_set=", m_system_settings.color_set_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -576,7 +595,13 @@ void ISystemSettingsServer::SetColorSetId(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetNotificationSettings(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called, flags={}, volume={}, head_time={}:{}, tailt_time={}:{}",
|
||||
m_system_settings.notification_settings.flags.raw,
|
||||
m_system_settings.notification_settings.volume,
|
||||
m_system_settings.notification_settings.start_time.hour,
|
||||
m_system_settings.notification_settings.start_time.minute,
|
||||
m_system_settings.notification_settings.stop_time.hour,
|
||||
m_system_settings.notification_settings.stop_time.minute);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 8};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -601,7 +626,8 @@ void ISystemSettingsServer::SetNotificationSettings(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetAccountNotificationSettings(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called, elements={}",
|
||||
m_system_settings.account_notification_settings_count);
|
||||
|
||||
ctx.WriteBuffer(m_system_settings.account_notification_settings);
|
||||
|
||||
@@ -645,6 +671,7 @@ using Settings =
|
||||
static Settings GetSettings() {
|
||||
Settings ret;
|
||||
|
||||
// AM
|
||||
ret["hbloader"]["applet_heap_size"] = ToBytes(u64{0x0});
|
||||
ret["hbloader"]["applet_heap_reservation_size"] = ToBytes(u64{0x8600000});
|
||||
|
||||
@@ -656,6 +683,24 @@ static Settings GetSettings() {
|
||||
ret["time"]["standard_steady_clock_test_offset_minutes"] = ToBytes(s32{0});
|
||||
ret["time"]["standard_user_clock_initial_year"] = ToBytes(s32{2023});
|
||||
|
||||
// HID
|
||||
ret["hid_debug"]["enables_debugpad"] = ToBytes(bool{true});
|
||||
ret["hid_debug"]["manages_devices"] = ToBytes(bool{true});
|
||||
ret["hid_debug"]["manages_touch_ic_i2c"] = ToBytes(bool{true});
|
||||
ret["hid_debug"]["emulate_future_device"] = ToBytes(bool{false});
|
||||
ret["hid_debug"]["emulate_mcu_hardware_error"] = ToBytes(bool{false});
|
||||
ret["hid_debug"]["enables_rail"] = ToBytes(bool{true});
|
||||
ret["hid_debug"]["emulate_firmware_update_failure"] = ToBytes(bool{false});
|
||||
ret["hid_debug"]["failure_firmware_update"] = ToBytes(s32{0});
|
||||
ret["hid_debug"]["ble_disabled"] = ToBytes(bool{false});
|
||||
ret["hid_debug"]["dscale_disabled"] = ToBytes(bool{false});
|
||||
ret["hid_debug"]["force_handheld"] = ToBytes(bool{true});
|
||||
ret["hid_debug"]["disabled_features_per_id"] = std::vector<u8>(0xa8);
|
||||
ret["hid_debug"]["touch_firmware_auto_update_disabled"] = ToBytes(bool{false});
|
||||
|
||||
// Settings
|
||||
ret["settings_debug"]["is_debug_mode_enabled"] = ToBytes(bool{false});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -708,7 +753,15 @@ void ISystemSettingsServer::GetSettingsItemValue(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetTvSettings(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
LOG_INFO(Service_SET,
|
||||
"called, flags={}, cmu_mode={}, contrast_ratio={}, hdmi_content_type={}, "
|
||||
"rgb_range={}, tv_gama={}, tv_resolution={}, tv_underscan={}",
|
||||
m_system_settings.tv_settings.flags.raw, m_system_settings.tv_settings.cmu_mode,
|
||||
m_system_settings.tv_settings.contrast_ratio,
|
||||
m_system_settings.tv_settings.hdmi_content_type,
|
||||
m_system_settings.tv_settings.rgb_range, m_system_settings.tv_settings.tv_gama,
|
||||
m_system_settings.tv_settings.tv_resolution,
|
||||
m_system_settings.tv_settings.tv_underscan);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 10};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -735,23 +788,26 @@ void ISystemSettingsServer::SetTvSettings(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetDebugModeFlag(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_SET, "called");
|
||||
bool is_debug_mode_enabled = false;
|
||||
GetSettingsItemValue<bool>(is_debug_mode_enabled, "settings_debug", "is_debug_mode_enabled");
|
||||
|
||||
LOG_DEBUG(Service_SET, "called, is_debug_mode_enabled={}", is_debug_mode_enabled);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u32>(0);
|
||||
rb.Push(is_debug_mode_enabled);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called");
|
||||
LOG_INFO(Service_SET, "called, quest_flag={}", m_system_settings.quest_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(QuestFlag::Retail);
|
||||
rb.PushEnum(m_system_settings.quest_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
Service::Time::TimeZone::LocationName name{};
|
||||
auto res = GetDeviceTimeZoneLocationName(name);
|
||||
@@ -762,7 +818,7 @@ void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto name{rp.PopRaw<Service::Time::TimeZone::LocationName>()};
|
||||
@@ -775,7 +831,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx
|
||||
|
||||
void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
m_system_settings.region_code = rp.PopEnum<RegionCode>();
|
||||
m_system_settings.region_code = rp.PopEnum<SystemRegionCode>();
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code);
|
||||
@@ -832,15 +888,38 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled(HLERequ
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetPrimaryAlbumStorage(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called");
|
||||
LOG_INFO(Service_SET, "called, primary_album_storage={}",
|
||||
m_system_settings.primary_album_storage);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(PrimaryAlbumStorage::SdCard);
|
||||
rb.PushEnum(m_system_settings.primary_album_storage);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetNfcEnableFlag(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called, nfc_enable_flag={}", m_system_settings.nfc_enable_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(m_system_settings.nfc_enable_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetNfcEnableFlag(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
m_system_settings.nfc_enable_flag = rp.Pop<bool>();
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET, "called, nfc_enable_flag={}", m_system_settings.nfc_enable_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetSleepSettings(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called, flags={}, handheld_sleep_plan={}, console_sleep_plan={}",
|
||||
m_system_settings.sleep_settings.flags.raw,
|
||||
m_system_settings.sleep_settings.handheld_sleep_plan,
|
||||
m_system_settings.sleep_settings.console_sleep_plan);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 5};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -861,8 +940,32 @@ void ISystemSettingsServer::SetSleepSettings(HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetWirelessLanEnableFlag(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called, wireless_lan_enable_flag={}",
|
||||
m_system_settings.wireless_lan_enable_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(m_system_settings.wireless_lan_enable_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetWirelessLanEnableFlag(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
m_system_settings.wireless_lan_enable_flag = rp.Pop<bool>();
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET, "called, wireless_lan_enable_flag={}",
|
||||
m_system_settings.wireless_lan_enable_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetInitialLaunchSettings(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called");
|
||||
LOG_INFO(Service_SET, "called, flags={}, timestamp={}",
|
||||
m_system_settings.initial_launch_settings_packed.flags.raw,
|
||||
m_system_settings.initial_launch_settings_packed.timestamp.time_point);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 10};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(m_system_settings.initial_launch_settings_packed);
|
||||
@@ -913,35 +1016,51 @@ void ISystemSettingsServer::GetProductModel(HLERequestContext& ctx) {
|
||||
rb.Push(product_model);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetMiiAuthorId(HLERequestContext& ctx) {
|
||||
const auto author_id = Common::UUID::MakeDefault();
|
||||
void ISystemSettingsServer::GetBluetoothEnableFlag(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called, bluetooth_enable_flag={}",
|
||||
m_system_settings.bluetooth_enable_flag);
|
||||
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called, author_id={}", author_id.FormattedString());
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(m_system_settings.bluetooth_enable_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetBluetoothEnableFlag(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
m_system_settings.bluetooth_enable_flag = rp.Pop<bool>();
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET, "called, bluetooth_enable_flag={}",
|
||||
m_system_settings.bluetooth_enable_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetMiiAuthorId(HLERequestContext& ctx) {
|
||||
LOG_INFO(Service_SET, "called, author_id={}",
|
||||
m_system_settings.mii_author_id.FormattedString());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(author_id);
|
||||
rb.PushRaw(m_system_settings.mii_author_id);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetAutoUpdateEnableFlag(HLERequestContext& ctx) {
|
||||
u8 auto_update_flag{};
|
||||
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called, auto_update_flag={}", auto_update_flag);
|
||||
LOG_INFO(Service_SET, "called, auto_update_flag={}", m_system_settings.auto_update_enable_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(auto_update_flag);
|
||||
rb.Push(m_system_settings.auto_update_enable_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetBatteryPercentageFlag(HLERequestContext& ctx) {
|
||||
u8 battery_percentage_flag{1};
|
||||
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called, battery_percentage_flag={}",
|
||||
battery_percentage_flag);
|
||||
LOG_DEBUG(Service_SET, "called, battery_percentage_flag={}",
|
||||
m_system_settings.battery_percentage_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(battery_percentage_flag);
|
||||
rb.Push(m_system_settings.battery_percentage_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetExternalSteadyClockInternalOffset(HLERequestContext& ctx) {
|
||||
@@ -968,11 +1087,12 @@ void ISystemSettingsServer::GetExternalSteadyClockInternalOffset(HLERequestConte
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetErrorReportSharePermission(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called");
|
||||
LOG_INFO(Service_SET, "called, error_report_share_permission={}",
|
||||
m_system_settings.error_report_share_permission);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(ErrorReportSharePermission::Denied);
|
||||
rb.PushEnum(m_system_settings.error_report_share_permission);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetAppletLaunchFlags(HLERequestContext& ctx) {
|
||||
@@ -1014,7 +1134,7 @@ void ISystemSettingsServer::GetKeyboardLayout(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "called.");
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
Service::Time::Clock::SteadyClockTimePoint time_point{};
|
||||
auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point);
|
||||
@@ -1025,7 +1145,7 @@ void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestConte
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "called.");
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()};
|
||||
@@ -1038,7 +1158,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestConte
|
||||
|
||||
void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime(
|
||||
HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "called.");
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
Service::Time::Clock::SteadyClockTimePoint time_point{};
|
||||
auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point);
|
||||
@@ -1050,7 +1170,7 @@ void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime(
|
||||
|
||||
void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
|
||||
HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "called.");
|
||||
LOG_INFO(Service_SET, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()};
|
||||
@@ -1062,11 +1182,12 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetChineseTraditionalInputMethod(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called");
|
||||
LOG_INFO(Service_SET, "called, chinese_traditional_input_method={}",
|
||||
m_system_settings.chinese_traditional_input_method);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushEnum(ChineseTraditionalInputMethod::Unknown0);
|
||||
rb.PushEnum(m_system_settings.chinese_traditional_input_method);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetHomeMenuScheme(HLERequestContext& ctx) {
|
||||
@@ -1094,11 +1215,11 @@ void ISystemSettingsServer::GetHomeMenuSchemeModel(HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::GetFieldTestingFlag(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_SET, "(STUBBED) called");
|
||||
LOG_INFO(Service_SET, "called, field_testing_flag={}", m_system_settings.field_testing_flag);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u8>(false);
|
||||
rb.Push(m_system_settings.field_testing_flag);
|
||||
}
|
||||
|
||||
void ISystemSettingsServer::SetupSettings() {
|
||||
|
@@ -12,10 +12,11 @@
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/set/appln_settings.h"
|
||||
#include "core/hle/service/set/device_settings.h"
|
||||
#include "core/hle/service/set/private_settings.h"
|
||||
#include "core/hle/service/set/system_settings.h"
|
||||
#include "core/hle/service/set/setting_formats/appln_settings.h"
|
||||
#include "core/hle/service/set/setting_formats/device_settings.h"
|
||||
#include "core/hle/service/set/setting_formats/private_settings.h"
|
||||
#include "core/hle/service/set/setting_formats/system_settings.h"
|
||||
#include "core/hle/service/set/settings_types.h"
|
||||
#include "core/hle/service/time/clock_types.h"
|
||||
#include "core/hle/service/time/time_zone_types.h"
|
||||
|
||||
@@ -24,25 +25,6 @@ class System;
|
||||
}
|
||||
|
||||
namespace Service::Set {
|
||||
enum class GetFirmwareVersionType {
|
||||
Version1,
|
||||
Version2,
|
||||
};
|
||||
|
||||
struct FirmwareVersionFormat {
|
||||
u8 major;
|
||||
u8 minor;
|
||||
u8 micro;
|
||||
INSERT_PADDING_BYTES(1);
|
||||
u8 revision_major;
|
||||
u8 revision_minor;
|
||||
INSERT_PADDING_BYTES(2);
|
||||
std::array<char, 0x20> platform;
|
||||
std::array<u8, 0x40> version_hash;
|
||||
std::array<char, 0x18> display_version;
|
||||
std::array<char, 0x80> display_title;
|
||||
};
|
||||
static_assert(sizeof(FirmwareVersionFormat) == 0x100, "FirmwareVersionFormat is an invalid size");
|
||||
|
||||
Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& system,
|
||||
GetFirmwareVersionType type);
|
||||
@@ -55,6 +37,18 @@ public:
|
||||
Result GetSettingsItemValue(std::vector<u8>& out_value, const std::string& category,
|
||||
const std::string& name);
|
||||
|
||||
template <typename T>
|
||||
Result GetSettingsItemValue(T& value, const std::string& category, const std::string& name) {
|
||||
std::vector<u8> data;
|
||||
const auto result = GetSettingsItemValue(data, category, name);
|
||||
if (result.IsError()) {
|
||||
return result;
|
||||
}
|
||||
ASSERT(data.size() >= sizeof(T));
|
||||
std::memcpy(&value, data.data(), sizeof(T));
|
||||
return result;
|
||||
}
|
||||
|
||||
Result GetExternalSteadyClockSourceId(Common::UUID& out_id);
|
||||
Result SetExternalSteadyClockSourceId(Common::UUID id);
|
||||
Result GetUserSystemClockContext(Service::Time::Clock::SystemClockContext& out_context);
|
||||
@@ -80,6 +74,8 @@ private:
|
||||
void SetLanguageCode(HLERequestContext& ctx);
|
||||
void GetFirmwareVersion(HLERequestContext& ctx);
|
||||
void GetFirmwareVersion2(HLERequestContext& ctx);
|
||||
void GetLockScreenFlag(HLERequestContext& ctx);
|
||||
void SetLockScreenFlag(HLERequestContext& ctx);
|
||||
void GetExternalSteadyClockSourceId(HLERequestContext& ctx);
|
||||
void SetExternalSteadyClockSourceId(HLERequestContext& ctx);
|
||||
void GetUserSystemClockContext(HLERequestContext& ctx);
|
||||
@@ -108,13 +104,19 @@ private:
|
||||
void IsUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx);
|
||||
void SetUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx);
|
||||
void GetPrimaryAlbumStorage(HLERequestContext& ctx);
|
||||
void GetNfcEnableFlag(HLERequestContext& ctx);
|
||||
void SetNfcEnableFlag(HLERequestContext& ctx);
|
||||
void GetSleepSettings(HLERequestContext& ctx);
|
||||
void SetSleepSettings(HLERequestContext& ctx);
|
||||
void GetWirelessLanEnableFlag(HLERequestContext& ctx);
|
||||
void SetWirelessLanEnableFlag(HLERequestContext& ctx);
|
||||
void GetInitialLaunchSettings(HLERequestContext& ctx);
|
||||
void SetInitialLaunchSettings(HLERequestContext& ctx);
|
||||
void GetDeviceNickName(HLERequestContext& ctx);
|
||||
void SetDeviceNickName(HLERequestContext& ctx);
|
||||
void GetProductModel(HLERequestContext& ctx);
|
||||
void GetBluetoothEnableFlag(HLERequestContext& ctx);
|
||||
void SetBluetoothEnableFlag(HLERequestContext& ctx);
|
||||
void GetMiiAuthorId(HLERequestContext& ctx);
|
||||
void GetAutoUpdateEnableFlag(HLERequestContext& ctx);
|
||||
void GetBatteryPercentageFlag(HLERequestContext& ctx);
|
||||
|
Reference in New Issue
Block a user