summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-12-09 05:13:07 +0100
committerbunnei <bunneidev@gmail.com>2014-12-09 05:13:07 +0100
commitb7327f807cc2d85a6a5353b904de7781a6c6429c (patch)
tree94b8d2c2a8a89e4feb2ab7cd73515bcc0aa99e91 /src
parentMerge pull request #242 from bunnei/fix-address-arbiters (diff)
parentLog the cmd_buff arguments when citra comes across an unimplemented function (diff)
downloadyuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.tar
yuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.tar.gz
yuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.tar.bz2
yuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.tar.lz
yuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.tar.xz
yuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.tar.zst
yuzu-b7327f807cc2d85a6a5353b904de7781a6c6429c.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/service.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 20e7fb4d3..3a7d6c469 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -10,6 +10,7 @@
#include <string>
#include "common/common.h"
+#include "common/string_util.h"
#include "core/mem_map.h"
#include "core/hle/kernel/kernel.h"
@@ -79,21 +80,20 @@ public:
u32* cmd_buff = GetCommandBuffer();
auto itr = m_functions.find(cmd_buff[0]);
- if (itr == m_functions.end()) {
- ERROR_LOG(OSHLE, "unknown/unimplemented function: port=%s, command=0x%08X",
- GetPortName().c_str(), cmd_buff[0]);
+ if (itr == m_functions.end() || itr->second.func == nullptr) {
+ // Number of params == bits 0-5 + bits 6-11
+ int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F);
- // TODO(bunnei): Hack - ignore error
- u32* cmd_buff = Service::GetCommandBuffer();
- cmd_buff[1] = 0;
- return MakeResult<bool>(false);
- }
- if (itr->second.func == nullptr) {
- ERROR_LOG(OSHLE, "unimplemented function: port=%s, name=%s",
- GetPortName().c_str(), itr->second.name.c_str());
+ std::string error = "unknown/unimplemented function '%s': port=%s";
+ for (int i = 1; i <= num_params; ++i) {
+ error += Common::StringFromFormat(", cmd_buff[%i]=%u", i, cmd_buff[i]);
+ }
+
+ std::string name = (itr == m_functions.end()) ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name;
+
+ ERROR_LOG(OSHLE, error.c_str(), name.c_str(), GetPortName().c_str());
// TODO(bunnei): Hack - ignore error
- u32* cmd_buff = Service::GetCommandBuffer();
cmd_buff[1] = 0;
return MakeResult<bool>(false);
}