summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/set
diff options
context:
space:
mode:
authorDavid <25727384+ogniK5377@users.noreply.github.com>2018-08-03 17:02:55 +0200
committerbunnei <bunneidev@gmail.com>2018-08-03 17:02:55 +0200
commitc1d54f4aeaada515f88b633b8cf0901ee4cb6853 (patch)
treee320222f18419b07c22617f06980bc0b767e3db7 /src/core/hle/service/set
parentMerge pull request #895 from lioncash/sink (diff)
downloadyuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.tar
yuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.tar.gz
yuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.tar.bz2
yuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.tar.lz
yuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.tar.xz
yuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.tar.zst
yuzu-c1d54f4aeaada515f88b633b8cf0901ee4cb6853.zip
Diffstat (limited to 'src/core/hle/service/set')
-rw-r--r--src/core/hle/service/set/set.cpp15
-rw-r--r--src/core/hle/service/set/set.h2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 1651f6122..a461e72ec 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -8,6 +8,7 @@
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h"
#include "core/hle/service/set/set.h"
+#include "core/settings.h"
namespace Service::Set {
@@ -31,6 +32,10 @@ constexpr std::array<LanguageCode, 17> available_language_codes = {{
LanguageCode::ZH_HANT,
}};
+LanguageCode GetLanguageCodeFromIndex(size_t index) {
+ return available_language_codes.at(index);
+}
+
void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
ctx.WriteBuffer(available_language_codes);
@@ -49,9 +54,17 @@ void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
}
+void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) {
+ 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") {
static const FunctionInfo functions[] = {
- {0, nullptr, "GetLanguageCode"},
+ {0, &SET::GetLanguageCode, "GetLanguageCode"},
{1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"},
{2, nullptr, "MakeLanguageCode"},
{3, &SET::GetAvailableLanguageCodeCount, "GetAvailableLanguageCodeCount"},
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h
index a2472ec4c..4232b6162 100644
--- a/src/core/hle/service/set/set.h
+++ b/src/core/hle/service/set/set.h
@@ -28,6 +28,7 @@ enum class LanguageCode : u64 {
ZH_HANS = 0x00736E61482D687A,
ZH_HANT = 0x00746E61482D687A,
};
+LanguageCode GetLanguageCodeFromIndex(size_t idx);
class SET final : public ServiceFramework<SET> {
public:
@@ -35,6 +36,7 @@ public:
~SET() = default;
private:
+ void GetLanguageCode(Kernel::HLERequestContext& ctx);
void GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx);
void GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx);
};