Merge pull request #12742 from Dentomologist/cheatsearch_use_twos_complement_for_negative_hex_values
CheatSearch: Use two's complement for negative hex values
This commit is contained in:
commit
9d87c82d8a
|
@ -572,11 +572,19 @@ std::string Cheats::CheatSearchSession<T>::GetResultValueAsString(size_t index,
|
|||
if (hex)
|
||||
{
|
||||
if constexpr (std::is_same_v<T, float>)
|
||||
return fmt::format("0x{0:08x}", Common::BitCast<u32>(m_search_results[index].m_value));
|
||||
{
|
||||
return fmt::format("0x{0:08x}", Common::BitCast<s32>(m_search_results[index].m_value));
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, double>)
|
||||
return fmt::format("0x{0:016x}", Common::BitCast<u64>(m_search_results[index].m_value));
|
||||
{
|
||||
return fmt::format("0x{0:016x}", Common::BitCast<s64>(m_search_results[index].m_value));
|
||||
}
|
||||
else
|
||||
return fmt::format("0x{0:0{1}x}", m_search_results[index].m_value, sizeof(T) * 2);
|
||||
{
|
||||
return fmt::format("0x{0:0{1}x}",
|
||||
Common::BitCast<std::make_unsigned_t<T>>(m_search_results[index].m_value),
|
||||
sizeof(T) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
return fmt::format("{}", m_search_results[index].m_value);
|
||||
|
|
Loading…
Reference in New Issue