From e6e61424d4ec2e668131af7e8010cfc206b7ad16 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Fri, 12 Mar 2021 16:59:39 -0500 Subject: service: Auto stub fallback For simple services we can implement an automatic stub fallback to help with compatibility until a proper implementation is done. Co-Authored-By: Chloe <25727384+ognik5377@users.noreply.github.com> --- src/core/hle/service/service.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core') diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 1da56bc27..90260a008 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -146,6 +146,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext system.GetReporter().SaveUnimplementedFunctionReport(ctx, ctx.GetCommand(), function_name, service_name); UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); + + LOG_WARNING(Service, "Using auto stub fallback!"); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); } void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3 From 54c1e0897df82b5c61d6058da57db34e1a893fd4 Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Fri, 12 Mar 2021 17:56:02 -0500 Subject: configuration: Add auto stub toggle that resets on boot Auto-stub is an experimental debugging feature that may cause unforseen bugs. This adds a toggle to only allow auto-stubbing unimplemented functions when explicitly enabled when yuzu is launched. --- src/core/hle/service/service.cpp | 10 ++++++---- src/core/settings.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 90260a008..aec399076 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -70,6 +70,7 @@ #include "core/hle/service/vi/vi.h" #include "core/hle/service/wlan/wlan.h" #include "core/reporter.h" +#include "core/settings.h" namespace Service { @@ -146,10 +147,11 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext system.GetReporter().SaveUnimplementedFunctionReport(ctx, ctx.GetCommand(), function_name, service_name); UNIMPLEMENTED_MSG("Unknown / unimplemented {}", fmt::to_string(buf)); - - LOG_WARNING(Service, "Using auto stub fallback!"); - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + if (Settings::values.use_auto_stub) { + LOG_WARNING(Service, "Using auto stub fallback!"); + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } } void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) { diff --git a/src/core/settings.h b/src/core/settings.h index d849dded3..a81016b23 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -222,6 +222,7 @@ struct Values { bool quest_flag; bool disable_macro_jit; bool extended_logging; + bool use_auto_stub; // Miscellaneous std::string log_filter; -- cgit v1.2.3