mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-26 19:11:00 +00:00
@@ -69,6 +69,9 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c
|
|||||||
void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) {
|
void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) {
|
||||||
const bool is_cmd_read = ctx.GetCommand() == 0;
|
const bool is_cmd_read = ctx.GetCommand() == 0;
|
||||||
auto const info = FindRequest(ctx.GetCommand());
|
auto const info = FindRequest(ctx.GetCommand());
|
||||||
|
if (info == nullptr || info->handler_callback == nullptr)
|
||||||
|
return ReportUnimplementedFunction(ctx, info);
|
||||||
|
|
||||||
LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer()));
|
LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer()));
|
||||||
handler_invoker(this, info->handler_callback, ctx);
|
handler_invoker(this, info->handler_callback, ctx);
|
||||||
if (is_i_storage && is_cmd_read) {
|
if (is_i_storage && is_cmd_read) {
|
||||||
@@ -81,6 +84,9 @@ void ServiceFrameworkBase::InvokeRequest(HLERequestContext& ctx) {
|
|||||||
|
|
||||||
void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) {
|
void ServiceFrameworkBase::InvokeRequestTipc(HLERequestContext& ctx) {
|
||||||
auto const info = FindRequestTipc(ctx.GetCommand());
|
auto const info = FindRequestTipc(ctx.GetCommand());
|
||||||
|
if (info == nullptr || info->handler_callback == nullptr)
|
||||||
|
return ReportUnimplementedFunction(ctx, info);
|
||||||
|
|
||||||
LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer()));
|
LOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName(), ctx.CommandBuffer()));
|
||||||
handler_invoker(this, info->handler_callback, ctx);
|
handler_invoker(this, info->handler_callback, ctx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,14 +180,12 @@ protected:
|
|||||||
|
|
||||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
auto it = handlers.find(key);
|
auto it = handlers.find(key);
|
||||||
FunctionInfoBase const* info = it == handlers.end() ? nullptr : &it->second;
|
return it != handlers.end() ? std::addressof(it->second) : nullptr;
|
||||||
return !(info == nullptr || info->handler_callback == nullptr) ? info : nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionInfoBase const* FindRequestTipc(u32 key) override {
|
FunctionInfoBase const* FindRequestTipc(u32 key) override {
|
||||||
auto it = handlers_tipc.find(key);
|
auto it = handlers_tipc.find(key);
|
||||||
FunctionInfoBase const* info = it == handlers_tipc.end() ? nullptr : &it->second;
|
return it != handlers_tipc.end() ? std::addressof(it->second) : nullptr;
|
||||||
return !(info == nullptr || info->handler_callback == nullptr) ? info : nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) {
|
constexpr void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) {
|
||||||
|
|||||||
Reference in New Issue
Block a user