mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-28 10:31:18 +00:00
This reverts commit 218c6705d9.
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md).
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
@@ -21,13 +21,20 @@ namespace Service::PTM {
|
||||
class IPsmSession final : public ServiceFramework<IPsmSession> {
|
||||
public:
|
||||
explicit IPsmSession(Core::System& system_)
|
||||
: ServiceFramework{system_, "IPsmSession"}
|
||||
, service_context{system_, "IPsmSession"} {
|
||||
state_change_event = service_context.CreateEvent("IPsmSession::state_change_event");
|
||||
}
|
||||
: ServiceFramework{system_, "IPsmSession"}, service_context{system_, "IPsmSession"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IPsmSession::BindStateChangeEvent, "BindStateChangeEvent"},
|
||||
{1, &IPsmSession::UnbindStateChangeEvent, "UnbindStateChangeEvent"},
|
||||
{2, &IPsmSession::SetChargerTypeChangeEventEnabled, "SetChargerTypeChangeEventEnabled"},
|
||||
{3, &IPsmSession::SetPowerSupplyChangeEventEnabled, "SetPowerSupplyChangeEventEnabled"},
|
||||
{4, &IPsmSession::SetBatteryVoltageStateChangeEventEnabled, "SetBatteryVoltageStateChangeEventEnabled"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
RegisterHandlers(functions);
|
||||
|
||||
state_change_event = service_context.CreateEvent("IPsmSession::state_change_event");
|
||||
}
|
||||
|
||||
~IPsmSession() override {
|
||||
@@ -105,15 +112,8 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &IPsmSession::BindStateChangeEvent, "BindStateChangeEvent"},
|
||||
FunctionInfo{1, &IPsmSession::UnbindStateChangeEvent, "UnbindStateChangeEvent"},
|
||||
FunctionInfo{2, &IPsmSession::SetChargerTypeChangeEventEnabled, "SetChargerTypeChangeEventEnabled"},
|
||||
FunctionInfo{3, &IPsmSession::SetPowerSupplyChangeEventEnabled, "SetPowerSupplyChangeEventEnabled"},
|
||||
FunctionInfo{4, &IPsmSession::SetBatteryVoltageStateChangeEventEnabled, "SetBatteryVoltageStateChangeEventEnabled"}
|
||||
);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
bool should_signal_charger_type{};
|
||||
bool should_signal_power_supply{};
|
||||
bool should_signal_battery_voltage{};
|
||||
@@ -122,6 +122,31 @@ private:
|
||||
};
|
||||
|
||||
PSM::PSM(Core::System& system_) : ServiceFramework{system_, "psm"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"},
|
||||
{1, &PSM::GetChargerType, "GetChargerType"},
|
||||
{2, nullptr, "EnableBatteryCharging"},
|
||||
{3, nullptr, "DisableBatteryCharging"},
|
||||
{4, nullptr, "IsBatteryChargingEnabled"},
|
||||
{5, nullptr, "AcquireControllerPowerSupply"},
|
||||
{6, nullptr, "ReleaseControllerPowerSupply"},
|
||||
{7, &PSM::OpenSession, "OpenSession"},
|
||||
{8, nullptr, "EnableEnoughPowerChargeEmulation"},
|
||||
{9, nullptr, "DisableEnoughPowerChargeEmulation"},
|
||||
{10, nullptr, "EnableFastBatteryCharging"},
|
||||
{11, nullptr, "DisableFastBatteryCharging"},
|
||||
{12, &PSM::GetBatteryVoltageState, "GetBatteryVoltageState"},
|
||||
{13, nullptr, "GetRawBatteryChargePercentage"},
|
||||
{14, nullptr, "IsEnoughPowerSupplied"},
|
||||
{15, &PSM::GetBatteryAgePercentage, "GetBatteryAgePercentage"},
|
||||
{16, nullptr, "GetBatteryChargeInfoEvent"},
|
||||
{17, &PSM::GetBatteryChargeInfoFields, "GetBatteryChargeInfoFields"},
|
||||
{18, nullptr, "GetBatteryChargeCalibratedEvent"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
PSM::~PSM() = default;
|
||||
|
||||
@@ -28,31 +28,6 @@ private:
|
||||
void GetBatteryVoltageState(HLERequestContext& ctx);
|
||||
void GetBatteryAgePercentage(HLERequestContext& ctx);
|
||||
void GetBatteryChargeInfoFields(HLERequestContext& ctx);
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, &PSM::GetBatteryChargePercentage, "GetBatteryChargePercentage"},
|
||||
FunctionInfo{1, &PSM::GetChargerType, "GetChargerType"},
|
||||
FunctionInfo{2, nullptr, "EnableBatteryCharging"},
|
||||
FunctionInfo{3, nullptr, "DisableBatteryCharging"},
|
||||
FunctionInfo{4, nullptr, "IsBatteryChargingEnabled"},
|
||||
FunctionInfo{5, nullptr, "AcquireControllerPowerSupply"},
|
||||
FunctionInfo{6, nullptr, "ReleaseControllerPowerSupply"},
|
||||
FunctionInfo{7, &PSM::OpenSession, "OpenSession"},
|
||||
FunctionInfo{8, nullptr, "EnableEnoughPowerChargeEmulation"},
|
||||
FunctionInfo{9, nullptr, "DisableEnoughPowerChargeEmulation"},
|
||||
FunctionInfo{10, nullptr, "EnableFastBatteryCharging"},
|
||||
FunctionInfo{11, nullptr, "DisableFastBatteryCharging"},
|
||||
FunctionInfo{12, &PSM::GetBatteryVoltageState, "GetBatteryVoltageState"},
|
||||
FunctionInfo{13, nullptr, "GetRawBatteryChargePercentage"},
|
||||
FunctionInfo{14, nullptr, "IsEnoughPowerSupplied"},
|
||||
FunctionInfo{15, &PSM::GetBatteryAgePercentage, "GetBatteryAgePercentage"},
|
||||
FunctionInfo{16, nullptr, "GetBatteryChargeInfoEvent"},
|
||||
FunctionInfo{17, &PSM::GetBatteryChargeInfoFields, "GetBatteryChargeInfoFields"},
|
||||
FunctionInfo{18, nullptr, "GetBatteryChargeCalibratedEvent"}
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace Service::PTM
|
||||
|
||||
@@ -17,28 +17,28 @@ namespace Service::PTM {
|
||||
class PSM_MANU final : public ServiceFramework<PSM_MANU> {
|
||||
public:
|
||||
explicit PSM_MANU(Core::System& system_)
|
||||
: ServiceFramework{system_, "psm:manu"} {}
|
||||
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "EnableVdd50StateControl"},
|
||||
FunctionInfo{1, nullptr, "DisableVdd50StateControl"},
|
||||
FunctionInfo{2, nullptr, "SetVdd50State"}
|
||||
);
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
: ServiceFramework{system_, "psm:manu"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "EnableVdd50StateControl"},
|
||||
{1, nullptr, "DisableVdd50StateControl"},
|
||||
{2, nullptr, "SetVdd50State"},
|
||||
};
|
||||
// clang-format on
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
class POWCTL final : public ServiceFramework<POWCTL> {
|
||||
public:
|
||||
explicit POWCTL(Core::System& system_)
|
||||
: ServiceFramework{system_, "powctl"} {}
|
||||
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "OpenSession"}
|
||||
);
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
: ServiceFramework{system_, "powctl"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "OpenSession"},
|
||||
};
|
||||
// clang-format on
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
@@ -19,10 +19,16 @@ enum class Location : u8 {
|
||||
|
||||
class ISession : public ServiceFramework<ISession> {
|
||||
public:
|
||||
explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {}
|
||||
explicit ISession(Core::System& system_) : ServiceFramework{system_, "ISession"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetTemperatureRange"},
|
||||
{2, nullptr, "SetMeasurementMode"},
|
||||
{4, &ISession::GetTemperature, "GetTemperature"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -33,15 +39,20 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(temperature);
|
||||
}
|
||||
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "GetTemperatureRange"},
|
||||
FunctionInfo{2, nullptr, "SetMeasurementMode"},
|
||||
FunctionInfo{4, &ISession::GetTemperature, "GetTemperature"}
|
||||
);
|
||||
};
|
||||
|
||||
TS::TS(Core::System& system_) : ServiceFramework{system_, "ts"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetTemperatureRange"},
|
||||
{1, &TS::GetTemperature, "GetTemperature"},
|
||||
{2, nullptr, "SetMeasurementMode"},
|
||||
{3, &TS::GetTemperatureMilliC, "GetTemperatureMilliC"},
|
||||
{4, &TS::OpenSession, "OpenSession"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
TS::~TS() = default;
|
||||
|
||||
@@ -20,17 +20,6 @@ private:
|
||||
void GetTemperature(HLERequestContext& ctx);
|
||||
void GetTemperatureMilliC(HLERequestContext& ctx);
|
||||
void OpenSession(HLERequestContext& ctx);
|
||||
|
||||
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
|
||||
return HandlerTableGenerateWithFind(key, functions);
|
||||
}
|
||||
static constexpr auto functions = CreateStaticMap(
|
||||
FunctionInfo{0, nullptr, "GetTemperatureRange"},
|
||||
FunctionInfo{1, &TS::GetTemperature, "GetTemperature"},
|
||||
FunctionInfo{2, nullptr, "SetMeasurementMode"},
|
||||
FunctionInfo{3, &TS::GetTemperatureMilliC, "GetTemperatureMilliC"},
|
||||
FunctionInfo{4, &TS::OpenSession, "OpenSession"}
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace Service::PTM
|
||||
|
||||
Reference in New Issue
Block a user