summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar liamwhite2022-12-16 14:05:00 -0500
committerGravatar GitHub2022-12-16 14:05:00 -0500
commitbbb202ceedf8c4054f6a602ad572ba8df33e315d (patch)
tree8b51f7711e7b698ca712c24b854f88a0022e1d9c /src/core
parentMerge pull request #9450 from ameerj/hle-ipc-vector-reserve (diff)
parentSet: Allow setting device nickname (diff)
downloadyuzu-bbb202ceedf8c4054f6a602ad572ba8df33e315d.tar.gz
yuzu-bbb202ceedf8c4054f6a602ad572ba8df33e315d.tar.xz
yuzu-bbb202ceedf8c4054f6a602ad572ba8df33e315d.zip
Merge pull request #6354 from ogniK5377/device-name
Set: Allow setting device nickname
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/set/set.cpp9
-rw-r--r--src/core/hle/service/set/set.h1
-rw-r--r--src/core/hle/service/set/set_sys.cpp10
-rw-r--r--src/core/hle/service/set/set_sys.h1
4 files changed, 19 insertions, 2 deletions
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 4f1a8d6b7..16c5eaf75 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -191,6 +191,13 @@ void SET::GetKeyCodeMap2(Kernel::HLERequestContext& ctx) {
191 GetKeyCodeMapImpl(ctx); 191 GetKeyCodeMapImpl(ctx);
192} 192}
193 193
194void SET::GetDeviceNickName(Kernel::HLERequestContext& ctx) {
195 LOG_DEBUG(Service_SET, "called");
196 IPC::ResponseBuilder rb{ctx, 2};
197 rb.Push(ResultSuccess);
198 ctx.WriteBuffer(Settings::values.device_name.GetValue());
199}
200
194SET::SET(Core::System& system_) : ServiceFramework{system_, "set"} { 201SET::SET(Core::System& system_) : ServiceFramework{system_, "set"} {
195 // clang-format off 202 // clang-format off
196 static const FunctionInfo functions[] = { 203 static const FunctionInfo functions[] = {
@@ -205,7 +212,7 @@ SET::SET(Core::System& system_) : ServiceFramework{system_, "set"} {
205 {8, &SET::GetQuestFlag, "GetQuestFlag"}, 212 {8, &SET::GetQuestFlag, "GetQuestFlag"},
206 {9, &SET::GetKeyCodeMap2, "GetKeyCodeMap2"}, 213 {9, &SET::GetKeyCodeMap2, "GetKeyCodeMap2"},
207 {10, nullptr, "GetFirmwareVersionForDebug"}, 214 {10, nullptr, "GetFirmwareVersionForDebug"},
208 {11, nullptr, "GetDeviceNickName"}, 215 {11, &SET::GetDeviceNickName, "GetDeviceNickName"},
209 }; 216 };
210 // clang-format on 217 // clang-format on
211 218
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h
index 60cad3e6f..375975711 100644
--- a/src/core/hle/service/set/set.h
+++ b/src/core/hle/service/set/set.h
@@ -50,6 +50,7 @@ private:
50 void GetRegionCode(Kernel::HLERequestContext& ctx); 50 void GetRegionCode(Kernel::HLERequestContext& ctx);
51 void GetKeyCodeMap(Kernel::HLERequestContext& ctx); 51 void GetKeyCodeMap(Kernel::HLERequestContext& ctx);
52 void GetKeyCodeMap2(Kernel::HLERequestContext& ctx); 52 void GetKeyCodeMap2(Kernel::HLERequestContext& ctx);
53 void GetDeviceNickName(Kernel::HLERequestContext& ctx);
53}; 54};
54 55
55} // namespace Service::Set 56} // namespace Service::Set
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp
index d7cea6aac..94c20edda 100644
--- a/src/core/hle/service/set/set_sys.cpp
+++ b/src/core/hle/service/set/set_sys.cpp
@@ -3,6 +3,7 @@
3 3
4#include "common/assert.h" 4#include "common/assert.h"
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "common/settings.h"
6#include "core/file_sys/errors.h" 7#include "core/file_sys/errors.h"
7#include "core/file_sys/system_archive/system_version.h" 8#include "core/file_sys/system_archive/system_version.h"
8#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
@@ -176,6 +177,13 @@ void SET_SYS::GetSettingsItemValue(Kernel::HLERequestContext& ctx) {
176 rb.Push(response); 177 rb.Push(response);
177} 178}
178 179
180void SET_SYS::GetDeviceNickName(Kernel::HLERequestContext& ctx) {
181 LOG_DEBUG(Service_SET, "called");
182 IPC::ResponseBuilder rb{ctx, 2};
183 rb.Push(ResultSuccess);
184 ctx.WriteBuffer(::Settings::values.device_name.GetValue());
185}
186
179SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { 187SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} {
180 // clang-format off 188 // clang-format off
181 static const FunctionInfo functions[] = { 189 static const FunctionInfo functions[] = {
@@ -253,7 +261,7 @@ SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} {
253 {74, nullptr, "SetWirelessLanEnableFlag"}, 261 {74, nullptr, "SetWirelessLanEnableFlag"},
254 {75, nullptr, "GetInitialLaunchSettings"}, 262 {75, nullptr, "GetInitialLaunchSettings"},
255 {76, nullptr, "SetInitialLaunchSettings"}, 263 {76, nullptr, "SetInitialLaunchSettings"},
256 {77, nullptr, "GetDeviceNickName"}, 264 {77, &SET_SYS::GetDeviceNickName, "GetDeviceNickName"},
257 {78, nullptr, "SetDeviceNickName"}, 265 {78, nullptr, "SetDeviceNickName"},
258 {79, nullptr, "GetProductModel"}, 266 {79, nullptr, "GetProductModel"},
259 {80, nullptr, "GetLdnChannel"}, 267 {80, nullptr, "GetLdnChannel"},
diff --git a/src/core/hle/service/set/set_sys.h b/src/core/hle/service/set/set_sys.h
index 258ef8c57..464ac3da1 100644
--- a/src/core/hle/service/set/set_sys.h
+++ b/src/core/hle/service/set/set_sys.h
@@ -29,6 +29,7 @@ private:
29 void GetFirmwareVersion2(Kernel::HLERequestContext& ctx); 29 void GetFirmwareVersion2(Kernel::HLERequestContext& ctx);
30 void GetColorSetId(Kernel::HLERequestContext& ctx); 30 void GetColorSetId(Kernel::HLERequestContext& ctx);
31 void SetColorSetId(Kernel::HLERequestContext& ctx); 31 void SetColorSetId(Kernel::HLERequestContext& ctx);
32 void GetDeviceNickName(Kernel::HLERequestContext& ctx);
32 33
33 ColorSet color_set = ColorSet::BasicWhite; 34 ColorSet color_set = ColorSet::BasicWhite;
34}; 35};