aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/i2c/i2c.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/i2c/i2c.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/i2c/i2c.cpp')
-rw-r--r--src/core/hle/service/i2c/i2c.cpp54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/core/hle/service/i2c/i2c.cpp b/src/core/hle/service/i2c/i2c.cpp
index d0a5e29f8c..0b242768c2 100644
--- a/src/core/hle/service/i2c/i2c.cpp
+++ b/src/core/hle/service/i2c/i2c.cpp
@@ -17,26 +17,25 @@ namespace Service::I2C {
class I2CSession final : public ServiceFramework<I2CSession> {
public:
- explicit I2CSession(Core::System& system_) : ServiceFramework{system_, "I2CSession"} {}
+ explicit I2CSession(Core::System& system_)
+ : ServiceFramework{system_, "I2CSession"}
+ {
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "SendOld"},
+ {1, nullptr, "ReceiveOld"},
+ {2, nullptr, "ExecuteCommandListOld"},
+ {10, C<&I2CSession::Send>, "Send"},
+ {11, nullptr, "Receive"},
+ {12, nullptr, "ExecuteCommandList"},
+ {13, nullptr, "SetRetryPolicy"},
+ };
+ RegisterHandlers(functions);
+ }
~I2CSession() override = default;
-
Result Send(InBuffer<BufferAttr_HipcMapAlias> in_data, u32 transaction_option) {
LOG_WARNING(Service, "(stubbed) topt={}", transaction_option);
R_THROW(ResultUnknown);
}
-
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
- }
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, nullptr, "SendOld"},
- FunctionInfo{1, nullptr, "ReceiveOld"},
- FunctionInfo{2, nullptr, "ExecuteCommandListOld"},
- FunctionInfo{10, C<&I2CSession::Send>, "Send"},
- FunctionInfo{11, nullptr, "Receive"},
- FunctionInfo{12, nullptr, "ExecuteCommandList"},
- FunctionInfo{13, nullptr, "SetRetryPolicy"}
- );
};
enum class I2CDevice : u32 {
@@ -46,9 +45,19 @@ enum class I2CDevice : u32 {
class I2C final : public ServiceFramework<I2C> {
public:
- explicit I2C(Core::System& system_) : ServiceFramework{system_, "i2c"} {}
+ explicit I2C(Core::System& system_)
+ : ServiceFramework{system_, "i2c"}
+ {
+ static const FunctionInfo functions[] = {
+ {0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"},
+ {1, C<&I2C::OpenSession>, "OpenSession"},
+ {2, C<&I2C::HasDevice>, "HasDevice"},
+ {3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"},
+ {4, C<&I2C::OpenSession2>, "OpenSession2"},
+ };
+ RegisterHandlers(functions);
+ }
~I2C() override = default;
-
Result OpenSessionForDev(OutInterface<I2CSession> out_session, s32 bus_idx, u32 slave_address, u32 addressing_mode, u32 speed_mode) {
LOG_DEBUG(Service, "(stubbed)");
*out_session = std::make_shared<I2CSession>(system);
@@ -74,17 +83,6 @@ public:
*out_session = std::make_shared<I2CSession>(system);
R_SUCCEED();
}
-
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
- }
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"},
- FunctionInfo{1, C<&I2C::OpenSession>, "OpenSession"},
- FunctionInfo{2, C<&I2C::HasDevice>, "HasDevice"},
- FunctionInfo{3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"},
- FunctionInfo{4, C<&I2C::OpenSession2>, "OpenSession2"}
- );
};
void LoopProcess(Core::System& system) {