diff options
| author | 2024-01-18 21:18:37 -0500 | |
|---|---|---|
| committer | 2024-01-18 21:18:37 -0500 | |
| commit | a560b9f5a26bdc49814930a0bec91d0ad6545942 (patch) | |
| tree | 5abfe9ae81e69dadc10461771a3e3aa0b7540b26 /src | |
| parent | Merge pull request #12683 from german77/amiibo-dump (diff) | |
| parent | service: set: Implement stubbed functions (diff) | |
| download | yuzu-a560b9f5a26bdc49814930a0bec91d0ad6545942.tar.gz yuzu-a560b9f5a26bdc49814930a0bec91d0ad6545942.tar.xz yuzu-a560b9f5a26bdc49814930a0bec91d0ad6545942.zip | |
Merge pull request #12678 from german77/settings_impl
service: set: Implement stubbed functions
Diffstat (limited to 'src')
17 files changed, 850 insertions, 651 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/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 4ce0a9834..03ebdc137 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -20,7 +20,7 @@ void LoopProcess(Core::System& system) { | |||
| 20 | auto server_manager = std::make_unique<ServerManager>(system); | 20 | auto server_manager = std::make_unique<ServerManager>(system); |
| 21 | std::shared_ptr<ResourceManager> resource_manager = std::make_shared<ResourceManager>(system); | 21 | std::shared_ptr<ResourceManager> resource_manager = std::make_shared<ResourceManager>(system); |
| 22 | std::shared_ptr<HidFirmwareSettings> firmware_settings = | 22 | std::shared_ptr<HidFirmwareSettings> firmware_settings = |
| 23 | std::make_shared<HidFirmwareSettings>(); | 23 | std::make_shared<HidFirmwareSettings>(system); |
| 24 | 24 | ||
| 25 | // TODO: Remove this hack when am is emulated properly. | 25 | // TODO: Remove this hack when am is emulated properly. |
| 26 | resource_manager->Initialize(); | 26 | resource_manager->Initialize(); |
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..f7c7d5b91 100644 --- a/src/core/hle/service/set/appln_settings.cpp +++ b/src/core/hle/service/set/setting_formats/appln_settings.cpp | |||
| @@ -1,12 +1,16 @@ | |||
| 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 | ||
| 8 | ApplnSettings DefaultApplnSettings() { | 8 | ApplnSettings DefaultApplnSettings() { |
| 9 | return {}; | 9 | ApplnSettings settings{}; |
| 10 | |||
| 11 | settings.mii_author_id = Common::UUID::MakeDefault(); | ||
| 12 | |||
| 13 | return settings; | ||
| 10 | } | 14 | } |
| 11 | 15 | ||
| 12 | } // namespace Service::Set | 16 | } // namespace Service::Set |
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..66e57651e 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 | ||
| @@ -11,6 +11,8 @@ SystemSettings DefaultSystemSettings() { | |||
| 11 | settings.version = 0x140000; | 11 | settings.version = 0x140000; |
| 12 | settings.flags = 7; | 12 | settings.flags = 7; |
| 13 | 13 | ||
| 14 | settings.mii_author_id = Common::UUID::MakeDefault(); | ||
| 15 | |||
| 14 | settings.color_set_id = ColorSet::BasicWhite; | 16 | settings.color_set_id = ColorSet::BasicWhite; |
| 15 | 17 | ||
| 16 | settings.notification_settings = { | 18 | settings.notification_settings = { |
| @@ -45,6 +47,10 @@ SystemSettings DefaultSystemSettings() { | |||
| 45 | settings.device_time_zone_location_name = {"UTC"}; | 47 | settings.device_time_zone_location_name = {"UTC"}; |
| 46 | settings.user_system_clock_automatic_correction_enabled = false; | 48 | settings.user_system_clock_automatic_correction_enabled = false; |
| 47 | 49 | ||
| 50 | settings.primary_album_storage = PrimaryAlbumStorage::SdCard; | ||
| 51 | settings.battery_percentage_flag = true; | ||
| 52 | settings.chinese_traditional_input_method = ChineseTraditionalInputMethod::Unknown0; | ||
| 53 | |||
| 48 | return settings; | 54 | return settings; |
| 49 | } | 55 | } |
| 50 | 56 | ||
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..4dee202d7 --- /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> Unknown; | ||
| 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..87242ae68 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp | |||
| @@ -97,8 +97,8 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_) | |||
| 97 | {3, &ISystemSettingsServer::GetFirmwareVersion, "GetFirmwareVersion"}, | 97 | {3, &ISystemSettingsServer::GetFirmwareVersion, "GetFirmwareVersion"}, |
| 98 | {4, &ISystemSettingsServer::GetFirmwareVersion2, "GetFirmwareVersion2"}, | 98 | {4, &ISystemSettingsServer::GetFirmwareVersion2, "GetFirmwareVersion2"}, |
| 99 | {5, nullptr, "GetFirmwareVersionDigest"}, | 99 | {5, nullptr, "GetFirmwareVersionDigest"}, |
| 100 | {7, nullptr, "GetLockScreenFlag"}, | 100 | {7, &ISystemSettingsServer::GetLockScreenFlag, "GetLockScreenFlag"}, |
| 101 | {8, nullptr, "SetLockScreenFlag"}, | 101 | {8, &ISystemSettingsServer::SetLockScreenFlag, "SetLockScreenFlag"}, |
| 102 | {9, nullptr, "GetBacklightSettings"}, | 102 | {9, nullptr, "GetBacklightSettings"}, |
| 103 | {10, nullptr, "SetBacklightSettings"}, | 103 | {10, nullptr, "SetBacklightSettings"}, |
| 104 | {11, nullptr, "SetBluetoothDevicesSettings"}, | 104 | {11, nullptr, "SetBluetoothDevicesSettings"}, |
| @@ -157,12 +157,12 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_) | |||
| 157 | {66, nullptr, "SetUsb30EnableFlag"}, | 157 | {66, nullptr, "SetUsb30EnableFlag"}, |
| 158 | {67, nullptr, "GetBatteryLot"}, | 158 | {67, nullptr, "GetBatteryLot"}, |
| 159 | {68, nullptr, "GetSerialNumber"}, | 159 | {68, nullptr, "GetSerialNumber"}, |
| 160 | {69, nullptr, "GetNfcEnableFlag"}, | 160 | {69, &ISystemSettingsServer::GetNfcEnableFlag, "GetNfcEnableFlag"}, |
| 161 | {70, nullptr, "SetNfcEnableFlag"}, | 161 | {70, &ISystemSettingsServer::SetNfcEnableFlag, "SetNfcEnableFlag"}, |
| 162 | {71, &ISystemSettingsServer::GetSleepSettings, "GetSleepSettings"}, | 162 | {71, &ISystemSettingsServer::GetSleepSettings, "GetSleepSettings"}, |
| 163 | {72, &ISystemSettingsServer::SetSleepSettings, "SetSleepSettings"}, | 163 | {72, &ISystemSettingsServer::SetSleepSettings, "SetSleepSettings"}, |
| 164 | {73, nullptr, "GetWirelessLanEnableFlag"}, | 164 | {73, &ISystemSettingsServer::GetWirelessLanEnableFlag, "GetWirelessLanEnableFlag"}, |
| 165 | {74, nullptr, "SetWirelessLanEnableFlag"}, | 165 | {74, &ISystemSettingsServer::SetWirelessLanEnableFlag, "SetWirelessLanEnableFlag"}, |
| 166 | {75, &ISystemSettingsServer::GetInitialLaunchSettings, "GetInitialLaunchSettings"}, | 166 | {75, &ISystemSettingsServer::GetInitialLaunchSettings, "GetInitialLaunchSettings"}, |
| 167 | {76, &ISystemSettingsServer::SetInitialLaunchSettings, "SetInitialLaunchSettings"}, | 167 | {76, &ISystemSettingsServer::SetInitialLaunchSettings, "SetInitialLaunchSettings"}, |
| 168 | {77, &ISystemSettingsServer::GetDeviceNickName, "GetDeviceNickName"}, | 168 | {77, &ISystemSettingsServer::GetDeviceNickName, "GetDeviceNickName"}, |
| @@ -176,8 +176,8 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_) | |||
| 176 | {85, nullptr, "SetPtmBatteryLot"}, | 176 | {85, nullptr, "SetPtmBatteryLot"}, |
| 177 | {86, nullptr, "GetPtmFuelGaugeParameter"}, | 177 | {86, nullptr, "GetPtmFuelGaugeParameter"}, |
| 178 | {87, nullptr, "SetPtmFuelGaugeParameter"}, | 178 | {87, nullptr, "SetPtmFuelGaugeParameter"}, |
| 179 | {88, nullptr, "GetBluetoothEnableFlag"}, | 179 | {88, &ISystemSettingsServer::GetBluetoothEnableFlag, "GetBluetoothEnableFlag"}, |
| 180 | {89, nullptr, "SetBluetoothEnableFlag"}, | 180 | {89, &ISystemSettingsServer::SetBluetoothEnableFlag, "SetBluetoothEnableFlag"}, |
| 181 | {90, &ISystemSettingsServer::GetMiiAuthorId, "GetMiiAuthorId"}, | 181 | {90, &ISystemSettingsServer::GetMiiAuthorId, "GetMiiAuthorId"}, |
| 182 | {91, nullptr, "SetShutdownRtcValue"}, | 182 | {91, nullptr, "SetShutdownRtcValue"}, |
| 183 | {92, nullptr, "GetShutdownRtcValue"}, | 183 | {92, nullptr, "GetShutdownRtcValue"}, |
| @@ -510,6 +510,25 @@ void ISystemSettingsServer::SetUserSystemClockContext(HLERequestContext& ctx) { | |||
| 510 | rb.Push(res); | 510 | rb.Push(res); |
| 511 | } | 511 | } |
| 512 | 512 | ||
| 513 | void ISystemSettingsServer::GetLockScreenFlag(HLERequestContext& ctx) { | ||
| 514 | LOG_INFO(Service_SET, "called, lock_screen_flag={}", m_system_settings.lock_screen_flag); | ||
| 515 | |||
| 516 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 517 | rb.Push(ResultSuccess); | ||
| 518 | rb.Push(m_system_settings.lock_screen_flag); | ||
| 519 | } | ||
| 520 | |||
| 521 | void ISystemSettingsServer::SetLockScreenFlag(HLERequestContext& ctx) { | ||
| 522 | IPC::RequestParser rp{ctx}; | ||
| 523 | m_system_settings.lock_screen_flag = rp.Pop<bool>(); | ||
| 524 | SetSaveNeeded(); | ||
| 525 | |||
| 526 | LOG_INFO(Service_SET, "called, lock_screen_flag={}", m_system_settings.lock_screen_flag); | ||
| 527 | |||
| 528 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 529 | rb.Push(ResultSuccess); | ||
| 530 | } | ||
| 531 | |||
| 513 | void ISystemSettingsServer::GetAccountSettings(HLERequestContext& ctx) { | 532 | void ISystemSettingsServer::GetAccountSettings(HLERequestContext& ctx) { |
| 514 | LOG_INFO(Service_SET, "called"); | 533 | LOG_INFO(Service_SET, "called"); |
| 515 | 534 | ||
| @@ -531,7 +550,7 @@ void ISystemSettingsServer::SetAccountSettings(HLERequestContext& ctx) { | |||
| 531 | } | 550 | } |
| 532 | 551 | ||
| 533 | void ISystemSettingsServer::GetEulaVersions(HLERequestContext& ctx) { | 552 | void ISystemSettingsServer::GetEulaVersions(HLERequestContext& ctx) { |
| 534 | LOG_INFO(Service_SET, "called"); | 553 | LOG_INFO(Service_SET, "called, elements={}", m_system_settings.eula_version_count); |
| 535 | 554 | ||
| 536 | ctx.WriteBuffer(m_system_settings.eula_versions); | 555 | ctx.WriteBuffer(m_system_settings.eula_versions); |
| 537 | 556 | ||
| @@ -557,7 +576,7 @@ void ISystemSettingsServer::SetEulaVersions(HLERequestContext& ctx) { | |||
| 557 | } | 576 | } |
| 558 | 577 | ||
| 559 | void ISystemSettingsServer::GetColorSetId(HLERequestContext& ctx) { | 578 | void ISystemSettingsServer::GetColorSetId(HLERequestContext& ctx) { |
| 560 | LOG_DEBUG(Service_SET, "called"); | 579 | LOG_DEBUG(Service_SET, "called, color_set=", m_system_settings.color_set_id); |
| 561 | 580 | ||
| 562 | IPC::ResponseBuilder rb{ctx, 3}; | 581 | IPC::ResponseBuilder rb{ctx, 3}; |
| 563 | rb.Push(ResultSuccess); | 582 | rb.Push(ResultSuccess); |
| @@ -576,7 +595,13 @@ void ISystemSettingsServer::SetColorSetId(HLERequestContext& ctx) { | |||
| 576 | } | 595 | } |
| 577 | 596 | ||
| 578 | void ISystemSettingsServer::GetNotificationSettings(HLERequestContext& ctx) { | 597 | void ISystemSettingsServer::GetNotificationSettings(HLERequestContext& ctx) { |
| 579 | LOG_INFO(Service_SET, "called"); | 598 | LOG_INFO(Service_SET, "called, flags={}, volume={}, head_time={}:{}, tailt_time={}:{}", |
| 599 | m_system_settings.notification_settings.flags.raw, | ||
| 600 | m_system_settings.notification_settings.volume, | ||
| 601 | m_system_settings.notification_settings.start_time.hour, | ||
| 602 | m_system_settings.notification_settings.start_time.minute, | ||
| 603 | m_system_settings.notification_settings.stop_time.hour, | ||
| 604 | m_system_settings.notification_settings.stop_time.minute); | ||
| 580 | 605 | ||
| 581 | IPC::ResponseBuilder rb{ctx, 8}; | 606 | IPC::ResponseBuilder rb{ctx, 8}; |
| 582 | rb.Push(ResultSuccess); | 607 | rb.Push(ResultSuccess); |
| @@ -601,7 +626,8 @@ void ISystemSettingsServer::SetNotificationSettings(HLERequestContext& ctx) { | |||
| 601 | } | 626 | } |
| 602 | 627 | ||
| 603 | void ISystemSettingsServer::GetAccountNotificationSettings(HLERequestContext& ctx) { | 628 | void ISystemSettingsServer::GetAccountNotificationSettings(HLERequestContext& ctx) { |
| 604 | LOG_INFO(Service_SET, "called"); | 629 | LOG_INFO(Service_SET, "called, elements={}", |
| 630 | m_system_settings.account_notification_settings_count); | ||
| 605 | 631 | ||
| 606 | ctx.WriteBuffer(m_system_settings.account_notification_settings); | 632 | ctx.WriteBuffer(m_system_settings.account_notification_settings); |
| 607 | 633 | ||
| @@ -645,6 +671,7 @@ using Settings = | |||
| 645 | static Settings GetSettings() { | 671 | static Settings GetSettings() { |
| 646 | Settings ret; | 672 | Settings ret; |
| 647 | 673 | ||
| 674 | // AM | ||
| 648 | ret["hbloader"]["applet_heap_size"] = ToBytes(u64{0x0}); | 675 | ret["hbloader"]["applet_heap_size"] = ToBytes(u64{0x0}); |
| 649 | ret["hbloader"]["applet_heap_reservation_size"] = ToBytes(u64{0x8600000}); | 676 | ret["hbloader"]["applet_heap_reservation_size"] = ToBytes(u64{0x8600000}); |
| 650 | 677 | ||
| @@ -656,6 +683,24 @@ static Settings GetSettings() { | |||
| 656 | ret["time"]["standard_steady_clock_test_offset_minutes"] = ToBytes(s32{0}); | 683 | ret["time"]["standard_steady_clock_test_offset_minutes"] = ToBytes(s32{0}); |
| 657 | ret["time"]["standard_user_clock_initial_year"] = ToBytes(s32{2023}); | 684 | ret["time"]["standard_user_clock_initial_year"] = ToBytes(s32{2023}); |
| 658 | 685 | ||
| 686 | // HID | ||
| 687 | ret["hid_debug"]["enables_debugpad"] = ToBytes(bool{true}); | ||
| 688 | ret["hid_debug"]["manages_devices"] = ToBytes(bool{true}); | ||
| 689 | ret["hid_debug"]["manages_touch_ic_i2c"] = ToBytes(bool{true}); | ||
| 690 | ret["hid_debug"]["emulate_future_device"] = ToBytes(bool{false}); | ||
| 691 | ret["hid_debug"]["emulate_mcu_hardware_error"] = ToBytes(bool{false}); | ||
| 692 | ret["hid_debug"]["enables_rail"] = ToBytes(bool{true}); | ||
| 693 | ret["hid_debug"]["emulate_firmware_update_failure"] = ToBytes(bool{false}); | ||
| 694 | ret["hid_debug"]["failure_firmware_update"] = ToBytes(s32{0}); | ||
| 695 | ret["hid_debug"]["ble_disabled"] = ToBytes(bool{false}); | ||
| 696 | ret["hid_debug"]["dscale_disabled"] = ToBytes(bool{false}); | ||
| 697 | ret["hid_debug"]["force_handheld"] = ToBytes(bool{true}); | ||
| 698 | ret["hid_debug"]["disabled_features_per_id"] = std::vector<u8>(0xa8); | ||
| 699 | ret["hid_debug"]["touch_firmware_auto_update_disabled"] = ToBytes(bool{false}); | ||
| 700 | |||
| 701 | // Settings | ||
| 702 | ret["settings_debug"]["is_debug_mode_enabled"] = ToBytes(bool{false}); | ||
| 703 | |||
| 659 | return ret; | 704 | return ret; |
| 660 | } | 705 | } |
| 661 | 706 | ||
| @@ -708,7 +753,15 @@ void ISystemSettingsServer::GetSettingsItemValue(HLERequestContext& ctx) { | |||
| 708 | } | 753 | } |
| 709 | 754 | ||
| 710 | void ISystemSettingsServer::GetTvSettings(HLERequestContext& ctx) { | 755 | void ISystemSettingsServer::GetTvSettings(HLERequestContext& ctx) { |
| 711 | LOG_INFO(Service_SET, "called"); | 756 | LOG_INFO(Service_SET, |
| 757 | "called, flags={}, cmu_mode={}, contrast_ratio={}, hdmi_content_type={}, " | ||
| 758 | "rgb_range={}, tv_gama={}, tv_resolution={}, tv_underscan={}", | ||
| 759 | m_system_settings.tv_settings.flags.raw, m_system_settings.tv_settings.cmu_mode, | ||
| 760 | m_system_settings.tv_settings.contrast_ratio, | ||
| 761 | m_system_settings.tv_settings.hdmi_content_type, | ||
| 762 | m_system_settings.tv_settings.rgb_range, m_system_settings.tv_settings.tv_gama, | ||
| 763 | m_system_settings.tv_settings.tv_resolution, | ||
| 764 | m_system_settings.tv_settings.tv_underscan); | ||
| 712 | 765 | ||
| 713 | IPC::ResponseBuilder rb{ctx, 10}; | 766 | IPC::ResponseBuilder rb{ctx, 10}; |
| 714 | rb.Push(ResultSuccess); | 767 | rb.Push(ResultSuccess); |
| @@ -735,23 +788,26 @@ void ISystemSettingsServer::SetTvSettings(HLERequestContext& ctx) { | |||
| 735 | } | 788 | } |
| 736 | 789 | ||
| 737 | void ISystemSettingsServer::GetDebugModeFlag(HLERequestContext& ctx) { | 790 | void ISystemSettingsServer::GetDebugModeFlag(HLERequestContext& ctx) { |
| 738 | LOG_DEBUG(Service_SET, "called"); | 791 | bool is_debug_mode_enabled = false; |
| 792 | GetSettingsItemValue<bool>(is_debug_mode_enabled, "settings_debug", "is_debug_mode_enabled"); | ||
| 793 | |||
| 794 | LOG_DEBUG(Service_SET, "called, is_debug_mode_enabled={}", is_debug_mode_enabled); | ||
| 739 | 795 | ||
| 740 | IPC::ResponseBuilder rb{ctx, 3}; | 796 | IPC::ResponseBuilder rb{ctx, 3}; |
| 741 | rb.Push(ResultSuccess); | 797 | rb.Push(ResultSuccess); |
| 742 | rb.Push<u32>(0); | 798 | rb.Push(is_debug_mode_enabled); |
| 743 | } | 799 | } |
| 744 | 800 | ||
| 745 | void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) { | 801 | void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) { |
| 746 | LOG_WARNING(Service_SET, "(STUBBED) called"); | 802 | LOG_INFO(Service_SET, "called, quest_flag={}", m_system_settings.quest_flag); |
| 747 | 803 | ||
| 748 | IPC::ResponseBuilder rb{ctx, 3}; | 804 | IPC::ResponseBuilder rb{ctx, 3}; |
| 749 | rb.Push(ResultSuccess); | 805 | rb.Push(ResultSuccess); |
| 750 | rb.PushEnum(QuestFlag::Retail); | 806 | rb.PushEnum(m_system_settings.quest_flag); |
| 751 | } | 807 | } |
| 752 | 808 | ||
| 753 | void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) { | 809 | void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) { |
| 754 | LOG_WARNING(Service_SET, "called"); | 810 | LOG_INFO(Service_SET, "called"); |
| 755 | 811 | ||
| 756 | Service::Time::TimeZone::LocationName name{}; | 812 | Service::Time::TimeZone::LocationName name{}; |
| 757 | auto res = GetDeviceTimeZoneLocationName(name); | 813 | auto res = GetDeviceTimeZoneLocationName(name); |
| @@ -762,7 +818,7 @@ void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx | |||
| 762 | } | 818 | } |
| 763 | 819 | ||
| 764 | void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx) { | 820 | void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx) { |
| 765 | LOG_WARNING(Service_SET, "called"); | 821 | LOG_INFO(Service_SET, "called"); |
| 766 | 822 | ||
| 767 | IPC::RequestParser rp{ctx}; | 823 | IPC::RequestParser rp{ctx}; |
| 768 | auto name{rp.PopRaw<Service::Time::TimeZone::LocationName>()}; | 824 | auto name{rp.PopRaw<Service::Time::TimeZone::LocationName>()}; |
| @@ -775,7 +831,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx | |||
| 775 | 831 | ||
| 776 | void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) { | 832 | void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) { |
| 777 | IPC::RequestParser rp{ctx}; | 833 | IPC::RequestParser rp{ctx}; |
| 778 | m_system_settings.region_code = rp.PopEnum<RegionCode>(); | 834 | m_system_settings.region_code = rp.PopEnum<SystemRegionCode>(); |
| 779 | SetSaveNeeded(); | 835 | SetSaveNeeded(); |
| 780 | 836 | ||
| 781 | LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code); | 837 | LOG_INFO(Service_SET, "called, region_code={}", m_system_settings.region_code); |
| @@ -832,15 +888,38 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled(HLERequ | |||
| 832 | } | 888 | } |
| 833 | 889 | ||
| 834 | void ISystemSettingsServer::GetPrimaryAlbumStorage(HLERequestContext& ctx) { | 890 | void ISystemSettingsServer::GetPrimaryAlbumStorage(HLERequestContext& ctx) { |
| 835 | LOG_WARNING(Service_SET, "(STUBBED) called"); | 891 | LOG_INFO(Service_SET, "called, primary_album_storage={}", |
| 892 | m_system_settings.primary_album_storage); | ||
| 893 | |||
| 894 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 895 | rb.Push(ResultSuccess); | ||
| 896 | rb.PushEnum(m_system_settings.primary_album_storage); | ||
| 897 | } | ||
| 898 | |||
| 899 | void ISystemSettingsServer::GetNfcEnableFlag(HLERequestContext& ctx) { | ||
| 900 | LOG_INFO(Service_SET, "called, nfc_enable_flag={}", m_system_settings.nfc_enable_flag); | ||
| 836 | 901 | ||
| 837 | IPC::ResponseBuilder rb{ctx, 3}; | 902 | IPC::ResponseBuilder rb{ctx, 3}; |
| 838 | rb.Push(ResultSuccess); | 903 | rb.Push(ResultSuccess); |
| 839 | rb.PushEnum(PrimaryAlbumStorage::SdCard); | 904 | rb.Push<u8>(m_system_settings.nfc_enable_flag); |
| 905 | } | ||
| 906 | |||
| 907 | void ISystemSettingsServer::SetNfcEnableFlag(HLERequestContext& ctx) { | ||
| 908 | IPC::RequestParser rp{ctx}; | ||
| 909 | m_system_settings.nfc_enable_flag = rp.Pop<bool>(); | ||
| 910 | SetSaveNeeded(); | ||
| 911 | |||
| 912 | LOG_INFO(Service_SET, "called, nfc_enable_flag={}", m_system_settings.nfc_enable_flag); | ||
| 913 | |||
| 914 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 915 | rb.Push(ResultSuccess); | ||
| 840 | } | 916 | } |
| 841 | 917 | ||
| 842 | void ISystemSettingsServer::GetSleepSettings(HLERequestContext& ctx) { | 918 | void ISystemSettingsServer::GetSleepSettings(HLERequestContext& ctx) { |
| 843 | LOG_INFO(Service_SET, "called"); | 919 | LOG_INFO(Service_SET, "called, flags={}, handheld_sleep_plan={}, console_sleep_plan={}", |
| 920 | m_system_settings.sleep_settings.flags.raw, | ||
| 921 | m_system_settings.sleep_settings.handheld_sleep_plan, | ||
| 922 | m_system_settings.sleep_settings.console_sleep_plan); | ||
| 844 | 923 | ||
| 845 | IPC::ResponseBuilder rb{ctx, 5}; | 924 | IPC::ResponseBuilder rb{ctx, 5}; |
| 846 | rb.Push(ResultSuccess); | 925 | rb.Push(ResultSuccess); |
| @@ -861,8 +940,32 @@ void ISystemSettingsServer::SetSleepSettings(HLERequestContext& ctx) { | |||
| 861 | rb.Push(ResultSuccess); | 940 | rb.Push(ResultSuccess); |
| 862 | } | 941 | } |
| 863 | 942 | ||
| 943 | void ISystemSettingsServer::GetWirelessLanEnableFlag(HLERequestContext& ctx) { | ||
| 944 | LOG_INFO(Service_SET, "called, wireless_lan_enable_flag={}", | ||
| 945 | m_system_settings.wireless_lan_enable_flag); | ||
| 946 | |||
| 947 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 948 | rb.Push(ResultSuccess); | ||
| 949 | rb.Push(m_system_settings.wireless_lan_enable_flag); | ||
| 950 | } | ||
| 951 | |||
| 952 | void ISystemSettingsServer::SetWirelessLanEnableFlag(HLERequestContext& ctx) { | ||
| 953 | IPC::RequestParser rp{ctx}; | ||
| 954 | m_system_settings.wireless_lan_enable_flag = rp.Pop<bool>(); | ||
| 955 | SetSaveNeeded(); | ||
| 956 | |||
| 957 | LOG_INFO(Service_SET, "called, wireless_lan_enable_flag={}", | ||
| 958 | m_system_settings.wireless_lan_enable_flag); | ||
| 959 | |||
| 960 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 961 | rb.Push(ResultSuccess); | ||
| 962 | } | ||
| 963 | |||
| 864 | void ISystemSettingsServer::GetInitialLaunchSettings(HLERequestContext& ctx) { | 964 | void ISystemSettingsServer::GetInitialLaunchSettings(HLERequestContext& ctx) { |
| 865 | LOG_INFO(Service_SET, "called"); | 965 | LOG_INFO(Service_SET, "called, flags={}, timestamp={}", |
| 966 | m_system_settings.initial_launch_settings_packed.flags.raw, | ||
| 967 | m_system_settings.initial_launch_settings_packed.timestamp.time_point); | ||
| 968 | |||
| 866 | IPC::ResponseBuilder rb{ctx, 10}; | 969 | IPC::ResponseBuilder rb{ctx, 10}; |
| 867 | rb.Push(ResultSuccess); | 970 | rb.Push(ResultSuccess); |
| 868 | rb.PushRaw(m_system_settings.initial_launch_settings_packed); | 971 | rb.PushRaw(m_system_settings.initial_launch_settings_packed); |
| @@ -913,35 +1016,51 @@ void ISystemSettingsServer::GetProductModel(HLERequestContext& ctx) { | |||
| 913 | rb.Push(product_model); | 1016 | rb.Push(product_model); |
| 914 | } | 1017 | } |
| 915 | 1018 | ||
| 916 | void ISystemSettingsServer::GetMiiAuthorId(HLERequestContext& ctx) { | 1019 | void ISystemSettingsServer::GetBluetoothEnableFlag(HLERequestContext& ctx) { |
| 917 | const auto author_id = Common::UUID::MakeDefault(); | 1020 | LOG_INFO(Service_SET, "called, bluetooth_enable_flag={}", |
| 1021 | m_system_settings.bluetooth_enable_flag); | ||
| 918 | 1022 | ||
| 919 | LOG_WARNING(Service_SET, "(STUBBED) called, author_id={}", author_id.FormattedString()); | 1023 | IPC::ResponseBuilder rb{ctx, 3}; |
| 1024 | rb.Push(ResultSuccess); | ||
| 1025 | rb.Push<u8>(m_system_settings.bluetooth_enable_flag); | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | void ISystemSettingsServer::SetBluetoothEnableFlag(HLERequestContext& ctx) { | ||
| 1029 | IPC::RequestParser rp{ctx}; | ||
| 1030 | m_system_settings.bluetooth_enable_flag = rp.Pop<bool>(); | ||
| 1031 | SetSaveNeeded(); | ||
| 1032 | |||
| 1033 | LOG_INFO(Service_SET, "called, bluetooth_enable_flag={}", | ||
| 1034 | m_system_settings.bluetooth_enable_flag); | ||
| 1035 | |||
| 1036 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1037 | rb.Push(ResultSuccess); | ||
| 1038 | } | ||
| 1039 | |||
| 1040 | void ISystemSettingsServer::GetMiiAuthorId(HLERequestContext& ctx) { | ||
| 1041 | LOG_INFO(Service_SET, "called, author_id={}", | ||
| 1042 | m_system_settings.mii_author_id.FormattedString()); | ||
| 920 | 1043 | ||
| 921 | IPC::ResponseBuilder rb{ctx, 6}; | 1044 | IPC::ResponseBuilder rb{ctx, 6}; |
| 922 | rb.Push(ResultSuccess); | 1045 | rb.Push(ResultSuccess); |
| 923 | rb.PushRaw(author_id); | 1046 | rb.PushRaw(m_system_settings.mii_author_id); |
| 924 | } | 1047 | } |
| 925 | 1048 | ||
| 926 | void ISystemSettingsServer::GetAutoUpdateEnableFlag(HLERequestContext& ctx) { | 1049 | void ISystemSettingsServer::GetAutoUpdateEnableFlag(HLERequestContext& ctx) { |
| 927 | u8 auto_update_flag{}; | 1050 | LOG_INFO(Service_SET, "called, auto_update_flag={}", m_system_settings.auto_update_enable_flag); |
| 928 | |||
| 929 | LOG_WARNING(Service_SET, "(STUBBED) called, auto_update_flag={}", auto_update_flag); | ||
| 930 | 1051 | ||
| 931 | IPC::ResponseBuilder rb{ctx, 3}; | 1052 | IPC::ResponseBuilder rb{ctx, 3}; |
| 932 | rb.Push(ResultSuccess); | 1053 | rb.Push(ResultSuccess); |
| 933 | rb.Push(auto_update_flag); | 1054 | rb.Push(m_system_settings.auto_update_enable_flag); |
| 934 | } | 1055 | } |
| 935 | 1056 | ||
| 936 | void ISystemSettingsServer::GetBatteryPercentageFlag(HLERequestContext& ctx) { | 1057 | void ISystemSettingsServer::GetBatteryPercentageFlag(HLERequestContext& ctx) { |
| 937 | u8 battery_percentage_flag{1}; | 1058 | LOG_DEBUG(Service_SET, "called, battery_percentage_flag={}", |
| 938 | 1059 | m_system_settings.battery_percentage_flag); | |
| 939 | LOG_WARNING(Service_SET, "(STUBBED) called, battery_percentage_flag={}", | ||
| 940 | battery_percentage_flag); | ||
| 941 | 1060 | ||
| 942 | IPC::ResponseBuilder rb{ctx, 3}; | 1061 | IPC::ResponseBuilder rb{ctx, 3}; |
| 943 | rb.Push(ResultSuccess); | 1062 | rb.Push(ResultSuccess); |
| 944 | rb.Push(battery_percentage_flag); | 1063 | rb.Push(m_system_settings.battery_percentage_flag); |
| 945 | } | 1064 | } |
| 946 | 1065 | ||
| 947 | void ISystemSettingsServer::SetExternalSteadyClockInternalOffset(HLERequestContext& ctx) { | 1066 | void ISystemSettingsServer::SetExternalSteadyClockInternalOffset(HLERequestContext& ctx) { |
| @@ -968,11 +1087,12 @@ void ISystemSettingsServer::GetExternalSteadyClockInternalOffset(HLERequestConte | |||
| 968 | } | 1087 | } |
| 969 | 1088 | ||
| 970 | void ISystemSettingsServer::GetErrorReportSharePermission(HLERequestContext& ctx) { | 1089 | void ISystemSettingsServer::GetErrorReportSharePermission(HLERequestContext& ctx) { |
| 971 | LOG_WARNING(Service_SET, "(STUBBED) called"); | 1090 | LOG_INFO(Service_SET, "called, error_report_share_permission={}", |
| 1091 | m_system_settings.error_report_share_permission); | ||
| 972 | 1092 | ||
| 973 | IPC::ResponseBuilder rb{ctx, 3}; | 1093 | IPC::ResponseBuilder rb{ctx, 3}; |
| 974 | rb.Push(ResultSuccess); | 1094 | rb.Push(ResultSuccess); |
| 975 | rb.PushEnum(ErrorReportSharePermission::Denied); | 1095 | rb.PushEnum(m_system_settings.error_report_share_permission); |
| 976 | } | 1096 | } |
| 977 | 1097 | ||
| 978 | void ISystemSettingsServer::GetAppletLaunchFlags(HLERequestContext& ctx) { | 1098 | void ISystemSettingsServer::GetAppletLaunchFlags(HLERequestContext& ctx) { |
| @@ -1014,7 +1134,7 @@ void ISystemSettingsServer::GetKeyboardLayout(HLERequestContext& ctx) { | |||
| 1014 | } | 1134 | } |
| 1015 | 1135 | ||
| 1016 | void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) { | 1136 | void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) { |
| 1017 | LOG_WARNING(Service_SET, "called."); | 1137 | LOG_INFO(Service_SET, "called"); |
| 1018 | 1138 | ||
| 1019 | Service::Time::Clock::SteadyClockTimePoint time_point{}; | 1139 | Service::Time::Clock::SteadyClockTimePoint time_point{}; |
| 1020 | auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point); | 1140 | auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point); |
| @@ -1025,7 +1145,7 @@ void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestConte | |||
| 1025 | } | 1145 | } |
| 1026 | 1146 | ||
| 1027 | void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) { | 1147 | void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) { |
| 1028 | LOG_WARNING(Service_SET, "called."); | 1148 | LOG_INFO(Service_SET, "called"); |
| 1029 | 1149 | ||
| 1030 | IPC::RequestParser rp{ctx}; | 1150 | IPC::RequestParser rp{ctx}; |
| 1031 | auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()}; | 1151 | auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()}; |
| @@ -1038,7 +1158,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestConte | |||
| 1038 | 1158 | ||
| 1039 | void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime( | 1159 | void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime( |
| 1040 | HLERequestContext& ctx) { | 1160 | HLERequestContext& ctx) { |
| 1041 | LOG_WARNING(Service_SET, "called."); | 1161 | LOG_INFO(Service_SET, "called"); |
| 1042 | 1162 | ||
| 1043 | Service::Time::Clock::SteadyClockTimePoint time_point{}; | 1163 | Service::Time::Clock::SteadyClockTimePoint time_point{}; |
| 1044 | auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point); | 1164 | auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point); |
| @@ -1050,7 +1170,7 @@ void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime( | |||
| 1050 | 1170 | ||
| 1051 | void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime( | 1171 | void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime( |
| 1052 | HLERequestContext& ctx) { | 1172 | HLERequestContext& ctx) { |
| 1053 | LOG_WARNING(Service_SET, "called."); | 1173 | LOG_INFO(Service_SET, "called"); |
| 1054 | 1174 | ||
| 1055 | IPC::RequestParser rp{ctx}; | 1175 | IPC::RequestParser rp{ctx}; |
| 1056 | auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()}; | 1176 | auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()}; |
| @@ -1062,11 +1182,12 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime( | |||
| 1062 | } | 1182 | } |
| 1063 | 1183 | ||
| 1064 | void ISystemSettingsServer::GetChineseTraditionalInputMethod(HLERequestContext& ctx) { | 1184 | void ISystemSettingsServer::GetChineseTraditionalInputMethod(HLERequestContext& ctx) { |
| 1065 | LOG_WARNING(Service_SET, "(STUBBED) called"); | 1185 | LOG_INFO(Service_SET, "called, chinese_traditional_input_method={}", |
| 1186 | m_system_settings.chinese_traditional_input_method); | ||
| 1066 | 1187 | ||
| 1067 | IPC::ResponseBuilder rb{ctx, 3}; | 1188 | IPC::ResponseBuilder rb{ctx, 3}; |
| 1068 | rb.Push(ResultSuccess); | 1189 | rb.Push(ResultSuccess); |
| 1069 | rb.PushEnum(ChineseTraditionalInputMethod::Unknown0); | 1190 | rb.PushEnum(m_system_settings.chinese_traditional_input_method); |
| 1070 | } | 1191 | } |
| 1071 | 1192 | ||
| 1072 | void ISystemSettingsServer::GetHomeMenuScheme(HLERequestContext& ctx) { | 1193 | void ISystemSettingsServer::GetHomeMenuScheme(HLERequestContext& ctx) { |
| @@ -1094,11 +1215,11 @@ void ISystemSettingsServer::GetHomeMenuSchemeModel(HLERequestContext& ctx) { | |||
| 1094 | } | 1215 | } |
| 1095 | 1216 | ||
| 1096 | void ISystemSettingsServer::GetFieldTestingFlag(HLERequestContext& ctx) { | 1217 | void ISystemSettingsServer::GetFieldTestingFlag(HLERequestContext& ctx) { |
| 1097 | LOG_WARNING(Service_SET, "(STUBBED) called"); | 1218 | LOG_INFO(Service_SET, "called, field_testing_flag={}", m_system_settings.field_testing_flag); |
| 1098 | 1219 | ||
| 1099 | IPC::ResponseBuilder rb{ctx, 3}; | 1220 | IPC::ResponseBuilder rb{ctx, 3}; |
| 1100 | rb.Push(ResultSuccess); | 1221 | rb.Push(ResultSuccess); |
| 1101 | rb.Push<u8>(false); | 1222 | rb.Push(m_system_settings.field_testing_flag); |
| 1102 | } | 1223 | } |
| 1103 | 1224 | ||
| 1104 | void ISystemSettingsServer::SetupSettings() { | 1225 | void ISystemSettingsServer::SetupSettings() { |
diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h index 6f587e0b3..32716f567 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); |
| @@ -55,6 +37,18 @@ public: | |||
| 55 | Result GetSettingsItemValue(std::vector<u8>& out_value, const std::string& category, | 37 | Result GetSettingsItemValue(std::vector<u8>& out_value, const std::string& category, |
| 56 | const std::string& name); | 38 | const std::string& name); |
| 57 | 39 | ||
| 40 | template <typename T> | ||
| 41 | Result GetSettingsItemValue(T& value, const std::string& category, const std::string& name) { | ||
| 42 | std::vector<u8> data; | ||
| 43 | const auto result = GetSettingsItemValue(data, category, name); | ||
| 44 | if (result.IsError()) { | ||
| 45 | return result; | ||
| 46 | } | ||
| 47 | ASSERT(data.size() >= sizeof(T)); | ||
| 48 | std::memcpy(&value, data.data(), sizeof(T)); | ||
| 49 | return result; | ||
| 50 | } | ||
| 51 | |||
| 58 | Result GetExternalSteadyClockSourceId(Common::UUID& out_id); | 52 | Result GetExternalSteadyClockSourceId(Common::UUID& out_id); |
| 59 | Result SetExternalSteadyClockSourceId(Common::UUID id); | 53 | Result SetExternalSteadyClockSourceId(Common::UUID id); |
| 60 | Result GetUserSystemClockContext(Service::Time::Clock::SystemClockContext& out_context); | 54 | Result GetUserSystemClockContext(Service::Time::Clock::SystemClockContext& out_context); |
| @@ -80,6 +74,8 @@ private: | |||
| 80 | void SetLanguageCode(HLERequestContext& ctx); | 74 | void SetLanguageCode(HLERequestContext& ctx); |
| 81 | void GetFirmwareVersion(HLERequestContext& ctx); | 75 | void GetFirmwareVersion(HLERequestContext& ctx); |
| 82 | void GetFirmwareVersion2(HLERequestContext& ctx); | 76 | void GetFirmwareVersion2(HLERequestContext& ctx); |
| 77 | void GetLockScreenFlag(HLERequestContext& ctx); | ||
| 78 | void SetLockScreenFlag(HLERequestContext& ctx); | ||
| 83 | void GetExternalSteadyClockSourceId(HLERequestContext& ctx); | 79 | void GetExternalSteadyClockSourceId(HLERequestContext& ctx); |
| 84 | void SetExternalSteadyClockSourceId(HLERequestContext& ctx); | 80 | void SetExternalSteadyClockSourceId(HLERequestContext& ctx); |
| 85 | void GetUserSystemClockContext(HLERequestContext& ctx); | 81 | void GetUserSystemClockContext(HLERequestContext& ctx); |
| @@ -108,13 +104,19 @@ private: | |||
| 108 | void IsUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx); | 104 | void IsUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx); |
| 109 | void SetUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx); | 105 | void SetUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx); |
| 110 | void GetPrimaryAlbumStorage(HLERequestContext& ctx); | 106 | void GetPrimaryAlbumStorage(HLERequestContext& ctx); |
| 107 | void GetNfcEnableFlag(HLERequestContext& ctx); | ||
| 108 | void SetNfcEnableFlag(HLERequestContext& ctx); | ||
| 111 | void GetSleepSettings(HLERequestContext& ctx); | 109 | void GetSleepSettings(HLERequestContext& ctx); |
| 112 | void SetSleepSettings(HLERequestContext& ctx); | 110 | void SetSleepSettings(HLERequestContext& ctx); |
| 111 | void GetWirelessLanEnableFlag(HLERequestContext& ctx); | ||
| 112 | void SetWirelessLanEnableFlag(HLERequestContext& ctx); | ||
| 113 | void GetInitialLaunchSettings(HLERequestContext& ctx); | 113 | void GetInitialLaunchSettings(HLERequestContext& ctx); |
| 114 | void SetInitialLaunchSettings(HLERequestContext& ctx); | 114 | void SetInitialLaunchSettings(HLERequestContext& ctx); |
| 115 | void GetDeviceNickName(HLERequestContext& ctx); | 115 | void GetDeviceNickName(HLERequestContext& ctx); |
| 116 | void SetDeviceNickName(HLERequestContext& ctx); | 116 | void SetDeviceNickName(HLERequestContext& ctx); |
| 117 | void GetProductModel(HLERequestContext& ctx); | 117 | void GetProductModel(HLERequestContext& ctx); |
| 118 | void GetBluetoothEnableFlag(HLERequestContext& ctx); | ||
| 119 | void SetBluetoothEnableFlag(HLERequestContext& ctx); | ||
| 118 | void GetMiiAuthorId(HLERequestContext& ctx); | 120 | void GetMiiAuthorId(HLERequestContext& ctx); |
| 119 | void GetAutoUpdateEnableFlag(HLERequestContext& ctx); | 121 | void GetAutoUpdateEnableFlag(HLERequestContext& ctx); |
| 120 | void GetBatteryPercentageFlag(HLERequestContext& ctx); | 122 | void GetBatteryPercentageFlag(HLERequestContext& ctx); |
diff --git a/src/hid_core/resources/hid_firmware_settings.cpp b/src/hid_core/resources/hid_firmware_settings.cpp index 9fa0db17e..00ceff7e6 100644 --- a/src/hid_core/resources/hid_firmware_settings.cpp +++ b/src/hid_core/resources/hid_firmware_settings.cpp | |||
| @@ -1,11 +1,14 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | 2 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/set/system_settings_server.h" | ||
| 5 | #include "core/hle/service/sm/sm.h" | ||
| 4 | #include "hid_core/resources/hid_firmware_settings.h" | 6 | #include "hid_core/resources/hid_firmware_settings.h" |
| 5 | 7 | ||
| 6 | namespace Service::HID { | 8 | namespace Service::HID { |
| 7 | 9 | ||
| 8 | HidFirmwareSettings::HidFirmwareSettings() { | 10 | HidFirmwareSettings::HidFirmwareSettings(Core::System& system) { |
| 11 | m_set_sys = system.ServiceManager().GetService<Service::Set::ISystemSettingsServer>("set:sys"); | ||
| 9 | LoadSettings(true); | 12 | LoadSettings(true); |
| 10 | } | 13 | } |
| 11 | 14 | ||
| @@ -18,21 +21,25 @@ void HidFirmwareSettings::LoadSettings(bool reload_config) { | |||
| 18 | return; | 21 | return; |
| 19 | } | 22 | } |
| 20 | 23 | ||
| 21 | // TODO: Use nn::settings::fwdbg::GetSettingsItemValue to load config values | 24 | m_set_sys->GetSettingsItemValue<bool>(is_debug_pad_enabled, "hid_debug", "enables_debugpad"); |
| 22 | 25 | m_set_sys->GetSettingsItemValue<bool>(is_device_managed, "hid_debug", "manages_devices"); | |
| 23 | is_debug_pad_enabled = true; | 26 | m_set_sys->GetSettingsItemValue<bool>(is_touch_i2c_managed, "hid_debug", |
| 24 | is_device_managed = true; | 27 | "manages_touch_ic_i2c"); |
| 25 | is_touch_i2c_managed = is_device_managed; | 28 | m_set_sys->GetSettingsItemValue<bool>(is_future_devices_emulated, "hid_debug", |
| 26 | is_future_devices_emulated = false; | 29 | "emulate_future_device"); |
| 27 | is_mcu_hardware_error_emulated = false; | 30 | m_set_sys->GetSettingsItemValue<bool>(is_mcu_hardware_error_emulated, "hid_debug", |
| 28 | is_rail_enabled = true; | 31 | "emulate_mcu_hardware_error"); |
| 29 | is_firmware_update_failure_emulated = false; | 32 | m_set_sys->GetSettingsItemValue<bool>(is_rail_enabled, "hid_debug", "enables_rail"); |
| 33 | m_set_sys->GetSettingsItemValue<bool>(is_firmware_update_failure_emulated, "hid_debug", | ||
| 34 | "emulate_firmware_update_failure"); | ||
| 30 | is_firmware_update_failure = {}; | 35 | is_firmware_update_failure = {}; |
| 31 | is_ble_disabled = false; | 36 | m_set_sys->GetSettingsItemValue<bool>(is_ble_disabled, "hid_debug", "ble_disabled"); |
| 32 | is_dscale_disabled = false; | 37 | m_set_sys->GetSettingsItemValue<bool>(is_dscale_disabled, "hid_debug", "dscale_disabled"); |
| 33 | is_handheld_forced = true; | 38 | m_set_sys->GetSettingsItemValue<bool>(is_handheld_forced, "hid_debug", "force_handheld"); |
| 34 | features_per_id_disabled = {}; | 39 | features_per_id_disabled = {}; |
| 35 | is_touch_firmware_auto_update_disabled = false; | 40 | m_set_sys->GetSettingsItemValue<bool>(is_touch_firmware_auto_update_disabled, "hid_debug", |
| 41 | "touch_firmware_auto_update_disabled"); | ||
| 42 | |||
| 36 | is_initialized = true; | 43 | is_initialized = true; |
| 37 | } | 44 | } |
| 38 | 45 | ||
diff --git a/src/hid_core/resources/hid_firmware_settings.h b/src/hid_core/resources/hid_firmware_settings.h index 00201fd94..3694fa9a3 100644 --- a/src/hid_core/resources/hid_firmware_settings.h +++ b/src/hid_core/resources/hid_firmware_settings.h | |||
| @@ -5,6 +5,14 @@ | |||
| 5 | 5 | ||
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | 7 | ||
| 8 | namespace Core { | ||
| 9 | class System; | ||
| 10 | } | ||
| 11 | |||
| 12 | namespace Service::Set { | ||
| 13 | class ISystemSettingsServer; | ||
| 14 | } | ||
| 15 | |||
| 8 | namespace Service::HID { | 16 | namespace Service::HID { |
| 9 | 17 | ||
| 10 | /// Loads firmware config from nn::settings::fwdbg | 18 | /// Loads firmware config from nn::settings::fwdbg |
| @@ -13,7 +21,7 @@ public: | |||
| 13 | using FirmwareSetting = std::array<u8, 4>; | 21 | using FirmwareSetting = std::array<u8, 4>; |
| 14 | using FeaturesPerId = std::array<bool, 0xA8>; | 22 | using FeaturesPerId = std::array<bool, 0xA8>; |
| 15 | 23 | ||
| 16 | HidFirmwareSettings(); | 24 | HidFirmwareSettings(Core::System& system); |
| 17 | 25 | ||
| 18 | void Reload(); | 26 | void Reload(); |
| 19 | void LoadSettings(bool reload_config); | 27 | void LoadSettings(bool reload_config); |
| @@ -49,6 +57,8 @@ private: | |||
| 49 | bool is_touch_firmware_auto_update_disabled{}; | 57 | bool is_touch_firmware_auto_update_disabled{}; |
| 50 | FirmwareSetting is_firmware_update_failure{}; | 58 | FirmwareSetting is_firmware_update_failure{}; |
| 51 | FeaturesPerId features_per_id_disabled{}; | 59 | FeaturesPerId features_per_id_disabled{}; |
| 60 | |||
| 61 | std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys; | ||
| 52 | }; | 62 | }; |
| 53 | 63 | ||
| 54 | } // namespace Service::HID | 64 | } // namespace Service::HID |