diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc index 85a27b1c2..a3e92c55f 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc @@ -47,10 +47,13 @@ void HandleSetThreadName(pointer_t record) { return; } + // Shadowrun (and its demo) has a bug where it ends up passing freed memory + // for the name, so at the point of SetThreadName it's filled with junk. + // TODO(gibbed): cvar for thread name encoding for conversion, some games use // SJIS and there's no way to automatically know this. - auto name = - std::string(kernel_memory()->TranslateVirtual(thread_info->name_ptr)); + auto name = std::string( + kernel_memory()->TranslateVirtual(thread_info->name_ptr)); std::replace_if( name.begin(), name.end(), [](auto c) { return c < 32 || c > 127; }, '?');