yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

service: set: Refractor setting service

This commit is contained in:
Narr the Reg 2024-01-14 19:22:30 -06:00 committed by german77
parent 2c29c2b8dd
commit 89d6856090
14 changed files with 619 additions and 588 deletions

View File

@ -712,22 +712,23 @@ add_library(core STATIC
hle/service/server_manager.h hle/service/server_manager.h
hle/service/service.cpp hle/service/service.cpp
hle/service/service.h hle/service/service.h
hle/service/set/appln_settings.cpp hle/service/set/setting_formats/appln_settings.cpp
hle/service/set/appln_settings.h hle/service/set/setting_formats/appln_settings.h
hle/service/set/device_settings.cpp hle/service/set/setting_formats/device_settings.cpp
hle/service/set/device_settings.h 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.cpp
hle/service/set/factory_settings_server.h hle/service/set/factory_settings_server.h
hle/service/set/firmware_debug_settings_server.cpp hle/service/set/firmware_debug_settings_server.cpp
hle/service/set/firmware_debug_settings_server.h 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.cpp
hle/service/set/settings.h hle/service/set/settings.h
hle/service/set/settings_server.cpp hle/service/set/settings_server.cpp
hle/service/set/settings_server.h hle/service/set/settings_server.h
hle/service/set/system_settings.cpp hle/service/set/settings_types.h
hle/service/set/system_settings.h
hle/service/set/system_settings_server.cpp hle/service/set/system_settings_server.cpp
hle/service/set/system_settings_server.h hle/service/set/system_settings_server.h
hle/service/sm/sm.cpp hle/service/sm/sm.cpp

View File

@ -1,72 +0,0 @@
// 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 "core/hle/service/time/clock_types.h"
namespace Service::Set {
/// 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::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");
struct PrivateSettings {
std::array<u8, 0x10> reserved_00;
// nn::settings::system::InitialLaunchSettings
InitialLaunchSettings initial_launch_settings;
std::array<u8, 0x20> reserved_30;
Common::UUID external_clock_source_id;
s64 shutdown_rtc_value;
s64 external_steady_clock_internal_offset;
std::array<u8, 0x60> reserved_70;
// nn::settings::system::PlatformRegion
std::array<u8, 0x4> platform_region;
std::array<u8, 0x4> reserved_D4;
};
static_assert(offsetof(PrivateSettings, initial_launch_settings) == 0x10);
static_assert(offsetof(PrivateSettings, external_clock_source_id) == 0x50);
static_assert(offsetof(PrivateSettings, reserved_70) == 0x70);
static_assert(offsetof(PrivateSettings, platform_region) == 0xD0);
static_assert(sizeof(PrivateSettings) == 0xD8, "PrivateSettings has the wrong size!");
PrivateSettings DefaultPrivateSettings();
} // namespace Service::Set

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/set/appln_settings.h" #include "core/hle/service/set/setting_formats/appln_settings.h"
namespace Service::Set { namespace Service::Set {

View File

@ -7,24 +7,23 @@
#include <cstddef> #include <cstddef>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/uuid.h"
#include "core/hle/service/set/settings_types.h"
namespace Service::Set { namespace Service::Set {
struct ApplnSettings { struct ApplnSettings {
std::array<u8, 0x10> reserved_000; INSERT_PADDING_BYTES(0x10); // Reserved
// nn::util::Uuid MiiAuthorId, copied from system settings 0x94B0 // nn::util::Uuid MiiAuthorId, copied from system settings 0x94B0
std::array<u8, 0x10> mii_author_id; Common::UUID mii_author_id;
INSERT_PADDING_BYTES(0x30); // Reserved
std::array<u8, 0x30> reserved_020;
// nn::settings::system::ServiceDiscoveryControlSettings // nn::settings::system::ServiceDiscoveryControlSettings
std::array<u8, 0x4> service_discovery_control_settings; u32 service_discovery_control_settings;
INSERT_PADDING_BYTES(0x20); // Reserved
std::array<u8, 0x20> reserved_054;
bool in_repair_process_enable_flag; bool in_repair_process_enable_flag;
INSERT_PADDING_BYTES(0x3);
std::array<u8, 0x3> pad_075;
}; };
static_assert(offsetof(ApplnSettings, mii_author_id) == 0x10); static_assert(offsetof(ApplnSettings, mii_author_id) == 0x10);
static_assert(offsetof(ApplnSettings, service_discovery_control_settings) == 0x50); static_assert(offsetof(ApplnSettings, service_discovery_control_settings) == 0x50);

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/set/device_settings.h" #include "core/hle/service/set/setting_formats/device_settings.h"
namespace Service::Set { namespace Service::Set {

View File

@ -7,10 +7,12 @@
#include <cstddef> #include <cstddef>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/vector_math.h"
#include "core/hle/service/set/settings_types.h"
namespace Service::Set { namespace Service::Set {
struct DeviceSettings { struct DeviceSettings {
std::array<u8, 0x10> reserved_000; INSERT_PADDING_BYTES(0x10); // Reserved
// nn::settings::BatteryLot // nn::settings::BatteryLot
std::array<u8, 0x18> ptm_battery_lot; std::array<u8, 0x18> ptm_battery_lot;
@ -19,26 +21,24 @@ struct DeviceSettings {
u8 ptm_battery_version; u8 ptm_battery_version;
// nn::settings::system::PtmCycleCountReliability // nn::settings::system::PtmCycleCountReliability
u32 ptm_cycle_count_reliability; u32 ptm_cycle_count_reliability;
INSERT_PADDING_BYTES(0x48); // Reserved
std::array<u8, 0x48> reserved_048;
// nn::settings::system::AnalogStickUserCalibration L // nn::settings::system::AnalogStickUserCalibration L
std::array<u8, 0x10> analog_user_stick_calibration_l; std::array<u8, 0x10> analog_user_stick_calibration_l;
// nn::settings::system::AnalogStickUserCalibration R // nn::settings::system::AnalogStickUserCalibration R
std::array<u8, 0x10> analog_user_stick_calibration_r; std::array<u8, 0x10> analog_user_stick_calibration_r;
INSERT_PADDING_BYTES(0x20); // Reserved
std::array<u8, 0x20> reserved_0B0;
// nn::settings::system::ConsoleSixAxisSensorAccelerationBias // nn::settings::system::ConsoleSixAxisSensorAccelerationBias
std::array<u8, 0xC> console_six_axis_sensor_acceleration_bias; Common::Vec3<f32> console_six_axis_sensor_acceleration_bias;
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias // nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias
std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_bias; Common::Vec3<f32> console_six_axis_sensor_angular_velocity_bias;
// nn::settings::system::ConsoleSixAxisSensorAccelerationGain // nn::settings::system::ConsoleSixAxisSensorAccelerationGain
std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain; std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain;
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain // nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain
std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain; std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain;
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias // nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias
std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_time_bias; Common::Vec3<f32> console_six_axis_sensor_angular_velocity_time_bias;
// nn::settings::system::ConsoleSixAxisSensorAngularAcceleration // nn::settings::system::ConsoleSixAxisSensorAngularAcceleration
std::array<u8, 0x24> console_six_axis_sensor_angular_acceleration; std::array<u8, 0x24> console_six_axis_sensor_angular_acceleration;
}; };

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/set/private_settings.h" #include "core/hle/service/set/setting_formats/private_settings.h"
namespace Service::Set { namespace Service::Set {

View 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

View File

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/set/system_settings.h" #include "core/hle/service/set/setting_formats/system_settings.h"
namespace Service::Set { namespace Service::Set {

View File

@ -8,272 +8,14 @@
#include "common/bit_field.h" #include "common/bit_field.h"
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/service/set/private_settings.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" #include "core/hle/service/time/clock_types.h"
namespace Service::Set { namespace Service::Set {
/// 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::ErrorReportSharePermission
enum class ErrorReportSharePermission : u32 {
NotConfirmed,
Granted,
Denied,
};
/// This is nn::settings::system::ChineseTraditionalInputMethod
enum class ChineseTraditionalInputMethod : u32 {
Unknown0 = 0,
Unknown1 = 1,
Unknown2 = 2,
};
/// 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");
/// Indicates the current theme set by the system settings
enum class ColorSet : u32 {
BasicWhite = 0,
BasicBlack = 1,
};
/// Indicates the current console is a retail or kiosk unit
enum class QuestFlag : u8 {
Retail = 0,
Kiosk = 1,
};
/// This is nn::settings::system::RegionCode
enum class RegionCode : u32 {
Japan,
Usa,
Europe,
Australia,
HongKongTaiwanKorea,
China,
};
/// 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::NotificationVolume
enum class NotificationVolume : u32 {
Mute,
Low,
High,
};
/// 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::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::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::FriendPresenceOverlayPermission
enum class FriendPresenceOverlayPermission : u8 {
NotConfirmed,
NoDisplay,
FavoriteFriends,
Friends,
};
/// 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::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::TvResolution
enum class TvResolution : u32 {
Auto,
Resolution1080p,
Resolution720p,
Resolution480p,
};
/// This is nn::settings::system::HdmiContentType
enum class HdmiContentType : u32 {
None,
Graphics,
Cinema,
Photo,
Game,
};
/// This is nn::settings::system::RgbRange
enum class RgbRange : u32 {
Auto,
Full,
Limited,
};
/// This is nn::settings::system::CmuMode
enum class CmuMode : u32 {
None,
ColorInvert,
HighContrast,
GrayScale,
};
/// 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");
/// This is nn::settings::system::PrimaryAlbumStorage
enum class PrimaryAlbumStorage : u32 {
Nand,
SdCard,
};
/// This is nn::settings::system::HandheldSleepPlan
enum class HandheldSleepPlan : u32 {
Sleep1Min,
Sleep3Min,
Sleep5Min,
Sleep10Min,
Sleep30Min,
Never,
};
/// This is nn::settings::system::ConsoleSleepPlan
enum class ConsoleSleepPlan : u32 {
Sleep1Hour,
Sleep2Hour,
Sleep3Hour,
Sleep6Hour,
Sleep12Hour,
Never,
};
/// 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::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::EulaVersionClockType
enum class EulaVersionClockType : u32 {
NetworkSystemClock,
SteadyClock,
};
/// This is nn::settings::system::EulaVersion
struct EulaVersion {
u32 version;
RegionCode 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 SystemSettings { 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 // 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 // (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
@ -283,20 +25,16 @@ struct SystemSettings {
// 0/unwritten (1.0.0), 1 (6.0.0-8.1.0), 2 (8.1.1), 7 (9.0.0+). // 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 // if (flags & 2), defaults are written for AnalogStickUserCalibration
u32 flags; u32 flags;
INSERT_PADDING_BYTES(0x8); // Reserved
std::array<u8, 0x8> reserved_00008;
// nn::settings::LanguageCode
LanguageCode language_code; LanguageCode language_code;
INSERT_PADDING_BYTES(0x38); // Reserved
std::array<u8, 0x38> reserved_00018;
// nn::settings::system::NetworkSettings // nn::settings::system::NetworkSettings
u32 network_setting_count; u32 network_setting_count;
bool wireless_lan_enable_flag; bool wireless_lan_enable_flag;
std::array<u8, 0x3> pad_00055; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x8); // Reserved
std::array<u8, 0x8> reserved_00058;
// nn::settings::system::NetworkSettings // nn::settings::system::NetworkSettings
std::array<std::array<u8, 0x400>, 32> network_settings_1B0; std::array<std::array<u8, 0x400>, 32> network_settings_1B0;
@ -304,161 +42,142 @@ struct SystemSettings {
// nn::settings::system::BluetoothDevicesSettings // nn::settings::system::BluetoothDevicesSettings
std::array<u8, 0x4> bluetooth_device_settings_count; std::array<u8, 0x4> bluetooth_device_settings_count;
bool bluetooth_enable_flag; bool bluetooth_enable_flag;
std::array<u8, 0x3> pad_08065; INSERT_PADDING_BYTES(0x3);
bool bluetooth_afh_enable_flag; bool bluetooth_afh_enable_flag;
std::array<u8, 0x3> pad_08069; INSERT_PADDING_BYTES(0x3);
bool bluetooth_boost_enable_flag; bool bluetooth_boost_enable_flag;
std::array<u8, 0x3> pad_0806D; INSERT_PADDING_BYTES(0x3);
std::array<std::array<u8, 0x200>, 10> bluetooth_device_settings_first_10; std::array<std::array<u8, 0x200>, 10> bluetooth_device_settings_first_10;
s32 ldn_channel; s32 ldn_channel;
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_09474;
// nn::util::Uuid MiiAuthorId // nn::util::Uuid MiiAuthorId
std::array<u8, 0x10> mii_author_id; Common::UUID mii_author_id;
std::array<u8, 0x30> reserved_094C0; INSERT_PADDING_BYTES(0x30); // Reserved
// nn::settings::system::NxControllerSettings // nn::settings::system::NxControllerSettings
u32 nx_controller_settings_count; u32 nx_controller_settings_count;
std::array<u8, 0xC> reserved_094F4; INSERT_PADDING_BYTES(0xC); // Reserved
// nn::settings::system::NxControllerSettings, // nn::settings::system::NxControllerSettings,
// nn::settings::system::NxControllerLegacySettings on 13.0.0+ // nn::settings::system::NxControllerLegacySettings on 13.0.0+
std::array<std::array<u8, 0x40>, 10> nx_controller_legacy_settings; std::array<std::array<u8, 0x40>, 10> nx_controller_legacy_settings;
INSERT_PADDING_BYTES(0x170); // Reserved
std::array<u8, 0x170> reserved_09780;
bool external_rtc_reset_flag; bool external_rtc_reset_flag;
std::array<u8, 0x3> pad_098F1; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_098F4;
s32 push_notification_activity_mode_on_sleep; s32 push_notification_activity_mode_on_sleep;
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_09934;
// nn::settings::system::ErrorReportSharePermission
ErrorReportSharePermission error_report_share_permission; ErrorReportSharePermission error_report_share_permission;
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_09974; KeyboardLayout keyboard_layout;
INSERT_PADDING_BYTES(0x3C); // Reserved
// nn::settings::KeyboardLayout
std::array<u8, 0x4> keyboard_layout;
std::array<u8, 0x3C> reserved_099B4;
bool web_inspector_flag; bool web_inspector_flag;
std::array<u8, 0x3> pad_099F1; INSERT_PADDING_BYTES(0x3);
// nn::settings::system::AllowedSslHost // nn::settings::system::AllowedSslHost
u32 allowed_ssl_host_count; u32 allowed_ssl_host_count;
bool memory_usage_rate_flag; bool memory_usage_rate_flag;
std::array<u8, 0x3> pad_099F9; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x34); // Reserved
std::array<u8, 0x34> reserved_099FC;
// nn::settings::system::HostFsMountPoint // nn::settings::system::HostFsMountPoint
std::array<u8, 0x100> host_fs_mount_point; std::array<u8, 0x100> host_fs_mount_point;
// nn::settings::system::AllowedSslHost // nn::settings::system::AllowedSslHost
std::array<std::array<u8, 0x100>, 8> allowed_ssl_hosts; std::array<std::array<u8, 0x100>, 8> allowed_ssl_hosts;
INSERT_PADDING_BYTES(0x6C0); // Reserved
std::array<u8, 0x6C0> reserved_0A330;
// nn::settings::system::BlePairingSettings // nn::settings::system::BlePairingSettings
u32 ble_pairing_settings_count; u32 ble_pairing_settings_count;
std::array<u8, 0xC> reserved_0A9F4; INSERT_PADDING_BYTES(0xC); // Reserved
std::array<std::array<u8, 0x80>, 10> ble_pairing_settings; std::array<std::array<u8, 0x80>, 10> ble_pairing_settings;
// nn::settings::system::AccountOnlineStorageSettings // nn::settings::system::AccountOnlineStorageSettings
u32 account_online_storage_settings_count; u32 account_online_storage_settings_count;
std::array<u8, 0xC> reserved_0AF04; INSERT_PADDING_BYTES(0xC); // Reserved
std::array<std::array<u8, 0x40>, 8> account_online_storage_settings; std::array<std::array<u8, 0x40>, 8> account_online_storage_settings;
bool pctl_ready_flag; bool pctl_ready_flag;
std::array<u8, 0x3> pad_0B111; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_0B114;
// nn::settings::system::ThemeId // nn::settings::system::ThemeId
std::array<u8, 0x80> theme_id_type0; std::array<u8, 0x80> theme_id_type0;
std::array<u8, 0x80> theme_id_type1; std::array<u8, 0x80> theme_id_type1;
INSERT_PADDING_BYTES(0x100); // Reserved
std::array<u8, 0x100> reserved_0B250;
// nn::settings::ChineseTraditionalInputMethod
ChineseTraditionalInputMethod chinese_traditional_input_method; ChineseTraditionalInputMethod chinese_traditional_input_method;
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_0B354;
bool zoom_flag; bool zoom_flag;
std::array<u8, 0x3> pad_0B391; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_0B394;
// nn::settings::system::ButtonConfigRegisteredSettings // nn::settings::system::ButtonConfigRegisteredSettings
u32 button_config_registered_settings_count; u32 button_config_registered_settings_count;
std::array<u8, 0xC> reserved_0B3D4; INSERT_PADDING_BYTES(0xC); // Reserved
// nn::settings::system::ButtonConfigSettings // nn::settings::system::ButtonConfigSettings
u32 button_config_settings_count; u32 button_config_settings_count;
std::array<u8, 0x4> reserved_0B3E4; INSERT_PADDING_BYTES(0x4); // Reserved
std::array<std::array<u8, 0x5A8>, 5> button_config_settings; std::array<std::array<u8, 0x5A8>, 5> button_config_settings;
std::array<u8, 0x13B0> reserved_0D030; INSERT_PADDING_BYTES(0x13B0); // Reserved
u32 button_config_settings_embedded_count; u32 button_config_settings_embedded_count;
std::array<u8, 0x4> reserved_0E3E4; INSERT_PADDING_BYTES(0x4); // Reserved
std::array<std::array<u8, 0x5A8>, 5> button_config_settings_embedded; std::array<std::array<u8, 0x5A8>, 5> button_config_settings_embedded;
std::array<u8, 0x13B0> reserved_10030; INSERT_PADDING_BYTES(0x13B0); // Reserved
u32 button_config_settings_left_count; u32 button_config_settings_left_count;
std::array<u8, 0x4> reserved_113E4; INSERT_PADDING_BYTES(0x4); // Reserved
std::array<std::array<u8, 0x5A8>, 5> button_config_settings_left; std::array<std::array<u8, 0x5A8>, 5> button_config_settings_left;
std::array<u8, 0x13B0> reserved_13030; INSERT_PADDING_BYTES(0x13B0); // Reserved
u32 button_config_settings_right_count; u32 button_config_settings_right_count;
std::array<u8, 0x4> reserved_143E4; INSERT_PADDING_BYTES(0x4); // Reserved
std::array<std::array<u8, 0x5A8>, 5> button_config_settings_right; std::array<std::array<u8, 0x5A8>, 5> button_config_settings_right;
std::array<u8, 0x73B0> reserved_16030; INSERT_PADDING_BYTES(0x73B0); // Reserved
// nn::settings::system::ButtonConfigRegisteredSettings // nn::settings::system::ButtonConfigRegisteredSettings
std::array<u8, 0x5C8> button_config_registered_settings_embedded; std::array<u8, 0x5C8> button_config_registered_settings_embedded;
std::array<std::array<u8, 0x5C8>, 10> button_config_registered_settings; std::array<std::array<u8, 0x5C8>, 10> button_config_registered_settings;
INSERT_PADDING_BYTES(0x7FF8); // Reserved
std::array<u8, 0x7FF8> reserved_21378;
// nn::settings::system::ConsoleSixAxisSensorAccelerationBias // nn::settings::system::ConsoleSixAxisSensorAccelerationBias
std::array<u8, 0xC> console_six_axis_sensor_acceleration_bias; Common::Vec3<f32> console_six_axis_sensor_acceleration_bias;
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias // nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias
std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_bias; Common::Vec3<f32> console_six_axis_sensor_angular_velocity_bias;
// nn::settings::system::ConsoleSixAxisSensorAccelerationGain // nn::settings::system::ConsoleSixAxisSensorAccelerationGain
std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain; std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain;
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain // nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain
std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain; std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain;
// nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias // nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias
std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_time_bias; Common::Vec3<f32> console_six_axis_sensor_angular_velocity_time_bias;
// nn::settings::system::ConsoleSixAxisSensorAngularAcceleration // nn::settings::system::ConsoleSixAxisSensorAngularAcceleration
std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_acceleration; std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_acceleration;
INSERT_PADDING_BYTES(0x70); // Reserved
std::array<u8, 0x70> reserved_29400;
bool lock_screen_flag; bool lock_screen_flag;
std::array<u8, 0x3> pad_29471; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x4); // Reserved
std::array<u8, 0x4> reserved_249274;
ColorSet color_set_id; ColorSet color_set_id;
QuestFlag quest_flag; QuestFlag quest_flag;
// nn::settings::system::RegionCode SystemRegionCode region_code;
RegionCode region_code;
// Different to nn::settings::system::InitialLaunchSettings? // Different to nn::settings::system::InitialLaunchSettings?
InitialLaunchSettingsPacked initial_launch_settings_packed; InitialLaunchSettingsPacked initial_launch_settings_packed;
bool battery_percentage_flag; bool battery_percentage_flag;
std::array<u8, 0x3> pad_294A1; INSERT_PADDING_BYTES(0x3);
// BitFlagSet<32, nn::settings::system::AppletLaunchFlag> // BitFlagSet<32, nn::settings::system::AppletLaunchFlag>
u32 applet_launch_flag; u32 applet_launch_flag;
@ -469,33 +188,26 @@ struct SystemSettings {
std::array<u8, 0x10> theme_key; std::array<u8, 0x10> theme_key;
bool field_testing_flag; bool field_testing_flag;
std::array<u8, 0x3> pad_294C1; INSERT_PADDING_BYTES(0x3);
s32 panel_crc_mode; s32 panel_crc_mode;
INSERT_PADDING_BYTES(0x28); // Reserved
std::array<u8, 0x28> reserved_294C8;
// nn::settings::system::BacklightSettings // nn::settings::system::BacklightSettings
std::array<u8, 0x2C> backlight_settings_mixed_up; std::array<u8, 0x2C> backlight_settings_mixed_up;
INSERT_PADDING_BYTES(0x64); // Reserved
std::array<u8, 0x64> reserved_2951C;
// nn::time::SystemClockContext
Service::Time::Clock::SystemClockContext user_system_clock_context; Service::Time::Clock::SystemClockContext user_system_clock_context;
Service::Time::Clock::SystemClockContext network_system_clock_context; Service::Time::Clock::SystemClockContext network_system_clock_context;
bool user_system_clock_automatic_correction_enabled; bool user_system_clock_automatic_correction_enabled;
std::array<u8, 0x3> pad_295C1; INSERT_PADDING_BYTES(0x3);
std::array<u8, 0x4> reserved_295C4; INSERT_PADDING_BYTES(0x4); // Reserved
// nn::time::SteadyClockTimePoint
Service::Time::Clock::SteadyClockTimePoint Service::Time::Clock::SteadyClockTimePoint
user_system_clock_automatic_correction_updated_time_point; user_system_clock_automatic_correction_updated_time_point;
INSERT_PADDING_BYTES(0x10); // Reserved
std::array<u8, 0x10> reserved_295E0;
// nn::settings::system::AccountSettings
AccountSettings account_settings; AccountSettings account_settings;
INSERT_PADDING_BYTES(0xFC); // Reserved
std::array<u8, 0xFC> reserved_295F4;
// nn::settings::system::AudioVolume // nn::settings::system::AudioVolume
std::array<u8, 0x8> audio_volume_type0; std::array<u8, 0x8> audio_volume_type0;
@ -505,47 +217,42 @@ struct SystemSettings {
s32 audio_output_mode_type1; s32 audio_output_mode_type1;
s32 audio_output_mode_type2; s32 audio_output_mode_type2;
bool force_mute_on_headphone_removed; bool force_mute_on_headphone_removed;
std::array<u8, 0x3> pad_2970D; INSERT_PADDING_BYTES(0x3);
s32 headphone_volume_warning_count; s32 headphone_volume_warning_count;
bool heaphone_volume_update_flag; bool heaphone_volume_update_flag;
std::array<u8, 0x3> pad_29715; INSERT_PADDING_BYTES(0x3);
// nn::settings::system::AudioVolume // nn::settings::system::AudioVolume
std::array<u8, 0x8> audio_volume_type2; std::array<u8, 0x8> audio_volume_type2;
// nn::settings::system::AudioOutputMode // nn::settings::system::AudioOutputMode
s32 audio_output_mode_type3; s32 audio_output_mode_type3;
s32 audio_output_mode_type4; s32 audio_output_mode_type4;
bool hearing_protection_safeguard_flag; bool hearing_protection_safeguard_flag;
std::array<u8, 0x3> pad_29729; INSERT_PADDING_BYTES(0x3);
std::array<u8, 0x4> reserved_2972C; INSERT_PADDING_BYTES(0x4); // Reserved
s64 hearing_protection_safeguard_remaining_time; s64 hearing_protection_safeguard_remaining_time;
std::array<u8, 0x38> reserved_29738; INSERT_PADDING_BYTES(0x38); // Reserved
bool console_information_upload_flag; bool console_information_upload_flag;
std::array<u8, 0x3> pad_29771; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_29774;
bool automatic_application_download_flag; bool automatic_application_download_flag;
std::array<u8, 0x3> pad_297B1; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x4); // Reserved
std::array<u8, 0x4> reserved_297B4;
// nn::settings::system::NotificationSettings
NotificationSettings notification_settings; NotificationSettings notification_settings;
INSERT_PADDING_BYTES(0x60); // Reserved
std::array<u8, 0x60> reserved_297D0;
// nn::settings::system::AccountNotificationSettings // nn::settings::system::AccountNotificationSettings
u32 account_notification_settings_count; u32 account_notification_settings_count;
std::array<u8, 0xC> reserved_29834; INSERT_PADDING_BYTES(0xC); // Reserved
std::array<AccountNotificationSettings, 8> account_notification_settings; std::array<AccountNotificationSettings, 8> account_notification_settings;
INSERT_PADDING_BYTES(0x140); // Reserved
std::array<u8, 0x140> reserved_29900;
f32 vibration_master_volume; f32 vibration_master_volume;
bool usb_full_key_enable_flag; bool usb_full_key_enable_flag;
std::array<u8, 0x3> pad_29A45; INSERT_PADDING_BYTES(0x3);
// nn::settings::system::AnalogStickUserCalibration // nn::settings::system::AnalogStickUserCalibration
std::array<u8, 0x10> analog_stick_user_calibration_left; std::array<u8, 0x10> analog_stick_user_calibration_left;
@ -553,85 +260,68 @@ struct SystemSettings {
// nn::settings::system::TouchScreenMode // nn::settings::system::TouchScreenMode
s32 touch_screen_mode; s32 touch_screen_mode;
INSERT_PADDING_BYTES(0x14); // Reserved
std::array<u8, 0x14> reserved_29A6C;
// nn::settings::system::TvSettings
TvSettings tv_settings; TvSettings tv_settings;
// nn::settings::system::Edid // nn::settings::system::Edid
std::array<u8, 0x100> edid; std::array<u8, 0x100> edid;
INSERT_PADDING_BYTES(0x2E0); // Reserved
std::array<u8, 0x2E0> reserved_29BA0;
// nn::settings::system::DataDeletionSettings // nn::settings::system::DataDeletionSettings
std::array<u8, 0x8> data_deletion_settings; std::array<u8, 0x8> data_deletion_settings;
INSERT_PADDING_BYTES(0x38); // Reserved
std::array<u8, 0x38> reserved_29E88;
// nn::ncm::ProgramId // nn::ncm::ProgramId
std::array<u8, 0x8> initial_system_applet_program_id; std::array<u8, 0x8> initial_system_applet_program_id;
std::array<u8, 0x8> overlay_disp_program_id; std::array<u8, 0x8> overlay_disp_program_id;
INSERT_PADDING_BYTES(0x4); // Reserved
std::array<u8, 0x4> reserved_29ED0;
bool requires_run_repair_time_reviser; bool requires_run_repair_time_reviser;
INSERT_PADDING_BYTES(0x6B); // Reserved
std::array<u8, 0x6B> reserved_29ED5;
// nn::time::LocationName
Service::Time::TimeZone::LocationName device_time_zone_location_name; Service::Time::TimeZone::LocationName device_time_zone_location_name;
std::array<u8, 0x4> reserved_29F64; INSERT_PADDING_BYTES(0x4); // Reserved
// nn::time::SteadyClockTimePoint
Service::Time::Clock::SteadyClockTimePoint device_time_zone_location_updated_time; Service::Time::Clock::SteadyClockTimePoint device_time_zone_location_updated_time;
INSERT_PADDING_BYTES(0xC0); // Reserved
std::array<u8, 0xC0> reserved_29F80;
// nn::settings::system::PrimaryAlbumStorage // nn::settings::system::PrimaryAlbumStorage
PrimaryAlbumStorage primary_album_storage; PrimaryAlbumStorage primary_album_storage;
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_2A044;
bool usb_30_enable_flag; bool usb_30_enable_flag;
std::array<u8, 0x3> pad_2A081; INSERT_PADDING_BYTES(0x3);
bool usb_30_host_enable_flag; bool usb_30_host_enable_flag;
std::array<u8, 0x3> pad_2A085; INSERT_PADDING_BYTES(0x3);
bool usb_30_device_enable_flag; bool usb_30_device_enable_flag;
std::array<u8, 0x3> pad_2A089; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x34); // Reserved
std::array<u8, 0x34> reserved_2A08C;
bool nfc_enable_flag; bool nfc_enable_flag;
std::array<u8, 0x3> pad_2A0C1; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x3C); // Reserved
std::array<u8, 0x3C> reserved_2A0C4;
// nn::settings::system::SleepSettings // nn::settings::system::SleepSettings
SleepSettings sleep_settings; SleepSettings sleep_settings;
INSERT_PADDING_BYTES(0x34); // Reserved
std::array<u8, 0x34> reserved_2A10C;
// nn::settings::system::EulaVersion // nn::settings::system::EulaVersion
u32 eula_version_count; u32 eula_version_count;
std::array<u8, 0xC> reserved_2A144; INSERT_PADDING_BYTES(0xC); // Reserved
std::array<EulaVersion, 32> eula_versions; std::array<EulaVersion, 32> eula_versions;
INSERT_PADDING_BYTES(0x200); // Reserved
std::array<u8, 0x200> reserved_2A750;
// nn::settings::system::DeviceNickName // nn::settings::system::DeviceNickName
std::array<u8, 0x80> device_nick_name; std::array<u8, 0x80> device_nick_name;
INSERT_PADDING_BYTES(0x80); // Reserved
std::array<u8, 0x80> reserved_2A9D0;
bool auto_update_enable_flag; bool auto_update_enable_flag;
std::array<u8, 0x3> pad_2AA51; INSERT_PADDING_BYTES(0x3);
INSERT_PADDING_BYTES(0x4C); // Reserved
std::array<u8, 0x4C> reserved_2AA54;
// nn::settings::system::BluetoothDevicesSettings // nn::settings::system::BluetoothDevicesSettings
std::array<std::array<u8, 0x200>, 14> bluetooth_device_settings_last_14; std::array<std::array<u8, 0x200>, 14> bluetooth_device_settings_last_14;
INSERT_PADDING_BYTES(0x2000); // Reserved
std::array<u8, 0x2000> reserved_2C6A0;
// nn::settings::system::NxControllerSettings // nn::settings::system::NxControllerSettings
std::array<std::array<u8, 0x800>, 10> nx_controller_settings_data_from_offset_30; std::array<std::array<u8, 0x800>, 10> nx_controller_settings_data_from_offset_30;

View File

@ -4,72 +4,13 @@
#pragma once #pragma once
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/hle/service/set/system_settings.h" #include "core/hle/service/set/settings_types.h"
namespace Core { namespace Core {
class System; class System;
} }
namespace Service::Set { 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); LanguageCode GetLanguageCodeFromIndex(std::size_t idx);

View 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> Uknown;
};
};
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

View File

@ -775,7 +775,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx
void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) { void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
m_system_settings.region_code = rp.PopEnum<RegionCode>(); m_system_settings.region_code = rp.PopEnum<SystemRegionCode>();
SetSaveNeeded(); SetSaveNeeded();
LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code); LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code);

View File

@ -12,10 +12,11 @@
#include "common/uuid.h" #include "common/uuid.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/hle/service/set/appln_settings.h" #include "core/hle/service/set/setting_formats/appln_settings.h"
#include "core/hle/service/set/device_settings.h" #include "core/hle/service/set/setting_formats/device_settings.h"
#include "core/hle/service/set/private_settings.h" #include "core/hle/service/set/setting_formats/private_settings.h"
#include "core/hle/service/set/system_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/clock_types.h"
#include "core/hle/service/time/time_zone_types.h" #include "core/hle/service/time/time_zone_types.h"
@ -24,25 +25,6 @@ class System;
} }
namespace Service::Set { 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, Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& system,
GetFirmwareVersionType type); GetFirmwareVersionType type);