diff --git a/nx/include/switch/services/fs.h b/nx/include/switch/services/fs.h index 0da76c50..be83aa2f 100644 --- a/nx/include/switch/services/fs.h +++ b/nx/include/switch/services/fs.h @@ -123,6 +123,11 @@ typedef struct { u8 padding[7]; } FsTimeStampRaw; +/// This is nn::fssystem::ArchiveMacKey. Returned by setsysGetThemeKey. Does not appear to be in use elsewhere. +typedef struct { + u8 key[0x10]; +} FsArchiveMacKey; + /// Returned by fsFsGetEntryType. typedef enum { FsDirEntryType_Dir = 0, ///< Entry is a directory. diff --git a/nx/include/switch/services/hid.h b/nx/include/switch/services/hid.h index f926d6cd..71eb5ac3 100644 --- a/nx/include/switch/services/hid.h +++ b/nx/include/switch/services/hid.h @@ -381,6 +381,14 @@ typedef enum { NpadInterfaceType_Unknown4 = 4, ///< Unknown. } HidNpadInterfaceType; +/// XcdInterfaceType +typedef enum { + XcdInterfaceType_Bluetooth = BIT(0), + XcdInterfaceType_Uart = BIT(1), + XcdInterfaceType_Usb = BIT(2), + XcdInterfaceType_FieldSet = BIT(7), +} XcdInterfaceType; + /// touchPosition typedef struct touchPosition { u32 id; diff --git a/nx/include/switch/services/set.h b/nx/include/switch/services/set.h index e60a6911..e3f7bcab 100644 --- a/nx/include/switch/services/set.h +++ b/nx/include/switch/services/set.h @@ -11,6 +11,7 @@ #include "../kernel/event.h" #include "../services/time.h" #include "../services/acc.h" +#include "../services/fs.h" #include "../sf/service.h" #define SET_MAX_NAME_SIZE 0x48 @@ -55,6 +56,39 @@ typedef enum { SetRegion_TWN = 6, ///< Taiwan } SetRegion; +/// ConnectionFlag +typedef enum { + SetSysConnectionFlag_ConnectAutomaticallyFlag = BIT(0), + SetSysConnectionFlag_Unknown = BIT(1), +} SetSysConnectionFlag; + +/// AccessPointSecurityType +typedef enum { + SetSysAccessPointSecurityType_None = 0, + SetSysAccessPointSecurityType_Shared = 1, + SetSysAccessPointSecurityType_Wpa = 2, + SetSysAccessPointSecurityType_Wpa2 = 3, +} SetSysAccessPointSecurityType; + +/// AccessPointSecurityStandard +typedef enum { + SetSysAccessPointSecurityStandard_None = 0, + SetSysAccessPointSecurityStandard_Wep = 1, + SetSysAccessPointSecurityStandard_Wpa = 2, +} SetSysAccessPointSecurityStandard; + +/// AutoSettings +typedef enum { + SetSysAutoSettings_AutoIp = BIT(0), + SetSysAutoSettings_AutoDns = BIT(1), +} SetSysAutoSettings; + +/// ProxyFlags +typedef enum { + SetSysProxyFlags_UseProxyFlag = BIT(0), + SetSysProxyFlags_ProxyAutoAuthenticateFlag = BIT(1), +} SetSysProxyFlags; + /// UserSelectorFlag typedef enum { SetSysUserSelectorFlag_SkipsIfSingleUser = BIT(0), @@ -81,6 +115,12 @@ typedef enum { SetSysFriendPresenceOverlayPermission_Friends = 3, } SetSysFriendPresenceOverlayPermission; +typedef enum { + SetSysAudioDevice_Console = 0, + SetSysAudioDevice_Headphone = 1, + SetSysAudioDevice_Tv = 2, +} SetSysAudioDevice; + /// PrimaryAlbumStorage typedef enum { SetSysPrimaryAlbumStorage_Nand = 0, @@ -107,6 +147,24 @@ typedef enum { SetSysConsoleSleepPlan_Never = 5, } SetSysConsoleSleepPlan; +/// AudioOutputModeTarget +typedef enum { + SetSysAudioOutputModeTarget_Unknown0 = 0, + SetSysAudioOutputModeTarget_Unknown1 = 1, + SetSysAudioOutputModeTarget_Unknown2 = 2, + SetSysAudioOutputModeTarget_Unknown3 = 3, +} SetSysAudioOutputModeTarget; + +/// AudioOutputMode +typedef enum { + SetSysAudioOutputMode_Unknown1 = 1 ///< Default value. +} SetSysAudioOutputMode; + +/// ServiceDiscoveryControlSettings +typedef enum { + SetSysServiceDiscoveryControlSettings_IsChangeEnvironmentIdentifierDisabled = BIT(0), +} SetSysServiceDiscoveryControlSettings; + /// ErrorReportSharePermission typedef enum { SetSysErrorReportSharePermission_NotConfirmed = 0, @@ -139,6 +197,12 @@ typedef enum { SetChineseTraditionalInputMethod_Unknown2 = 2, } SetChineseTraditionalInputMethod; +/// PtmCycleCountReliability +typedef enum { + PtmCycleCountReliability_Default = 0, + PtmCycleCountReliability_Unk = 1, +} SetSysPtmCycleCountReliability; + /// PlatformRegion. Other values not listed here should be handled as "Unknown". typedef enum { SetSysPlatformRegion_Global = 1, @@ -151,11 +215,108 @@ typedef enum { SetSysTouchScreenMode_Standard = 1, ///< Standard, the default. } SetSysTouchScreenMode; +typedef enum { + SetSysBlockType_Audio = 1, + SetSysBlockType_Video = 2, + SetSysBlockType_VendorSpecific = 3, + SetSysBlockType_Speaker = 4, +} SetSysBlockType; + +typedef enum { + SetSysControllerType_JoyConR = 1, + SetSysControllerType_JoyConL = 2, + SetSysControllerType_ProCon = 3, +} SetSysControllerType; + /// BatteryLot typedef struct { char lot[0x18]; ///< BatteryLot string. } SetBatteryLot; +/// NetworkSettings +typedef struct { + char name[0x40]; + Uuid uuid; + u32 connection_flags; ///< Bitmask with \ref SetSysConnectionFlag. + u32 wired_flag; + u32 connect_to_hidden_network; ///< Bitmask with UseStealthNetworkFlag. + char access_point_ssid[0x20]; + u32 access_point_ssid_len; + u32 access_point_security_type; ///< Bitmask with \ref SetSysAccessPointSecurityType. + u32 access_point_security_standard; ///< Bitmask with \ref SetSysAccessPointSecurityStandard. + char access_point_password[0x40]; + u32 access_point_password_len; + u32 auto_settings; ///< Bitmask with \ref SetSysAutoSettings. + u32 manual_ip_address; + u32 manual_subnet_mask; + u32 manual_gateway; + u32 primary_dns; + u32 secondary_dns; + u32 proxy_flags; ///< Bitmask with \ref SetSysProxyFlags. + char proxy_server[0x80]; + u16 proxy_port; + u16 padding1; + char proxy_autoauth_user[0x20]; + char proxy_autoauth_pass[0x20]; + u16 mtu; + u16 padding2; +} SetSysNetworkSettings; + +/// LcdBacklightBrightnessMapping +typedef struct { + float brightness_applied_to_backlight; + float ambient_light_sensor_value; + float float8; +} SetSysLcdBacklightBrightnessMapping; + +/// BacklightSettings +typedef struct { + u32 auto_brightness_flags; + float screen_brightness; + SetSysLcdBacklightBrightnessMapping brightness_mapping; + float float14; + float float18; + float float1C; + float float20; + float float24; +} SetSysBacklightSettings; + +/// BacklightSettingsEx +typedef struct { + u32 auto_brightness_flags; + float screen_brightness; + float current_brightness_for_vr_mode; + SetSysLcdBacklightBrightnessMapping brightness_mapping; + float float18; + float float1C; + float float20; + float float24; + float float28; +} SetSysBacklightSettingsEx; + +/// BluetoothDevicesSettings +typedef struct { + u8 address[6]; ///< nn::bluetooth::Address + char name[0x20]; + u16 unk_x26; + u8 unk_x28; + Uuid uuid; + u8 unk_x39; + u16 unk_x3A; + u32 unk_x3C; + u16 unk_x40; + u16 unk_x42; + u16 unk_x44; + u8 unk_x46[0x80]; + u16 unk_xC6; + u8 unk_xC8; + u8 unk_xC9; + u16 unk_xCA; + u8 unk_xCC[8]; + u8 unk_xD4; + u8 unk_xD5[0x12B]; +} SetSysBluetoothDevicesSettings; + /// Structure returned by \ref setsysGetFirmwareVersion. typedef struct { u8 major; @@ -172,6 +333,11 @@ typedef struct { char display_title[0x80]; } SetSysFirmwareVersion; +/// Structure returned by \ref setsysGetFirmwareVersionDigest. +typedef struct { + char digest[0x40]; +} SetSysFirmwareVersionDigest; + /// UserSelectorSettings typedef struct { u32 flags; ///< Bitmask with \ref SetSysUserSelectorFlag. @@ -182,6 +348,11 @@ typedef struct { SetSysUserSelectorSettings settings; } SetSysAccountSettings; +typedef struct { + u32 unk_x0; ///< 0 for Console and Tv, 2 for Headphones. + u8 volume; ///< From 0-15. +} SetSysAudioVolume; + /// EulaVersion typedef struct { u32 version; @@ -226,6 +397,140 @@ typedef struct { float contrast; ///< Contrast. } SetSysTvSettings; +typedef struct { + u16 pixel_clock; ///< In 10 kHz units. + u8 horizontal_active_pixels_lsb; + u8 horizontal_blanking_pixels_lsb; + u8 horizontal_blanking_pixels_msb : 4; + u8 horizontal_active_pixels_msb : 4; + u8 vertical_active_lines_lsb; + u8 vertical_blanking_lines_lsb; + u8 vertical_blanking_lines_msb : 4; + u8 vertical_active_lines_msb : 4; + u8 horizontal_sync_offset_pixels_lsb; + u8 horizontal_sync_pulse_width_pixels_lsb; + u8 horizontal_sync_pulse_width_lines_lsb : 4; + u8 horizontal_sync_offset_lines_lsb : 4; + u8 vertical_sync_pulse_width_lines_msb : 2; + u8 vertical_sync_offset_lines_msb : 2; + u8 horizontal_sync_pulse_width_pixels_msb : 2; + u8 horizontal_sync_offset_pixels_msb : 2; + u8 horizontal_image_size_mm_lsb; + u8 vertical_image_size_mm_lsb; + u8 vertical_image_size_mm_msb : 4; + u8 horizontal_image_size_mm_msb : 4; + u8 horizontal_border_pixels; + u8 vertical_border_lines; + u8 features_bitmap_0 : 1; + u8 features_bitmap_1 : 1; + u8 features_bitmap_2 : 1; + u8 features_bitmap_34 : 2; + u8 features_bitmap_56 : 2; + u8 interlaced : 1; +} SetSysModeLine; + +typedef struct { + struct { + u8 size : 5; + SetSysBlockType block_type : 3; + struct { + u8 svd_index : 7; + u8 native_flag : 1; + } svd[0xC]; + } PACKED video; + struct { + u8 size : 5; + SetSysBlockType block_type : 3; + u8 channel_count : 3; + u8 format_code : 4; + u8 padding1 : 1; + u8 sampling_rates_bitmap; + u8 bitrate; + } PACKED audio; + struct { + u8 size : 5; + SetSysBlockType block_type : 3; + u8 ieee_registration_id[3]; + u16 source_physical_address; + u8 mode_bitmap; + u8 max_tmds_frequency; + u8 latency_bitmap; + } PACKED vendor_specific; + u8 padding[2]; +} SetSysDataBlock; + +/// Edid +typedef struct { + u8 pattern[8]; ///< Fixed pattern 00 FF FF FF FF FF FF 00. + u16 pnp_id; ///< Big-endian set of 3 5-bit values representing letters, 1 = A .. 26 = Z. + u16 product_code; + u32 serial_number; + u8 manufacture_week; + u8 manufacture_year; + u8 edid_version; + u8 edid_revision; + u8 video_input_parameters_bitmap; + u8 display_width; + u8 display_height; + u8 display_gamma; + u8 supported_features_bitmap; + struct { + u8 green_y_lsb : 2; + u8 green_x_lsb : 2; + u8 red_y_lsb : 2; + u8 red_x_lsb : 2; + u8 blue_lsb : 4; + u8 white_lsb : 4; + u8 red_x_msb; + u8 red_y_msb; + u8 green_x_msb; + u8 green_y_msb; + u8 blue_x_msb; + u8 blue_y_msb; + u8 white_x_msb; + u8 white_y_msb; + } chromaticity; + u8 timing_bitmap[3]; + struct { + u8 x_resolution; ///< Real value is (val + 31) * 8 pixels. + u8 vertical_frequency : 6; ///< Real value is val + 60 Hz. + u8 aspect_ratio : 2; ///< 0 = 16:10, 1 = 4:3, 2 = 5:4, 3 = 16:9. + } timing_info[8]; + SetSysModeLine timing_descriptor[2]; + struct { + u16 display_descriptor_zero; + u8 padding1; + u8 descriptor_type; + u8 padding2; + char name[0xD]; + } display_descriptor_name; + struct { + u16 display_descriptor_zero; + u8 padding1; + u8 descriptor_type; + u8 range_limit_offsets; + u8 vertical_field_rate_min; + u8 vertical_field_rate_max; + u8 horizontal_line_rate_min; + u8 horizontal_line_rate_max; + u8 pixel_clock_rate_max; ///< Rounded up to multiples of 10 MHz. + u8 extended_timing_info; + u8 padding[7]; + } display_descriptor_range_limits; + u8 extension_count; ///< Always 1. + u8 checksum; ///< Sum of all 128 bytes should equal 0 mod 256. + ///< Extended data. + u8 extension_tag; ///< Always 2 = CEA EDID timing extension. + u8 revision; + u8 dtd_start; + u8 native_dtd_count : 4; + u8 native_dtd_feature_bitmap : 4; + SetSysDataBlock data_block; + SetSysModeLine extended_timing_descriptor[5]; + u8 padding[5]; + u8 extended_checksum; ///< Sum of 128 extended bytes should equal 0 mod 256. +} SetSysEdid; + /// DataDeletionSettings typedef struct { u32 flags; ///< Bitmask with DataDeletionFlag. @@ -246,6 +551,122 @@ typedef struct { TimeSteadyClockTimePoint timestamp; ///< \ref TimeSteadyClockTimePoint timestamp. } SetSysInitialLaunchSettings; +/// PtmFuelGaugeParameter +typedef struct { + u16 unk_x0; + u16 unk_x2; + u16 unk_x4; + u16 unk_x6; + u16 unk_x8; + u16 unk_xA; + u16 unk_xC; + u16 unk_xE; + u16 unk_x10; + u16 unk_x12; + u32 cycles; +} SetSysPtmFuelGaugeParameter; + +/// Actually nn::util::Color4u8Type. +typedef struct { + u8 field[4]; +} SetSysColor4u8Type; + +/// NxControllerSettings +typedef struct { + u8 address[6]; ///< nn::bluetooth::Address + u8 type; ///< \ref SetSysControllerType. + char serial[0x10]; + SetSysColor4u8Type body_color; + SetSysColor4u8Type button_color; + u8 unk_x1F[8]; + u8 unk_x27; + u8 interface_type; ///< Bitmask with \ref XcdInterfaceType. +} SetSysNxControllerSettings; + +/// ConsoleSixAxisSensorAccelerationBias +typedef struct { + float unk_x0; + float unk_x4; + float unk_x8; +} SetSysConsoleSixAxisSensorAccelerationBias; + +/// ConsoleSixAxisSensorAngularVelocityBias +typedef struct { + float unk_x0; + float unk_x4; + float unk_x8; +} SetSysConsoleSixAxisSensorAngularVelocityBias; + +/// ConsoleSixAxisSensorAccelerationGain +typedef struct { + float unk_x0; + float unk_x4; + float unk_x8; + float unk_xC; + float unk_x10; + float unk_x14; + float unk_x18; + float unk_x1C; + float unk_x20; +} SetSysConsoleSixAxisSensorAccelerationGain; + +/// ConsoleSixAxisSensorAngularVelocityGain +typedef struct { + float unk_x0; + float unk_x4; + float unk_x8; + float unk_xC; + float unk_x10; + float unk_x14; + float unk_x18; + float unk_x1C; + float unk_x20; +} SetSysConsoleSixAxisSensorAngularVelocityGain; + +/// AllowedSslHosts +typedef struct { + u8 hosts[0x100]; +} SetSysAllowedSslHosts; + +/// HostFsMountPoint +typedef struct { + char mount[0x100]; +} SetSysHostFsMountPoint; + +/// BlePairingSettings +typedef struct { + u8 address[6]; ///< nn::bluetooth::Address + u16 unk_x6; + u16 unk_x8; + u8 unk_xA; + u8 unk_xB; + u8 unk_xC; + u8 unk_xD; + u8 unk_xE; + u8 unk_xF; + u8 padding[0x70]; +} SetSysBlePairingSettings; + +/// ConsoleSixAxisSensorAngularVelocityTimeBias +typedef struct { + float unk_x0; + float unk_x4; + float unk_x8; +} SetSysConsoleSixAxisSensorAngularVelocityTimeBias; + +/// ConsoleSixAxisSensorAngularAcceleration +typedef struct { + float unk_x0; + float unk_x4; + float unk_x8; + float unk_xC; + float unk_x10; + float unk_x14; + float unk_x18; + float unk_x1C; + float unk_x20; +} SetSysConsoleSixAxisSensorAngularAcceleration; + /// RebootlessSystemUpdateVersion. This is the content of the RebootlessSystemUpdateVersion SystemData, in the "/version" file. typedef struct { u32 version; @@ -253,6 +674,35 @@ typedef struct { char display_version[0x20]; } SetSysRebootlessSystemUpdateVersion; +/// AccountOnlineStorageSettings +typedef struct { + AccountUid uid; ///< \ref AccountUid + u32 unk_x10; + u32 unk_x14; +} SetSysAccountOnlineStorageSettings; + +/// AnalogStickUserCalibration +typedef struct { + u16 unk_x0; + u16 unk_x2; + u16 unk_x4; + u16 unk_x6; + u16 unk_x8; + u16 unk_xA; + u16 unk_xC; + u16 unk_xE; +} SetSysAnalogStickUserCalibration; + +/// ThemeId +typedef struct { + u64 theme_id[0x10]; +} SetSysThemeId; + +/// ThemeSettings +typedef struct { + u64 theme_settings; +} SetSysThemeSettings; + /// Output from \ref setsysGetHomeMenuScheme. This contains RGBA8 colors which correspond with the physical shell of the system. typedef struct { u32 main_color; ///< Main Color. @@ -444,12 +894,33 @@ Service* setsysGetServiceSession(void); */ Result setsysSetLanguageCode(u64 LanguageCode); +/** + * @brief SetNetworkSettings + * @param[in] settings Input array of \ref SetSysNetworkSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysSetNetworkSettings(const SetSysNetworkSettings *settings, s32 count); + +/** + * @brief GetNetworkSettings + * @param[out] total_out Total output entries. + * @param[out] versions Output array of \ref SetSysNetworkSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysGetNetworkSettings(s32 *total_out, SetSysNetworkSettings *settings, s32 count); + /** * @brief Gets the system firmware version. * @param[out] out Firmware version to populate. */ Result setsysGetFirmwareVersion(SetSysFirmwareVersion *out); +/** + * @brief GetFirmwareVersionDigest + * @param[out] out \ref SetSysFirmwareVersionDigest + */ +Result setsysGetFirmwareVersionDigest(SetSysFirmwareVersionDigest *out); + /** * @brief GetLockScreenFlag * @param[out] out Output flag. @@ -462,6 +933,57 @@ Result setsysGetLockScreenFlag(bool *out); */ Result setsysSetLockScreenFlag(bool flag); +/** + * @brief GetBacklightSettings + * @param[out] out \ref SetSysBacklightSettings + */ +Result setsysGetBacklightSettings(SetSysBacklightSettings *out); + +/** + * @brief SetBacklightSettings + * @param[in] settings \ref SetSysBacklightSettings + */ +Result setsysSetBacklightSettings(const SetSysBacklightSettings *settings); + +/** + * @brief SetBluetoothDevicesSettings + * @param[in] settings Input array of \ref SetSysBluetoothDevicesSettings. + * @param[in] count Size of the versions array in entries. + */ +Result setsysSetBluetoothDevicesSettings(const SetSysBluetoothDevicesSettings *settings, s32 count); + +/** + * @brief GetBluetoothDevicesSettings + * @param[out] total_out Total output entries. + * @param[out] settings Output array of \ref SetSysBluetoothDevicesSettings. + * @param[in] count Size of the versions array in entries. + */ +Result setsysGetBluetoothDevicesSettings(s32 *total_out, SetSysBluetoothDevicesSettings *settings, s32 count); + +/** + * @brief GetExternalSteadyClockSourceId + * @param[out] out \ref Uuid + */ +Result setsysGetExternalSteadyClockSourceId(Uuid *out); + +/** + * @brief SetExternalSteadyClockSourceId + * @param[in] settings \ref Uuid + */ +Result setsysSetExternalSteadyClockSourceId(const Uuid *uuid); + +/** + * @brief GetUserSystemClockContext + * @param[out] out \ref TimeSystemClockContext + */ +Result setsysGetUserSystemClockContext(TimeSystemClockContext *out); + +/** + * @brief SetUserSystemClockContext + * @param[in] settings \ref TimeSystemClockContext + */ +Result setsysSetUserSystemClockContext(const TimeSystemClockContext *context); + /** * @brief GetAccountSettings * @param[out] out \ref SetSysAccountSettings @@ -474,6 +996,20 @@ Result setsysGetAccountSettings(SetSysAccountSettings *out); */ Result setsysSetAccountSettings(SetSysAccountSettings settings); +/** + * @brief GetAudioVolume + * @param[out] device \ref SetSysAudioDevice + * @param[out] out \ref SetSysAudioVolume + */ +Result setsysGetAudioVolume(SetSysAudioDevice device, SetSysAudioVolume *out); + +/** + * @brief SetAudioVolume + * @param[in] device \ref SetSysAudioDevice + * @param[in] settings \ref SetSysAudioVolume + */ +Result setsysSetAudioVolume(SetSysAudioDevice device, const SetSysAudioVolume *volume); + /** * @brief GetEulaVersions * @param[out] total_out Total output entries. @@ -546,6 +1082,18 @@ Result setsysGetAccountNotificationSettings(s32 *total_out, SetSysAccountNotific */ Result setsysSetAccountNotificationSettings(const SetSysAccountNotificationSettings *settings, s32 count); +/** + * @brief GetVibrationMasterVolume + * @param[out] out Output volume. + */ +Result setsysGetVibrationMasterVolume(float *out); + +/** + * @brief SetVibrationMasterVolume + * @param[in] volume Input volume. + */ +Result setsysSetVibrationMasterVolume(float volume); + /** * @brief Gets the size of a settings item value. * @param name Name string. @@ -576,6 +1124,44 @@ Result setsysGetTvSettings(SetSysTvSettings *out); */ Result setsysSetTvSettings(const SetSysTvSettings *settings); +/** + * @brief GetEdid + * @param[out] out \ref SetSysEdid + */ +Result setsysGetEdid(SetSysEdid *out); + +/** + * @brief SetEdid + * @param[in] edid \ref SetSysEdid + */ +Result setsysSetEdid(const SetSysEdid *edid); + +/** + * @brief GetAudioOutputMode + * @param[in] target \ref SetSysAudioOutputModeTarget + * @param[out] out \ref SetSysAudioOutputMode + */ +Result setsysGetAudioOutputMode(SetSysAudioOutputModeTarget target, SetSysAudioOutputMode *out); + +/** + * @brief SetAudioOutputMode + * @param[in] target \ref SetSysAudioOutputModeTarget + * @param[in] mode \ref SetSysAudioOutputMode + */ +Result setsysSetAudioOutputMode(SetSysAudioOutputModeTarget target, SetSysAudioOutputMode mode); + +/** + * @brief IsForceMuteOnHeadphoneRemoved + * @param[out] out Output flag. + */ +Result setsysIsForceMuteOnHeadphoneRemoved(bool *out); + +/** + * @brief SetForceMuteOnHeadphoneRemoved + * @param[in] flag Input flag. + */ +Result setsysSetForceMuteOnHeadphoneRemoved(bool flag); + /** * @brief GetQuestFlag * @param[out] out Output flag. @@ -600,6 +1186,30 @@ Result setsysGetDataDeletionSettings(SetSysDataDeletionSettings *out); */ Result setsysSetDataDeletionSettings(const SetSysDataDeletionSettings *settings); +/** + * @brief GetInitialSystemAppletProgramId + * @param[out] out output ProgramId. + */ +Result setsysGetInitialSystemAppletProgramId(u64 *out); + +/** + * @brief GetOverlayDispProgramId + * @param[out] out output ProgramId. + */ +Result setsysGetOverlayDispProgramId(u64 *out); + +/** + * @brief GetDeviceTimeZoneLocationName + * @param[out] out \ref TimeLocationName + */ +Result setsysGetDeviceTimeZoneLocationName(TimeLocationName *out); + +/** + * @brief SetDeviceTimeZoneLocationName + * @param[in] name \ref TimeLocationName + */ +Result setsysSetDeviceTimeZoneLocationName(const TimeLocationName *name); + /** * @brief GetWirelessCertificationFileSize * @param[out] out_size Output size. @@ -620,6 +1230,18 @@ Result setsysGetWirelessCertificationFile(void* buffer, size_t size, u64 *out_si */ Result setsysSetRegionCode(SetRegion region); +/** + * @brief GetNetworkSystemClockContext + * @param[out] out \ref TimeSystemClockContext + */ +Result setsysGetNetworkSystemClockContext(TimeSystemClockContext *out); + +/** + * @brief SetNetworkSystemClockContext + * @param[in] settings \ref TimeSystemClockContext + */ +Result setsysSetNetworkSystemClockContext(const TimeSystemClockContext *context); + /** * @brief IsUserSystemClockAutomaticCorrectionEnabled * @param[out] out Output flag. @@ -632,6 +1254,12 @@ Result setsysIsUserSystemClockAutomaticCorrectionEnabled(bool *out); */ Result setsysSetUserSystemClockAutomaticCorrectionEnabled(bool flag); +/** + * @brief GetDebugModeFlag + * @param[out] out Output flag. + */ +Result setsysGetDebugModeFlag(bool *out); + /** * @brief GetPrimaryAlbumStorage * @param[out] out \ref GetPrimaryAlbumStorage @@ -734,6 +1362,55 @@ Result setsysSetDeviceNickname(const char* nickname); */ Result setsysGetProductModel(s32 *out); +/** + * @brief GetLdnChannel + * @param[out] out Output LdnChannel. + */ +Result setsysGetLdnChannel(s32 *out); + +/** + * @brief SetLdnChannel + * @param[in] channel Input LdnChannel. + */ +Result setsysSetLdnChannel(s32 channel); + +/** + * @brief Gets an event that settings will signal on flag change. + * @param out_event Event to bind. Output event will have autoclear=false. + */ +Result setsysAcquireTelemetryDirtyFlagEventHandle(Event *out_event); + +/** + * @brief Gets the settings flags that have changed. + * @param flags_0 Pointer to populate with first 64 flags. + * @param flags_1 Pointer to populate with second 64 flags. + */ +Result setsysGetTelemetryDirtyFlags(u64 *flags_0, u64 *flags_1); + +/** + * @brief GetPtmBatteryLot + * @param[out] out \ref SetBatteryLot + */ +Result setsysGetPtmBatteryLot(SetBatteryLot *out) ; + +/** + * @brief SetPtmBatteryLot + * @param[in] lot \ref SetBatteryLot + */ +Result setsysSetPtmBatteryLot(const SetBatteryLot *lot); + +/** + * @brief GetPtmFuelGaugeParameter + * @param[out] out \ref SetSysPtmFuelGaugeParameter + */ +Result setsysGetPtmFuelGaugeParameter(SetSysPtmFuelGaugeParameter *out); + +/** + * @brief SetPtmFuelGaugeParameter + * @param[in] parameter \ref SetSysPtmFuelGaugeParameter + */ +Result setsysSetPtmFuelGaugeParameter(const SetSysPtmFuelGaugeParameter *parameter); + /** * @brief GetBluetoothEnableFlag * @param[out] out Output flag. @@ -752,11 +1429,23 @@ Result setsysSetBluetoothEnableFlag(bool flag); */ Result setsysGetMiiAuthorId(Uuid *out); +/** + * @brief SetShutdownRtcValue + * @param[in] value Input value. + */ +Result setsysSetShutdownRtcValue(u64 value); + +/** + * @brief GetShutdownRtcValue + * @param[out] out Output value. + */ +Result setsysGetShutdownRtcValue(u64 *out); + /** * @brief Gets an event that settings will signal on flag change. * @param out_event Event to bind. Output event will have autoclear=false. */ -Result setsysBindFatalDirtyFlagEvent(Event *out_event); +Result setsysAcquireFatalDirtyFlagEventHandle(Event *out_event); /** * @brief Gets the settings flags that have changed. @@ -779,6 +1468,21 @@ Result setsysGetAutoUpdateEnableFlag(bool *out); */ Result setsysSetAutoUpdateEnableFlag(bool flag); +/** + * @brief GetNxControllerSettings + * @param[out] total_out Total output entries. + * @param[out] settings Output array of \ref SetSysNxControllerSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysGetNxControllerSettings(s32 *total_out, SetSysNxControllerSettings *settings, s32 count); + +/** + * @brief SetNxControllerSettings + * @param[in] settings Input array of \ref SetSysNxControllerSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysSetNxControllerSettings(const SetSysNxControllerSettings *settings, s32 count); + /** * @brief GetBatteryPercentageFlag * @note Only available on [2.0.0+]. @@ -821,6 +1525,48 @@ Result setsysGetUsbFullKeyEnableFlag(bool *out); */ Result setsysSetUsbFullKeyEnableFlag(bool flag); +/** + * @brief SetExternalSteadyClockInternalOffset + * @note Only available on [3.0.0+]. + * @param[in] offset Input offset. + */ +Result setsysSetExternalSteadyClockInternalOffset(u64 offset); + +/** + * @brief GetExternalSteadyClockInternalOffset + * @note Only available on [3.0.0+]. + * @param[out] out Output offset. + */ +Result setsysGetExternalSteadyClockInternalOffset(u64 *out); + +/** + * @brief GetBacklightSettingsEx + * @note Only available on [3.0.0+]. + * @param[out] out \ref SetSysBacklightSettingsEx + */ +Result setsysGetBacklightSettingsEx(SetSysBacklightSettingsEx *out); + +/** + * @brief SetBacklightSettingsEx + * @note Only available on [3.0.0+]. + * @param[in] settings \ref SetSysBacklightSettingsEx + */ +Result setsysSetBacklightSettingsEx(const SetSysBacklightSettingsEx *settings); + +/** + * @brief GetHeadphoneVolumeWarningCount + * @note Only available on [3.0.0+]. + * @param[out] out Output count. + */ +Result setsysGetHeadphoneVolumeWarningCount(u32 *out); + +/** + * @brief SetHeadphoneVolumeWarningCount + * @note Only available on [3.0.0+]. + * @param[in] count Input count. + */ +Result setsysSetHeadphoneVolumeWarningCount(u32 count); + /** * @brief GetBluetoothAfhEnableFlag * @note Only available on [3.0.0+]. @@ -877,6 +1623,44 @@ Result setsysGetHeadphoneVolumeUpdateFlag(bool *out); */ Result setsysSetHeadphoneVolumeUpdateFlag(bool flag); +/** + * @brief NeedsToUpdateHeadphoneVolume + * @note Only available on [3.0.0+]. + * @param[out] a0 Output arg. + * @param[out] a1 Output arg. + * @param[out] a2 Output arg. + * @param[in] flag Input flag. + */ +Result setsysNeedsToUpdateHeadphoneVolume(u8 *a0, u8 *a1, u8 *a2, bool flag); + +/** + * @brief HetPushNotificationActivityModeOnSleep + * @note Only available on [3.0.0+]. + * @param[out] out Output mode. + */ +Result setsysGetPushNotificationActivityModeOnSleep(u32 *out); + +/** + * @brief SetPushNotificationActivityModeOnSleep + * @note Only available on [3.0.0+]. + * @param[in] mode Input mode. + */ +Result setsysSetPushNotificationActivityModeOnSleep(u32 mode); + +/** + * @brief GetServiceDiscoveryControlSettings + * @note Only available on [4.0.0+]. + * @param[out] out \ref ServiceDiscoveryControlSettings + */ +Result setsysGetServiceDiscoveryControlSettings(SetSysServiceDiscoveryControlSettings *out); + +/** + * @brief SetServiceDiscoveryControlSettings + * @note Only available on [4.0.0+]. + * @param[in] settings \ref ServiceDiscoveryControlSettings + */ +Result setsysSetServiceDiscoveryControlSettings(SetSysServiceDiscoveryControlSettings settings); + /** * @brief GetErrorReportSharePermission * @note Only available on [4.0.0+]. @@ -905,6 +1689,62 @@ Result setsysGetAppletLaunchFlags(u32 *out); */ Result setsysSetAppletLaunchFlags(u32 flags); +/** + * @brief GetConsoleSixAxisSensorAccelerationBias + * @note Only available on [4.0.0+]. + * @param[out] out \ref SetSysConsoleSixAxisSensorAccelerationBias + */ +Result setsysGetConsoleSixAxisSensorAccelerationBias(SetSysConsoleSixAxisSensorAccelerationBias *out); + +/** + * @brief SetConsoleSixAxisSensorAccelerationBias + * @note Only available on [4.0.0+]. + * @param[in] bias \ref SetSysConsoleSixAxisSensorAccelerationBias + */ +Result setsysSetConsoleSixAxisSensorAccelerationBias(const SetSysConsoleSixAxisSensorAccelerationBias *bias); + +/** + * @brief GetConsoleSixAxisSensorAngularVelocityBias + * @note Only available on [4.0.0+]. + * @param[out] out \ref SetSysConsoleSixAxisSensorAngularVelocityBias + */ +Result setsysGetConsoleSixAxisSensorAngularVelocityBias(SetSysConsoleSixAxisSensorAngularVelocityBias *out); + +/** + * @brief SetConsoleSixAxisSensorAngularVelocityBias + * @note Only available on [4.0.0+]. + * @param[in] bias \ref SetSysConsoleSixAxisSensorAngularVelocityBias + */ +Result setsysSetConsoleSixAxisSensorAngularVelocityBias(const SetSysConsoleSixAxisSensorAngularVelocityBias *bias); + +/** + * @brief GetConsoleSixAxisSensorAccelerationGain + * @note Only available on [4.0.0+]. + * @param[out] out \ref SetSysConsoleSixAxisSensorAccelerationGain + */ +Result setsysGetConsoleSixAxisSensorAccelerationGain(SetSysConsoleSixAxisSensorAccelerationGain *out); + +/** + * @brief SetConsoleSixAxisSensorAccelerationGain + * @note Only available on [4.0.0+]. + * @param[in] gain \ref SetSysConsoleSixAxisSensorAccelerationGain + */ +Result setsysSetConsoleSixAxisSensorAccelerationGain(const SetSysConsoleSixAxisSensorAccelerationGain *gain); + +/** + * @brief GetConsoleSixAxisSensorAngularVelocityGain + * @note Only available on [4.0.0+]. + * @param[out] out \ref SetSysConsoleSixAxisSensorAngularVelocityGain + */ +Result setsysGetConsoleSixAxisSensorAngularVelocityGain(SetSysConsoleSixAxisSensorAngularVelocityGain *out); + +/** + * @brief SetConsoleSixAxisSensorAngularVelocityGain + * @note Only available on [4.0.0+]. + * @param[in] gain \ref SetSysConsoleSixAxisSensorAngularVelocityGain + */ +Result setsysSetConsoleSixAxisSensorAngularVelocityGain(const SetSysConsoleSixAxisSensorAngularVelocityGain *gain); + /** * @brief GetKeyboardLayout * @note Only available on [4.0.0+]. @@ -919,6 +1759,29 @@ Result setsysGetKeyboardLayout(SetKeyboardLayout *out); */ Result setsysSetKeyboardLayout(SetKeyboardLayout layout); +/** + * @brief GetWebInspectorFlag + * @note Only available on [4.0.0+]. + * @param[out] out Output flag. + */ +Result setsysGetWebInspectorFlag(bool *out); + +/** + * @brief GetAllowedSslHosts + * @note Only available on [4.0.0+]. + * @param[out] total_out Total output entries. + * @param[out] out Output array of \ref SetSysAllowedSslHosts. + * @param[in] count Size of the hosts array in entries. + */ +Result setsysGetAllowedSslHosts(s32 *total_out, SetSysAllowedSslHosts *out, s32 count); + +/** + * @brief GetHostFsMountPoint + * @note Only available on [4.0.0+]. + * @param[out] out \ref SetSysHostFsMountPoint + */ +Result setsysGetHostFsMountPoint(SetSysHostFsMountPoint *out); + /** * @brief GetRequiresRunRepairTimeReviser * @note Only available on [5.0.0+]. @@ -926,6 +1789,58 @@ Result setsysSetKeyboardLayout(SetKeyboardLayout layout); */ Result setsysGetRequiresRunRepairTimeReviser(bool *out); +/** + * @brief SetRequiresRunRepairTimeReviser + * @note Only available on [5.0.0+]. + * @param[in] flag Input flag. + */ +Result setsysSetRequiresRunRepairTimeReviser(bool flag); + +/** + * @brief SetBlePairingSettings + * @note Only available on [5.0.0+]. + * @param[in] settings Input array of \ref SetSysBlePairingSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysSetBlePairingSettings(const SetSysBlePairingSettings *settings, s32 count); + +/** + * @brief GetBlePairingSettings + * @note Only available on [5.0.0+]. + * @param[out] total_out Total output entries. + * @param[out] settings Output array of \ref SetSysBlePairingSettings. + * @param[in] count Size of the hosts array in entries. + */ +Result setsysGetBlePairingSettings(s32 *total_out, SetSysBlePairingSettings *settings, s32 count); + +/** + * @brief GetConsoleSixAxisSensorAngularVelocityTimeBias + * @note Only available on [5.0.0+]. + * @param[out] out \ref SetSysConsoleSixAxisSensorAngularVelocityTimeBias + */ +Result setsysGetConsoleSixAxisSensorAngularVelocityTimeBias(SetSysConsoleSixAxisSensorAngularVelocityTimeBias *out); + +/** + * @brief SetConsoleSixAxisSensorAngularVelocityTimeBias + * @note Only available on [5.0.0+]. + * @param[in] bias \ref SetSysConsoleSixAxisSensorAngularVelocityTimeBias + */ +Result setsysSetConsoleSixAxisSensorAngularVelocityTimeBias(const SetSysConsoleSixAxisSensorAngularVelocityTimeBias *bias); + +/** + * @brief GetConsoleSixAxisSensorAngularAcceleration + * @note Only available on [5.0.0+]. + * @param[out] out \ref SetSysConsoleSixAxisSensorAngularAcceleration + */ +Result setsysGetConsoleSixAxisSensorAngularAcceleration(SetSysConsoleSixAxisSensorAngularAcceleration *out); + +/** + * @brief SetConsoleSixAxisSensorAngularAcceleration + * @note Only available on [5.0.0+]. + * @param[in] acceleration \ref SetSysConsoleSixAxisSensorAngularAcceleration + */ +Result setsysSetConsoleSixAxisSensorAngularAcceleration(const SetSysConsoleSixAxisSensorAngularAcceleration *acceleration); + /** * @brief GetRebootlessSystemUpdateVersion * @note Only available on [5.0.0+]. @@ -934,11 +1849,49 @@ Result setsysGetRequiresRunRepairTimeReviser(bool *out); Result setsysGetRebootlessSystemUpdateVersion(SetSysRebootlessSystemUpdateVersion *out); /** - * @brief SetRequiresRunRepairTimeReviser + * @brief GetDeviceTimeZoneLocationUpdatedTime * @note Only available on [5.0.0+]. - * @param[in] flag Input flag. + * @param[out] out \ref TimeSteadyClockTimePoint */ -Result setsysSetRequiresRunRepairTimeReviser(bool flag); +Result setsysGetDeviceTimeZoneLocationUpdatedTime(TimeSteadyClockTimePoint *out); + +/** + * @brief SetDeviceTimeZoneLocationUpdatedTime + * @note Only available on [5.0.0+]. + * @param[in] time_point \ref TimeSteadyClockTimePoint + */ +Result setsysSetDeviceTimeZoneLocationUpdatedTime(const TimeSteadyClockTimePoint *time_point); + +/** + * @brief GetUserSystemClockAutomaticCorrectionUpdatedTime + * @note Only available on [6.0.0+]. + * @param[out] out \ref TimeSteadyClockTimePoint + */ +Result setsysGetUserSystemClockAutomaticCorrectionUpdatedTime(TimeSteadyClockTimePoint *out); + +/** + * @brief SetUserSystemClockAutomaticCorrectionUpdatedTime + * @note Only available on [6.0.0+]. + * @param[in] time_point \ref TimeSteadyClockTimePoint + */ +Result setsysSetUserSystemClockAutomaticCorrectionUpdatedTime(const TimeSteadyClockTimePoint *time_point); + +/** + * @brief GetAccountOnlineStorageSettings + * @note Only available on [6.0.0+]. + * @param[out] total_out Total output entries. + * @param[out] settings Output array of \ref SetSysAccountOnlineStorageSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysGetAccountOnlineStorageSettings(s32 *total_out, SetSysAccountOnlineStorageSettings *out, s32 count); + +/** + * @brief SetAccountOnlineStorageSettings + * @note Only available on [6.0.0+]. + * @param[in] settings Input array of \ref SetSysAccountOnlineStorageSettings. + * @param[in] count Size of the settings array in entries. + */ +Result setsysSetAccountOnlineStorageSettings(const SetSysAccountOnlineStorageSettings *settings, s32 count); /** * @brief GetPctlReadyFlag @@ -954,6 +1907,92 @@ Result setsysGetPctlReadyFlag(bool *out); */ Result setsysSetPctlReadyFlag(bool flag); +/** + * @brief GetAnalogStickUserCalibrationL + * @note Only available on [8.1.1+]. + * @param[out] out \ref SetSysAnalogStickUserCalibration + */ +Result setsysGetAnalogStickUserCalibrationL(SetSysAnalogStickUserCalibration *out); + +/** + * @brief SetAnalogStickUserCalibrationL + * @note Only available on [8.1.1+]. + * @param[in] calibration \ref SetSysAnalogStickUserCalibration + */ +Result setsysSetAnalogStickUserCalibrationL(const SetSysAnalogStickUserCalibration *calibration); + +/** + * @brief GetAnalogStickUserCalibrationR + * @note Only available on [8.1.1+]. + * @param[out] out \ref SetSysAnalogStickUserCalibration + */ +Result setsysGetAnalogStickUserCalibrationR(SetSysAnalogStickUserCalibration *out); + +/** + * @brief SetAnalogStickUserCalibrationR + * @note Only available on [8.1.1+]. + * @param[in] calibration \ref SetSysAnalogStickUserCalibration + */ +Result setsysSetAnalogStickUserCalibrationR(const SetSysAnalogStickUserCalibration *calibration) ; + +/** + * @brief GetPtmBatteryVersion + * @note Only available on [6.0.0+]. + * @param[out] out Output version. + */ +Result setsysGetPtmBatteryVersion(u8 *out); + +/** + * @brief SetPtmBatteryVersion + * @note Only available on [6.0.0+]. + * @param[in] version Input version. + */ +Result setsysSetPtmBatteryVersion(u8 version); + +/** + * @brief GetUsb30HostEnableFlag + * @note Only available on [6.0.0+]. + * @param[out] out Output flag. + */ +Result setsysGetUsb30HostEnableFlag(bool *out); + +/** + * @brief SetUsb30HostEnableFlag + * @note Only available on [6.0.0+]. + * @param[in] flag Input flag. + */ +Result setsysSetUsb30HostEnableFlag(bool flag); + +/** + * @brief GetUsb30DeviceEnableFlag + * @note Only available on [6.0.0+]. + * @param[out] out Output flag. + */ +Result setsysGetUsb30DeviceEnableFlag(bool *out); + +/** + * @brief SetUsb30DeviceEnableFlag + * @note Only available on [6.0.0+]. + * @param[in] flag Input flag. + */ +Result setsysSetUsb30DeviceEnableFlag(bool flag); + +/** + * @brief GetThemeId + * @note Only available on [7.0.0+]. + * @param[in] type Input theme id type. + * @param[out] out \ref SetSysThemeId + */ +Result setsysGetThemeId(s32 type, SetSysThemeId *out); + +/** + * @brief SetThemeId + * @note Only available on [7.0.0+]. + * @param[in] type Input theme id type. + * @param[in] theme_id \ref SetSysThemeId + */ +Result setsysSetThemeId(s32 type, const SetSysThemeId *theme_id) ; + /** * @brief GetChineseTraditionalInputMethod * @note Only available on [7.0.0+]. @@ -968,6 +2007,20 @@ Result setsysGetChineseTraditionalInputMethod(SetChineseTraditionalInputMethod * */ Result setsysSetChineseTraditionalInputMethod(SetChineseTraditionalInputMethod method); +/** + * @brief GetPtmCycleCountReliability + * @note Only available on [7.0.0+]. + * @param[out] out \ref SetSysPtmCycleCountReliability + */ +Result setsysGetPtmCycleCountReliability(SetSysPtmCycleCountReliability *out); + +/** + * @brief SetPtmCycleCountReliability + * @note Only available on [7.0.0+]. + * @param[in] reliability \ref SetSysPtmCycleCountReliability + */ +Result setsysSetPtmCycleCountReliability(SetSysPtmCycleCountReliability reliability); + /** * @brief Gets the \ref SetSysHomeMenuScheme. * @note Only available on [8.1.1+]. @@ -975,6 +2028,62 @@ Result setsysSetChineseTraditionalInputMethod(SetChineseTraditionalInputMethod m */ Result setsysGetHomeMenuScheme(SetSysHomeMenuScheme *out); +/** + * @brief GetThemeSettings + * @note Only available on [7.0.0+]. + * @param[out] out \ref SetSysThemeSettings + */ +Result setsysGetThemeSettings(SetSysThemeSettings *out); + +/** + * @brief SetThemeSettings + * @note Only available on [7.0.0+]. + * @param[in] settings \ref SetSysThemeSettings + */ +Result setsysSetThemeSettings(const SetSysThemeSettings *settings); + +/** + * @brief GetThemeKey + * @note Only available on [7.0.0+]. + * @param[out] out \ref FsArchiveMacKey + */ +Result setsysGetThemeKey(FsArchiveMacKey *out); + +/** + * @brief SetThemeKey + * @note Only available on [7.0.0+]. + * @param[in] key \ref FsArchiveMacKey + */ +Result setsysSetThemeKey(const FsArchiveMacKey *key); + +/** + * @brief GetZoomFlag + * @note Only available on [8.0.0+]. + * @param[out] out Output flag. + */ +Result setsysGetZoomFlag(bool *out); + +/** + * @brief SetZoomFlag + * @note Only available on [8.0.0+]. + * @param[in] flag Input flag. + */ +Result setsysSetZoomFlag(bool flag); + +/** + * @brief On 9.0.0, this is a wrapper for \ref setsysGetPlatFormRegion() == 2. + * @note Only available on [8.0.0+]. + * @param[out] out Output flag. + */ +Result setsysGetT(bool *out); + +/** + * @brief On 9.0.0, this is a wrapper for \ref setsysSetPlatFormRegion(1 + (IsT & 1)). + * @note Only available on [8.0.0+]. + * @param[in] flag Input flag. + */ +Result setsysSetT(bool flag); + /** * @brief Gets the \ref SetSysPlatformRegion. * @note This is used internally by \ref appletGetSettingsPlatformRegion. diff --git a/nx/include/switch/services/time.h b/nx/include/switch/services/time.h index 756d2d68..9de42969 100644 --- a/nx/include/switch/services/time.h +++ b/nx/include/switch/services/time.h @@ -57,6 +57,11 @@ typedef struct { Uuid source_id; ///< An ID representing the clock source. } TimeSteadyClockTimePoint; +typedef struct { + s64 time_point; + TimeSteadyClockTimePoint steady_clock_time_point; +} TimeSystemClockContext; + /// Initialize time. Used automatically during app startup. Result timeInitialize(void); diff --git a/nx/source/services/set.c b/nx/source/services/set.c index 67d9dd92..fd99a9de 100644 --- a/nx/source/services/set.c +++ b/nx/source/services/set.c @@ -114,6 +114,10 @@ static Result _setCmdInU64NoOut(Service* srv, u64 inval, u32 cmd_id) { return serviceDispatchIn(srv, cmd_id, inval); } +static Result _setCmdInUuidNoOut(Service* srv, const Uuid *inval, u32 cmd_id) { + return serviceDispatchIn(srv, cmd_id, *inval); +} + static Result setInitializeLanguageCodesCache(void) { if (g_setLanguageCodesInitialized) return 0; Result rc = 0; @@ -213,6 +217,20 @@ Result setsysSetLanguageCode(u64 LanguageCode) { return _setCmdInU64NoOut(&g_setsysSrv, LanguageCode, 0); } +Result setsysSetNetworkSettings(const SetSysNetworkSettings *settings, s32 count) { + return serviceDispatch(&g_setsysSrv, 1, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, + .buffers = { { settings, count*sizeof(SetSysNetworkSettings) } }, + ); +} + +Result setsysGetNetworkSettings(s32 *total_out, SetSysNetworkSettings *settings, s32 count) { + return serviceDispatchOut(&g_setsysSrv, 2, *total_out, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { settings, count*sizeof(SetSysNetworkSettings) } }, + ); +} + static Result _setsysGetFirmwareVersionImpl(SetSysFirmwareVersion *out, u32 cmd_id) { return serviceDispatch(&g_setsysSrv, cmd_id, .buffer_attrs = { SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_Out }, @@ -229,6 +247,10 @@ Result setsysGetFirmwareVersion(SetSysFirmwareVersion *out) { } } +Result setsysGetFirmwareVersionDigest(SetSysFirmwareVersionDigest *out) { + return serviceDispatchOut(&g_setsysSrv, 5, *out); +} + Result setsysGetLockScreenFlag(bool *out) { return _setCmdNoInOutBool(&g_setsysSrv, out, 7); } @@ -237,6 +259,44 @@ Result setsysSetLockScreenFlag(bool flag) { return _setCmdInBoolNoOut(&g_setsysSrv, flag, 8); } +Result setsysGetBacklightSettings(SetSysBacklightSettings *out) { + return serviceDispatchOut(&g_setsysSrv, 9, *out); +} + +Result setsysSetBacklightSettings(const SetSysBacklightSettings *settings) { + return serviceDispatchIn(&g_setsysSrv, 10, *settings); +} + +Result setsysSetBluetoothDevicesSettings(const SetSysBluetoothDevicesSettings *settings, s32 count) { + return serviceDispatch(&g_setsysSrv, 11, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, + .buffers = { { settings, count*sizeof(SetSysBluetoothDevicesSettings) } }, + ); +} + +Result setsysGetBluetoothDevicesSettings(s32 *total_out, SetSysBluetoothDevicesSettings *settings, s32 count) { + return serviceDispatchOut(&g_setsysSrv, 12, *total_out, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { settings, count*sizeof(SetSysBluetoothDevicesSettings) } }, + ); +} + +Result setsysGetExternalSteadyClockSourceId(Uuid *out) { + return _setCmdNoInOutUuid(&g_setsysSrv, out, 13); +} + +Result setsysSetExternalSteadyClockSourceId(const Uuid *uuid) { + return _setCmdInUuidNoOut(&g_setsysSrv, uuid, 14); +} + +Result setsysGetUserSystemClockContext(TimeSystemClockContext *out) { + return serviceDispatchOut(&g_setsysSrv, 15, *out); +} + +Result setsysSetUserSystemClockContext(const TimeSystemClockContext *context) { + return serviceDispatchIn(&g_setsysSrv, 16, *context); +} + Result setsysGetAccountSettings(SetSysAccountSettings *out) { return serviceDispatchOut(&g_setsysSrv, 17, *out); } @@ -245,6 +305,19 @@ Result setsysSetAccountSettings(SetSysAccountSettings settings) { return serviceDispatchIn(&g_setsysSrv, 18, settings); } +Result setsysGetAudioVolume(SetSysAudioDevice device, SetSysAudioVolume *out) { + return serviceDispatchInOut(&g_setsysSrv, 19, device, *out); +} + +Result setsysSetAudioVolume(SetSysAudioDevice device, const SetSysAudioVolume *volume) { + const struct { + SetSysAudioVolume volume; + u32 device; + } in = { *volume, device }; + + return serviceDispatchIn(&g_setsysSrv, 20, in); +} + Result setsysGetEulaVersions(s32 *total_out, SetSysEulaVersion *versions, s32 count) { return serviceDispatchOut(&g_setsysSrv, 21, *total_out, .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, @@ -308,6 +381,14 @@ Result setsysSetAccountNotificationSettings(const SetSysAccountNotificationSetti ); } +Result setsysGetVibrationMasterVolume(float *out) { + return serviceDispatchOut(&g_setsysSrv, 35, *out); +} + +Result setsysSetVibrationMasterVolume(float volume) { + return serviceDispatchIn(&g_setsysSrv, 36, volume); +} + Result setsysGetSettingsItemValueSize(const char *name, const char *item_key, u64 *size_out) { char send_name[SET_MAX_NAME_SIZE]; char send_item_key[SET_MAX_NAME_SIZE]; @@ -360,6 +441,44 @@ Result setsysSetTvSettings(const SetSysTvSettings *settings) { return serviceDispatchIn(&g_setsysSrv, 40, *settings); } +Result setsysGetEdid(SetSysEdid *out) { + return serviceDispatch(&g_setsysSrv, 41, + .buffer_attrs = { SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_Out }, + .buffers = { { out, sizeof(*out) } }, + ); +} + +Result setsysSetEdid(const SetSysEdid *edid) { + return serviceDispatch(&g_setsysSrv, 42, + .buffer_attrs = { SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_In }, + .buffers = { { edid, sizeof(*edid) } }, + ); +} + +Result setsysGetAudioOutputMode(SetSysAudioOutputModeTarget target, SetSysAudioOutputMode *out) { + u32 tmp=0; + Result rc = serviceDispatchInOut(&g_setsysSrv, 43, target, tmp); + if (R_SUCCEEDED(rc) && out) *out = tmp; + return rc; +} + +Result setsysSetAudioOutputMode(SetSysAudioOutputModeTarget target, SetSysAudioOutputMode mode) { + const struct { + u32 target; + u32 mode; + } in = { target, mode }; + + return serviceDispatchIn(&g_setsysSrv, 44, in); +} + +Result setsysIsForceMuteOnHeadphoneRemoved(bool *out) { + return _setCmdNoInOutBool(&g_setsysSrv, out, 45); +} + +Result setsysSetForceMuteOnHeadphoneRemoved(bool flag) { + return _setCmdInBoolNoOut(&g_setsysSrv, flag, 46); +} + Result setsysGetQuestFlag(bool *out) { return _setCmdNoInOutBool(&g_setsysSrv, out, 47); } @@ -376,6 +495,22 @@ Result setsysSetDataDeletionSettings(const SetSysDataDeletionSettings *settings) return serviceDispatchIn(&g_setsysSrv, 50, *settings); } +Result setsysGetInitialSystemAppletProgramId(u64 *out) { + return _setCmdNoInOut64(&g_setsysSrv, out, 51); +} + +Result setsysGetOverlayDispProgramId(u64 *out) { + return _setCmdNoInOut64(&g_setsysSrv, out, 52); +} + +Result setsysGetDeviceTimeZoneLocationName(TimeLocationName *out) { + return serviceDispatchOut(&g_setsysSrv, 53, *out); +} + +Result setsysSetDeviceTimeZoneLocationName(const TimeLocationName *name) { + return serviceDispatchIn(&g_setsysSrv, 54, *name); +} + Result setsysGetWirelessCertificationFileSize(u64 *out_size) { return _setCmdNoInOut64(&g_setsysSrv, out_size, 55); } @@ -391,6 +526,14 @@ Result setsysSetRegionCode(SetRegion region) { return _setCmdInU32NoOut(&g_setsysSrv, region, 57); } +Result setsysGetNetworkSystemClockContext(TimeSystemClockContext *out) { + return serviceDispatchOut(&g_setsysSrv, 58, *out); +} + +Result setsysSetNetworkSystemClockContext(const TimeSystemClockContext *context) { + return serviceDispatchIn(&g_setsysSrv, 59, *context); +} + Result setsysIsUserSystemClockAutomaticCorrectionEnabled(bool *out) { return _setCmdNoInOutBool(&g_setsysSrv, out, 60); } @@ -399,6 +542,10 @@ Result setsysSetUserSystemClockAutomaticCorrectionEnabled(bool flag) { return _setCmdInBoolNoOut(&g_setsysSrv, flag, 61); } +Result setsysGetDebugModeFlag(bool *out) { + return _setCmdNoInOutBool(&g_setsysSrv, out, 62); +} + Result setsysGetPrimaryAlbumStorage(SetSysPrimaryAlbumStorage *out) { u32 tmp=0; Result rc = _setCmdNoInOutU32(&g_setsysSrv, &tmp, 63); @@ -486,6 +633,46 @@ Result setsysGetProductModel(s32 *out) { return _setCmdNoInOutU32(&g_setsysSrv, (u32*)out, 79); } +Result setsysGetLdnChannel(s32 *out) { + return _setCmdNoInOutU32(&g_setsysSrv, (u32*)out, 80); +} + +Result setsysSetLdnChannel(s32 channel) { + return _setCmdInU32NoOut(&g_setsysSrv, (u32)channel, 81); +} + +Result setsysAcquireTelemetryDirtyFlagEventHandle(Event *out_event) { + return _setCmdGetEvent(&g_setsysSrv, out_event, false, 82); +} + +Result setsysGetTelemetryDirtyFlags(u64 *flags_0, u64 *flags_1) { + struct { + u64 flags_0; + u64 flags_1; + } out; + + Result rc = serviceDispatchOut(&g_setsysSrv, 83, out); + if (R_SUCCEEDED(rc) && flags_0) *flags_0 = out.flags_0; + if (R_SUCCEEDED(rc) && flags_1) *flags_1 = out.flags_1; + return rc; +} + +Result setsysGetPtmBatteryLot(SetBatteryLot *out) { + return serviceDispatchOut(&g_setsysSrv, 84, *out); +} + +Result setsysSetPtmBatteryLot(const SetBatteryLot *lot) { + return serviceDispatchIn(&g_setsysSrv, 85, *lot); +} + +Result setsysGetPtmFuelGaugeParameter(SetSysPtmFuelGaugeParameter *out) { + return serviceDispatchOut(&g_setsysSrv, 86, *out); +} + +Result setsysSetPtmFuelGaugeParameter(const SetSysPtmFuelGaugeParameter *parameter) { + return serviceDispatchIn(&g_setsysSrv, 87, *parameter); +} + Result setsysGetBluetoothEnableFlag(bool *out) { return _setCmdNoInOutBool(&g_setsysSrv, out, 88); } @@ -498,7 +685,15 @@ Result setsysGetMiiAuthorId(Uuid *out) { return _setCmdNoInOutUuid(&g_setsysSrv, out, 90); } -Result setsysBindFatalDirtyFlagEvent(Event *out_event) { +Result setsysSetShutdownRtcValue(u64 value) { + return _setCmdInU64NoOut(&g_setsysSrv, value, 91); +} + +Result setsysGetShutdownRtcValue(u64 *out) { + return _setCmdNoInOut64(&g_setsysSrv, out, 92); +} + +Result setsysAcquireFatalDirtyFlagEventHandle(Event *out_event) { return _setCmdGetEvent(&g_setsysSrv, out_event, false, 93); } @@ -528,6 +723,26 @@ Result setsysSetAutoUpdateEnableFlag(bool flag) { return _setCmdInBoolNoOut(&g_setsysSrv, flag, 96); } +Result setsysGetNxControllerSettings(s32 *total_out, SetSysNxControllerSettings *settings, s32 count) { + if (hosversionBefore(2,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 97, *total_out, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { settings, count*sizeof(SetSysNxControllerSettings) } }, + ); +} + +Result setsysSetNxControllerSettings(const SetSysNxControllerSettings *settings, s32 count) { + if (hosversionBefore(2,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatch(&g_setsysSrv, 98, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, + .buffers = { { settings, count*sizeof(SetSysNxControllerSettings) } }, + ); +} + Result setsysGetBatteryPercentageFlag(bool *out) { if (hosversionBefore(2,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -570,6 +785,48 @@ Result setsysSetUsbFullKeyEnableFlag(bool flag) { return _setCmdInBoolNoOut(&g_setsysSrv, flag, 104); } +Result setsysSetExternalSteadyClockInternalOffset(u64 offset) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInU64NoOut(&g_setsysSrv, offset, 105); +} + +Result setsysGetExternalSteadyClockInternalOffset(u64 *out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOut64(&g_setsysSrv, out, 106); +} + +Result setsysGetBacklightSettingsEx(SetSysBacklightSettingsEx *out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 107, *out); +} + +Result setsysSetBacklightSettingsEx(const SetSysBacklightSettingsEx *settings) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 108, *settings); +} + +Result setsysGetHeadphoneVolumeWarningCount(u32 *out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutU32(&g_setsysSrv, out, 109); +} + +Result setsysSetHeadphoneVolumeWarningCount(u32 count) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInU32NoOut(&g_setsysSrv, count, 110); +} + Result setsysGetBluetoothAfhEnableFlag(bool *out) { if (hosversionBefore(3,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -626,6 +883,54 @@ Result setsysSetHeadphoneVolumeUpdateFlag(bool flag) { return _setCmdInBoolNoOut(&g_setsysSrv, flag, 118); } +Result setsysNeedsToUpdateHeadphoneVolume(u8 *a0, u8 *a1, u8 *a2, bool flag) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + struct { + u8 a0; + u8 a1; + u8 a2; + } out; + + Result rc = serviceDispatchInOut(&g_setsysSrv, 119, flag, out); + if (R_SUCCEEDED(rc) && a0) *a0 = out.a0; + if (R_SUCCEEDED(rc) && a1) *a1 = out.a1; + if (R_SUCCEEDED(rc) && a2) *a2 = out.a2; + return rc; +} + +Result setsysGetPushNotificationActivityModeOnSleep(u32 *out) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutU32(&g_setsysSrv, out, 120); +} + +Result setsysSetPushNotificationActivityModeOnSleep(u32 mode) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInU32NoOut(&g_setsysSrv, mode, 121); +} + +Result setsysGetServiceDiscoveryControlSettings(SetSysServiceDiscoveryControlSettings *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + u32 tmp=0; + Result rc = _setCmdNoInOutU32(&g_setsysSrv, &tmp, 122); + if (R_SUCCEEDED(rc) && out) *out = tmp; + return rc; +} + +Result setsysSetServiceDiscoveryControlSettings(SetSysServiceDiscoveryControlSettings settings) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInU32NoOut(&g_setsysSrv, settings, 123); +} + Result setsysGetErrorReportSharePermission(SetSysErrorReportSharePermission *out) { if (hosversionBefore(4,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -657,6 +962,62 @@ Result setsysSetAppletLaunchFlags(u32 flags) { return _setCmdInU32NoOut(&g_setsysSrv, flags, 127); } +Result setsysGetConsoleSixAxisSensorAccelerationBias(SetSysConsoleSixAxisSensorAccelerationBias *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 128, out); +} + +Result setsysSetConsoleSixAxisSensorAccelerationBias(const SetSysConsoleSixAxisSensorAccelerationBias *bias) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 129, bias); +} + +Result setsysGetConsoleSixAxisSensorAngularVelocityBias(SetSysConsoleSixAxisSensorAngularVelocityBias *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 130, out); +} + +Result setsysSetConsoleSixAxisSensorAngularVelocityBias(const SetSysConsoleSixAxisSensorAngularVelocityBias *bias) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 131, bias); +} + +Result setsysGetConsoleSixAxisSensorAccelerationGain(SetSysConsoleSixAxisSensorAccelerationGain *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 132, out); +} + +Result setsysSetConsoleSixAxisSensorAccelerationGain(const SetSysConsoleSixAxisSensorAccelerationGain *gain) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 133, gain); +} + +Result setsysGetConsoleSixAxisSensorAngularVelocityGain(SetSysConsoleSixAxisSensorAngularVelocityGain *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 134, out); +} + +Result setsysSetConsoleSixAxisSensorAngularVelocityGain(const SetSysConsoleSixAxisSensorAngularVelocityGain *gain) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 135, gain); +} + Result setsysGetKeyboardLayout(SetKeyboardLayout *out) { if (hosversionBefore(4,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -674,6 +1035,33 @@ Result setsysSetKeyboardLayout(SetKeyboardLayout layout) { return _setCmdInU32NoOut(&g_setsysSrv, layout, 137); } +Result setsysGetWebInspectorFlag(bool *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutBool(&g_setsysSrv, out, 138); +} + +Result setsysGetAllowedSslHosts(s32 *total_out, SetSysAllowedSslHosts *out, s32 count) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 139, *total_out, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { out, count*sizeof(SetSysAllowedSslHosts) } }, + ); +} + +Result setsysGetHostFsMountPoint(SetSysHostFsMountPoint *out) { + if (hosversionBefore(4,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatch(&g_setsysSrv, 140, + .buffer_attrs = { SfBufferAttr_FixedSize | SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { out, sizeof(SetSysHostFsMountPoint) } }, + ); +} + Result setsysGetRequiresRunRepairTimeReviser(bool *out) { if (hosversionBefore(5,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -681,6 +1069,61 @@ Result setsysGetRequiresRunRepairTimeReviser(bool *out) { return _setCmdNoInOutBool(&g_setsysSrv, out, 141); } +Result setsysSetRequiresRunRepairTimeReviser(bool flag) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInBoolNoOut(&g_setsysSrv, flag, 142); +} + +Result setsysSetBlePairingSettings(const SetSysBlePairingSettings *settings, s32 count) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatch(&g_setsysSrv, 143, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, + .buffers = { { settings, count*sizeof(SetSysBlePairingSettings) } }, + ); +} + +Result setsysGetBlePairingSettings(s32 *total_out, SetSysBlePairingSettings *settings, s32 count) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 144, *total_out, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { settings, count*sizeof(SetSysBlePairingSettings) } }, + ); +} + +Result setsysGetConsoleSixAxisSensorAngularVelocityTimeBias(SetSysConsoleSixAxisSensorAngularVelocityTimeBias *out) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 145, *out); +} + +Result setsysSetConsoleSixAxisSensorAngularVelocityTimeBias(const SetSysConsoleSixAxisSensorAngularVelocityTimeBias *bias) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 146, bias); +} + +Result setsysGetConsoleSixAxisSensorAngularAcceleration(SetSysConsoleSixAxisSensorAngularAcceleration *out) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 147, *out); +} + +Result setsysSetConsoleSixAxisSensorAngularAcceleration(const SetSysConsoleSixAxisSensorAngularAcceleration *acceleration) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 148, acceleration); +} + Result setsysGetRebootlessSystemUpdateVersion(SetSysRebootlessSystemUpdateVersion *out) { if (hosversionBefore(5,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -688,11 +1131,52 @@ Result setsysGetRebootlessSystemUpdateVersion(SetSysRebootlessSystemUpdateVersio return serviceDispatchOut(&g_setsysSrv, 149, *out); } -Result setsysSetRequiresRunRepairTimeReviser(bool flag) { +Result setsysGetDeviceTimeZoneLocationUpdatedTime(TimeSteadyClockTimePoint *out) { if (hosversionBefore(5,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); - return _setCmdInBoolNoOut(&g_setsysSrv, flag, 142); + return serviceDispatchOut(&g_setsysSrv, 150, *out); +} + +Result setsysSetDeviceTimeZoneLocationUpdatedTime(const TimeSteadyClockTimePoint *time_point) { + if (hosversionBefore(5,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 151, *time_point); +} + +Result setsysGetUserSystemClockAutomaticCorrectionUpdatedTime(TimeSteadyClockTimePoint *out) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 152, *out); +} + +Result setsysSetUserSystemClockAutomaticCorrectionUpdatedTime(const TimeSteadyClockTimePoint *time_point) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 153, *time_point); +} + +Result setsysGetAccountOnlineStorageSettings(s32 *total_out, SetSysAccountOnlineStorageSettings *settings, s32 count) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 154, *total_out, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out }, + .buffers = { { settings, count*sizeof(SetSysAccountOnlineStorageSettings) } }, + ); +} + +Result setsysSetAccountOnlineStorageSettings(const SetSysAccountOnlineStorageSettings *settings, s32 count) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatch(&g_setsysSrv, 155, + .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_In }, + .buffers = { { settings, count*sizeof(SetSysAccountOnlineStorageSettings) } }, + ); } Result setsysGetPctlReadyFlag(bool *out) { @@ -709,6 +1193,95 @@ Result setsysSetPctlReadyFlag(bool flag) { return _setCmdInBoolNoOut(&g_setsysSrv, flag, 157); } +Result setsysGetAnalogStickUserCalibrationL(SetSysAnalogStickUserCalibration *out) { + if (hosversionBefore(8,1,1)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 158, *out); +} + +Result setsysSetAnalogStickUserCalibrationL(const SetSysAnalogStickUserCalibration *calibration) { + if (hosversionBefore(8,1,1)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 159, *calibration); +} + +Result setsysGetAnalogStickUserCalibrationR(SetSysAnalogStickUserCalibration *out) { + if (hosversionBefore(8,1,1)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 160, *out); +} + +Result setsysSetAnalogStickUserCalibrationR(const SetSysAnalogStickUserCalibration *calibration) { + if (hosversionBefore(8,1,1)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 161, *calibration); +} + +Result setsysGetPtmBatteryVersion(u8 *out) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutU8(&g_setsysSrv, out, 162); +} + +Result setsysSetPtmBatteryVersion(u8 version) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInU8NoOut(&g_setsysSrv, version, 163); +} + +Result setsysGetUsb30HostEnableFlag(bool *out) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutBool(&g_setsysSrv, out, 164); +} + +Result setsysSetUsb30HostEnableFlag(bool flag) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInBoolNoOut(&g_setsysSrv, flag, 165); +} + +Result setsysGetUsb30DeviceEnableFlag(bool *out) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutBool(&g_setsysSrv, out, 166); +} + +Result setsysSetUsb30DeviceEnableFlag(bool flag) { + if (hosversionBefore(6,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInBoolNoOut(&g_setsysSrv, flag, 167); +} + +Result setsysGetThemeId(s32 type, SetSysThemeId *out) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchInOut(&g_setsysSrv, 168, type, *out); +} + +Result setsysSetThemeId(s32 type, const SetSysThemeId *theme_id) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + const struct { + s32 type; + SetSysThemeId theme_id; + } in = { type, *theme_id }; + + return serviceDispatchIn(&g_setsysSrv, 169, in); +} + Result setsysGetChineseTraditionalInputMethod(SetChineseTraditionalInputMethod *out) { if (hosversionBefore(7,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -726,6 +1299,23 @@ Result setsysSetChineseTraditionalInputMethod(SetChineseTraditionalInputMethod m return _setCmdInU32NoOut(&g_setsysSrv, method, 171); } +Result setsysGetPtmCycleCountReliability(SetSysPtmCycleCountReliability *out) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + u32 tmp=0; + Result rc = _setCmdNoInOutU32(&g_setsysSrv, &tmp, 172); + if (R_SUCCEEDED(rc) && out) *out = tmp; + return rc; +} + +Result setsysSetPtmCycleCountReliability(SetSysPtmCycleCountReliability reliability) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInU32NoOut(&g_setsysSrv, reliability, 173); +} + Result setsysGetHomeMenuScheme(SetSysHomeMenuScheme *out) { if (hosversionBefore(8,1,1)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); @@ -733,6 +1323,62 @@ Result setsysGetHomeMenuScheme(SetSysHomeMenuScheme *out) { return serviceDispatchOut(&g_setsysSrv, 174, *out); } +Result setsysGetThemeSettings(SetSysThemeSettings *out) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 175, *out); +} + +Result setsysSetThemeSettings(const SetSysThemeSettings *settings) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 176, *settings); +} + +Result setsysGetThemeKey(FsArchiveMacKey *out) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchOut(&g_setsysSrv, 177, *out); +} + +Result setsysSetThemeKey(const FsArchiveMacKey *key) { + if (hosversionBefore(7,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return serviceDispatchIn(&g_setsysSrv, 178, *key); +} + +Result setsysGetZoomFlag(bool *out) { + if (hosversionBefore(8,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutBool(&g_setsysSrv, out, 179); +} + +Result setsysSetZoomFlag(bool flag) { + if (hosversionBefore(8,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInBoolNoOut(&g_setsysSrv, flag, 180); +} + +Result setsysGetT(bool *out) { + if (hosversionBefore(8,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdNoInOutBool(&g_setsysSrv, out, 181); +} + +Result setsysSetT(bool flag) { + if (hosversionBefore(8,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + + return _setCmdInBoolNoOut(&g_setsysSrv, flag, 182); +} + Result setsysGetPlatformRegion(SetSysPlatformRegion *out) { if (hosversionBefore(9,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);