diff options
author | LC <mathew1800@gmail.com> | 2020-09-25 06:07:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 06:07:19 +0200 |
commit | 4d4afc150294483e6090626022be55b1dfdfd498 (patch) | |
tree | 182452e53238f8f82d6d1cfc8c3b4edd3f3b2288 /src/core/hle | |
parent | Merge pull request #4711 from lioncash/move5 (diff) | |
parent | service: Restore "unused" function (diff) | |
download | yuzu-4d4afc150294483e6090626022be55b1dfdfd498.tar yuzu-4d4afc150294483e6090626022be55b1dfdfd498.tar.gz yuzu-4d4afc150294483e6090626022be55b1dfdfd498.tar.bz2 yuzu-4d4afc150294483e6090626022be55b1dfdfd498.tar.lz yuzu-4d4afc150294483e6090626022be55b1dfdfd498.tar.xz yuzu-4d4afc150294483e6090626022be55b1dfdfd498.tar.zst yuzu-4d4afc150294483e6090626022be55b1dfdfd498.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/service.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 76b3533ec..ba9159ee0 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -72,6 +72,23 @@ namespace Service { +/** + * Creates a function string for logging, complete with the name (or header code, depending + * on what's passed in) the port name, and all the cmd_buff arguments. + */ +[[maybe_unused]] static std::string MakeFunctionString(std::string_view name, + std::string_view port_name, + const u32* cmd_buff) { + // Number of params == bits 0-5 + bits 6-11 + int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); + + std::string function_string = fmt::format("function '{}': port={}", name, port_name); + for (int i = 1; i <= num_params; ++i) { + function_string += fmt::format(", cmd_buff[{}]=0x{:X}", i, cmd_buff[i]); + } + return function_string; +} + ServiceFrameworkBase::ServiceFrameworkBase(const char* service_name, u32 max_sessions, InvokerFn* handler_invoker) : service_name(service_name), max_sessions(max_sessions), handler_invoker(handler_invoker) {} |