aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/apm/apm_interface.cpp
diff options
context:
space:
mode:
authorPavelBARABANOV <pavelbarabanov94@gmail.com>2026-10-15 08:45:15 +0200
committercrueter <crueter@eden-emu.dev>2026-10-15 08:45:15 +0200
commite255c20db4111485d228c10478bda63aabcfdde5 (patch)
tree1f8c88981b60e9a4db4ed306742196b1c4b68116 /src/core/hle/service/apm/apm_interface.cpp
parent14da4482a4668928bad43bb67ef12f96b9c9d972 (diff)
Revert "[hle] constexpr handler dispatch maps, introduce version gating (#4480)" (#4532)
This reverts commit 218c6705d950635bc18f8458d738a1996fb592b6. - [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>
Diffstat (limited to 'src/core/hle/service/apm/apm_interface.cpp')
-rw-r--r--src/core/hle/service/apm/apm_interface.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/core/hle/service/apm/apm_interface.cpp b/src/core/hle/service/apm/apm_interface.cpp
index 2b4768478e..51c01e2f25 100644
--- a/src/core/hle/service/apm/apm_interface.cpp
+++ b/src/core/hle/service/apm/apm_interface.cpp
@@ -14,7 +14,15 @@ namespace Service::APM {
class ISession final : public ServiceFramework<ISession> {
public:
- explicit ISession(Core::System& system_, Controller& controller_) : ServiceFramework{system_, "ISession"}, controller{controller_} {}
+ explicit ISession(Core::System& system_, Controller& controller_)
+ : ServiceFramework{system_, "ISession"}, controller{controller_} {
+ static const FunctionInfo functions[] = {
+ {0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"},
+ {1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"},
+ {2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"},
+ };
+ RegisterHandlers(functions);
+ }
private:
void SetPerformanceConfiguration(HLERequestContext& ctx) {
@@ -53,20 +61,18 @@ private:
rb.Push(ResultSuccess);
}
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
- }
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"},
- FunctionInfo{1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"},
- FunctionInfo{2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"}
- );
Controller& controller;
};
APM::APM(Core::System& system_, std::shared_ptr<Module> apm_, Controller& controller_,
const char* name)
: ServiceFramework{system_, name}, apm(std::move(apm_)), controller{controller_} {
+ static const FunctionInfo functions[] = {
+ {0, &APM::OpenSession, "OpenSession"},
+ {1, &APM::GetPerformanceMode, "GetPerformanceMode"},
+ {6, &APM::IsCpuOverclockEnabled, "IsCpuOverclockEnabled"},
+ };
+ RegisterHandlers(functions);
}
APM::~APM() = default;
@@ -96,6 +102,20 @@ void APM::IsCpuOverclockEnabled(HLERequestContext& ctx) {
APM_Sys::APM_Sys(Core::System& system_, Controller& controller_)
: ServiceFramework{system_, "apm:sys"}, controller{controller_} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "RequestPerformanceMode"},
+ {1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"},
+ {2, nullptr, "GetThrottlingState"},
+ {3, nullptr, "GetLastThrottlingState"},
+ {4, nullptr, "ClearLastThrottlingState"},
+ {5, nullptr, "LoadAndApplySettings"},
+ {6, &APM_Sys::SetCpuBoostMode, "SetCpuBoostMode"},
+ {7, &APM_Sys::GetCurrentPerformanceConfiguration, "GetCurrentPerformanceConfiguration"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
}
APM_Sys::~APM_Sys() = default;