1
0
Fork 0
forked from suyu/suyu

Log the cmd_buff arguments when citra comes across an unimplemented function

This commit is contained in:
archshift 2014-11-23 00:22:46 -08:00
parent bb730855e5
commit 43a682a106

View file

@ -10,6 +10,7 @@
#include <string> #include <string>
#include "common/common.h" #include "common/common.h"
#include "common/string_util.h"
#include "core/mem_map.h" #include "core/mem_map.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
@ -79,21 +80,20 @@ public:
u32* cmd_buff = GetCommandBuffer(); u32* cmd_buff = GetCommandBuffer();
auto itr = m_functions.find(cmd_buff[0]); auto itr = m_functions.find(cmd_buff[0]);
if (itr == m_functions.end()) { if (itr == m_functions.end() || itr->second.func == nullptr) {
ERROR_LOG(OSHLE, "unknown/unimplemented function: port=%s, command=0x%08X", // Number of params == bits 0-5 + bits 6-11
GetPortName().c_str(), cmd_buff[0]); int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F);
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 // 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());
// TODO(bunnei): Hack - ignore error
u32* cmd_buff = Service::GetCommandBuffer();
cmd_buff[1] = 0; cmd_buff[1] = 0;
return MakeResult<bool>(false); return MakeResult<bool>(false);
} }