summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/ipc_helpers.h8
-rw-r--r--src/core/hle/kernel/svc.cpp4
-rw-r--r--src/core/hle/kernel/thread.cpp1
-rw-r--r--src/core/hle/kernel/timer.cpp1
-rw-r--r--src/core/hle/service/audio/audout_u.cpp1
-rw-r--r--src/core/hle/service/audio/audren_u.cpp1
-rw-r--r--src/core/hle/service/hid/hid.cpp1
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp1
-rw-r--r--src/core/hle/service/set/set_sys.cpp19
-rw-r--r--src/core/hle/service/set/set_sys.h11
-rw-r--r--src/core/hle/service/time/interface.cpp (renamed from src/core/hle/service/time/time_s.cpp)15
-rw-r--r--src/core/hle/service/time/interface.h (renamed from src/core/hle/service/time/time_s.h)4
-rw-r--r--src/core/hle/service/time/time.cpp9
-rw-r--r--src/core/hle/service/time/time_u.cpp31
-rw-r--r--src/core/hle/service/time/time_u.h16
15 files changed, 57 insertions, 66 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 da7cacb57..0b439401a 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -40,7 +40,9 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) {
}
static ResultCode SetMemoryAttribute(VAddr addr, u64 size, u32 state0, u32 state1) {
- LOG_WARNING(Kernel_SVC, "(STUBBED) called, addr=0x{:X}", addr);
+ LOG_WARNING(Kernel_SVC,
+ "(STUBBED) called, addr=0x{:X}, size=0x{:X}, state0=0x{:X}, state1=0x{:X}", addr,
+ size, state0, state1);
return RESULT_SUCCESS;
}
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/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_s.cpp b/src/core/hle/service/time/interface.cpp
index 0b599ea00..048d5b077 100644
--- a/src/core/hle/service/time/time_s.cpp
+++ b/src/core/hle/service/time/interface.cpp
@@ -2,17 +2,18 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "core/hle/service/time/time_s.h"
+#include "core/hle/service/time/interface.h"
namespace Service::Time {
-TIME_S::TIME_S(std::shared_ptr<Module> time) : Module::Interface(std::move(time), "time:s") {
+Time::Time(std::shared_ptr<Module> time, const char* name)
+ : Module::Interface(std::move(time), name) {
static const FunctionInfo functions[] = {
- {0, &TIME_S::GetStandardUserSystemClock, "GetStandardUserSystemClock"},
- {1, &TIME_S::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"},
- {2, &TIME_S::GetStandardSteadyClock, "GetStandardSteadyClock"},
- {3, &TIME_S::GetTimeZoneService, "GetTimeZoneService"},
- {4, &TIME_S::GetStandardLocalSystemClock, "GetStandardLocalSystemClock"},
+ {0, &Time::GetStandardUserSystemClock, "GetStandardUserSystemClock"},
+ {1, &Time::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"},
+ {2, &Time::GetStandardSteadyClock, "GetStandardSteadyClock"},
+ {3, &Time::GetTimeZoneService, "GetTimeZoneService"},
+ {4, &Time::GetStandardLocalSystemClock, "GetStandardLocalSystemClock"},
{5, nullptr, "GetEphemeralNetworkSystemClock"},
{50, nullptr, "SetStandardSteadyClockInternalOffset"},
{100, nullptr, "IsStandardUserSystemClockAutomaticCorrectionEnabled"},
diff --git a/src/core/hle/service/time/time_s.h b/src/core/hle/service/time/interface.h
index 4a2daa513..183a53db1 100644
--- a/src/core/hle/service/time/time_s.h
+++ b/src/core/hle/service/time/interface.h
@@ -8,9 +8,9 @@
namespace Service::Time {
-class TIME_S final : public Module::Interface {
+class Time final : public Module::Interface {
public:
- explicit TIME_S(std::shared_ptr<Module> time);
+ explicit Time(std::shared_ptr<Module> time, const char* name);
};
} // namespace Service::Time
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 507ae95f4..37b58bb77 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -6,12 +6,12 @@
#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"
+#include "core/hle/service/time/interface.h"
#include "core/hle/service/time/time.h"
-#include "core/hle/service/time/time_s.h"
-#include "core/hle/service/time/time_u.h"
namespace Service::Time {
@@ -212,8 +212,9 @@ Module::Interface::Interface(std::shared_ptr<Module> time, const char* name)
void InstallInterfaces(SM::ServiceManager& service_manager) {
auto time = std::make_shared<Module>();
- std::make_shared<TIME_S>(time)->InstallAsService(service_manager);
- std::make_shared<TIME_U>(time)->InstallAsService(service_manager);
+ std::make_shared<Time>(time, "time:a")->InstallAsService(service_manager);
+ std::make_shared<Time>(time, "time:s")->InstallAsService(service_manager);
+ std::make_shared<Time>(time, "time:u")->InstallAsService(service_manager);
}
} // namespace Service::Time
diff --git a/src/core/hle/service/time/time_u.cpp b/src/core/hle/service/time/time_u.cpp
deleted file mode 100644
index 1ed42c419..000000000
--- a/src/core/hle/service/time/time_u.cpp
+++ /dev/null
@@ -1,31 +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/time/time_u.h"
-
-namespace Service::Time {
-
-TIME_U::TIME_U(std::shared_ptr<Module> time) : Module::Interface(std::move(time), "time:u") {
- static const FunctionInfo functions[] = {
- {0, &TIME_U::GetStandardUserSystemClock, "GetStandardUserSystemClock"},
- {1, &TIME_U::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"},
- {2, &TIME_U::GetStandardSteadyClock, "GetStandardSteadyClock"},
- {3, &TIME_U::GetTimeZoneService, "GetTimeZoneService"},
- {4, &TIME_U::GetStandardLocalSystemClock, "GetStandardLocalSystemClock"},
- {5, nullptr, "GetEphemeralNetworkSystemClock"},
- {50, nullptr, "SetStandardSteadyClockInternalOffset"},
- {100, nullptr, "IsStandardUserSystemClockAutomaticCorrectionEnabled"},
- {101, nullptr, "SetStandardUserSystemClockAutomaticCorrectionEnabled"},
- {102, nullptr, "GetStandardUserSystemClockInitialYear"},
- {200, nullptr, "IsStandardNetworkSystemClockAccuracySufficient"},
- {300, nullptr, "CalculateMonotonicSystemClockBaseTimePoint"},
- {400, nullptr, "GetClockSnapshot"},
- {401, nullptr, "GetClockSnapshotFromSystemClockContext"},
- {500, nullptr, "CalculateStandardUserSystemClockDifferenceByUser"},
- {501, nullptr, "CalculateSpanBetween"},
- };
- RegisterHandlers(functions);
-}
-
-} // namespace Service::Time
diff --git a/src/core/hle/service/time/time_u.h b/src/core/hle/service/time/time_u.h
deleted file mode 100644
index 3724bcdc7..000000000
--- a/src/core/hle/service/time/time_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/time/time.h"
-
-namespace Service::Time {
-
-class TIME_U final : public Module::Interface {
-public:
- explicit TIME_U(std::shared_ptr<Module> time);
-};
-
-} // namespace Service::Time