diff options
| author | 2018-10-20 17:23:43 -0400 | |
|---|---|---|
| committer | 2018-10-20 18:01:11 -0400 | |
| commit | 10a2d20e26e8f43dc15be0e13c570ab28bb57242 (patch) | |
| tree | 99c84b8d54b56d3edde2af7abf4aa9dce2a69fd8 /src | |
| parent | service: Add skeleton for psm service (diff) | |
| download | yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.gz yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.tar.xz yuzu-10a2d20e26e8f43dc15be0e13c570ab28bb57242.zip | |
psm: Stub GetBatteryChargePercentage
Used by LovePotion Lua Homebrew. Stubbed to return 100% charge.
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/ptm/psm.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/psm.h | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index f6186b809..a8e3813c8 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp | |||
| @@ -12,10 +12,12 @@ | |||
| 12 | 12 | ||
| 13 | namespace Service::PSM { | 13 | namespace Service::PSM { |
| 14 | 14 | ||
| 15 | constexpr u32 BATTERY_FULLY_CHARGED = 100; // 100% Full | ||
| 16 | |||
| 15 | PSM::PSM() : ServiceFramework{"psm"} { | 17 | PSM::PSM() : ServiceFramework{"psm"} { |
| 16 | // clang-format off | 18 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 19 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "GetBatteryChargePercentage"}, | 20 | {0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"}, |
| 19 | {1, nullptr, "GetChargerType"}, | 21 | {1, nullptr, "GetChargerType"}, |
| 20 | {2, nullptr, "EnableBatteryCharging"}, | 22 | {2, nullptr, "EnableBatteryCharging"}, |
| 21 | {3, nullptr, "DisableBatteryCharging"}, | 23 | {3, nullptr, "DisableBatteryCharging"}, |
| @@ -41,6 +43,14 @@ PSM::PSM() : ServiceFramework{"psm"} { | |||
| 41 | 43 | ||
| 42 | PSM::~PSM() = default; | 44 | PSM::~PSM() = default; |
| 43 | 45 | ||
| 46 | void PSM::GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) { | ||
| 47 | LOG_WARNING(Service_PSM, "(STUBBED) called"); | ||
| 48 | |||
| 49 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 50 | rb.Push(RESULT_SUCCESS); | ||
| 51 | rb.Push<u32>(BATTERY_FULLY_CHARGED); | ||
| 52 | } | ||
| 53 | |||
| 44 | void InstallInterfaces(SM::ServiceManager& sm) { | 54 | void InstallInterfaces(SM::ServiceManager& sm) { |
| 45 | std::make_shared<PSM>()->InstallAsService(sm); | 55 | std::make_shared<PSM>()->InstallAsService(sm); |
| 46 | } | 56 | } |
diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h index 21955aa22..113878bb7 100644 --- a/src/core/hle/service/ptm/psm.h +++ b/src/core/hle/service/ptm/psm.h | |||
| @@ -15,6 +15,9 @@ class PSM final : public ServiceFramework<PSM> { | |||
| 15 | public: | 15 | public: |
| 16 | explicit PSM(); | 16 | explicit PSM(); |
| 17 | ~PSM() override; | 17 | ~PSM() override; |
| 18 | |||
| 19 | private: | ||
| 20 | void GetBatteryChargePercentage(Kernel::HLERequestContext& ctx); | ||
| 18 | }; | 21 | }; |
| 19 | 22 | ||
| 20 | void InstallInterfaces(SM::ServiceManager& sm); | 23 | void InstallInterfaces(SM::ServiceManager& sm); |