Revert "[hle] constexpr handler dispatch maps, introduce version gating (#4480)" (#4532)

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:
PavelBARABANOV
2026-10-15 08:45:15 +02:00
committed by crueter
parent 14da4482a4
commit e255c20db4
588 changed files with 14723 additions and 12534 deletions
+78 -82
View File
@@ -21,10 +21,15 @@ namespace Service::NGC {
class IService final : public ServiceFramework<IService> {
public:
explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {}
explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &IService::Match, "Match"},
{1, &IService::Filter, "Filter"},
};
// clang-format on
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
RegisterHandlers(functions);
}
private:
@@ -56,19 +61,23 @@ private:
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, &IService::Match, "Match"},
FunctionInfo{1, &IService::Filter, "Filter"}
);
};
class NgcServiceImpl final : public ServiceFramework<NgcServiceImpl> {
public:
explicit NgcServiceImpl(Core::System& system_) : ServiceFramework(system_, "ngc:u") {}
explicit NgcServiceImpl(Core::System& system_) : ServiceFramework(system_, "ngc:u") {
// clang-format off
static const FunctionInfo functions[] = {
{0, &NgcServiceImpl::GetContentVersion, "GetContentVersion"},
{1, &NgcServiceImpl::Check, "Check"},
{2, &NgcServiceImpl::Mask, "Mask"},
{3, &NgcServiceImpl::Reload, "Reload"},
{4, &NgcServiceImpl::Check, "Check2"},
{5, &NgcServiceImpl::Mask, "Mask2"},
};
// clang-format on
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
RegisterHandlers(functions);
}
private:
@@ -141,34 +150,25 @@ private:
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, &NgcServiceImpl::GetContentVersion, "GetContentVersion"},
FunctionInfo{1, &NgcServiceImpl::Check, "Check"},
FunctionInfo{2, &NgcServiceImpl::Mask, "Mask"},
FunctionInfo{3, &NgcServiceImpl::Reload, "Reload"},
FunctionInfo{4, &NgcServiceImpl::Check, "Check2"},
FunctionInfo{5, &NgcServiceImpl::Mask, "Mask2"}
);
};
class IServiceWithManagementApi final : public ServiceFramework<IServiceWithManagementApi> {
public:
explicit IServiceWithManagementApi(Core::System& system_) : ServiceFramework(system_, "ngct:s") {}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, nullptr, "Match"},
FunctionInfo{1, nullptr, "Filter"},
FunctionInfo{100, nullptr, "ConfigureAutoUpdateSetting"},
FunctionInfo{101, nullptr, "RequestResourceUpdateCheck"},
FunctionInfo{110, nullptr, "Reload"},
FunctionInfo{111, nullptr, "IsReloadRequired"},
FunctionInfo{112, nullptr, "TryAcquireReloadRequestNotifier"},
FunctionInfo{120, nullptr, "CalculateContentFingerprint"},
FunctionInfo{130, nullptr, "TryEnableTemporalPassThrough"}
);
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
explicit IServiceWithManagementApi(Core::System& system_) : ServiceFramework(system_, "ngct:s") {
// clang-format off
static const FunctionInfo functions[] = {
{0 , nullptr, "Match"},
{1 , nullptr, "Filter"},
{100, nullptr, "ConfigureAutoUpdateSetting"},
{101, nullptr, "RequestResourceUpdateCheck"},
{110, nullptr, "Reload"},
{111, nullptr, "IsReloadRequired"},
{112, nullptr, "TryAcquireReloadRequestNotifier"},
{120, nullptr, "CalculateContentFingerprint"},
{130, nullptr, "TryEnableTemporalPassThrough"},
};
// clang-format on
RegisterHandlers(functions);
}
};
@@ -179,10 +179,20 @@ static_assert(sizeof(SaveDataHandle) == 0x08);
class IUserShimScopedObject final : public ServiceFramework<IUserShimScopedObject> {
public:
explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") {}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
explicit IUserShimScopedObject(Core::System& system_) : ServiceFramework(system_, "IUserShimScopedObject") {
// clang-format off
static const FunctionInfo functions[] = {
{450, nullptr, "InitializeForSaveData"},
{451, nullptr, "FinalizeForSaveData"},
{452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"},
{453, nullptr, "CloseSaveData"},
{454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"},
{455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"},
{456, nullptr, "FlushSaveSlot"},
{457, nullptr, "CommitSaveData"},
};
// clang-format on
RegisterHandlers(functions);
}
Result OpenSaveData(Account::Uid unk0, Out<SaveDataHandle> unk1) {
@@ -200,43 +210,42 @@ public:
// to implement
R_SUCCEED();
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{450, nullptr, "InitializeForSaveData"},
FunctionInfo{451, nullptr, "FinalizeForSaveData"},
FunctionInfo{452, D<&IUserShimScopedObject::OpenSaveData>, "OpenSaveData"},
FunctionInfo{453, nullptr, "CloseSaveData"},
FunctionInfo{454, D<&IUserShimScopedObject::ReadSaveSlot>, "ReadSaveSlot"},
FunctionInfo{455, D<&IUserShimScopedObject::WriteSaveSlot>, "WriteSaveSlot"},
FunctionInfo{456, nullptr, "FlushSaveSlot"},
FunctionInfo{457, nullptr, "CommitSaveData"}
);
};
class IUserService final : public ServiceFramework<IUserService> {
public:
explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") {}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
explicit IUserService(Core::System& system_) : ServiceFramework(system_, "stpl:u") {
// clang-format off
static const FunctionInfo functions[] = {
{0 , D<&IUserService::Cmd0>, "Cmd0"},
};
// clang-format on
RegisterHandlers(functions);
}
Result Cmd0(u32 unk0, OutInterface<IUserShimScopedObject> out_interface) {
LOG_WARNING(Service_NGC, "stubbed");
*out_interface = std::make_shared<IUserShimScopedObject>(system);
R_SUCCEED();
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, D<&IUserService::Cmd0>, "Cmd0"}
);
};
class ISystemShimScopedObject final : public ServiceFramework<ISystemShimScopedObject> {
public:
explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") {}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
explicit ISystemShimScopedObject(Core::System& system_) : ServiceFramework(system_, "ISystemShimScopedObject") {
// clang-format off
static const FunctionInfo functions[] = {
{106, nullptr, "Cmd106"},
{107, nullptr, "Cmd107"},
{108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"},
{207, nullptr, "Cmd207"},
{208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"},
{209, nullptr, "Cmd209"},
{210, nullptr, "Cmd210"},
{211, nullptr, "Cmd211"},
{212, nullptr, "Cmd212"},
};
// clang-format on
RegisterHandlers(functions);
}
Result Cmd108() {
@@ -248,36 +257,23 @@ public:
LOG_WARNING(Service_NGC, "stubbed");
R_THROW(IPC::ResultNotSupported);
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{106, nullptr, "Cmd106"},
FunctionInfo{107, nullptr, "Cmd107"},
FunctionInfo{108, D<&ISystemShimScopedObject::Cmd108>, "Cmd108"},
FunctionInfo{207, nullptr, "Cmd207"},
FunctionInfo{208, D<&ISystemShimScopedObject::Cmd208>, "Cmd208"},
FunctionInfo{209, nullptr, "Cmd209"},
FunctionInfo{210, nullptr, "Cmd210"},
FunctionInfo{211, nullptr, "Cmd211"},
FunctionInfo{212, nullptr, "Cmd212"}
);
};
class ISystemService final : public ServiceFramework<ISystemService> {
public:
explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") {}
std::optional<FunctionInfoBase> FindRequest(u32 key) override {
return HandlerTableGenerateWithFind(key, functions);
explicit ISystemService(Core::System& system_) : ServiceFramework(system_, "stpl:sys") {
// clang-format off
static const FunctionInfo functions[] = {
{0 , D<&ISystemService::Cmd0>, "Cmd0"},
};
// clang-format on
RegisterHandlers(functions);
}
Result Cmd0(OutInterface<ISystemShimScopedObject> out_interface) {
LOG_WARNING(Service_NGC, "stubbed");
*out_interface = std::make_shared<ISystemShimScopedObject>(system);
R_SUCCEED();
}
static constexpr auto functions = CreateStaticMap(
FunctionInfo{0, D<&ISystemService::Cmd0>, "Cmd0"}
);
};
void LoopProcess(Core::System& system) {
+3
View File
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later