diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/ipc_helpers.h | 8 | ||||
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 11 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/timer.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/friend/friend.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/service/friend/friend_u.cpp | 18 | ||||
-rw-r--r-- | src/core/hle/service/friend/friend_u.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/friend/interface.cpp (renamed from src/core/hle/service/friend/friend_a.cpp) | 9 | ||||
-rw-r--r-- | src/core/hle/service/friend/interface.h (renamed from src/core/hle/service/friend/friend_a.h) | 4 | ||||
-rw-r--r-- | src/core/hle/service/hid/hid.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/service/set/set_sys.cpp | 19 | ||||
-rw-r--r-- | src/core/hle/service/set/set_sys.h | 11 | ||||
-rw-r--r-- | src/core/hle/service/time/time.cpp | 1 |
16 files changed, 60 insertions, 53 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index f5bd27a75..7fb0da408 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -300,6 +300,14 @@ public: template <typename First, typename... Other> void Pop(First& first_value, Other&... other_values); + template <typename T> + T PopEnum() { + static_assert(std::is_enum_v<T>, "T must be an enum type within a PopEnum call."); + static_assert(!std::is_convertible_v<T, int>, + "enum type in PopEnum must be a strongly typed enum."); + return static_cast<T>(Pop<std::underlying_type_t<T>>()); + } + /** * @brief Reads the next normal parameters as a struct, by copying it * @note: The output class must be correctly packed/padded to fit hardware layout. diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 3e236cfd5..0b439401a 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -167,11 +167,14 @@ static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64 using ObjectPtr = SharedPtr<WaitObject>; std::vector<ObjectPtr> objects(handle_count); - for (int i = 0; i < handle_count; ++i) { - Handle handle = Memory::Read32(handles_address + i * sizeof(Handle)); - auto object = g_handle_table.Get<WaitObject>(handle); - if (object == nullptr) + for (u64 i = 0; i < handle_count; ++i) { + const Handle handle = Memory::Read32(handles_address + i * sizeof(Handle)); + const auto object = g_handle_table.Get<WaitObject>(handle); + + if (object == nullptr) { return ERR_INVALID_HANDLE; + } + objects[i] = object; } diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index cd85c4b7c..94735c86e 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -14,6 +14,7 @@ #include "core/arm/arm_interface.h" #include "core/core.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/hle/kernel/errors.h" #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/kernel.h" diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 0141125e4..904a3d0a5 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -6,6 +6,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 154bc12da..1dcd84d98 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -6,6 +6,7 @@ #include <vector> #include "common/logging/log.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/hle_ipc.h" diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index e623f4f8e..6aed9e2fa 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -7,6 +7,7 @@ #include "common/alignment.h" #include "common/logging/log.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/hle_ipc.h" diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index c98a46e05..fb4d89068 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp @@ -5,8 +5,7 @@ #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/friend/friend.h" -#include "core/hle/service/friend/friend_a.h" -#include "core/hle/service/friend/friend_u.h" +#include "core/hle/service/friend/interface.h" namespace Service::Friend { @@ -21,8 +20,11 @@ Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) void InstallInterfaces(SM::ServiceManager& service_manager) { auto module = std::make_shared<Module>(); - std::make_shared<Friend_A>(module)->InstallAsService(service_manager); - std::make_shared<Friend_U>(module)->InstallAsService(service_manager); + std::make_shared<Friend>(module, "friend:a")->InstallAsService(service_manager); + std::make_shared<Friend>(module, "friend:m")->InstallAsService(service_manager); + std::make_shared<Friend>(module, "friend:s")->InstallAsService(service_manager); + std::make_shared<Friend>(module, "friend:u")->InstallAsService(service_manager); + std::make_shared<Friend>(module, "friend:v")->InstallAsService(service_manager); } } // namespace Service::Friend diff --git a/src/core/hle/service/friend/friend_u.cpp b/src/core/hle/service/friend/friend_u.cpp deleted file mode 100644 index 90b30883f..000000000 --- a/src/core/hle/service/friend/friend_u.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/service/friend/friend_u.h" - -namespace Service::Friend { - -Friend_U::Friend_U(std::shared_ptr<Module> module) - : Module::Interface(std::move(module), "friend:u") { - static const FunctionInfo functions[] = { - {0, &Friend_U::CreateFriendService, "CreateFriendService"}, - {1, nullptr, "CreateNotificationService"}, - }; - RegisterHandlers(functions); -} - -} // namespace Service::Friend diff --git a/src/core/hle/service/friend/friend_u.h b/src/core/hle/service/friend/friend_u.h deleted file mode 100644 index 0d953d807..000000000 --- a/src/core/hle/service/friend/friend_u.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/service/friend/friend.h" - -namespace Service::Friend { - -class Friend_U final : public Module::Interface { -public: - explicit Friend_U(std::shared_ptr<Module> module); -}; - -} // namespace Service::Friend diff --git a/src/core/hle/service/friend/friend_a.cpp b/src/core/hle/service/friend/interface.cpp index a2cc81926..27c6a09e2 100644 --- a/src/core/hle/service/friend/friend_a.cpp +++ b/src/core/hle/service/friend/interface.cpp @@ -2,15 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/friend/friend_a.h" +#include "core/hle/service/friend/interface.h" namespace Service::Friend { -Friend_A::Friend_A(std::shared_ptr<Module> module) - : Module::Interface(std::move(module), "friend:a") { +Friend::Friend(std::shared_ptr<Module> module, const char* name) + : Interface(std::move(module), name) { static const FunctionInfo functions[] = { - {0, &Friend_A::CreateFriendService, "CreateFriendService"}, + {0, &Friend::CreateFriendService, "CreateFriendService"}, {1, nullptr, "CreateNotificationService"}, + {2, nullptr, "CreateDaemonSuspendSessionService"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/friend/friend_a.h b/src/core/hle/service/friend/interface.h index 81257583b..89dae8471 100644 --- a/src/core/hle/service/friend/friend_a.h +++ b/src/core/hle/service/friend/interface.h @@ -8,9 +8,9 @@ namespace Service::Friend { -class Friend_A final : public Module::Interface { +class Friend final : public Module::Interface { public: - explicit Friend_A(std::shared_ptr<Module> module); + explicit Friend(std::shared_ptr<Module> module, const char* name); }; } // namespace Service::Friend diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 475a0a5cf..9a02ba686 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -5,6 +5,7 @@ #include <atomic> #include "common/logging/log.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/frontend/emu_window.h" #include "core/frontend/input.h" #include "core/hle/ipc_helpers.h" diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 1fca1743d..5344441e1 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -9,6 +9,7 @@ #include "common/scope_exit.h" #include "core/core.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" #include "core/hle/service/nvdrv/nvdrv.h" #include "core/hle/service/nvflinger/buffer_queue.h" diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index fa85277fe..41efca31c 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp @@ -10,13 +10,22 @@ namespace Service::Set { void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) { - IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push<u32>(0); + rb.PushEnum(color_set); - LOG_WARNING(Service_SET, "(STUBBED) called"); + LOG_DEBUG(Service_SET, "called"); +} + +void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) { + 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") { @@ -44,7 +53,7 @@ SET_SYS::SET_SYS() : ServiceFramework("set:sys") { {21, nullptr, "GetEulaVersions"}, {22, nullptr, "SetEulaVersions"}, {23, &SET_SYS::GetColorSetId, "GetColorSetId"}, - {24, nullptr, "SetColorSetId"}, + {24, &SET_SYS::SetColorSetId, "SetColorSetId"}, {25, nullptr, "GetConsoleInformationUploadFlag"}, {26, nullptr, "SetConsoleInformationUploadFlag"}, {27, nullptr, "GetAutomaticApplicationDownloadFlag"}, @@ -172,4 +181,6 @@ SET_SYS::SET_SYS() : ServiceFramework("set:sys") { RegisterHandlers(functions); } +SET_SYS::~SET_SYS() = default; + } // namespace Service::Set diff --git a/src/core/hle/service/set/set_sys.h b/src/core/hle/service/set/set_sys.h index b77a97cde..f602f3c77 100644 --- a/src/core/hle/service/set/set_sys.h +++ b/src/core/hle/service/set/set_sys.h @@ -11,10 +11,19 @@ namespace Service::Set { class SET_SYS final : public ServiceFramework<SET_SYS> { public: explicit SET_SYS(); - ~SET_SYS() = default; + ~SET_SYS() override; private: + /// Indicates the current theme set by the system settings + enum class ColorSet : u32 { + BasicWhite = 0, + BasicBlack = 1, + }; + void GetColorSetId(Kernel::HLERequestContext& ctx); + void SetColorSetId(Kernel::HLERequestContext& ctx); + + ColorSet color_set = ColorSet::BasicWhite; }; } // namespace Service::Set diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 507ae95f4..f60bf7b91 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -6,6 +6,7 @@ #include <ctime> #include "common/logging/log.h" #include "core/core_timing.h" +#include "core/core_timing_util.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_session.h" |