diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc index b5a4c9241..d5313ed7f 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc @@ -49,6 +49,9 @@ enum FormatFlags { FF_IsWide = 1 << 9, FF_IsSigned = 1 << 10, FF_ForceLeadingZero = 1 << 11, + // IsWide gets used as an "is opposite encoding" flag, but this flag means + // it's definitely wide + FF_IsAlwaysWide = 1 << 12, }; enum ArgumentSize { @@ -292,7 +295,7 @@ int32_t format_core(PPCContext* ppc_context, FormatData& data, ArgList& args, state = FS_Type; continue; } else if (c == 'w') { - flags |= FF_IsWide; + flags |= (FF_IsWide | FF_IsAlwaysWide); state = FS_Type; continue; } else if (c == 'I') { @@ -337,7 +340,7 @@ int32_t format_core(PPCContext* ppc_context, FormatData& data, ArgList& args, // functions and with C in wprintf functions." is_wide = false; } else { - is_wide = ((flags & FF_IsWide) != 0) ^ wide; + is_wide = (((flags & FF_IsWide) != 0) ^ wide) || (flags & FF_IsAlwaysWide) != 0; } auto value = args.get32(); @@ -552,7 +555,7 @@ int32_t format_core(PPCContext* ppc_context, FormatData& data, ArgList& args, // functions and with S in wprintf functions." is_wide = false; } else { - is_wide = ((flags & (FF_IsWide)) != 0) ^ wide; + is_wide = (((flags & (FF_IsWide)) != 0) ^ wide) || (flags & FF_IsAlwaysWide) != 0; } int32_t length;