summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/set
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2018-11-26 07:06:13 +0100
committerDavid Marcec <dmarcecguzman@gmail.com>2018-11-26 07:06:13 +0100
commita2cc3b10bb6115b17d980fdb83ed5c561835eb3b (patch)
treee802627fe23c3ad043c86bcf757d15d902127766 /src/core/hle/service/set
parentMerge pull request #1800 from encounter/svcgetinfo (diff)
downloadyuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.tar
yuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.tar.gz
yuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.tar.bz2
yuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.tar.lz
yuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.tar.xz
yuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.tar.zst
yuzu-a2cc3b10bb6115b17d980fdb83ed5c561835eb3b.zip
Diffstat (limited to 'src/core/hle/service/set')
-rw-r--r--src/core/hle/service/set/set.cpp33
-rw-r--r--src/core/hle/service/set/set_sys.cpp8
2 files changed, 21 insertions, 20 deletions
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 9e5af7839..40a9144f9 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -49,38 +49,39 @@ static std::array<LanguageCode, size> MakeLanguageCodeSubset() {
static void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t max_size) {
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- if (available_language_codes.size() > max_size)
+ if (available_language_codes.size() > max_size) {
rb.Push(static_cast<u32>(max_size));
- else
+ } else {
rb.Push(static_cast<u32>(available_language_codes.size()));
+ }
}
void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
- if (available_language_codes.size() > pre4_0_0_max_entries)
+ LOG_DEBUG(Service_SET, "called");
+
+ if (available_language_codes.size() > pre4_0_0_max_entries) {
ctx.WriteBuffer(MakeLanguageCodeSubset<pre4_0_0_max_entries>());
- else
+ } else {
ctx.WriteBuffer(available_language_codes);
-
+ }
PushResponseLanguageCode(ctx, pre4_0_0_max_entries);
-
- LOG_DEBUG(Service_SET, "called");
}
void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) {
- if (available_language_codes.size() > post4_0_0_max_entries)
+ LOG_DEBUG(Service_SET, "called");
+
+ if (available_language_codes.size() > post4_0_0_max_entries) {
ctx.WriteBuffer(MakeLanguageCodeSubset<post4_0_0_max_entries>());
- else
+ } else {
ctx.WriteBuffer(available_language_codes);
-
+ }
PushResponseLanguageCode(ctx, post4_0_0_max_entries);
-
- LOG_DEBUG(Service_SET, "called");
}
void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) {
- PushResponseLanguageCode(ctx, pre4_0_0_max_entries);
-
LOG_DEBUG(Service_SET, "called");
+
+ PushResponseLanguageCode(ctx, pre4_0_0_max_entries);
}
void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) {
@@ -90,11 +91,11 @@ void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) {
}
void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index);
+
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u64>(available_language_codes[Settings::values.language_index]));
-
- LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index);
}
SET::SET() : ServiceFramework("set") {
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp
index 41efca31c..c9b4da5b0 100644
--- a/src/core/hle/service/set/set_sys.cpp
+++ b/src/core/hle/service/set/set_sys.cpp
@@ -10,22 +10,22 @@
namespace Service::Set {
void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_SET, "called");
+
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.PushEnum(color_set);
-
- LOG_DEBUG(Service_SET, "called");
}
void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_SET, "called");
+
IPC::RequestParser rp{ctx};
color_set = rp.PopEnum<ColorSet>();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
-
- LOG_DEBUG(Service_SET, "called");
}
SET_SYS::SET_SYS() : ServiceFramework("set:sys") {