diff options
| author | 2018-10-20 17:22:15 -0400 | |
|---|---|---|
| committer | 2018-10-20 18:01:07 -0400 | |
| commit | 3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd (patch) | |
| tree | 61b10c6249df5732518963b66ad75d0ac13fb3b8 /src/core/hle/service/ptm | |
| parent | Merge pull request #1535 from ReinUsesLisp/fixup-position (diff) | |
| download | yuzu-3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd.tar.gz yuzu-3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd.tar.xz yuzu-3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd.zip | |
service: Add skeleton for psm service
Seems to be the power controller. Listed in switchbrew under the category PTM services.
Diffstat (limited to 'src/core/hle/service/ptm')
| -rw-r--r-- | src/core/hle/service/ptm/psm.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/psm.h | 22 |
2 files changed, 70 insertions, 0 deletions
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp new file mode 100644 index 000000000..f6186b809 --- /dev/null +++ b/src/core/hle/service/ptm/psm.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 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 <memory> | ||
| 6 | |||
| 7 | #include "common/logging/log.h" | ||
| 8 | #include "core/hle/ipc_helpers.h" | ||
| 9 | #include "core/hle/service/ptm/psm.h" | ||
| 10 | #include "core/hle/service/service.h" | ||
| 11 | #include "core/hle/service/sm/sm.h" | ||
| 12 | |||
| 13 | namespace Service::PSM { | ||
| 14 | |||
| 15 | PSM::PSM() : ServiceFramework{"psm"} { | ||
| 16 | // clang-format off | ||
| 17 | static const FunctionInfo functions[] = { | ||
| 18 | {0, nullptr, "GetBatteryChargePercentage"}, | ||
| 19 | {1, nullptr, "GetChargerType"}, | ||
| 20 | {2, nullptr, "EnableBatteryCharging"}, | ||
| 21 | {3, nullptr, "DisableBatteryCharging"}, | ||
| 22 | {4, nullptr, "IsBatteryChargingEnabled"}, | ||
| 23 | {5, nullptr, "AcquireControllerPowerSupply"}, | ||
| 24 | {6, nullptr, "ReleaseControllerPowerSupply"}, | ||
| 25 | {7, nullptr, "OpenSession"}, | ||
| 26 | {8, nullptr, "EnableEnoughPowerChargeEmulation"}, | ||
| 27 | {9, nullptr, "DisableEnoughPowerChargeEmulation"}, | ||
| 28 | {10, nullptr, "EnableFastBatteryCharging"}, | ||
| 29 | {11, nullptr, "DisableFastBatteryCharging"}, | ||
| 30 | {12, nullptr, "GetBatteryVoltageState"}, | ||
| 31 | {13, nullptr, "GetRawBatteryChargePercentage"}, | ||
| 32 | {14, nullptr, "IsEnoughPowerSupplied"}, | ||
| 33 | {15, nullptr, "GetBatteryAgePercentage"}, | ||
| 34 | {16, nullptr, "GetBatteryChargeInfoEvent"}, | ||
| 35 | {17, nullptr, "GetBatteryChargeInfoFields"}, | ||
| 36 | }; | ||
| 37 | // clang-format on | ||
| 38 | |||
| 39 | RegisterHandlers(functions); | ||
| 40 | } | ||
| 41 | |||
| 42 | PSM::~PSM() = default; | ||
| 43 | |||
| 44 | void InstallInterfaces(SM::ServiceManager& sm) { | ||
| 45 | std::make_shared<PSM>()->InstallAsService(sm); | ||
| 46 | } | ||
| 47 | |||
| 48 | } // namespace Service::PSM | ||
diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h new file mode 100644 index 000000000..21955aa22 --- /dev/null +++ b/src/core/hle/service/ptm/psm.h | |||
| @@ -0,0 +1,22 @@ | |||
| 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 | #include "core/hle/service/service.h" | ||
| 7 | |||
| 8 | namespace Service::SM { | ||
| 9 | class ServiceManager; | ||
| 10 | } | ||
| 11 | |||
| 12 | namespace Service::PSM { | ||
| 13 | |||
| 14 | class PSM final : public ServiceFramework<PSM> { | ||
| 15 | public: | ||
| 16 | explicit PSM(); | ||
| 17 | ~PSM() override; | ||
| 18 | }; | ||
| 19 | |||
| 20 | void InstallInterfaces(SM::ServiceManager& sm); | ||
| 21 | |||
| 22 | } // namespace Service::PSM | ||