summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/caps/caps_su.cpp3
-rw-r--r--src/core/hle/service/nim/nim.cpp70
-rw-r--r--src/core/hle/service/ptm/psm.cpp21
3 files changed, 86 insertions, 8 deletions
diff --git a/src/core/hle/service/caps/caps_su.cpp b/src/core/hle/service/caps/caps_su.cpp
index 2b4c2d808..b4d9355ef 100644
--- a/src/core/hle/service/caps/caps_su.cpp
+++ b/src/core/hle/service/caps/caps_su.cpp
@@ -9,8 +9,11 @@ namespace Service::Capture {
CAPS_SU::CAPS_SU() : ServiceFramework("caps:su") {
// clang-format off
static const FunctionInfo functions[] = {
+ {32, nullptr, "SetShimLibraryVersion"},
{201, nullptr, "SaveScreenShot"},
{203, nullptr, "SaveScreenShotEx0"},
+ {205, nullptr, "SaveScreenShotEx1"},
+ {210, nullptr, "SaveScreenShotEx2"},
};
// clang-format on
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index e85f123e2..f19affce7 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -15,6 +15,66 @@
namespace Service::NIM {
+class IShopServiceAsync final : public ServiceFramework<IShopServiceAsync> {
+public:
+ IShopServiceAsync() : ServiceFramework("IShopServiceAsync") {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "Cancel"},
+ {1, nullptr, "GetSize"},
+ {2, nullptr, "Read"},
+ {3, nullptr, "GetErrorCode"},
+ {4, nullptr, "Request"},
+ {5, nullptr, "Prepare"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+};
+
+class IShopServiceAccessor final : public ServiceFramework<IShopServiceAccessor> {
+public:
+ IShopServiceAccessor() : ServiceFramework("IShopServiceAccessor") {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, &IShopServiceAccessor::CreateAsyncInterface, "CreateAsyncInterface"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+
+private:
+ void CreateAsyncInterface(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service_NIM, "(STUBBED) called");
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IShopServiceAsync>();
+ }
+};
+
+class IShopServiceAccessServer final : public ServiceFramework<IShopServiceAccessServer> {
+public:
+ IShopServiceAccessServer() : ServiceFramework("IShopServiceAccessServer") {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, &IShopServiceAccessServer::CreateAccessorInterface, "CreateAccessorInterface"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+
+private:
+ void CreateAccessorInterface(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service_NIM, "(STUBBED) called");
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IShopServiceAccessor>();
+ }
+};
+
class NIM final : public ServiceFramework<NIM> {
public:
explicit NIM() : ServiceFramework{"nim"} {
@@ -78,7 +138,7 @@ public:
explicit NIM_ECA() : ServiceFramework{"nim:eca"} {
// clang-format off
static const FunctionInfo functions[] = {
- {0, nullptr, "CreateServerInterface"},
+ {0, &NIM_ECA::CreateServerInterface, "CreateServerInterface"},
{1, nullptr, "RefreshDebugAvailability"},
{2, nullptr, "ClearDebugResponse"},
{3, nullptr, "RegisterDebugResponse"},
@@ -87,6 +147,14 @@ public:
RegisterHandlers(functions);
}
+
+private:
+ void CreateServerInterface(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service_NIM, "(STUBBED) called");
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IShopServiceAccessServer>();
+ }
};
class NIM_SHP final : public ServiceFramework<NIM_SHP> {
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp
index c2d5fda94..12d154ecf 100644
--- a/src/core/hle/service/ptm/psm.cpp
+++ b/src/core/hle/service/ptm/psm.cpp
@@ -12,9 +12,6 @@
namespace Service::PSM {
-constexpr u32 BATTERY_FULLY_CHARGED = 100; // 100% Full
-constexpr u32 BATTERY_CURRENTLY_CHARGING = 1; // Plugged into an official dock
-
class PSM final : public ServiceFramework<PSM> {
public:
explicit PSM() : ServiceFramework{"psm"} {
@@ -48,20 +45,30 @@ public:
private:
void GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) {
- LOG_WARNING(Service_PSM, "(STUBBED) called");
+ LOG_DEBUG(Service_PSM, "called");
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push<u32>(BATTERY_FULLY_CHARGED);
+ rb.Push<u32>(battery_charge_percentage);
}
void GetChargerType(Kernel::HLERequestContext& ctx) {
- LOG_WARNING(Service_PSM, "(STUBBED) called");
+ LOG_DEBUG(Service_PSM, "called");
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
- rb.Push<u32>(BATTERY_CURRENTLY_CHARGING);
+ rb.PushEnum(charger_type);
}
+
+ enum class ChargerType : u32 {
+ Unplugged = 0,
+ RegularCharger = 1,
+ LowPowerCharger = 2,
+ Unknown = 3,
+ };
+
+ u32 battery_charge_percentage{100}; // 100%
+ ChargerType charger_type{ChargerType::RegularCharger};
};
void InstallInterfaces(SM::ServiceManager& sm) {