diff options
| author | 2024-01-14 19:22:30 -0600 | |
|---|---|---|
| committer | 2024-01-15 23:16:36 -0600 | |
| commit | 89d6856090708dd6a67c33c7149e7f3d9665908b (patch) | |
| tree | 635401eb8048351ea649e803362aea44edba1da4 | |
| parent | Merge pull request #12686 from szepeviktor/typos3 (diff) | |
| download | yuzu-89d6856090708dd6a67c33c7149e7f3d9665908b.tar.gz yuzu-89d6856090708dd6a67c33c7149e7f3d9665908b.tar.xz yuzu-89d6856090708dd6a67c33c7149e7f3d9665908b.zip | |
service: set: Refractor setting service
14 files changed, 619 insertions, 588 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 293d9647b..16ddb5e90 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -712,22 +712,23 @@ add_library(core STATIC | |||
| 712 | hle/service/server_manager.h | 712 | hle/service/server_manager.h |
| 713 | hle/service/service.cpp | 713 | hle/service/service.cpp |
| 714 | hle/service/service.h | 714 | hle/service/service.h |
| 715 | hle/service/set/appln_settings.cpp | 715 | hle/service/set/setting_formats/appln_settings.cpp |
| 716 | hle/service/set/appln_settings.h | 716 | hle/service/set/setting_formats/appln_settings.h |
| 717 | hle/service/set/device_settings.cpp | 717 | hle/service/set/setting_formats/device_settings.cpp |
| 718 | hle/service/set/device_settings.h | 718 | hle/service/set/setting_formats/device_settings.h |
| 719 | hle/service/set/setting_formats/system_settings.cpp | ||
| 720 | hle/service/set/setting_formats/system_settings.h | ||
| 721 | hle/service/set/setting_formats/private_settings.cpp | ||
| 722 | hle/service/set/setting_formats/private_settings.h | ||
| 719 | hle/service/set/factory_settings_server.cpp | 723 | hle/service/set/factory_settings_server.cpp |
| 720 | hle/service/set/factory_settings_server.h | 724 | hle/service/set/factory_settings_server.h |
| 721 | hle/service/set/firmware_debug_settings_server.cpp | 725 | hle/service/set/firmware_debug_settings_server.cpp |
| 722 | hle/service/set/firmware_debug_settings_server.h | 726 | hle/service/set/firmware_debug_settings_server.h |
| 723 | hle/service/set/private_settings.cpp | ||
| 724 | hle/service/set/private_settings.h | ||
| 725 | hle/service/set/settings.cpp | 727 | hle/service/set/settings.cpp |
| 726 | hle/service/set/settings.h | 728 | hle/service/set/settings.h |
| 727 | hle/service/set/settings_server.cpp | 729 | hle/service/set/settings_server.cpp |
| 728 | hle/service/set/settings_server.h | 730 | hle/service/set/settings_server.h |
| 729 | hle/service/set/system_settings.cpp | 731 | hle/service/set/settings_types.h |
| 730 | hle/service/set/system_settings.h | ||
| 731 | hle/service/set/system_settings_server.cpp | 732 | hle/service/set/system_settings_server.cpp |
| 732 | hle/service/set/system_settings_server.h | 733 | hle/service/set/system_settings_server.h |
| 733 | hle/service/sm/sm.cpp | 734 | hle/service/sm/sm.cpp |
diff --git a/src/core/hle/service/set/private_settings.h b/src/core/hle/service/set/private_settings.h deleted file mode 100644 index b63eaf45c..000000000 --- a/src/core/hle/service/set/private_settings.h +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <array> | ||
| 7 | |||
| 8 | #include "common/bit_field.h" | ||
| 9 | #include "common/common_funcs.h" | ||
| 10 | #include "common/common_types.h" | ||
| 11 | #include "common/uuid.h" | ||
| 12 | #include "core/hle/service/time/clock_types.h" | ||
| 13 | |||
| 14 | namespace Service::Set { | ||
| 15 | |||
| 16 | /// This is nn::settings::system::InitialLaunchFlag | ||
| 17 | struct InitialLaunchFlag { | ||
| 18 | union { | ||
| 19 | u32 raw{}; | ||
| 20 | |||
| 21 | BitField<0, 1, u32> InitialLaunchCompletionFlag; | ||
| 22 | BitField<8, 1, u32> InitialLaunchUserAdditionFlag; | ||
| 23 | BitField<16, 1, u32> InitialLaunchTimestampFlag; | ||
| 24 | }; | ||
| 25 | }; | ||
| 26 | static_assert(sizeof(InitialLaunchFlag) == 4, "InitialLaunchFlag is an invalid size"); | ||
| 27 | |||
| 28 | /// This is nn::settings::system::InitialLaunchSettings | ||
| 29 | struct InitialLaunchSettings { | ||
| 30 | InitialLaunchFlag flags; | ||
| 31 | INSERT_PADDING_BYTES(0x4); | ||
| 32 | Service::Time::Clock::SteadyClockTimePoint timestamp; | ||
| 33 | }; | ||
| 34 | static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size"); | ||
| 35 | |||
| 36 | #pragma pack(push, 4) | ||
| 37 | struct InitialLaunchSettingsPacked { | ||
| 38 | InitialLaunchFlag flags; | ||
| 39 | Service::Time::Clock::SteadyClockTimePoint timestamp; | ||
| 40 | }; | ||
| 41 | #pragma pack(pop) | ||
| 42 | static_assert(sizeof(InitialLaunchSettingsPacked) == 0x1C, | ||
| 43 | "InitialLaunchSettingsPacked is incorrect size"); | ||
| 44 | |||
| 45 | struct PrivateSettings { | ||
| 46 | std::array<u8, 0x10> reserved_00; | ||
| 47 | |||
| 48 | // nn::settings::system::InitialLaunchSettings | ||
| 49 | InitialLaunchSettings initial_launch_settings; | ||
| 50 | |||
| 51 | std::array<u8, 0x20> reserved_30; | ||
| 52 | |||
| 53 | Common::UUID external_clock_source_id; | ||
| 54 | s64 shutdown_rtc_value; | ||
| 55 | s64 external_steady_clock_internal_offset; | ||
| 56 | |||
| 57 | std::array<u8, 0x60> reserved_70; | ||
| 58 | |||
| 59 | // nn::settings::system::PlatformRegion | ||
| 60 | std::array<u8, 0x4> platform_region; | ||
| 61 | |||
| 62 | std::array<u8, 0x4> reserved_D4; | ||
| 63 | }; | ||
| 64 | static_assert(offsetof(PrivateSettings, initial_launch_settings) == 0x10); | ||
| 65 | static_assert(offsetof(PrivateSettings, external_clock_source_id) == 0x50); | ||
| 66 | static_assert(offsetof(PrivateSettings, reserved_70) == 0x70); | ||
| 67 | static_assert(offsetof(PrivateSettings, platform_region) == 0xD0); | ||
| 68 | static_assert(sizeof(PrivateSettings) == 0xD8, "PrivateSettings has the wrong size!"); | ||
| 69 | |||
| 70 | PrivateSettings DefaultPrivateSettings(); | ||
| 71 | |||
| 72 | } // namespace Service::Set | ||
diff --git a/src/core/hle/service/set/appln_settings.cpp b/src/core/hle/service/set/setting_formats/appln_settings.cpp index a5d802757..566ee1b13 100644 --- a/src/core/hle/service/set/appln_settings.cpp +++ b/src/core/hle/service/set/setting_formats/appln_settings.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/set/appln_settings.h" | 4 | #include "core/hle/service/set/setting_formats/appln_settings.h" |
| 5 | 5 | ||
| 6 | namespace Service::Set { | 6 | namespace Service::Set { |
| 7 | 7 | ||
diff --git a/src/core/hle/service/set/appln_settings.h b/src/core/hle/service/set/setting_formats/appln_settings.h index 126375860..ba9af998a 100644 --- a/src/core/hle/service/set/appln_settings.h +++ b/src/core/hle/service/set/setting_formats/appln_settings.h | |||
| @@ -7,24 +7,23 @@ | |||
| 7 | #include <cstddef> | 7 | #include <cstddef> |
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/uuid.h" | ||
| 11 | #include "core/hle/service/set/settings_types.h" | ||
| 10 | 12 | ||
| 11 | namespace Service::Set { | 13 | namespace Service::Set { |
| 12 | struct ApplnSettings { | 14 | struct ApplnSettings { |
| 13 | std::array<u8, 0x10> reserved_000; | 15 | INSERT_PADDING_BYTES(0x10); // Reserved |
| 14 | 16 | ||
| 15 | // nn::util::Uuid MiiAuthorId, copied from system settings 0x94B0 | 17 | // nn::util::Uuid MiiAuthorId, copied from system settings 0x94B0 |
| 16 | std::array<u8, 0x10> mii_author_id; | 18 | Common::UUID mii_author_id; |
| 17 | 19 | INSERT_PADDING_BYTES(0x30); // Reserved | |
| 18 | std::array<u8, 0x30> reserved_020; | ||
| 19 | 20 | ||
| 20 | // nn::settings::system::ServiceDiscoveryControlSettings | 21 | // nn::settings::system::ServiceDiscoveryControlSettings |
| 21 | std::array<u8, 0x4> service_discovery_control_settings; | 22 | u32 service_discovery_control_settings; |
| 22 | 23 | INSERT_PADDING_BYTES(0x20); // Reserved | |
| 23 | std::array<u8, 0x20> reserved_054; | ||
| 24 | 24 | ||
| 25 | bool in_repair_process_enable_flag; | 25 | bool in_repair_process_enable_flag; |
| 26 | 26 | INSERT_PADDING_BYTES(0x3); | |
| 27 | std::array<u8, 0x3> pad_075; | ||
| 28 | }; | 27 | }; |
| 29 | static_assert(offsetof(ApplnSettings, mii_author_id) == 0x10); | 28 | static_assert(offsetof(ApplnSettings, mii_author_id) == 0x10); |
| 30 | static_assert(offsetof(ApplnSettings, service_discovery_control_settings) == 0x50); | 29 | static_assert(offsetof(ApplnSettings, service_discovery_control_settings) == 0x50); |
diff --git a/src/core/hle/service/set/device_settings.cpp b/src/core/hle/service/set/setting_formats/device_settings.cpp index e423ce38a..5f295404d 100644 --- a/src/core/hle/service/set/device_settings.cpp +++ b/src/core/hle/service/set/setting_formats/device_settings.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/set/device_settings.h" | 4 | #include "core/hle/service/set/setting_formats/device_settings.h" |
| 5 | 5 | ||
| 6 | namespace Service::Set { | 6 | namespace Service::Set { |
| 7 | 7 | ||
diff --git a/src/core/hle/service/set/device_settings.h b/src/core/hle/service/set/setting_formats/device_settings.h index f291d0ebe..2827756f6 100644 --- a/src/core/hle/service/set/device_settings.h +++ b/src/core/hle/service/set/setting_formats/device_settings.h | |||
| @@ -7,10 +7,12 @@ | |||
| 7 | #include <cstddef> | 7 | #include <cstddef> |
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/vector_math.h" | ||
| 11 | #include "core/hle/service/set/settings_types.h" | ||
| 10 | 12 | ||
| 11 | namespace Service::Set { | 13 | namespace Service::Set { |
| 12 | struct DeviceSettings { | 14 | struct DeviceSettings { |
| 13 | std::array<u8, 0x10> reserved_000; | 15 | INSERT_PADDING_BYTES(0x10); // Reserved |
| 14 | 16 | ||
| 15 | // nn::settings::BatteryLot | 17 | // nn::settings::BatteryLot |
| 16 | std::array<u8, 0x18> ptm_battery_lot; | 18 | std::array<u8, 0x18> ptm_battery_lot; |
| @@ -19,26 +21,24 @@ struct DeviceSettings { | |||
| 19 | u8 ptm_battery_version; | 21 | u8 ptm_battery_version; |
| 20 | // nn::settings::system::PtmCycleCountReliability | 22 | // nn::settings::system::PtmCycleCountReliability |
| 21 | u32 ptm_cycle_count_reliability; | 23 | u32 ptm_cycle_count_reliability; |
| 22 | 24 | INSERT_PADDING_BYTES(0x48); // Reserved | |
| 23 | std::array<u8, 0x48> reserved_048; | ||
| 24 | 25 | ||
| 25 | // nn::settings::system::AnalogStickUserCalibration L | 26 | // nn::settings::system::AnalogStickUserCalibration L |
| 26 | std::array<u8, 0x10> analog_user_stick_calibration_l; | 27 | std::array<u8, 0x10> analog_user_stick_calibration_l; |
| 27 | // nn::settings::system::AnalogStickUserCalibration R | 28 | // nn::settings::system::AnalogStickUserCalibration R |
| 28 | std::array<u8, 0x10> analog_user_stick_calibration_r; | 29 | std::array<u8, 0x10> analog_user_stick_calibration_r; |
| 29 | 30 | INSERT_PADDING_BYTES(0x20); // Reserved | |
| 30 | std::array<u8, 0x20> reserved_0B0; | ||
| 31 | 31 | ||
| 32 | // nn::settings::system::ConsoleSixAxisSensorAccelerationBias | 32 | // nn::settings::system::ConsoleSixAxisSensorAccelerationBias |
| 33 | std::array<u8, 0xC> console_six_axis_sensor_acceleration_bias; | 33 | Common::Vec3<f32> console_six_axis_sensor_acceleration_bias; |
| 34 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias | 34 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias |
| 35 | std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_bias; | 35 | Common::Vec3<f32> console_six_axis_sensor_angular_velocity_bias; |
| 36 | // nn::settings::system::ConsoleSixAxisSensorAccelerationGain | 36 | // nn::settings::system::ConsoleSixAxisSensorAccelerationGain |
| 37 | std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain; | 37 | std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain; |
| 38 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain | 38 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain |
| 39 | std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain; | 39 | std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain; |
| 40 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias | 40 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias |
| 41 | std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_time_bias; | 41 | Common::Vec3<f32> console_six_axis_sensor_angular_velocity_time_bias; |
| 42 | // nn::settings::system::ConsoleSixAxisSensorAngularAcceleration | 42 | // nn::settings::system::ConsoleSixAxisSensorAngularAcceleration |
| 43 | std::array<u8, 0x24> console_six_axis_sensor_angular_acceleration; | 43 | std::array<u8, 0x24> console_six_axis_sensor_angular_acceleration; |
| 44 | }; | 44 | }; |
diff --git a/src/core/hle/service/set/private_settings.cpp b/src/core/hle/service/set/setting_formats/private_settings.cpp index 70bf65727..81c362482 100644 --- a/src/core/hle/service/set/private_settings.cpp +++ b/src/core/hle/service/set/setting_formats/private_settings.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/set/private_settings.h" | 4 | #include "core/hle/service/set/setting_formats/private_settings.h" |
| 5 | 5 | ||
| 6 | namespace Service::Set { | 6 | namespace Service::Set { |
| 7 | 7 | ||
diff --git a/src/core/hle/service/set/setting_formats/private_settings.h b/src/core/hle/service/set/setting_formats/private_settings.h new file mode 100644 index 000000000..6c40f62e1 --- /dev/null +++ b/src/core/hle/service/set/setting_formats/private_settings.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <array> | ||
| 7 | |||
| 8 | #include "common/common_types.h" | ||
| 9 | #include "common/uuid.h" | ||
| 10 | #include "core/hle/service/set/settings_types.h" | ||
| 11 | #include "core/hle/service/time/clock_types.h" | ||
| 12 | |||
| 13 | namespace Service::Set { | ||
| 14 | |||
| 15 | struct PrivateSettings { | ||
| 16 | INSERT_PADDING_BYTES(0x10); // Reserved | ||
| 17 | |||
| 18 | InitialLaunchSettings initial_launch_settings; | ||
| 19 | INSERT_PADDING_BYTES(0x20); // Reserved | ||
| 20 | |||
| 21 | Common::UUID external_clock_source_id; | ||
| 22 | s64 shutdown_rtc_value; | ||
| 23 | s64 external_steady_clock_internal_offset; | ||
| 24 | INSERT_PADDING_BYTES(0x60); // Reserved | ||
| 25 | |||
| 26 | // nn::settings::system::PlatformRegion | ||
| 27 | s32 platform_region; | ||
| 28 | INSERT_PADDING_BYTES(0x4); // Reserved | ||
| 29 | }; | ||
| 30 | static_assert(offsetof(PrivateSettings, initial_launch_settings) == 0x10); | ||
| 31 | static_assert(offsetof(PrivateSettings, external_clock_source_id) == 0x50); | ||
| 32 | static_assert(offsetof(PrivateSettings, shutdown_rtc_value) == 0x60); | ||
| 33 | static_assert(offsetof(PrivateSettings, external_steady_clock_internal_offset) == 0x68); | ||
| 34 | static_assert(offsetof(PrivateSettings, platform_region) == 0xD0); | ||
| 35 | static_assert(sizeof(PrivateSettings) == 0xD8, "PrivateSettings has the wrong size!"); | ||
| 36 | |||
| 37 | PrivateSettings DefaultPrivateSettings(); | ||
| 38 | |||
| 39 | } // namespace Service::Set | ||
diff --git a/src/core/hle/service/set/system_settings.cpp b/src/core/hle/service/set/setting_formats/system_settings.cpp index 5977429b2..4e524c0de 100644 --- a/src/core/hle/service/set/system_settings.cpp +++ b/src/core/hle/service/set/setting_formats/system_settings.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/set/system_settings.h" | 4 | #include "core/hle/service/set/setting_formats/system_settings.h" |
| 5 | 5 | ||
| 6 | namespace Service::Set { | 6 | namespace Service::Set { |
| 7 | 7 | ||
diff --git a/src/core/hle/service/set/system_settings.h b/src/core/hle/service/set/setting_formats/system_settings.h index 6ec9e71e7..14654f8b1 100644 --- a/src/core/hle/service/set/system_settings.h +++ b/src/core/hle/service/set/setting_formats/system_settings.h | |||
| @@ -8,272 +8,14 @@ | |||
| 8 | #include "common/bit_field.h" | 8 | #include "common/bit_field.h" |
| 9 | #include "common/common_funcs.h" | 9 | #include "common/common_funcs.h" |
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "core/hle/service/set/private_settings.h" | 11 | #include "common/uuid.h" |
| 12 | #include "common/vector_math.h" | ||
| 13 | #include "core/hle/service/set/setting_formats/private_settings.h" | ||
| 14 | #include "core/hle/service/set/settings_types.h" | ||
| 12 | #include "core/hle/service/time/clock_types.h" | 15 | #include "core/hle/service/time/clock_types.h" |
| 13 | 16 | ||
| 14 | namespace Service::Set { | 17 | namespace Service::Set { |
| 15 | 18 | ||
| 16 | /// This is "nn::settings::LanguageCode", which is a NUL-terminated string stored in a u64. | ||
| 17 | enum class LanguageCode : u64 { | ||
| 18 | JA = 0x000000000000616A, | ||
| 19 | EN_US = 0x00000053552D6E65, | ||
| 20 | FR = 0x0000000000007266, | ||
| 21 | DE = 0x0000000000006564, | ||
| 22 | IT = 0x0000000000007469, | ||
| 23 | ES = 0x0000000000007365, | ||
| 24 | ZH_CN = 0x0000004E432D687A, | ||
| 25 | KO = 0x0000000000006F6B, | ||
| 26 | NL = 0x0000000000006C6E, | ||
| 27 | PT = 0x0000000000007470, | ||
| 28 | RU = 0x0000000000007572, | ||
| 29 | ZH_TW = 0x00000057542D687A, | ||
| 30 | EN_GB = 0x00000042472D6E65, | ||
| 31 | FR_CA = 0x00000041432D7266, | ||
| 32 | ES_419 = 0x00003931342D7365, | ||
| 33 | ZH_HANS = 0x00736E61482D687A, | ||
| 34 | ZH_HANT = 0x00746E61482D687A, | ||
| 35 | PT_BR = 0x00000052422D7470, | ||
| 36 | }; | ||
| 37 | |||
| 38 | /// This is nn::settings::system::ErrorReportSharePermission | ||
| 39 | enum class ErrorReportSharePermission : u32 { | ||
| 40 | NotConfirmed, | ||
| 41 | Granted, | ||
| 42 | Denied, | ||
| 43 | }; | ||
| 44 | |||
| 45 | /// This is nn::settings::system::ChineseTraditionalInputMethod | ||
| 46 | enum class ChineseTraditionalInputMethod : u32 { | ||
| 47 | Unknown0 = 0, | ||
| 48 | Unknown1 = 1, | ||
| 49 | Unknown2 = 2, | ||
| 50 | }; | ||
| 51 | |||
| 52 | /// This is nn::settings::system::HomeMenuScheme | ||
| 53 | struct HomeMenuScheme { | ||
| 54 | u32 main; | ||
| 55 | u32 back; | ||
| 56 | u32 sub; | ||
| 57 | u32 bezel; | ||
| 58 | u32 extra; | ||
| 59 | }; | ||
| 60 | static_assert(sizeof(HomeMenuScheme) == 0x14, "HomeMenuScheme is incorrect size"); | ||
| 61 | |||
| 62 | /// Indicates the current theme set by the system settings | ||
| 63 | enum class ColorSet : u32 { | ||
| 64 | BasicWhite = 0, | ||
| 65 | BasicBlack = 1, | ||
| 66 | }; | ||
| 67 | |||
| 68 | /// Indicates the current console is a retail or kiosk unit | ||
| 69 | enum class QuestFlag : u8 { | ||
| 70 | Retail = 0, | ||
| 71 | Kiosk = 1, | ||
| 72 | }; | ||
| 73 | |||
| 74 | /// This is nn::settings::system::RegionCode | ||
| 75 | enum class RegionCode : u32 { | ||
| 76 | Japan, | ||
| 77 | Usa, | ||
| 78 | Europe, | ||
| 79 | Australia, | ||
| 80 | HongKongTaiwanKorea, | ||
| 81 | China, | ||
| 82 | }; | ||
| 83 | |||
| 84 | /// This is nn::settings::system::AccountSettings | ||
| 85 | struct AccountSettings { | ||
| 86 | u32 flags; | ||
| 87 | }; | ||
| 88 | static_assert(sizeof(AccountSettings) == 4, "AccountSettings is an invalid size"); | ||
| 89 | |||
| 90 | /// This is nn::settings::system::NotificationVolume | ||
| 91 | enum class NotificationVolume : u32 { | ||
| 92 | Mute, | ||
| 93 | Low, | ||
| 94 | High, | ||
| 95 | }; | ||
| 96 | |||
| 97 | /// This is nn::settings::system::NotificationFlag | ||
| 98 | struct NotificationFlag { | ||
| 99 | union { | ||
| 100 | u32 raw{}; | ||
| 101 | |||
| 102 | BitField<0, 1, u32> RingtoneFlag; | ||
| 103 | BitField<1, 1, u32> DownloadCompletionFlag; | ||
| 104 | BitField<8, 1, u32> EnablesNews; | ||
| 105 | BitField<9, 1, u32> IncomingLampFlag; | ||
| 106 | }; | ||
| 107 | }; | ||
| 108 | static_assert(sizeof(NotificationFlag) == 4, "NotificationFlag is an invalid size"); | ||
| 109 | |||
| 110 | /// This is nn::settings::system::NotificationTime | ||
| 111 | struct NotificationTime { | ||
| 112 | u32 hour; | ||
| 113 | u32 minute; | ||
| 114 | }; | ||
| 115 | static_assert(sizeof(NotificationTime) == 0x8, "NotificationTime is an invalid size"); | ||
| 116 | |||
| 117 | /// This is nn::settings::system::NotificationSettings | ||
| 118 | struct NotificationSettings { | ||
| 119 | NotificationFlag flags; | ||
| 120 | NotificationVolume volume; | ||
| 121 | NotificationTime start_time; | ||
| 122 | NotificationTime stop_time; | ||
| 123 | }; | ||
| 124 | static_assert(sizeof(NotificationSettings) == 0x18, "NotificationSettings is an invalid size"); | ||
| 125 | |||
| 126 | /// This is nn::settings::system::AccountNotificationFlag | ||
| 127 | struct AccountNotificationFlag { | ||
| 128 | union { | ||
| 129 | u32 raw{}; | ||
| 130 | |||
| 131 | BitField<0, 1, u32> FriendOnlineFlag; | ||
| 132 | BitField<1, 1, u32> FriendRequestFlag; | ||
| 133 | BitField<8, 1, u32> CoralInvitationFlag; | ||
| 134 | }; | ||
| 135 | }; | ||
| 136 | static_assert(sizeof(AccountNotificationFlag) == 4, "AccountNotificationFlag is an invalid size"); | ||
| 137 | |||
| 138 | /// This is nn::settings::system::FriendPresenceOverlayPermission | ||
| 139 | enum class FriendPresenceOverlayPermission : u8 { | ||
| 140 | NotConfirmed, | ||
| 141 | NoDisplay, | ||
| 142 | FavoriteFriends, | ||
| 143 | Friends, | ||
| 144 | }; | ||
| 145 | |||
| 146 | /// This is nn::settings::system::AccountNotificationSettings | ||
| 147 | struct AccountNotificationSettings { | ||
| 148 | Common::UUID uid; | ||
| 149 | AccountNotificationFlag flags; | ||
| 150 | FriendPresenceOverlayPermission friend_presence_permission; | ||
| 151 | FriendPresenceOverlayPermission friend_invitation_permission; | ||
| 152 | INSERT_PADDING_BYTES(0x2); | ||
| 153 | }; | ||
| 154 | static_assert(sizeof(AccountNotificationSettings) == 0x18, | ||
| 155 | "AccountNotificationSettings is an invalid size"); | ||
| 156 | |||
| 157 | /// This is nn::settings::system::TvFlag | ||
| 158 | struct TvFlag { | ||
| 159 | union { | ||
| 160 | u32 raw{}; | ||
| 161 | |||
| 162 | BitField<0, 1, u32> Allows4k; | ||
| 163 | BitField<1, 1, u32> Allows3d; | ||
| 164 | BitField<2, 1, u32> AllowsCec; | ||
| 165 | BitField<3, 1, u32> PreventsScreenBurnIn; | ||
| 166 | }; | ||
| 167 | }; | ||
| 168 | static_assert(sizeof(TvFlag) == 4, "TvFlag is an invalid size"); | ||
| 169 | |||
| 170 | /// This is nn::settings::system::TvResolution | ||
| 171 | enum class TvResolution : u32 { | ||
| 172 | Auto, | ||
| 173 | Resolution1080p, | ||
| 174 | Resolution720p, | ||
| 175 | Resolution480p, | ||
| 176 | }; | ||
| 177 | |||
| 178 | /// This is nn::settings::system::HdmiContentType | ||
| 179 | enum class HdmiContentType : u32 { | ||
| 180 | None, | ||
| 181 | Graphics, | ||
| 182 | Cinema, | ||
| 183 | Photo, | ||
| 184 | Game, | ||
| 185 | }; | ||
| 186 | |||
| 187 | /// This is nn::settings::system::RgbRange | ||
| 188 | enum class RgbRange : u32 { | ||
| 189 | Auto, | ||
| 190 | Full, | ||
| 191 | Limited, | ||
| 192 | }; | ||
| 193 | |||
| 194 | /// This is nn::settings::system::CmuMode | ||
| 195 | enum class CmuMode : u32 { | ||
| 196 | None, | ||
| 197 | ColorInvert, | ||
| 198 | HighContrast, | ||
| 199 | GrayScale, | ||
| 200 | }; | ||
| 201 | |||
| 202 | /// This is nn::settings::system::TvSettings | ||
| 203 | struct TvSettings { | ||
| 204 | TvFlag flags; | ||
| 205 | TvResolution tv_resolution; | ||
| 206 | HdmiContentType hdmi_content_type; | ||
| 207 | RgbRange rgb_range; | ||
| 208 | CmuMode cmu_mode; | ||
| 209 | u32 tv_underscan; | ||
| 210 | f32 tv_gama; | ||
| 211 | f32 contrast_ratio; | ||
| 212 | }; | ||
| 213 | static_assert(sizeof(TvSettings) == 0x20, "TvSettings is an invalid size"); | ||
| 214 | |||
| 215 | /// This is nn::settings::system::PrimaryAlbumStorage | ||
| 216 | enum class PrimaryAlbumStorage : u32 { | ||
| 217 | Nand, | ||
| 218 | SdCard, | ||
| 219 | }; | ||
| 220 | |||
| 221 | /// This is nn::settings::system::HandheldSleepPlan | ||
| 222 | enum class HandheldSleepPlan : u32 { | ||
| 223 | Sleep1Min, | ||
| 224 | Sleep3Min, | ||
| 225 | Sleep5Min, | ||
| 226 | Sleep10Min, | ||
| 227 | Sleep30Min, | ||
| 228 | Never, | ||
| 229 | }; | ||
| 230 | |||
| 231 | /// This is nn::settings::system::ConsoleSleepPlan | ||
| 232 | enum class ConsoleSleepPlan : u32 { | ||
| 233 | Sleep1Hour, | ||
| 234 | Sleep2Hour, | ||
| 235 | Sleep3Hour, | ||
| 236 | Sleep6Hour, | ||
| 237 | Sleep12Hour, | ||
| 238 | Never, | ||
| 239 | }; | ||
| 240 | |||
| 241 | /// This is nn::settings::system::SleepFlag | ||
| 242 | struct SleepFlag { | ||
| 243 | union { | ||
| 244 | u32 raw{}; | ||
| 245 | |||
| 246 | BitField<0, 1, u32> SleepsWhilePlayingMedia; | ||
| 247 | BitField<1, 1, u32> WakesAtPowerStateChange; | ||
| 248 | }; | ||
| 249 | }; | ||
| 250 | static_assert(sizeof(SleepFlag) == 4, "TvFlag is an invalid size"); | ||
| 251 | |||
| 252 | /// This is nn::settings::system::SleepSettings | ||
| 253 | struct SleepSettings { | ||
| 254 | SleepFlag flags; | ||
| 255 | HandheldSleepPlan handheld_sleep_plan; | ||
| 256 | ConsoleSleepPlan console_sleep_plan; | ||
| 257 | }; | ||
| 258 | static_assert(sizeof(SleepSettings) == 0xc, "SleepSettings is incorrect size"); | ||
| 259 | |||
| 260 | /// This is nn::settings::system::EulaVersionClockType | ||
| 261 | enum class EulaVersionClockType : u32 { | ||
| 262 | NetworkSystemClock, | ||
| 263 | SteadyClock, | ||
| 264 | }; | ||
| 265 | |||
| 266 | /// This is nn::settings::system::EulaVersion | ||
| 267 | struct EulaVersion { | ||
| 268 | u32 version; | ||
| 269 | RegionCode region_code; | ||
| 270 | EulaVersionClockType clock_type; | ||
| 271 | INSERT_PADDING_BYTES(0x4); | ||
| 272 | s64 posix_time; | ||
| 273 | Time::Clock::SteadyClockTimePoint timestamp; | ||
| 274 | }; | ||
| 275 | static_assert(sizeof(EulaVersion) == 0x30, "EulaVersion is incorrect size"); | ||
| 276 | |||
| 277 | struct SystemSettings { | 19 | struct SystemSettings { |
| 278 | // 0/unwritten (1.0.0), 0x20000 (2.0.0), 0x30000 (3.0.0-3.0.1), 0x40001 (4.0.0-4.1.0), 0x50000 | 20 | // 0/unwritten (1.0.0), 0x20000 (2.0.0), 0x30000 (3.0.0-3.0.1), 0x40001 (4.0.0-4.1.0), 0x50000 |
| 279 | // (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 | 21 | // (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 { | |||
| 283 | // 0/unwritten (1.0.0), 1 (6.0.0-8.1.0), 2 (8.1.1), 7 (9.0.0+). | 25 | // 0/unwritten (1.0.0), 1 (6.0.0-8.1.0), 2 (8.1.1), 7 (9.0.0+). |
| 284 | // if (flags & 2), defaults are written for AnalogStickUserCalibration | 26 | // if (flags & 2), defaults are written for AnalogStickUserCalibration |
| 285 | u32 flags; | 27 | u32 flags; |
| 28 | INSERT_PADDING_BYTES(0x8); // Reserved | ||
| 286 | 29 | ||
| 287 | std::array<u8, 0x8> reserved_00008; | ||
| 288 | |||
| 289 | // nn::settings::LanguageCode | ||
| 290 | LanguageCode language_code; | 30 | LanguageCode language_code; |
| 291 | 31 | INSERT_PADDING_BYTES(0x38); // Reserved | |
| 292 | std::array<u8, 0x38> reserved_00018; | ||
| 293 | 32 | ||
| 294 | // nn::settings::system::NetworkSettings | 33 | // nn::settings::system::NetworkSettings |
| 295 | u32 network_setting_count; | 34 | u32 network_setting_count; |
| 296 | bool wireless_lan_enable_flag; | 35 | bool wireless_lan_enable_flag; |
| 297 | std::array<u8, 0x3> pad_00055; | 36 | INSERT_PADDING_BYTES(0x3); |
| 298 | 37 | INSERT_PADDING_BYTES(0x8); // Reserved | |
| 299 | std::array<u8, 0x8> reserved_00058; | ||
| 300 | 38 | ||
| 301 | // nn::settings::system::NetworkSettings | 39 | // nn::settings::system::NetworkSettings |
| 302 | std::array<std::array<u8, 0x400>, 32> network_settings_1B0; | 40 | std::array<std::array<u8, 0x400>, 32> network_settings_1B0; |
| @@ -304,161 +42,142 @@ struct SystemSettings { | |||
| 304 | // nn::settings::system::BluetoothDevicesSettings | 42 | // nn::settings::system::BluetoothDevicesSettings |
| 305 | std::array<u8, 0x4> bluetooth_device_settings_count; | 43 | std::array<u8, 0x4> bluetooth_device_settings_count; |
| 306 | bool bluetooth_enable_flag; | 44 | bool bluetooth_enable_flag; |
| 307 | std::array<u8, 0x3> pad_08065; | 45 | INSERT_PADDING_BYTES(0x3); |
| 308 | bool bluetooth_afh_enable_flag; | 46 | bool bluetooth_afh_enable_flag; |
| 309 | std::array<u8, 0x3> pad_08069; | 47 | INSERT_PADDING_BYTES(0x3); |
| 310 | bool bluetooth_boost_enable_flag; | 48 | bool bluetooth_boost_enable_flag; |
| 311 | std::array<u8, 0x3> pad_0806D; | 49 | INSERT_PADDING_BYTES(0x3); |
| 312 | std::array<std::array<u8, 0x200>, 10> bluetooth_device_settings_first_10; | 50 | std::array<std::array<u8, 0x200>, 10> bluetooth_device_settings_first_10; |
| 313 | 51 | ||
| 314 | s32 ldn_channel; | 52 | s32 ldn_channel; |
| 315 | 53 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 316 | std::array<u8, 0x3C> reserved_09474; | ||
| 317 | 54 | ||
| 318 | // nn::util::Uuid MiiAuthorId | 55 | // nn::util::Uuid MiiAuthorId |
| 319 | std::array<u8, 0x10> mii_author_id; | 56 | Common::UUID mii_author_id; |
| 320 | 57 | ||
| 321 | std::array<u8, 0x30> reserved_094C0; | 58 | INSERT_PADDING_BYTES(0x30); // Reserved |
| 322 | 59 | ||
| 323 | // nn::settings::system::NxControllerSettings | 60 | // nn::settings::system::NxControllerSettings |
| 324 | u32 nx_controller_settings_count; | 61 | u32 nx_controller_settings_count; |
| 325 | 62 | ||
| 326 | std::array<u8, 0xC> reserved_094F4; | 63 | INSERT_PADDING_BYTES(0xC); // Reserved |
| 327 | 64 | ||
| 328 | // nn::settings::system::NxControllerSettings, | 65 | // nn::settings::system::NxControllerSettings, |
| 329 | // nn::settings::system::NxControllerLegacySettings on 13.0.0+ | 66 | // nn::settings::system::NxControllerLegacySettings on 13.0.0+ |
| 330 | std::array<std::array<u8, 0x40>, 10> nx_controller_legacy_settings; | 67 | std::array<std::array<u8, 0x40>, 10> nx_controller_legacy_settings; |
| 331 | 68 | INSERT_PADDING_BYTES(0x170); // Reserved | |
| 332 | std::array<u8, 0x170> reserved_09780; | ||
| 333 | 69 | ||
| 334 | bool external_rtc_reset_flag; | 70 | bool external_rtc_reset_flag; |
| 335 | std::array<u8, 0x3> pad_098F1; | 71 | INSERT_PADDING_BYTES(0x3); |
| 336 | 72 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 337 | std::array<u8, 0x3C> reserved_098F4; | ||
| 338 | 73 | ||
| 339 | s32 push_notification_activity_mode_on_sleep; | 74 | s32 push_notification_activity_mode_on_sleep; |
| 75 | INSERT_PADDING_BYTES(0x3C); // Reserved | ||
| 340 | 76 | ||
| 341 | std::array<u8, 0x3C> reserved_09934; | ||
| 342 | |||
| 343 | // nn::settings::system::ErrorReportSharePermission | ||
| 344 | ErrorReportSharePermission error_report_share_permission; | 77 | ErrorReportSharePermission error_report_share_permission; |
| 78 | INSERT_PADDING_BYTES(0x3C); // Reserved | ||
| 345 | 79 | ||
| 346 | std::array<u8, 0x3C> reserved_09974; | 80 | KeyboardLayout keyboard_layout; |
| 347 | 81 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 348 | // nn::settings::KeyboardLayout | ||
| 349 | std::array<u8, 0x4> keyboard_layout; | ||
| 350 | |||
| 351 | std::array<u8, 0x3C> reserved_099B4; | ||
| 352 | 82 | ||
| 353 | bool web_inspector_flag; | 83 | bool web_inspector_flag; |
| 354 | std::array<u8, 0x3> pad_099F1; | 84 | INSERT_PADDING_BYTES(0x3); |
| 355 | 85 | ||
| 356 | // nn::settings::system::AllowedSslHost | 86 | // nn::settings::system::AllowedSslHost |
| 357 | u32 allowed_ssl_host_count; | 87 | u32 allowed_ssl_host_count; |
| 358 | 88 | ||
| 359 | bool memory_usage_rate_flag; | 89 | bool memory_usage_rate_flag; |
| 360 | std::array<u8, 0x3> pad_099F9; | 90 | INSERT_PADDING_BYTES(0x3); |
| 361 | 91 | INSERT_PADDING_BYTES(0x34); // Reserved | |
| 362 | std::array<u8, 0x34> reserved_099FC; | ||
| 363 | 92 | ||
| 364 | // nn::settings::system::HostFsMountPoint | 93 | // nn::settings::system::HostFsMountPoint |
| 365 | std::array<u8, 0x100> host_fs_mount_point; | 94 | std::array<u8, 0x100> host_fs_mount_point; |
| 366 | 95 | ||
| 367 | // nn::settings::system::AllowedSslHost | 96 | // nn::settings::system::AllowedSslHost |
| 368 | std::array<std::array<u8, 0x100>, 8> allowed_ssl_hosts; | 97 | std::array<std::array<u8, 0x100>, 8> allowed_ssl_hosts; |
| 369 | 98 | INSERT_PADDING_BYTES(0x6C0); // Reserved | |
| 370 | std::array<u8, 0x6C0> reserved_0A330; | ||
| 371 | 99 | ||
| 372 | // nn::settings::system::BlePairingSettings | 100 | // nn::settings::system::BlePairingSettings |
| 373 | u32 ble_pairing_settings_count; | 101 | u32 ble_pairing_settings_count; |
| 374 | std::array<u8, 0xC> reserved_0A9F4; | 102 | INSERT_PADDING_BYTES(0xC); // Reserved |
| 375 | std::array<std::array<u8, 0x80>, 10> ble_pairing_settings; | 103 | std::array<std::array<u8, 0x80>, 10> ble_pairing_settings; |
| 376 | 104 | ||
| 377 | // nn::settings::system::AccountOnlineStorageSettings | 105 | // nn::settings::system::AccountOnlineStorageSettings |
| 378 | u32 account_online_storage_settings_count; | 106 | u32 account_online_storage_settings_count; |
| 379 | std::array<u8, 0xC> reserved_0AF04; | 107 | INSERT_PADDING_BYTES(0xC); // Reserved |
| 380 | std::array<std::array<u8, 0x40>, 8> account_online_storage_settings; | 108 | std::array<std::array<u8, 0x40>, 8> account_online_storage_settings; |
| 381 | 109 | ||
| 382 | bool pctl_ready_flag; | 110 | bool pctl_ready_flag; |
| 383 | std::array<u8, 0x3> pad_0B111; | 111 | INSERT_PADDING_BYTES(0x3); |
| 384 | 112 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 385 | std::array<u8, 0x3C> reserved_0B114; | ||
| 386 | 113 | ||
| 387 | // nn::settings::system::ThemeId | 114 | // nn::settings::system::ThemeId |
| 388 | std::array<u8, 0x80> theme_id_type0; | 115 | std::array<u8, 0x80> theme_id_type0; |
| 389 | std::array<u8, 0x80> theme_id_type1; | 116 | std::array<u8, 0x80> theme_id_type1; |
| 117 | INSERT_PADDING_BYTES(0x100); // Reserved | ||
| 390 | 118 | ||
| 391 | std::array<u8, 0x100> reserved_0B250; | ||
| 392 | |||
| 393 | // nn::settings::ChineseTraditionalInputMethod | ||
| 394 | ChineseTraditionalInputMethod chinese_traditional_input_method; | 119 | ChineseTraditionalInputMethod chinese_traditional_input_method; |
| 395 | 120 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 396 | std::array<u8, 0x3C> reserved_0B354; | ||
| 397 | 121 | ||
| 398 | bool zoom_flag; | 122 | bool zoom_flag; |
| 399 | std::array<u8, 0x3> pad_0B391; | 123 | INSERT_PADDING_BYTES(0x3); |
| 400 | 124 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 401 | std::array<u8, 0x3C> reserved_0B394; | ||
| 402 | 125 | ||
| 403 | // nn::settings::system::ButtonConfigRegisteredSettings | 126 | // nn::settings::system::ButtonConfigRegisteredSettings |
| 404 | u32 button_config_registered_settings_count; | 127 | u32 button_config_registered_settings_count; |
| 405 | std::array<u8, 0xC> reserved_0B3D4; | 128 | INSERT_PADDING_BYTES(0xC); // Reserved |
| 406 | 129 | ||
| 407 | // nn::settings::system::ButtonConfigSettings | 130 | // nn::settings::system::ButtonConfigSettings |
| 408 | u32 button_config_settings_count; | 131 | u32 button_config_settings_count; |
| 409 | std::array<u8, 0x4> reserved_0B3E4; | 132 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 410 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings; | 133 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings; |
| 411 | std::array<u8, 0x13B0> reserved_0D030; | 134 | INSERT_PADDING_BYTES(0x13B0); // Reserved |
| 412 | u32 button_config_settings_embedded_count; | 135 | u32 button_config_settings_embedded_count; |
| 413 | std::array<u8, 0x4> reserved_0E3E4; | 136 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 414 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings_embedded; | 137 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings_embedded; |
| 415 | std::array<u8, 0x13B0> reserved_10030; | 138 | INSERT_PADDING_BYTES(0x13B0); // Reserved |
| 416 | u32 button_config_settings_left_count; | 139 | u32 button_config_settings_left_count; |
| 417 | std::array<u8, 0x4> reserved_113E4; | 140 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 418 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings_left; | 141 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings_left; |
| 419 | std::array<u8, 0x13B0> reserved_13030; | 142 | INSERT_PADDING_BYTES(0x13B0); // Reserved |
| 420 | u32 button_config_settings_right_count; | 143 | u32 button_config_settings_right_count; |
| 421 | std::array<u8, 0x4> reserved_143E4; | 144 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 422 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings_right; | 145 | std::array<std::array<u8, 0x5A8>, 5> button_config_settings_right; |
| 423 | std::array<u8, 0x73B0> reserved_16030; | 146 | INSERT_PADDING_BYTES(0x73B0); // Reserved |
| 424 | // nn::settings::system::ButtonConfigRegisteredSettings | 147 | // nn::settings::system::ButtonConfigRegisteredSettings |
| 425 | std::array<u8, 0x5C8> button_config_registered_settings_embedded; | 148 | std::array<u8, 0x5C8> button_config_registered_settings_embedded; |
| 426 | std::array<std::array<u8, 0x5C8>, 10> button_config_registered_settings; | 149 | std::array<std::array<u8, 0x5C8>, 10> button_config_registered_settings; |
| 427 | 150 | INSERT_PADDING_BYTES(0x7FF8); // Reserved | |
| 428 | std::array<u8, 0x7FF8> reserved_21378; | ||
| 429 | 151 | ||
| 430 | // nn::settings::system::ConsoleSixAxisSensorAccelerationBias | 152 | // nn::settings::system::ConsoleSixAxisSensorAccelerationBias |
| 431 | std::array<u8, 0xC> console_six_axis_sensor_acceleration_bias; | 153 | Common::Vec3<f32> console_six_axis_sensor_acceleration_bias; |
| 432 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias | 154 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityBias |
| 433 | std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_bias; | 155 | Common::Vec3<f32> console_six_axis_sensor_angular_velocity_bias; |
| 434 | // nn::settings::system::ConsoleSixAxisSensorAccelerationGain | 156 | // nn::settings::system::ConsoleSixAxisSensorAccelerationGain |
| 435 | std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain; | 157 | std::array<u8, 0x24> console_six_axis_sensor_acceleration_gain; |
| 436 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain | 158 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityGain |
| 437 | std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain; | 159 | std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_gain; |
| 438 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias | 160 | // nn::settings::system::ConsoleSixAxisSensorAngularVelocityTimeBias |
| 439 | std::array<u8, 0xC> console_six_axis_sensor_angular_velocity_time_bias; | 161 | Common::Vec3<f32> console_six_axis_sensor_angular_velocity_time_bias; |
| 440 | // nn::settings::system::ConsoleSixAxisSensorAngularAcceleration | 162 | // nn::settings::system::ConsoleSixAxisSensorAngularAcceleration |
| 441 | std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_acceleration; | 163 | std::array<u8, 0x24> console_six_axis_sensor_angular_velocity_acceleration; |
| 442 | 164 | INSERT_PADDING_BYTES(0x70); // Reserved | |
| 443 | std::array<u8, 0x70> reserved_29400; | ||
| 444 | 165 | ||
| 445 | bool lock_screen_flag; | 166 | bool lock_screen_flag; |
| 446 | std::array<u8, 0x3> pad_29471; | 167 | INSERT_PADDING_BYTES(0x3); |
| 447 | 168 | INSERT_PADDING_BYTES(0x4); // Reserved | |
| 448 | std::array<u8, 0x4> reserved_249274; | ||
| 449 | 169 | ||
| 450 | ColorSet color_set_id; | 170 | ColorSet color_set_id; |
| 451 | 171 | ||
| 452 | QuestFlag quest_flag; | 172 | QuestFlag quest_flag; |
| 453 | 173 | ||
| 454 | // nn::settings::system::RegionCode | 174 | SystemRegionCode region_code; |
| 455 | RegionCode region_code; | ||
| 456 | 175 | ||
| 457 | // Different to nn::settings::system::InitialLaunchSettings? | 176 | // Different to nn::settings::system::InitialLaunchSettings? |
| 458 | InitialLaunchSettingsPacked initial_launch_settings_packed; | 177 | InitialLaunchSettingsPacked initial_launch_settings_packed; |
| 459 | 178 | ||
| 460 | bool battery_percentage_flag; | 179 | bool battery_percentage_flag; |
| 461 | std::array<u8, 0x3> pad_294A1; | 180 | INSERT_PADDING_BYTES(0x3); |
| 462 | 181 | ||
| 463 | // BitFlagSet<32, nn::settings::system::AppletLaunchFlag> | 182 | // BitFlagSet<32, nn::settings::system::AppletLaunchFlag> |
| 464 | u32 applet_launch_flag; | 183 | u32 applet_launch_flag; |
| @@ -469,33 +188,26 @@ struct SystemSettings { | |||
| 469 | std::array<u8, 0x10> theme_key; | 188 | std::array<u8, 0x10> theme_key; |
| 470 | 189 | ||
| 471 | bool field_testing_flag; | 190 | bool field_testing_flag; |
| 472 | std::array<u8, 0x3> pad_294C1; | 191 | INSERT_PADDING_BYTES(0x3); |
| 473 | 192 | ||
| 474 | s32 panel_crc_mode; | 193 | s32 panel_crc_mode; |
| 475 | 194 | INSERT_PADDING_BYTES(0x28); // Reserved | |
| 476 | std::array<u8, 0x28> reserved_294C8; | ||
| 477 | 195 | ||
| 478 | // nn::settings::system::BacklightSettings | 196 | // nn::settings::system::BacklightSettings |
| 479 | std::array<u8, 0x2C> backlight_settings_mixed_up; | 197 | std::array<u8, 0x2C> backlight_settings_mixed_up; |
| 198 | INSERT_PADDING_BYTES(0x64); // Reserved | ||
| 480 | 199 | ||
| 481 | std::array<u8, 0x64> reserved_2951C; | ||
| 482 | |||
| 483 | // nn::time::SystemClockContext | ||
| 484 | Service::Time::Clock::SystemClockContext user_system_clock_context; | 200 | Service::Time::Clock::SystemClockContext user_system_clock_context; |
| 485 | Service::Time::Clock::SystemClockContext network_system_clock_context; | 201 | Service::Time::Clock::SystemClockContext network_system_clock_context; |
| 486 | bool user_system_clock_automatic_correction_enabled; | 202 | bool user_system_clock_automatic_correction_enabled; |
| 487 | std::array<u8, 0x3> pad_295C1; | 203 | INSERT_PADDING_BYTES(0x3); |
| 488 | std::array<u8, 0x4> reserved_295C4; | 204 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 489 | // nn::time::SteadyClockTimePoint | ||
| 490 | Service::Time::Clock::SteadyClockTimePoint | 205 | Service::Time::Clock::SteadyClockTimePoint |
| 491 | user_system_clock_automatic_correction_updated_time_point; | 206 | user_system_clock_automatic_correction_updated_time_point; |
| 207 | INSERT_PADDING_BYTES(0x10); // Reserved | ||
| 492 | 208 | ||
| 493 | std::array<u8, 0x10> reserved_295E0; | ||
| 494 | |||
| 495 | // nn::settings::system::AccountSettings | ||
| 496 | AccountSettings account_settings; | 209 | AccountSettings account_settings; |
| 497 | 210 | INSERT_PADDING_BYTES(0xFC); // Reserved | |
| 498 | std::array<u8, 0xFC> reserved_295F4; | ||
| 499 | 211 | ||
| 500 | // nn::settings::system::AudioVolume | 212 | // nn::settings::system::AudioVolume |
| 501 | std::array<u8, 0x8> audio_volume_type0; | 213 | std::array<u8, 0x8> audio_volume_type0; |
| @@ -505,47 +217,42 @@ struct SystemSettings { | |||
| 505 | s32 audio_output_mode_type1; | 217 | s32 audio_output_mode_type1; |
| 506 | s32 audio_output_mode_type2; | 218 | s32 audio_output_mode_type2; |
| 507 | bool force_mute_on_headphone_removed; | 219 | bool force_mute_on_headphone_removed; |
| 508 | std::array<u8, 0x3> pad_2970D; | 220 | INSERT_PADDING_BYTES(0x3); |
| 509 | s32 headphone_volume_warning_count; | 221 | s32 headphone_volume_warning_count; |
| 510 | bool heaphone_volume_update_flag; | 222 | bool heaphone_volume_update_flag; |
| 511 | std::array<u8, 0x3> pad_29715; | 223 | INSERT_PADDING_BYTES(0x3); |
| 512 | // nn::settings::system::AudioVolume | 224 | // nn::settings::system::AudioVolume |
| 513 | std::array<u8, 0x8> audio_volume_type2; | 225 | std::array<u8, 0x8> audio_volume_type2; |
| 514 | // nn::settings::system::AudioOutputMode | 226 | // nn::settings::system::AudioOutputMode |
| 515 | s32 audio_output_mode_type3; | 227 | s32 audio_output_mode_type3; |
| 516 | s32 audio_output_mode_type4; | 228 | s32 audio_output_mode_type4; |
| 517 | bool hearing_protection_safeguard_flag; | 229 | bool hearing_protection_safeguard_flag; |
| 518 | std::array<u8, 0x3> pad_29729; | 230 | INSERT_PADDING_BYTES(0x3); |
| 519 | std::array<u8, 0x4> reserved_2972C; | 231 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 520 | s64 hearing_protection_safeguard_remaining_time; | 232 | s64 hearing_protection_safeguard_remaining_time; |
| 521 | std::array<u8, 0x38> reserved_29738; | 233 | INSERT_PADDING_BYTES(0x38); // Reserved |
| 522 | 234 | ||
| 523 | bool console_information_upload_flag; | 235 | bool console_information_upload_flag; |
| 524 | std::array<u8, 0x3> pad_29771; | 236 | INSERT_PADDING_BYTES(0x3); |
| 525 | 237 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 526 | std::array<u8, 0x3C> reserved_29774; | ||
| 527 | 238 | ||
| 528 | bool automatic_application_download_flag; | 239 | bool automatic_application_download_flag; |
| 529 | std::array<u8, 0x3> pad_297B1; | 240 | INSERT_PADDING_BYTES(0x3); |
| 530 | 241 | INSERT_PADDING_BYTES(0x4); // Reserved | |
| 531 | std::array<u8, 0x4> reserved_297B4; | ||
| 532 | 242 | ||
| 533 | // nn::settings::system::NotificationSettings | ||
| 534 | NotificationSettings notification_settings; | 243 | NotificationSettings notification_settings; |
| 535 | 244 | INSERT_PADDING_BYTES(0x60); // Reserved | |
| 536 | std::array<u8, 0x60> reserved_297D0; | ||
| 537 | 245 | ||
| 538 | // nn::settings::system::AccountNotificationSettings | 246 | // nn::settings::system::AccountNotificationSettings |
| 539 | u32 account_notification_settings_count; | 247 | u32 account_notification_settings_count; |
| 540 | std::array<u8, 0xC> reserved_29834; | 248 | INSERT_PADDING_BYTES(0xC); // Reserved |
| 541 | std::array<AccountNotificationSettings, 8> account_notification_settings; | 249 | std::array<AccountNotificationSettings, 8> account_notification_settings; |
| 542 | 250 | INSERT_PADDING_BYTES(0x140); // Reserved | |
| 543 | std::array<u8, 0x140> reserved_29900; | ||
| 544 | 251 | ||
| 545 | f32 vibration_master_volume; | 252 | f32 vibration_master_volume; |
| 546 | 253 | ||
| 547 | bool usb_full_key_enable_flag; | 254 | bool usb_full_key_enable_flag; |
| 548 | std::array<u8, 0x3> pad_29A45; | 255 | INSERT_PADDING_BYTES(0x3); |
| 549 | 256 | ||
| 550 | // nn::settings::system::AnalogStickUserCalibration | 257 | // nn::settings::system::AnalogStickUserCalibration |
| 551 | std::array<u8, 0x10> analog_stick_user_calibration_left; | 258 | std::array<u8, 0x10> analog_stick_user_calibration_left; |
| @@ -553,85 +260,68 @@ struct SystemSettings { | |||
| 553 | 260 | ||
| 554 | // nn::settings::system::TouchScreenMode | 261 | // nn::settings::system::TouchScreenMode |
| 555 | s32 touch_screen_mode; | 262 | s32 touch_screen_mode; |
| 263 | INSERT_PADDING_BYTES(0x14); // Reserved | ||
| 556 | 264 | ||
| 557 | std::array<u8, 0x14> reserved_29A6C; | ||
| 558 | |||
| 559 | // nn::settings::system::TvSettings | ||
| 560 | TvSettings tv_settings; | 265 | TvSettings tv_settings; |
| 561 | 266 | ||
| 562 | // nn::settings::system::Edid | 267 | // nn::settings::system::Edid |
| 563 | std::array<u8, 0x100> edid; | 268 | std::array<u8, 0x100> edid; |
| 564 | 269 | INSERT_PADDING_BYTES(0x2E0); // Reserved | |
| 565 | std::array<u8, 0x2E0> reserved_29BA0; | ||
| 566 | 270 | ||
| 567 | // nn::settings::system::DataDeletionSettings | 271 | // nn::settings::system::DataDeletionSettings |
| 568 | std::array<u8, 0x8> data_deletion_settings; | 272 | std::array<u8, 0x8> data_deletion_settings; |
| 569 | 273 | INSERT_PADDING_BYTES(0x38); // Reserved | |
| 570 | std::array<u8, 0x38> reserved_29E88; | ||
| 571 | 274 | ||
| 572 | // nn::ncm::ProgramId | 275 | // nn::ncm::ProgramId |
| 573 | std::array<u8, 0x8> initial_system_applet_program_id; | 276 | std::array<u8, 0x8> initial_system_applet_program_id; |
| 574 | std::array<u8, 0x8> overlay_disp_program_id; | 277 | std::array<u8, 0x8> overlay_disp_program_id; |
| 575 | 278 | INSERT_PADDING_BYTES(0x4); // Reserved | |
| 576 | std::array<u8, 0x4> reserved_29ED0; | ||
| 577 | 279 | ||
| 578 | bool requires_run_repair_time_reviser; | 280 | bool requires_run_repair_time_reviser; |
| 281 | INSERT_PADDING_BYTES(0x6B); // Reserved | ||
| 579 | 282 | ||
| 580 | std::array<u8, 0x6B> reserved_29ED5; | ||
| 581 | |||
| 582 | // nn::time::LocationName | ||
| 583 | Service::Time::TimeZone::LocationName device_time_zone_location_name; | 283 | Service::Time::TimeZone::LocationName device_time_zone_location_name; |
| 584 | std::array<u8, 0x4> reserved_29F64; | 284 | INSERT_PADDING_BYTES(0x4); // Reserved |
| 585 | // nn::time::SteadyClockTimePoint | ||
| 586 | Service::Time::Clock::SteadyClockTimePoint device_time_zone_location_updated_time; | 285 | Service::Time::Clock::SteadyClockTimePoint device_time_zone_location_updated_time; |
| 587 | 286 | INSERT_PADDING_BYTES(0xC0); // Reserved | |
| 588 | std::array<u8, 0xC0> reserved_29F80; | ||
| 589 | 287 | ||
| 590 | // nn::settings::system::PrimaryAlbumStorage | 288 | // nn::settings::system::PrimaryAlbumStorage |
| 591 | PrimaryAlbumStorage primary_album_storage; | 289 | PrimaryAlbumStorage primary_album_storage; |
| 592 | 290 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 593 | std::array<u8, 0x3C> reserved_2A044; | ||
| 594 | 291 | ||
| 595 | bool usb_30_enable_flag; | 292 | bool usb_30_enable_flag; |
| 596 | std::array<u8, 0x3> pad_2A081; | 293 | INSERT_PADDING_BYTES(0x3); |
| 597 | bool usb_30_host_enable_flag; | 294 | bool usb_30_host_enable_flag; |
| 598 | std::array<u8, 0x3> pad_2A085; | 295 | INSERT_PADDING_BYTES(0x3); |
| 599 | bool usb_30_device_enable_flag; | 296 | bool usb_30_device_enable_flag; |
| 600 | std::array<u8, 0x3> pad_2A089; | 297 | INSERT_PADDING_BYTES(0x3); |
| 601 | 298 | INSERT_PADDING_BYTES(0x34); // Reserved | |
| 602 | std::array<u8, 0x34> reserved_2A08C; | ||
| 603 | 299 | ||
| 604 | bool nfc_enable_flag; | 300 | bool nfc_enable_flag; |
| 605 | std::array<u8, 0x3> pad_2A0C1; | 301 | INSERT_PADDING_BYTES(0x3); |
| 606 | 302 | INSERT_PADDING_BYTES(0x3C); // Reserved | |
| 607 | std::array<u8, 0x3C> reserved_2A0C4; | ||
| 608 | 303 | ||
| 609 | // nn::settings::system::SleepSettings | 304 | // nn::settings::system::SleepSettings |
| 610 | SleepSettings sleep_settings; | 305 | SleepSettings sleep_settings; |
| 611 | 306 | INSERT_PADDING_BYTES(0x34); // Reserved | |
| 612 | std::array<u8, 0x34> reserved_2A10C; | ||
| 613 | 307 | ||
| 614 | // nn::settings::system::EulaVersion | 308 | // nn::settings::system::EulaVersion |
| 615 | u32 eula_version_count; | 309 | u32 eula_version_count; |
| 616 | std::array<u8, 0xC> reserved_2A144; | 310 | INSERT_PADDING_BYTES(0xC); // Reserved |
| 617 | std::array<EulaVersion, 32> eula_versions; | 311 | std::array<EulaVersion, 32> eula_versions; |
| 618 | 312 | INSERT_PADDING_BYTES(0x200); // Reserved | |
| 619 | std::array<u8, 0x200> reserved_2A750; | ||
| 620 | 313 | ||
| 621 | // nn::settings::system::DeviceNickName | 314 | // nn::settings::system::DeviceNickName |
| 622 | std::array<u8, 0x80> device_nick_name; | 315 | std::array<u8, 0x80> device_nick_name; |
| 623 | 316 | INSERT_PADDING_BYTES(0x80); // Reserved | |
| 624 | std::array<u8, 0x80> reserved_2A9D0; | ||
| 625 | 317 | ||
| 626 | bool auto_update_enable_flag; | 318 | bool auto_update_enable_flag; |
| 627 | std::array<u8, 0x3> pad_2AA51; | 319 | INSERT_PADDING_BYTES(0x3); |
| 628 | 320 | INSERT_PADDING_BYTES(0x4C); // Reserved | |
| 629 | std::array<u8, 0x4C> reserved_2AA54; | ||
| 630 | 321 | ||
| 631 | // nn::settings::system::BluetoothDevicesSettings | 322 | // nn::settings::system::BluetoothDevicesSettings |
| 632 | std::array<std::array<u8, 0x200>, 14> bluetooth_device_settings_last_14; | 323 | std::array<std::array<u8, 0x200>, 14> bluetooth_device_settings_last_14; |
| 633 | 324 | INSERT_PADDING_BYTES(0x2000); // Reserved | |
| 634 | std::array<u8, 0x2000> reserved_2C6A0; | ||
| 635 | 325 | ||
| 636 | // nn::settings::system::NxControllerSettings | 326 | // nn::settings::system::NxControllerSettings |
| 637 | std::array<std::array<u8, 0x800>, 10> nx_controller_settings_data_from_offset_30; | 327 | std::array<std::array<u8, 0x800>, 10> nx_controller_settings_data_from_offset_30; |
diff --git a/src/core/hle/service/set/settings_server.h b/src/core/hle/service/set/settings_server.h index a4e78db6c..8304e8424 100644 --- a/src/core/hle/service/set/settings_server.h +++ b/src/core/hle/service/set/settings_server.h | |||
| @@ -4,72 +4,13 @@ | |||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include "core/hle/service/service.h" | 6 | #include "core/hle/service/service.h" |
| 7 | #include "core/hle/service/set/system_settings.h" | 7 | #include "core/hle/service/set/settings_types.h" |
| 8 | 8 | ||
| 9 | namespace Core { | 9 | namespace Core { |
| 10 | class System; | 10 | class System; |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | namespace Service::Set { | 13 | namespace Service::Set { |
| 14 | enum class KeyboardLayout : u64 { | ||
| 15 | Japanese = 0, | ||
| 16 | EnglishUs = 1, | ||
| 17 | EnglishUsInternational = 2, | ||
| 18 | EnglishUk = 3, | ||
| 19 | French = 4, | ||
| 20 | FrenchCa = 5, | ||
| 21 | Spanish = 6, | ||
| 22 | SpanishLatin = 7, | ||
| 23 | German = 8, | ||
| 24 | Italian = 9, | ||
| 25 | Portuguese = 10, | ||
| 26 | Russian = 11, | ||
| 27 | Korean = 12, | ||
| 28 | ChineseSimplified = 13, | ||
| 29 | ChineseTraditional = 14, | ||
| 30 | }; | ||
| 31 | |||
| 32 | constexpr std::array<LanguageCode, 18> available_language_codes = {{ | ||
| 33 | LanguageCode::JA, | ||
| 34 | LanguageCode::EN_US, | ||
| 35 | LanguageCode::FR, | ||
| 36 | LanguageCode::DE, | ||
| 37 | LanguageCode::IT, | ||
| 38 | LanguageCode::ES, | ||
| 39 | LanguageCode::ZH_CN, | ||
| 40 | LanguageCode::KO, | ||
| 41 | LanguageCode::NL, | ||
| 42 | LanguageCode::PT, | ||
| 43 | LanguageCode::RU, | ||
| 44 | LanguageCode::ZH_TW, | ||
| 45 | LanguageCode::EN_GB, | ||
| 46 | LanguageCode::FR_CA, | ||
| 47 | LanguageCode::ES_419, | ||
| 48 | LanguageCode::ZH_HANS, | ||
| 49 | LanguageCode::ZH_HANT, | ||
| 50 | LanguageCode::PT_BR, | ||
| 51 | }}; | ||
| 52 | |||
| 53 | static constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{ | ||
| 54 | {LanguageCode::JA, KeyboardLayout::Japanese}, | ||
| 55 | {LanguageCode::EN_US, KeyboardLayout::EnglishUs}, | ||
| 56 | {LanguageCode::FR, KeyboardLayout::French}, | ||
| 57 | {LanguageCode::DE, KeyboardLayout::German}, | ||
| 58 | {LanguageCode::IT, KeyboardLayout::Italian}, | ||
| 59 | {LanguageCode::ES, KeyboardLayout::Spanish}, | ||
| 60 | {LanguageCode::ZH_CN, KeyboardLayout::ChineseSimplified}, | ||
| 61 | {LanguageCode::KO, KeyboardLayout::Korean}, | ||
| 62 | {LanguageCode::NL, KeyboardLayout::EnglishUsInternational}, | ||
| 63 | {LanguageCode::PT, KeyboardLayout::Portuguese}, | ||
| 64 | {LanguageCode::RU, KeyboardLayout::Russian}, | ||
| 65 | {LanguageCode::ZH_TW, KeyboardLayout::ChineseTraditional}, | ||
| 66 | {LanguageCode::EN_GB, KeyboardLayout::EnglishUk}, | ||
| 67 | {LanguageCode::FR_CA, KeyboardLayout::FrenchCa}, | ||
| 68 | {LanguageCode::ES_419, KeyboardLayout::SpanishLatin}, | ||
| 69 | {LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified}, | ||
| 70 | {LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional}, | ||
| 71 | {LanguageCode::PT_BR, KeyboardLayout::Portuguese}, | ||
| 72 | }}; | ||
| 73 | 14 | ||
| 74 | LanguageCode GetLanguageCodeFromIndex(std::size_t idx); | 15 | LanguageCode GetLanguageCodeFromIndex(std::size_t idx); |
| 75 | 16 | ||
diff --git a/src/core/hle/service/set/settings_types.h b/src/core/hle/service/set/settings_types.h new file mode 100644 index 000000000..ae2a884bc --- /dev/null +++ b/src/core/hle/service/set/settings_types.h | |||
| @@ -0,0 +1,451 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <array> | ||
| 7 | |||
| 8 | #include "common/bit_field.h" | ||
| 9 | #include "common/common_funcs.h" | ||
| 10 | #include "common/common_types.h" | ||
| 11 | #include "common/uuid.h" | ||
| 12 | #include "core/hle/service/time/clock_types.h" | ||
| 13 | |||
| 14 | namespace Service::Set { | ||
| 15 | |||
| 16 | /// This is nn::settings::system::AudioOutputMode | ||
| 17 | enum class AudioOutputMode : u32 { | ||
| 18 | ch_1, | ||
| 19 | ch_2, | ||
| 20 | ch_5_1, | ||
| 21 | ch_7_1, | ||
| 22 | }; | ||
| 23 | |||
| 24 | /// This is nn::settings::system::AudioOutputModeTarget | ||
| 25 | enum class AudioOutputModeTarget : u32 { | ||
| 26 | Hdmi, | ||
| 27 | Speaker, | ||
| 28 | Headphone, | ||
| 29 | }; | ||
| 30 | |||
| 31 | /// This is nn::settings::system::AudioVolumeTarget | ||
| 32 | enum class AudioVolumeTarget : u32 { | ||
| 33 | Speaker, | ||
| 34 | Headphone, | ||
| 35 | }; | ||
| 36 | |||
| 37 | /// This is nn::settings::system::ClockSourceId | ||
| 38 | enum class ClockSourceId : u32 { | ||
| 39 | NetworkSystemClock, | ||
| 40 | SteadyClock, | ||
| 41 | }; | ||
| 42 | |||
| 43 | /// This is nn::settings::system::CmuMode | ||
| 44 | enum class CmuMode : u32 { | ||
| 45 | None, | ||
| 46 | ColorInvert, | ||
| 47 | HighContrast, | ||
| 48 | GrayScale, | ||
| 49 | }; | ||
| 50 | |||
| 51 | /// This is nn::settings::system::ChineseTraditionalInputMethod | ||
| 52 | enum class ChineseTraditionalInputMethod : u32 { | ||
| 53 | Unknown0 = 0, | ||
| 54 | Unknown1 = 1, | ||
| 55 | Unknown2 = 2, | ||
| 56 | }; | ||
| 57 | |||
| 58 | /// Indicates the current theme set by the system settings | ||
| 59 | enum class ColorSet : u32 { | ||
| 60 | BasicWhite = 0, | ||
| 61 | BasicBlack = 1, | ||
| 62 | }; | ||
| 63 | |||
| 64 | /// This is nn::settings::system::ConsoleSleepPlan | ||
| 65 | enum class ConsoleSleepPlan : u32 { | ||
| 66 | Sleep1Hour, | ||
| 67 | Sleep2Hour, | ||
| 68 | Sleep3Hour, | ||
| 69 | Sleep6Hour, | ||
| 70 | Sleep12Hour, | ||
| 71 | Never, | ||
| 72 | }; | ||
| 73 | |||
| 74 | /// This is nn::settings::system::ErrorReportSharePermission | ||
| 75 | enum class ErrorReportSharePermission : u32 { | ||
| 76 | NotConfirmed, | ||
| 77 | Granted, | ||
| 78 | Denied, | ||
| 79 | }; | ||
| 80 | |||
| 81 | /// This is nn::settings::system::EulaVersionClockType | ||
| 82 | enum class EulaVersionClockType : u32 { | ||
| 83 | NetworkSystemClock, | ||
| 84 | SteadyClock, | ||
| 85 | }; | ||
| 86 | |||
| 87 | /// This is nn::settings::factory::RegionCode | ||
| 88 | enum class FactoryRegionCode : u32 { | ||
| 89 | Japan, | ||
| 90 | Usa, | ||
| 91 | Europe, | ||
| 92 | Australia, | ||
| 93 | China, | ||
| 94 | Korea, | ||
| 95 | Taiwan, | ||
| 96 | }; | ||
| 97 | |||
| 98 | /// This is nn::settings::system::FriendPresenceOverlayPermission | ||
| 99 | enum class FriendPresenceOverlayPermission : u8 { | ||
| 100 | NotConfirmed, | ||
| 101 | NoDisplay, | ||
| 102 | FavoriteFriends, | ||
| 103 | Friends, | ||
| 104 | }; | ||
| 105 | |||
| 106 | enum class GetFirmwareVersionType { | ||
| 107 | Version1, | ||
| 108 | Version2, | ||
| 109 | }; | ||
| 110 | |||
| 111 | /// This is nn::settings::system::HandheldSleepPlan | ||
| 112 | enum class HandheldSleepPlan : u32 { | ||
| 113 | Sleep1Min, | ||
| 114 | Sleep3Min, | ||
| 115 | Sleep5Min, | ||
| 116 | Sleep10Min, | ||
| 117 | Sleep30Min, | ||
| 118 | Never, | ||
| 119 | }; | ||
| 120 | |||
| 121 | /// This is nn::settings::system::HdmiContentType | ||
| 122 | enum class HdmiContentType : u32 { | ||
| 123 | None, | ||
| 124 | Graphics, | ||
| 125 | Cinema, | ||
| 126 | Photo, | ||
| 127 | Game, | ||
| 128 | }; | ||
| 129 | |||
| 130 | enum class KeyboardLayout : u32 { | ||
| 131 | Japanese = 0, | ||
| 132 | EnglishUs = 1, | ||
| 133 | EnglishUsInternational = 2, | ||
| 134 | EnglishUk = 3, | ||
| 135 | French = 4, | ||
| 136 | FrenchCa = 5, | ||
| 137 | Spanish = 6, | ||
| 138 | SpanishLatin = 7, | ||
| 139 | German = 8, | ||
| 140 | Italian = 9, | ||
| 141 | Portuguese = 10, | ||
| 142 | Russian = 11, | ||
| 143 | Korean = 12, | ||
| 144 | ChineseSimplified = 13, | ||
| 145 | ChineseTraditional = 14, | ||
| 146 | }; | ||
| 147 | |||
| 148 | /// This is "nn::settings::LanguageCode", which is a NUL-terminated string stored in a u64. | ||
| 149 | enum class LanguageCode : u64 { | ||
| 150 | JA = 0x000000000000616A, | ||
| 151 | EN_US = 0x00000053552D6E65, | ||
| 152 | FR = 0x0000000000007266, | ||
| 153 | DE = 0x0000000000006564, | ||
| 154 | IT = 0x0000000000007469, | ||
| 155 | ES = 0x0000000000007365, | ||
| 156 | ZH_CN = 0x0000004E432D687A, | ||
| 157 | KO = 0x0000000000006F6B, | ||
| 158 | NL = 0x0000000000006C6E, | ||
| 159 | PT = 0x0000000000007470, | ||
| 160 | RU = 0x0000000000007572, | ||
| 161 | ZH_TW = 0x00000057542D687A, | ||
| 162 | EN_GB = 0x00000042472D6E65, | ||
| 163 | FR_CA = 0x00000041432D7266, | ||
| 164 | ES_419 = 0x00003931342D7365, | ||
| 165 | ZH_HANS = 0x00736E61482D687A, | ||
| 166 | ZH_HANT = 0x00746E61482D687A, | ||
| 167 | PT_BR = 0x00000052422D7470, | ||
| 168 | }; | ||
| 169 | |||
| 170 | /// This is nn::settings::system::NotificationVolume | ||
| 171 | enum class NotificationVolume : u32 { | ||
| 172 | Mute, | ||
| 173 | Low, | ||
| 174 | High, | ||
| 175 | }; | ||
| 176 | |||
| 177 | /// This is nn::settings::system::PrimaryAlbumStorage | ||
| 178 | enum class PrimaryAlbumStorage : u32 { | ||
| 179 | Nand, | ||
| 180 | SdCard, | ||
| 181 | }; | ||
| 182 | |||
| 183 | /// Indicates the current console is a retail or kiosk unit | ||
| 184 | enum class QuestFlag : u8 { | ||
| 185 | Retail = 0, | ||
| 186 | Kiosk = 1, | ||
| 187 | }; | ||
| 188 | |||
| 189 | /// This is nn::settings::system::RgbRange | ||
| 190 | enum class RgbRange : u32 { | ||
| 191 | Auto, | ||
| 192 | Full, | ||
| 193 | Limited, | ||
| 194 | }; | ||
| 195 | |||
| 196 | /// This is nn::settings::system::RegionCode | ||
| 197 | enum class SystemRegionCode : u32 { | ||
| 198 | Japan, | ||
| 199 | Usa, | ||
| 200 | Europe, | ||
| 201 | Australia, | ||
| 202 | HongKongTaiwanKorea, | ||
| 203 | China, | ||
| 204 | }; | ||
| 205 | |||
| 206 | /// This is nn::settings::system::TouchScreenMode | ||
| 207 | enum class TouchScreenMode : u32 { | ||
| 208 | Stylus, | ||
| 209 | Standard, | ||
| 210 | }; | ||
| 211 | |||
| 212 | /// This is nn::settings::system::TvResolution | ||
| 213 | enum class TvResolution : u32 { | ||
| 214 | Auto, | ||
| 215 | Resolution1080p, | ||
| 216 | Resolution720p, | ||
| 217 | Resolution480p, | ||
| 218 | }; | ||
| 219 | |||
| 220 | constexpr std::array<LanguageCode, 18> available_language_codes = {{ | ||
| 221 | LanguageCode::JA, | ||
| 222 | LanguageCode::EN_US, | ||
| 223 | LanguageCode::FR, | ||
| 224 | LanguageCode::DE, | ||
| 225 | LanguageCode::IT, | ||
| 226 | LanguageCode::ES, | ||
| 227 | LanguageCode::ZH_CN, | ||
| 228 | LanguageCode::KO, | ||
| 229 | LanguageCode::NL, | ||
| 230 | LanguageCode::PT, | ||
| 231 | LanguageCode::RU, | ||
| 232 | LanguageCode::ZH_TW, | ||
| 233 | LanguageCode::EN_GB, | ||
| 234 | LanguageCode::FR_CA, | ||
| 235 | LanguageCode::ES_419, | ||
| 236 | LanguageCode::ZH_HANS, | ||
| 237 | LanguageCode::ZH_HANT, | ||
| 238 | LanguageCode::PT_BR, | ||
| 239 | }}; | ||
| 240 | |||
| 241 | static constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{ | ||
| 242 | {LanguageCode::JA, KeyboardLayout::Japanese}, | ||
| 243 | {LanguageCode::EN_US, KeyboardLayout::EnglishUs}, | ||
| 244 | {LanguageCode::FR, KeyboardLayout::French}, | ||
| 245 | {LanguageCode::DE, KeyboardLayout::German}, | ||
| 246 | {LanguageCode::IT, KeyboardLayout::Italian}, | ||
| 247 | {LanguageCode::ES, KeyboardLayout::Spanish}, | ||
| 248 | {LanguageCode::ZH_CN, KeyboardLayout::ChineseSimplified}, | ||
| 249 | {LanguageCode::KO, KeyboardLayout::Korean}, | ||
| 250 | {LanguageCode::NL, KeyboardLayout::EnglishUsInternational}, | ||
| 251 | {LanguageCode::PT, KeyboardLayout::Portuguese}, | ||
| 252 | {LanguageCode::RU, KeyboardLayout::Russian}, | ||
| 253 | {LanguageCode::ZH_TW, KeyboardLayout::ChineseTraditional}, | ||
| 254 | {LanguageCode::EN_GB, KeyboardLayout::EnglishUk}, | ||
| 255 | {LanguageCode::FR_CA, KeyboardLayout::FrenchCa}, | ||
| 256 | {LanguageCode::ES_419, KeyboardLayout::SpanishLatin}, | ||
| 257 | {LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified}, | ||
| 258 | {LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional}, | ||
| 259 | {LanguageCode::PT_BR, KeyboardLayout::Portuguese}, | ||
| 260 | }}; | ||
| 261 | |||
| 262 | /// This is nn::settings::system::AccountNotificationFlag | ||
| 263 | struct AccountNotificationFlag { | ||
| 264 | union { | ||
| 265 | u32 raw{}; | ||
| 266 | |||
| 267 | BitField<0, 1, u32> FriendOnlineFlag; | ||
| 268 | BitField<1, 1, u32> FriendRequestFlag; | ||
| 269 | BitField<8, 1, u32> CoralInvitationFlag; | ||
| 270 | }; | ||
| 271 | }; | ||
| 272 | static_assert(sizeof(AccountNotificationFlag) == 4, "AccountNotificationFlag is an invalid size"); | ||
| 273 | |||
| 274 | /// This is nn::settings::system::AccountSettings | ||
| 275 | struct AccountSettings { | ||
| 276 | u32 flags; | ||
| 277 | }; | ||
| 278 | static_assert(sizeof(AccountSettings) == 4, "AccountSettings is an invalid size"); | ||
| 279 | |||
| 280 | /// This is nn::settings::system::DataDeletionFlag | ||
| 281 | struct DataDeletionFlag { | ||
| 282 | union { | ||
| 283 | u32 raw{}; | ||
| 284 | |||
| 285 | BitField<0, 1, u32> AutomaticDeletionFlag; | ||
| 286 | }; | ||
| 287 | }; | ||
| 288 | static_assert(sizeof(DataDeletionFlag) == 4, "DataDeletionFlag is an invalid size"); | ||
| 289 | |||
| 290 | /// This is nn::settings::system::InitialLaunchFlag | ||
| 291 | struct InitialLaunchFlag { | ||
| 292 | union { | ||
| 293 | u32 raw{}; | ||
| 294 | |||
| 295 | BitField<0, 1, u32> InitialLaunchCompletionFlag; | ||
| 296 | BitField<8, 1, u32> InitialLaunchUserAdditionFlag; | ||
| 297 | BitField<16, 1, u32> InitialLaunchTimestampFlag; | ||
| 298 | }; | ||
| 299 | }; | ||
| 300 | static_assert(sizeof(InitialLaunchFlag) == 4, "InitialLaunchFlag is an invalid size"); | ||
| 301 | |||
| 302 | /// This is nn::settings::system::SleepFlag | ||
| 303 | struct SleepFlag { | ||
| 304 | union { | ||
| 305 | u32 raw{}; | ||
| 306 | |||
| 307 | BitField<0, 1, u32> SleepsWhilePlayingMedia; | ||
| 308 | BitField<1, 1, u32> WakesAtPowerStateChange; | ||
| 309 | }; | ||
| 310 | }; | ||
| 311 | static_assert(sizeof(SleepFlag) == 4, "TvFlag is an invalid size"); | ||
| 312 | |||
| 313 | /// This is nn::settings::system::NotificationFlag | ||
| 314 | struct NotificationFlag { | ||
| 315 | union { | ||
| 316 | u32 raw{}; | ||
| 317 | |||
| 318 | BitField<0, 1, u32> RingtoneFlag; | ||
| 319 | BitField<1, 1, u32> DownloadCompletionFlag; | ||
| 320 | BitField<8, 1, u32> EnablesNews; | ||
| 321 | BitField<9, 1, u32> IncomingLampFlag; | ||
| 322 | }; | ||
| 323 | }; | ||
| 324 | static_assert(sizeof(NotificationFlag) == 4, "NotificationFlag is an invalid size"); | ||
| 325 | |||
| 326 | /// This is nn::settings::system::TvFlag | ||
| 327 | struct TvFlag { | ||
| 328 | union { | ||
| 329 | u32 raw{}; | ||
| 330 | |||
| 331 | BitField<0, 1, u32> Allows4k; | ||
| 332 | BitField<1, 1, u32> Allows3d; | ||
| 333 | BitField<2, 1, u32> AllowsCec; | ||
| 334 | BitField<3, 1, u32> PreventsScreenBurnIn; | ||
| 335 | }; | ||
| 336 | }; | ||
| 337 | static_assert(sizeof(TvFlag) == 4, "TvFlag is an invalid size"); | ||
| 338 | |||
| 339 | /// This is nn::settings::system::UserSelectorFlag | ||
| 340 | struct UserSelectorFlag { | ||
| 341 | union { | ||
| 342 | u32 raw{}; | ||
| 343 | |||
| 344 | BitField<0, 1, u32> SkipIfSingleUser; | ||
| 345 | BitField<31, 1, u32> Uknown; | ||
| 346 | }; | ||
| 347 | }; | ||
| 348 | static_assert(sizeof(UserSelectorFlag) == 4, "UserSelectorFlag is an invalid size"); | ||
| 349 | |||
| 350 | /// This is nn::settings::system::AccountNotificationSettings | ||
| 351 | struct AccountNotificationSettings { | ||
| 352 | Common::UUID uid; | ||
| 353 | AccountNotificationFlag flags; | ||
| 354 | FriendPresenceOverlayPermission friend_presence_permission; | ||
| 355 | FriendPresenceOverlayPermission friend_invitation_permission; | ||
| 356 | INSERT_PADDING_BYTES(0x2); | ||
| 357 | }; | ||
| 358 | static_assert(sizeof(AccountNotificationSettings) == 0x18, | ||
| 359 | "AccountNotificationSettings is an invalid size"); | ||
| 360 | |||
| 361 | /// This is nn::settings::system::EulaVersion | ||
| 362 | struct EulaVersion { | ||
| 363 | u32 version; | ||
| 364 | SystemRegionCode region_code; | ||
| 365 | EulaVersionClockType clock_type; | ||
| 366 | INSERT_PADDING_BYTES(0x4); | ||
| 367 | s64 posix_time; | ||
| 368 | Time::Clock::SteadyClockTimePoint timestamp; | ||
| 369 | }; | ||
| 370 | static_assert(sizeof(EulaVersion) == 0x30, "EulaVersion is incorrect size"); | ||
| 371 | |||
| 372 | struct FirmwareVersionFormat { | ||
| 373 | u8 major; | ||
| 374 | u8 minor; | ||
| 375 | u8 micro; | ||
| 376 | INSERT_PADDING_BYTES(1); | ||
| 377 | u8 revision_major; | ||
| 378 | u8 revision_minor; | ||
| 379 | INSERT_PADDING_BYTES(2); | ||
| 380 | std::array<char, 0x20> platform; | ||
| 381 | std::array<u8, 0x40> version_hash; | ||
| 382 | std::array<char, 0x18> display_version; | ||
| 383 | std::array<char, 0x80> display_title; | ||
| 384 | }; | ||
| 385 | static_assert(sizeof(FirmwareVersionFormat) == 0x100, "FirmwareVersionFormat is an invalid size"); | ||
| 386 | |||
| 387 | /// This is nn::settings::system::HomeMenuScheme | ||
| 388 | struct HomeMenuScheme { | ||
| 389 | u32 main; | ||
| 390 | u32 back; | ||
| 391 | u32 sub; | ||
| 392 | u32 bezel; | ||
| 393 | u32 extra; | ||
| 394 | }; | ||
| 395 | static_assert(sizeof(HomeMenuScheme) == 0x14, "HomeMenuScheme is incorrect size"); | ||
| 396 | |||
| 397 | /// This is nn::settings::system::InitialLaunchSettings | ||
| 398 | struct InitialLaunchSettings { | ||
| 399 | InitialLaunchFlag flags; | ||
| 400 | INSERT_PADDING_BYTES(0x4); | ||
| 401 | Service::Time::Clock::SteadyClockTimePoint timestamp; | ||
| 402 | }; | ||
| 403 | static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size"); | ||
| 404 | |||
| 405 | #pragma pack(push, 4) | ||
| 406 | struct InitialLaunchSettingsPacked { | ||
| 407 | InitialLaunchFlag flags; | ||
| 408 | Service::Time::Clock::SteadyClockTimePoint timestamp; | ||
| 409 | }; | ||
| 410 | #pragma pack(pop) | ||
| 411 | static_assert(sizeof(InitialLaunchSettingsPacked) == 0x1C, | ||
| 412 | "InitialLaunchSettingsPacked is incorrect size"); | ||
| 413 | |||
| 414 | /// This is nn::settings::system::NotificationTime | ||
| 415 | struct NotificationTime { | ||
| 416 | u32 hour; | ||
| 417 | u32 minute; | ||
| 418 | }; | ||
| 419 | static_assert(sizeof(NotificationTime) == 0x8, "NotificationTime is an invalid size"); | ||
| 420 | |||
| 421 | /// This is nn::settings::system::NotificationSettings | ||
| 422 | struct NotificationSettings { | ||
| 423 | NotificationFlag flags; | ||
| 424 | NotificationVolume volume; | ||
| 425 | NotificationTime start_time; | ||
| 426 | NotificationTime stop_time; | ||
| 427 | }; | ||
| 428 | static_assert(sizeof(NotificationSettings) == 0x18, "NotificationSettings is an invalid size"); | ||
| 429 | |||
| 430 | /// This is nn::settings::system::SleepSettings | ||
| 431 | struct SleepSettings { | ||
| 432 | SleepFlag flags; | ||
| 433 | HandheldSleepPlan handheld_sleep_plan; | ||
| 434 | ConsoleSleepPlan console_sleep_plan; | ||
| 435 | }; | ||
| 436 | static_assert(sizeof(SleepSettings) == 0xc, "SleepSettings is incorrect size"); | ||
| 437 | |||
| 438 | /// This is nn::settings::system::TvSettings | ||
| 439 | struct TvSettings { | ||
| 440 | TvFlag flags; | ||
| 441 | TvResolution tv_resolution; | ||
| 442 | HdmiContentType hdmi_content_type; | ||
| 443 | RgbRange rgb_range; | ||
| 444 | CmuMode cmu_mode; | ||
| 445 | u32 tv_underscan; | ||
| 446 | f32 tv_gama; | ||
| 447 | f32 contrast_ratio; | ||
| 448 | }; | ||
| 449 | static_assert(sizeof(TvSettings) == 0x20, "TvSettings is an invalid size"); | ||
| 450 | |||
| 451 | } // namespace Service::Set | ||
diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index af9348522..122b915c5 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp | |||
| @@ -775,7 +775,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx | |||
| 775 | 775 | ||
| 776 | void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) { | 776 | void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) { |
| 777 | IPC::RequestParser rp{ctx}; | 777 | IPC::RequestParser rp{ctx}; |
| 778 | m_system_settings.region_code = rp.PopEnum<RegionCode>(); | 778 | m_system_settings.region_code = rp.PopEnum<SystemRegionCode>(); |
| 779 | SetSaveNeeded(); | 779 | SetSaveNeeded(); |
| 780 | 780 | ||
| 781 | LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code); | 781 | LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code); |
diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h index 6f587e0b3..bab913615 100644 --- a/src/core/hle/service/set/system_settings_server.h +++ b/src/core/hle/service/set/system_settings_server.h | |||
| @@ -12,10 +12,11 @@ | |||
| 12 | #include "common/uuid.h" | 12 | #include "common/uuid.h" |
| 13 | #include "core/hle/result.h" | 13 | #include "core/hle/result.h" |
| 14 | #include "core/hle/service/service.h" | 14 | #include "core/hle/service/service.h" |
| 15 | #include "core/hle/service/set/appln_settings.h" | 15 | #include "core/hle/service/set/setting_formats/appln_settings.h" |
| 16 | #include "core/hle/service/set/device_settings.h" | 16 | #include "core/hle/service/set/setting_formats/device_settings.h" |
| 17 | #include "core/hle/service/set/private_settings.h" | 17 | #include "core/hle/service/set/setting_formats/private_settings.h" |
| 18 | #include "core/hle/service/set/system_settings.h" | 18 | #include "core/hle/service/set/setting_formats/system_settings.h" |
| 19 | #include "core/hle/service/set/settings_types.h" | ||
| 19 | #include "core/hle/service/time/clock_types.h" | 20 | #include "core/hle/service/time/clock_types.h" |
| 20 | #include "core/hle/service/time/time_zone_types.h" | 21 | #include "core/hle/service/time/time_zone_types.h" |
| 21 | 22 | ||
| @@ -24,25 +25,6 @@ class System; | |||
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | namespace Service::Set { | 27 | namespace Service::Set { |
| 27 | enum class GetFirmwareVersionType { | ||
| 28 | Version1, | ||
| 29 | Version2, | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct FirmwareVersionFormat { | ||
| 33 | u8 major; | ||
| 34 | u8 minor; | ||
| 35 | u8 micro; | ||
| 36 | INSERT_PADDING_BYTES(1); | ||
| 37 | u8 revision_major; | ||
| 38 | u8 revision_minor; | ||
| 39 | INSERT_PADDING_BYTES(2); | ||
| 40 | std::array<char, 0x20> platform; | ||
| 41 | std::array<u8, 0x40> version_hash; | ||
| 42 | std::array<char, 0x18> display_version; | ||
| 43 | std::array<char, 0x80> display_title; | ||
| 44 | }; | ||
| 45 | static_assert(sizeof(FirmwareVersionFormat) == 0x100, "FirmwareVersionFormat is an invalid size"); | ||
| 46 | 28 | ||
| 47 | Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& system, | 29 | Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& system, |
| 48 | GetFirmwareVersionType type); | 30 | GetFirmwareVersionType type); |