summaryrefslogtreecommitdiff
path: root/src/core/hle/service/set
diff options
context:
space:
mode:
authorGravatar Narr the Reg2024-01-16 12:17:18 -0600
committerGravatar german772024-01-28 18:27:25 -0600
commit575183d6dcd8da9b10ee41e47be4b7d4f8631783 (patch)
treed2898bdefae5be2fb68e7df97465422c0fae3991 /src/core/hle/service/set
parentMerge pull request #12555 from flodavid/fix-gamemode-setting (diff)
downloadyuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.gz
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.tar.xz
yuzu-575183d6dcd8da9b10ee41e47be4b7d4f8631783.zip
service: hid: Fully implement touch resource
Diffstat (limited to 'src/core/hle/service/set')
-rw-r--r--src/core/hle/service/set/setting_formats/system_settings.h4
-rw-r--r--src/core/hle/service/set/system_settings_server.cpp37
-rw-r--r--src/core/hle/service/set/system_settings_server.h4
3 files changed, 41 insertions, 4 deletions
diff --git a/src/core/hle/service/set/setting_formats/system_settings.h b/src/core/hle/service/set/setting_formats/system_settings.h
index ebc373da5..40230182a 100644
--- a/src/core/hle/service/set/setting_formats/system_settings.h
+++ b/src/core/hle/service/set/setting_formats/system_settings.h
@@ -12,6 +12,7 @@
12#include "common/vector_math.h" 12#include "common/vector_math.h"
13#include "core/hle/service/set/setting_formats/private_settings.h" 13#include "core/hle/service/set/setting_formats/private_settings.h"
14#include "core/hle/service/set/settings_types.h" 14#include "core/hle/service/set/settings_types.h"
15#include "hid_core/resources/touch_screen/touch_types.h"
15 16
16namespace Service::Set { 17namespace Service::Set {
17 18
@@ -257,8 +258,7 @@ struct SystemSettings {
257 std::array<u8, 0x10> analog_stick_user_calibration_left; 258 std::array<u8, 0x10> analog_stick_user_calibration_left;
258 std::array<u8, 0x10> analog_stick_user_calibration_right; 259 std::array<u8, 0x10> analog_stick_user_calibration_right;
259 260
260 // nn::settings::system::TouchScreenMode 261 TouchScreenMode touch_screen_mode;
261 s32 touch_screen_mode;
262 INSERT_PADDING_BYTES(0x14); // Reserved 262 INSERT_PADDING_BYTES(0x14); // Reserved
263 263
264 TvSettings tv_settings; 264 TvSettings tv_settings;
diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp
index 100cb2db4..c889aec47 100644
--- a/src/core/hle/service/set/system_settings_server.cpp
+++ b/src/core/hle/service/set/system_settings_server.cpp
@@ -275,8 +275,8 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
275 {184, nullptr, "SetPlatformRegion"}, 275 {184, nullptr, "SetPlatformRegion"},
276 {185, &ISystemSettingsServer::GetHomeMenuSchemeModel, "GetHomeMenuSchemeModel"}, 276 {185, &ISystemSettingsServer::GetHomeMenuSchemeModel, "GetHomeMenuSchemeModel"},
277 {186, nullptr, "GetMemoryUsageRateFlag"}, 277 {186, nullptr, "GetMemoryUsageRateFlag"},
278 {187, nullptr, "GetTouchScreenMode"}, 278 {187, &ISystemSettingsServer::GetTouchScreenMode, "GetTouchScreenMode"},
279 {188, nullptr, "SetTouchScreenMode"}, 279 {188, &ISystemSettingsServer::SetTouchScreenMode, "SetTouchScreenMode"},
280 {189, nullptr, "GetButtonConfigSettingsFull"}, 280 {189, nullptr, "GetButtonConfigSettingsFull"},
281 {190, nullptr, "SetButtonConfigSettingsFull"}, 281 {190, nullptr, "SetButtonConfigSettingsFull"},
282 {191, nullptr, "GetButtonConfigSettingsEmbedded"}, 282 {191, nullptr, "GetButtonConfigSettingsEmbedded"},
@@ -1395,6 +1395,28 @@ void ISystemSettingsServer::GetHomeMenuSchemeModel(HLERequestContext& ctx) {
1395 rb.Push(0); 1395 rb.Push(0);
1396} 1396}
1397 1397
1398void ISystemSettingsServer::GetTouchScreenMode(HLERequestContext& ctx) {
1399 TouchScreenMode touch_screen_mode{};
1400 auto res = GetTouchScreenMode(touch_screen_mode);
1401
1402 LOG_INFO(Service_SET, "called, touch_screen_mode={}", touch_screen_mode);
1403
1404 IPC::ResponseBuilder rb{ctx, 3};
1405 rb.Push(res);
1406 rb.PushEnum(touch_screen_mode);
1407}
1408
1409void ISystemSettingsServer::SetTouchScreenMode(HLERequestContext& ctx) {
1410 IPC::RequestParser rp{ctx};
1411 const auto touch_screen_mode = rp.PopEnum<TouchScreenMode>();
1412 auto res = SetTouchScreenMode(touch_screen_mode);
1413
1414 LOG_INFO(Service_SET, "called, touch_screen_mode={}", touch_screen_mode);
1415
1416 IPC::ResponseBuilder rb{ctx, 2};
1417 rb.Push(res);
1418}
1419
1398void ISystemSettingsServer::GetFieldTestingFlag(HLERequestContext& ctx) { 1420void ISystemSettingsServer::GetFieldTestingFlag(HLERequestContext& ctx) {
1399 LOG_INFO(Service_SET, "called, field_testing_flag={}", m_system_settings.field_testing_flag); 1421 LOG_INFO(Service_SET, "called, field_testing_flag={}", m_system_settings.field_testing_flag);
1400 1422
@@ -1670,4 +1692,15 @@ Result ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
1670 R_SUCCEED(); 1692 R_SUCCEED();
1671} 1693}
1672 1694
1695Result ISystemSettingsServer::GetTouchScreenMode(TouchScreenMode& touch_screen_mode) const {
1696 touch_screen_mode = m_system_settings.touch_screen_mode;
1697 R_SUCCEED();
1698}
1699
1700Result ISystemSettingsServer::SetTouchScreenMode(TouchScreenMode touch_screen_mode) {
1701 m_system_settings.touch_screen_mode = touch_screen_mode;
1702 SetSaveNeeded();
1703 R_SUCCEED();
1704}
1705
1673} // namespace Service::Set 1706} // namespace Service::Set
diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h
index 1982b9723..9a3b36f0c 100644
--- a/src/core/hle/service/set/system_settings_server.h
+++ b/src/core/hle/service/set/system_settings_server.h
@@ -74,6 +74,8 @@ public:
74 Service::PSC::Time::SteadyClockTimePoint& out_time_point) const; 74 Service::PSC::Time::SteadyClockTimePoint& out_time_point) const;
75 Result SetUserSystemClockAutomaticCorrectionUpdatedTime( 75 Result SetUserSystemClockAutomaticCorrectionUpdatedTime(
76 const Service::PSC::Time::SteadyClockTimePoint& time_point); 76 const Service::PSC::Time::SteadyClockTimePoint& time_point);
77 Result GetTouchScreenMode(TouchScreenMode& touch_screen_mode) const;
78 Result SetTouchScreenMode(TouchScreenMode touch_screen_mode);
77 79
78private: 80private:
79 void SetLanguageCode(HLERequestContext& ctx); 81 void SetLanguageCode(HLERequestContext& ctx);
@@ -154,6 +156,8 @@ private:
154 void GetChineseTraditionalInputMethod(HLERequestContext& ctx); 156 void GetChineseTraditionalInputMethod(HLERequestContext& ctx);
155 void GetHomeMenuScheme(HLERequestContext& ctx); 157 void GetHomeMenuScheme(HLERequestContext& ctx);
156 void GetHomeMenuSchemeModel(HLERequestContext& ctx); 158 void GetHomeMenuSchemeModel(HLERequestContext& ctx);
159 void GetTouchScreenMode(HLERequestContext& ctx);
160 void SetTouchScreenMode(HLERequestContext& ctx);
157 void GetFieldTestingFlag(HLERequestContext& ctx); 161 void GetFieldTestingFlag(HLERequestContext& ctx);
158 void GetPanelCrcMode(HLERequestContext& ctx); 162 void GetPanelCrcMode(HLERequestContext& ctx);
159 void SetPanelCrcMode(HLERequestContext& ctx); 163 void SetPanelCrcMode(HLERequestContext& ctx);