diff options
| author | 2018-01-19 21:44:58 +0100 | |
|---|---|---|
| committer | 2018-01-19 15:44:58 -0500 | |
| commit | c457f34eb22eb43aa2beca0414e59f2a284715dd (patch) | |
| tree | e0f344e4ff1d48d01d3aa89f655b8d442b5cfd51 /src/core/hle/service/set | |
| parent | Merge pull request #109 from bunnei/libnx-fixes (diff) | |
| download | yuzu-c457f34eb22eb43aa2beca0414e59f2a284715dd.tar.gz yuzu-c457f34eb22eb43aa2beca0414e59f2a284715dd.tar.xz yuzu-c457f34eb22eb43aa2beca0414e59f2a284715dd.zip | |
acc, set, applet_oe: stub various functions, add set service (#105)
* Stubs for various acc:u0 funcs needed
* Stub for GetDesiredLanguage in IApplicationFunctions
* Add set service + stubs needed for games
* Fix formatting
* Implement IProfile, IManagerForApplication, return bool in CheckAvailability, style fixes
* Remove IProfile::Get(needs more research), fix IPC response sizes
Diffstat (limited to 'src/core/hle/service/set')
| -rw-r--r-- | src/core/hle/service/set/set.cpp | 42 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.h | 25 |
2 files changed, 67 insertions, 0 deletions
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp new file mode 100644 index 000000000..3715acd74 --- /dev/null +++ b/src/core/hle/service/set/set.cpp | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <chrono> | ||
| 6 | #include "common/logging/log.h" | ||
| 7 | #include "core/hle/ipc_helpers.h" | ||
| 8 | #include "core/hle/kernel/client_port.h" | ||
| 9 | #include "core/hle/kernel/client_session.h" | ||
| 10 | #include "core/hle/service/set/set.h" | ||
| 11 | |||
| 12 | namespace Service { | ||
| 13 | namespace Set { | ||
| 14 | |||
| 15 | void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { | ||
| 16 | constexpr std::array<u8, 13> lang_codes{}; | ||
| 17 | |||
| 18 | const auto& output_buffer = ctx.BufferDescriptorC()[0]; | ||
| 19 | |||
| 20 | Memory::WriteBlock(output_buffer.Address(), lang_codes.data(), lang_codes.size()); | ||
| 21 | |||
| 22 | IPC::RequestBuilder rb{ctx, 4}; | ||
| 23 | |||
| 24 | rb.Push(RESULT_SUCCESS); | ||
| 25 | rb.Push(static_cast<u64>(lang_codes.size())); | ||
| 26 | |||
| 27 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 28 | } | ||
| 29 | |||
| 30 | SET::SET(const char* name) : ServiceFramework(name) { | ||
| 31 | static const FunctionInfo functions[] = { | ||
| 32 | {1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"}, | ||
| 33 | }; | ||
| 34 | RegisterHandlers(functions); | ||
| 35 | } | ||
| 36 | |||
| 37 | void InstallInterfaces(SM::ServiceManager& service_manager) { | ||
| 38 | std::make_shared<SET>("set")->InstallAsService(service_manager); | ||
| 39 | } | ||
| 40 | |||
| 41 | } // namespace Set | ||
| 42 | } // namespace Service | ||
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h new file mode 100644 index 000000000..61e957946 --- /dev/null +++ b/src/core/hle/service/set/set.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace Set { | ||
| 11 | |||
| 12 | class SET final : public ServiceFramework<SET> { | ||
| 13 | public: | ||
| 14 | explicit SET(const char* name); | ||
| 15 | ~SET() = default; | ||
| 16 | |||
| 17 | private: | ||
| 18 | void GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx); | ||
| 19 | }; | ||
| 20 | |||
| 21 | /// Registers all Set services with the specified service manager. | ||
| 22 | void InstallInterfaces(SM::ServiceManager& service_manager); | ||
| 23 | |||
| 24 | } // namespace Set | ||
| 25 | } // namespace Service | ||